credential

package
v1.1.3 Latest Latest
Warning

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

Go to latest
Published: Jul 18, 2023 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)

RegisterClientImplementor registers the client-side seed service implementor.

func RegisterServerImplementor

func RegisterServerImplementor(svr Server)

RegisterServerImplementor registers the server-side seed service implementor.

Types

type Client

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

Client secret key.

func ClientImplementor

func ClientImplementor() Client

ClientImplementor returns the client-side seed 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

ServerImplementor returns the server-side seed service implementor.

Jump to

Keyboard shortcuts

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