session

package
v0.68.24 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 12, 2023 License: Apache-2.0 Imports: 8 Imported by: 2

Documentation

Index

Constants

View Source
const (
	LoginUrlRipple     = "https://login.alphaus.cloud/ripple/access_token"
	LoginUrlWave       = "https://login.alphaus.cloud/access_token"
	LoginUrlRippleNext = "https://loginnext.alphaus.cloud/ripple/access_token"
	LoginUrlWaveNext   = "https://loginnext.alphaus.cloud/access_token"
)

Variables

This section is empty.

Functions

func GetLocalCreds added in v0.6.6

func GetLocalCreds() (string, string, string, string, string)

GetLocalCreds returns caller's id, secret, user, password, and login url.

func NewRpcCredentials added in v0.4.5

func NewRpcCredentials(in ...RpcCredentialsInput) tokenAuth

Types

type Option

type Option interface {
	Apply(*Session)
}

func WithClientId

func WithClientId(v string) Option

func WithClientSecret

func WithClientSecret(v string) Option

func WithGrantType

func WithGrantType(v string) Option

func WithHttpClient

func WithHttpClient(v *http.Client) Option

func WithLoginUrl

func WithLoginUrl(v string) Option

func WithPassword

func WithPassword(v string) Option

func WithScope

func WithScope(v string) Option

func WithUsername

func WithUsername(v string) Option

type RpcCredentialsInput added in v0.4.5

type RpcCredentialsInput struct {
	LoginUrl     string
	ClientId     string
	ClientSecret string
	AuthType     string // default: Bearer
	AccessToken  string // use directly if non-empty; disregard others
}

type Session

type Session struct {
	// contains filtered or unexported fields
}

func New

func New(o ...Option) *Session

New returns a Session object for Blue API authentication.

func (*Session) AccessToken

func (s *Session) AccessToken() (string, error)

AccessToken returns the access token after successful authentication to Blue API.

func (*Session) ClientId added in v0.6.6

func (s *Session) ClientId() string

func (*Session) ClientSecret added in v0.6.6

func (s *Session) ClientSecret() string

func (*Session) GrantType added in v0.6.6

func (s *Session) GrantType() string

func (*Session) LoginUrl added in v0.6.6

func (s *Session) LoginUrl() string

func (*Session) Password added in v0.6.6

func (s *Session) Password() string

func (*Session) Scope added in v0.6.6

func (s *Session) Scope() string

func (*Session) Username added in v0.6.6

func (s *Session) Username() string

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL