/
imaging.go
43 lines (34 loc) · 950 Bytes
/
imaging.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
// Package imaging provides access to the Akamai Image & Video Manager APIs
package imaging
import (
"errors"
"github.com/akamai/AkamaiOPEN-edgegrid-golang/v8/pkg/session"
)
var (
// ErrStructValidation is returned when given struct validation failed
ErrStructValidation = errors.New("struct validation")
)
type (
// Imaging is the api interface for Image and Video Manager
Imaging interface {
Policies
PolicySets
}
imaging struct {
session.Session
}
// Option defines an Image and Video Manager option
Option func(*imaging)
// ClientFunc is a Image and Video Manager client new method, this can be used for mocking
ClientFunc func(sess session.Session, opts ...Option) Imaging
)
// Client returns a new Image and Video Manager Client instance with the specified controller
func Client(sess session.Session, opts ...Option) Imaging {
c := &imaging{
Session: sess,
}
for _, opt := range opts {
opt(c)
}
return c
}