account

package
v22.4.2 Latest Latest
Warning

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

Go to latest
Published: Apr 28, 2022 License: GPL-3.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const ConnectorName = "account"

Variables

This section is empty.

Functions

func ToUrl

func ToUrl(strUrl string) (accounts.URL, error)

Types

type CreatorService

type CreatorService interface {
	NewAccount(ctx context.Context, newAccountConfig interface{}) (accounts.Account, error)
	ImportRawKey(ctx context.Context, rawKey string, newAccountConfig interface{}) (accounts.Account, error)
}

func NewCreator

func NewCreator(service Service) CreatorService

NewCreator creates an implementation of CreatorService that simply acts as a delegate to service. This method exists to allow for only the CreatorService methods to be exposed as APIs with the plugin delegate API framework.

type DispenseFunc

type DispenseFunc func() (Service, error)

type PluginConnector

type PluginConnector struct {
	plugin.Plugin
}

func (*PluginConnector) GRPCClient

func (*PluginConnector) GRPCClient(_ context.Context, _ *plugin.GRPCBroker, cc *grpc.ClientConn) (interface{}, error)

func (*PluginConnector) GRPCServer

func (*PluginConnector) GRPCServer(_ *plugin.GRPCBroker, _ *grpc.Server) error

type ReloadableService

type ReloadableService struct {
	DispenseFunc DispenseFunc
}

func (*ReloadableService) Accounts

func (am *ReloadableService) Accounts(ctx context.Context) []accounts.Account

func (*ReloadableService) Close

func (am *ReloadableService) Close(ctx context.Context) error

func (*ReloadableService) Contains

func (am *ReloadableService) Contains(ctx context.Context, account accounts.Account) bool

func (*ReloadableService) ImportRawKey

func (am *ReloadableService) ImportRawKey(ctx context.Context, rawKey string, newAccountConfig interface{}) (accounts.Account, error)

func (*ReloadableService) Lock

func (am *ReloadableService) Lock(ctx context.Context, account accounts.Account) error

func (*ReloadableService) NewAccount

func (am *ReloadableService) NewAccount(ctx context.Context, newAccountConfig interface{}) (accounts.Account, error)

func (*ReloadableService) Open

func (am *ReloadableService) Open(ctx context.Context, passphrase string) error

func (*ReloadableService) Sign

func (am *ReloadableService) Sign(ctx context.Context, account accounts.Account, toSign []byte) ([]byte, error)

func (*ReloadableService) Status

func (am *ReloadableService) Status(ctx context.Context) (string, error)

func (*ReloadableService) TimedUnlock

func (am *ReloadableService) TimedUnlock(ctx context.Context, account accounts.Account, password string, duration time.Duration) error

func (*ReloadableService) UnlockAndSign

func (am *ReloadableService) UnlockAndSign(ctx context.Context, account accounts.Account, toSign []byte, passphrase string) ([]byte, error)

type Service

type Service interface {
	Status(ctx context.Context) (string, error)
	Open(ctx context.Context, passphrase string) error
	Close(ctx context.Context) error
	Accounts(ctx context.Context) []accounts.Account
	Contains(ctx context.Context, account accounts.Account) bool
	Sign(ctx context.Context, account accounts.Account, toSign []byte) ([]byte, error)
	UnlockAndSign(ctx context.Context, account accounts.Account, toSign []byte, passphrase string) ([]byte, error)
	TimedUnlock(ctx context.Context, account accounts.Account, password string, duration time.Duration) error
	Lock(ctx context.Context, account accounts.Account) error
	CreatorService
}

Directories

Path Synopsis
internal

Jump to

Keyboard shortcuts

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