github.com/optim-corp/cios-golang-sdk@v0.5.1/sdk/service/authorization/init.go (about) 1 package srvauth 2 3 import ( 4 "context" 5 6 "github.com/optim-corp/cios-golang-sdk/cios" 7 ) 8 9 type CiosAuth struct { 10 ApiClient *cios.APIClient 11 Url string 12 Host string 13 withHost func(context.Context) context.Context 14 refresh func() error 15 debug bool 16 scope string 17 assertion string 18 ref string 19 clientId string 20 clientSecret string 21 } 22 23 func NewCiosAuth(apiClient *cios.APIClient, url string, withHost func(context.Context) context.Context) *CiosAuth { 24 return &CiosAuth{ApiClient: apiClient, Url: url, withHost: withHost} 25 } 26 27 func (self *CiosAuth) SetScope(scope string) { 28 self.scope = scope 29 } 30 31 func (self *CiosAuth) SetClientSecret(clientSecret string) { 32 self.clientSecret = clientSecret 33 } 34 35 func (self *CiosAuth) SetClientId(clientId string) { 36 self.clientId = clientId 37 } 38 39 func (self *CiosAuth) SetRef(ref string) { 40 self.ref = ref 41 } 42 43 func (self *CiosAuth) SetAssertion(assertion string) { 44 self.assertion = assertion 45 } 46 47 func (self *CiosAuth) SetDebug(debug bool) { 48 self.debug = debug 49 }