1
0
mirror of https://github.com/go-micro/go-micro.git synced 2025-06-12 22:07:47 +02:00

Implement new interface

This commit is contained in:
Ben Toogood
2020-03-31 18:17:01 +01:00
parent 8dbb5153f4
commit 134bc1c68a
7 changed files with 275 additions and 110 deletions

View File

@ -10,8 +10,8 @@ import (
type Options struct {
// ID is the services auth ID
ID string
// Secret is used to generate new tokens
Secret string
// RefreshToken is used to generate new tokens
RefreshToken string
// Token is the services token used to authenticate itself
Token *Token
// Public key base64 encoded
@ -50,10 +50,10 @@ func PrivateKey(key string) Option {
}
// Credentials sets the auth credentials
func Credentials(id, secret string) Option {
func Credentials(id, refresh string) Option {
return func(o *Options) {
o.ID = id
o.Secret = secret
o.RefreshToken = refresh
}
}