Documentation ¶
Overview ¶
Package edgegrid allows you to sign http.Request's using the Akamai OPEN Edgegrid Signing Scheme
Index ¶
Constants ¶
const ( ErrUUIDGenerateFailed = 500 ErrHomeDirNotFound = 501 ErrConfigFile = 502 ErrConfigFileSection = 503 ErrConfigMissingOptions = 504 ErrMissingEnvVariables = 505 )
Error constants
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Config ¶
type Config struct { Host string `ini:"host"` ClientToken string `ini:"client_token"` ClientSecret string `ini:"client_secret"` AccessToken string `ini:"access_token"` HeaderToSign []string `ini:"headers_to_sign"` MaxBody int `ini:"max_body"` Debug bool `ini:"debug"` }
Config struct provides all the necessary fields to create authorization header, debug is optional
func Init ¶
Init initializes by first attempting to use ENV vars, with .edgerc as a fallback
See: InitEnv() See: InitEdgeRc()
func InitEdgeRc ¶
InitEdgeRc initializes using a configuration file in standard INI format
By default, it uses the .edgerc found in the users home directory, and the "default" section.
func InitEnv ¶
InitEnv initializes using the Environment (ENV)
By default, it uses AKAMAI_HOST, AKAMAI_CLIENT_TOKEN, AKAMAI_CLIENT_SECRET, AKAMAI_ACCESS_TOKEN, and AKAMAI_MAX_BODY variables.
You can define multiple configurations by prefixing with the section name specified, e.g. passing "ccu" will cause it to look for AKAMAI_CCU_HOST, etc.
If AKAMAI_{SECTION} does not exist, it will fall back to just AKAMAI_.