client.go (822B)
1 package models 2 3 // Client client model 4 type Client interface { 5 GetID() string 6 GetSecret() string 7 GetDomain() string 8 GetUserID() string 9 } 10 11 func New(id string, secret string, domain string, userID string) Client { 12 return &simpleClient{ 13 id: id, 14 secret: secret, 15 domain: domain, 16 userID: userID, 17 } 18 } 19 20 // simpleClient is a very simple client model that satisfies the Client interface 21 type simpleClient struct { 22 id string 23 secret string 24 domain string 25 userID string 26 } 27 28 // GetID client id 29 func (c *simpleClient) GetID() string { 30 return c.id 31 } 32 33 // GetSecret client secret 34 func (c *simpleClient) GetSecret() string { 35 return c.secret 36 } 37 38 // GetDomain client domain 39 func (c *simpleClient) GetDomain() string { 40 return c.domain 41 } 42 43 // GetUserID user id 44 func (c *simpleClient) GetUserID() string { 45 return c.userID 46 }