Golang SDK for accessing different Akamai service APIs. https://developer.akamai.com/api
Supported APIs:
You can install go-akamai
as a Go package:
go get github.com/dstdfx/go-akamai
To work with Akamai APIs you need to create API client with specific access rules. More information here.
// Example: cache invalidation for specific URLs.
package main
import (
"context"
"fmt"
"os"
"github.com/dstdfx/go-akamai/akamai/ccu/v3"
"github.com/dstdfx/go-akamai/akamai/ccu/v3/cache"
"github.com/dstdfx/go-akamai/akamai/edgegrid"
)
func main(){
// Fill it up with your credentials
cfg := &edgegrid.Config{
Host: "<your-host>",
ClientSecret: "<your-client-secret>",
ClientToken: "<your-client-token>",
AccessToken: "<your-access-token>",
MaxBody: 131072,
}
client := v3.NewV3CCUClient(cfg)
// Invalidate cache for specific URLs for production network.
// Default context just for the sake of simplicity.
resp, _, err := cache.InvalidateByURL(context.Background(),
client,
cache.ProductionNetwork,
cache.URLs{
Objects:[]string{
"https://1136022d-e7a4-45ec-b60c-c41913eff6db.akamaized.net/example_video.mp4",
"https://4136022d-e7a4-45ec-b60c-c41913eff6db.akamaized.net/example_video_4k.mp4",
},
})
if err != nil {
panic(err)
}
fmt.Printf("%+v\n", resp)
}
Please read CONTRIBUTING.md for details.
This library is distributed under the MIT license found in the LICENSE file.