storage

package
v0.0.0-...-e416dba Latest Latest
Warning

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

Go to latest
Published: Apr 19, 2017 License: BSD-3-Clause Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ExampleStorage

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

ExampleStorage is a backend used to persist data generated by the example OAuth2 server

func NewExampleStorage

func NewExampleStorage() *ExampleStorage

NewExampleStorage returns a new ExampleStorage

func (*ExampleStorage) Close

func (s *ExampleStorage) Close() error

Close the resources the Storage potentially holds. (Implements io.Closer)

func (*ExampleStorage) DeleteAuthorizeData

func (s *ExampleStorage) DeleteAuthorizeData(ctx context.Context, code string) error

DeleteAuthorizeData revokes or deletes the authorization code.

func (*ExampleStorage) DeleteRefreshTokenData

func (s *ExampleStorage) DeleteRefreshTokenData(ctx context.Context, token string) error

DeleteRefreshTokenData revokes or deletes a RefreshToken.

func (*ExampleStorage) GetAuthorizeData

func (s *ExampleStorage) GetAuthorizeData(_ context.Context, code string) (*niso.AuthorizationData, error)

GetAuthorizeData looks up AuthorizeData by a code. // ClientData information MUST be loaded together. Optionally can return error if expired.

func (*ExampleStorage) GetClientData

func (s *ExampleStorage) GetClientData(_ context.Context, id string) (*niso.ClientData, error)

GetClientData fetches the data for a ClientData by id Should return NotFoundError, so an EInvalidClient error will be returned instead of EServerError

func (*ExampleStorage) GetRefreshTokenData

func (s *ExampleStorage) GetRefreshTokenData(ctx context.Context, token string) (*niso.RefreshTokenData, error)

GetRefreshTokenData retrieves refresh token data from the token string.

func (*ExampleStorage) SaveAccessData

func (s *ExampleStorage) SaveAccessData(ctx context.Context, data *niso.AccessData) error

SaveAccessData writes AccessData to storage.

func (*ExampleStorage) SaveAuthorizeData

func (s *ExampleStorage) SaveAuthorizeData(_ context.Context, data *niso.AuthorizationData) error

SaveAuthorizeData saves authorize data.

func (*ExampleStorage) SaveRefreshTokenData

func (s *ExampleStorage) SaveRefreshTokenData(ctx context.Context, data *niso.RefreshTokenData) error

SaveRefreshTokenData saves refresh token data so it can be retrieved with GetRefreshTokenData

Jump to

Keyboard shortcuts

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