github.com/akamai/AkamaiOPEN-edgegrid-golang/v2@v2.17.0/pkg/imaging/imaging.go (about)

     1  package imaging
     2  
     3  import (
     4  	"errors"
     5  
     6  	"github.com/akamai/AkamaiOPEN-edgegrid-golang/v2/pkg/session"
     7  )
     8  
     9  var (
    10  	// ErrStructValidation is returned when given struct validation failed
    11  	ErrStructValidation = errors.New("struct validation")
    12  )
    13  
    14  type (
    15  	// Imaging is the api interface for Image and Video Manager
    16  	Imaging interface {
    17  		Policies
    18  		PolicySets
    19  	}
    20  
    21  	imaging struct {
    22  		session.Session
    23  	}
    24  
    25  	// Option defines an Image and Video Manager option
    26  	Option func(*imaging)
    27  
    28  	// ClientFunc is a Image and Video Manager client new method, this can be used for mocking
    29  	ClientFunc func(sess session.Session, opts ...Option) Imaging
    30  )
    31  
    32  // Client returns a new Image and Video Manager Client instance with the specified controller
    33  func Client(sess session.Session, opts ...Option) Imaging {
    34  	c := &imaging{
    35  		Session: sess,
    36  	}
    37  
    38  	for _, opt := range opts {
    39  		opt(c)
    40  	}
    41  	return c
    42  }