Documentation ¶
Index ¶
- Variables
- func NewCachingTokenSource(config *oauth2.Config, token *oauth2.Token, readFunc ReadTokenFunc, ...) (oauth2.TokenSource, error)
- func NewConfig(clientID, clientSecret string) oauth2.Config
- func OAuthLogin(ctx context.Context, config oauth2.Config) (*oauth2.Token, error)
- type CachingTokenSource
- type Client
- type Contact
- type QueryParams
- type ReadTokenFunc
- type SaveTokenFunc
- type Timestamp
Constants ¶
This section is empty.
Variables ¶
View Source
var ( NotFoundError = errors.New("Not found") )
Functions ¶
func NewCachingTokenSource ¶
func NewCachingTokenSource(config *oauth2.Config, token *oauth2.Token, readFunc ReadTokenFunc, saveFunc SaveTokenFunc) (oauth2.TokenSource, error)
Types ¶
type CachingTokenSource ¶
type CachingTokenSource struct {
// contains filtered or unexported fields
}
func (*CachingTokenSource) Token ¶
func (c *CachingTokenSource) Token() (token *oauth2.Token, err error)
Tries to read from the given read function first. If that token is not present or not valid anymore, it reads from the given token source, which should renew the token automatically. After that, the token is saved via the given save token function.
type Contact ¶
type Contact struct { ID int `json:"id"` Number string `json:"nr"` Name string `json:"name_1"` Name2 string `json:"name_2"` Address string `json:"address"` Postcode string `json:"postcode"` City string `json:"city"` Mail string `json:"mail"` Phone string `json:"phone_fixed"` Mobile string `json:"phone_mobile"` UpdatedAt Timestamp `json:"updated_at"` }
type QueryParams ¶
type ReadTokenFunc ¶
type SaveTokenFunc ¶
Click to show internal directories.
Click to hide internal directories.