github.com/optim-corp/cios-golang-sdk@v0.5.1/sdk/service/device/init.go (about) 1 package srvdevice 2 3 import ( 4 "context" 5 6 "github.com/optim-corp/cios-golang-sdk/cios" 7 ) 8 9 type ( 10 CiosDeviceManagement struct { 11 ApiClient *cios.APIClient 12 Url string 13 Host string 14 withHost func(context.Context) context.Context 15 refresh func() error 16 } 17 CiosDeviceAssetManagement struct { 18 ApiClient *cios.APIClient 19 Url string 20 Host string 21 withHost func(context.Context) context.Context 22 refresh func() error 23 } 24 ) 25 26 func (self *CiosDeviceAssetManagement) SetWithHost(withHost func(context.Context) context.Context) { 27 self.withHost = withHost 28 } 29 30 func (self *CiosDeviceAssetManagement) SetRefresh(refresh func() error) { 31 self.refresh = refresh 32 } 33 34 func (self *CiosDeviceManagement) SetWithHost(withHost func(context.Context) context.Context) { 35 self.withHost = withHost 36 } 37 38 func (self *CiosDeviceManagement) SetRefresh(refresh func() error) { 39 self.refresh = refresh 40 } 41 42 func NewCiosDeviceManagement(apiClient *cios.APIClient, url string, withHost func(context.Context) context.Context) *CiosDeviceManagement { 43 return &CiosDeviceManagement{ApiClient: apiClient, Url: url, withHost: withHost} 44 } 45 46 func NewCiosDeviceAssetManagement(apiClient *cios.APIClient, url string, withHost func(context.Context) context.Context) *CiosDeviceAssetManagement { 47 return &CiosDeviceAssetManagement{ApiClient: apiClient, Url: url, withHost: withHost} 48 }