credential

package
v0.1.7 Latest Latest
Warning

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

Go to latest
Published: Aug 16, 2022 License: MIT Imports: 1 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RegisterClientImplementor

func RegisterClientImplementor(cli Client)

Register service implementor.

func RegisterServerImplementor

func RegisterServerImplementor(svr Server)

Register service implementor.

Types

type Client

type Client interface {
	// Add a new secret key.
	Add(accountID uint64, keyID int64, val []byte, expire time.Duration) error
	// Get and refresh the secret key's expiration.
	Refresh(accountID uint64, keyID int64, expire time.Duration) ([]byte, error)
	// Get secret key.
	Get(accountID uint64, keyID int64) ([]byte, error)
	// Revoke the secret key of the specified ID.
	Revoke(accountID uint64, keyID int64) error
	// Revoke all secret keys of the specified account ID.
	RevokeAll(accountID uint64) error
	// Lock all secret keys for a specified duration.
	// Returns codes.FailedPrecondition (9).
	Lock(accountID uint64, reason string, duration time.Duration) error
	// Unlock secret keys.
	Unlock(accountID uint64) error
}

Client secret key.

func ClientImplementor

func ClientImplementor() Client

Return the service implementor.

type Server

type Server interface {
	// Add a new secret key for the specified ID.
	Add(keyID int64, key []byte) error
	// Get the secret key of the specified ID.
	Get(keyID int64) ([]byte, error)
	// Revoke the secret key of the specified ID.
	Revoke(keyID int64) error
}

Server secret key.

func ServerImplementor

func ServerImplementor() Server

Return the service implementor.

Jump to

Keyboard shortcuts

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