-
Notifications
You must be signed in to change notification settings - Fork 69
/
edgeworkers.go
55 lines (46 loc) · 1.06 KB
/
edgeworkers.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
package edgeworkers
import (
"errors"
"github.com/akamai/AkamaiOPEN-edgegrid-golang/v2/pkg/session"
)
var (
// ErrStructValidation is returned when given struct validation failed
ErrStructValidation = errors.New("struct validation")
)
type (
// Edgeworkers is the api interface for EdgeWorkers and EdgeKV
Edgeworkers interface {
Activations
Contracts
Deactivations
EdgeKVAccessTokens
EdgeKVInitialize
EdgeKVItems
EdgeKVNamespaces
EdgeWorkerIDs
EdgeWorkerVersions
PermissionGroups
Properties
Reports
ResourceTiers
SecureTokens
Validations
}
edgeworkers struct {
session.Session
}
// Option defines an Edgeworkers option
Option func(*edgeworkers)
// ClientFunc is a Edgeworkers client new method, this can be used for mocking
ClientFunc func(sess session.Session, opts ...Option) Edgeworkers
)
// Client returns a new edgeworkers Client instance with the specified controller
func Client(sess session.Session, opts ...Option) Edgeworkers {
e := &edgeworkers{
Session: sess,
}
for _, opt := range opts {
opt(e)
}
return e
}