Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Generate tokens for securing content distributed with the Fastly CDN

License

NotificationsYou must be signed in to change notification settings

zencoder/fastly-tokens

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

44 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Generate tokens for securing content distributed with the Fastly CDN, in go!

Usage

Install thefastly-tokens library:go get github.com/zencoder/fastly-tokens/ft

package mainimport ("encoding/base64""fmt""log""time""github.com/zencoder/fastly-tokens/ft")funcmain() {// Generate token that is valid for 60 seconds using the default secrettoken:=ft.GenerateToken("RmFzdGx5IFRva2VuIFRlc3Q=",60*time.Second,base64.StdEncoding)fmt.Printf("Token: %s\n",token)}

Benchmarks

BenchmarkGenerateToken-8    1000000      1771 ns/op     848 B/op      12 allocs/opPASSok  github.com/zencoder/fastly-tokens/ft2.101s

Development

Dependencies

Tested on go 1.13

Build and run unit tests

make

CI

This library builds on Circle CI, here.

License

Apache License Version 2.0

About

Generate tokens for securing content distributed with the Fastly CDN

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors7


[8]ページ先頭

©2009-2025 Movatter.jp