github.com/optim-corp/cios-golang-sdk@v0.5.1/sdk/service/license/init.go (about) 1 package srvlicense 2 3 import ( 4 "context" 5 6 "github.com/optim-corp/cios-golang-sdk/cios" 7 ) 8 9 type CiosLicense struct { 10 ApiClient *cios.APIClient 11 Url string 12 Host string 13 withHost func(context.Context) context.Context 14 refresh func() error 15 } 16 17 func (self *CiosLicense) SetWithHost(withHost func(context.Context) context.Context) { 18 self.withHost = withHost 19 } 20 21 func (self *CiosLicense) SetRefresh(refresh func() error) { 22 self.refresh = refresh 23 } 24 25 func NewCiosLicense(apiClient *cios.APIClient, host string, withHost func(context.Context) context.Context) *CiosLicense { 26 return &CiosLicense{ApiClient: apiClient, Host: host, withHost: withHost} 27 }