File tree Expand file tree Collapse file tree 1 file changed +33
-0
lines changed
examples/smart-cdn-signature Expand file tree Collapse file tree 1 file changed +33
-0
lines changed Original file line number Diff line number Diff line change 1+ package main
2+
3+ import (
4+ "fmt"
5+ "net/url"
6+
7+ transloadit "github.com/transloadit/go-sdk"
8+ )
9+
10+ func main () {
11+ url := GetSmartCDNUrl ()
12+ fmt .Println (url )
13+ }
14+
15+ func GetSmartCDNUrl () string {
16+ options := transloadit .DefaultConfig
17+ options .AuthKey = "YOUR_TRANSLOADIT_KEY"
18+ options .AuthSecret = "YOUR_TRANSLOADIT_SECRET"
19+ client := transloadit .NewClient (options )
20+
21+ params := url.Values {}
22+ params .Add ("height" , "100" )
23+ params .Add ("width" , "100" )
24+
25+ url := client .CreateSignedSmartCDNUrl (transloadit.SignedSmartCDNUrlOptions {
26+ Workspace : "YOUR_WORKSPACE" ,
27+ Template : "YOUR_TEMPLATE" ,
28+ Input : "image.png" ,
29+ URLParams : params ,
30+ })
31+
32+ return url
33+ }
You can’t perform that action at this time.
0 commit comments