/
ds.go
51 lines (41 loc) · 1 KB
/
ds.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
// Package datastream provides access to the Akamai DataStream APIs
//
// See: https://techdocs.akamai.com/datastream2/reference/api
package datastream
import (
"errors"
"github.com/akamai/AkamaiOPEN-edgegrid-golang/v5/pkg/session"
)
var (
// ErrStructValidation is returned when given struct validation failed
ErrStructValidation = errors.New("struct validation")
)
type (
// DS is the ds api interface
DS interface {
Activation
Properties
Stream
}
ds struct {
session.Session
}
// Option defines a DS option
Option func(*ds)
// ClientFunc is a ds client new method, this can be used for mocking
ClientFunc func(sess session.Session, ops ...Option) DS
)
// Client returns a new ds Client instance with the specified controller
func Client(sess session.Session, opts ...Option) DS {
c := &ds{
Session: sess,
}
for _, opt := range opts {
opt(c)
}
return c
}
// DelimiterTypePtr returns the address of the DelimiterType
func DelimiterTypePtr(d DelimiterType) *DelimiterType {
return &d
}