common

package
v0.1.18 Latest Latest
Warning

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

Go to latest
Published: Apr 29, 2024 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CommonAPI

type CommonAPI struct {
	Alerting     *alerting.Alerting
	APISecret    *jwt.HMACSHA
	ShutdownChan dtypes.ShutdownChan
}

CommonAPI api o

func NewCommonAPI

func NewCommonAPI(lr repo.LockedRepo, secret *jwt.HMACSHA, shutdownChan dtypes.ShutdownChan) (CommonAPI, error)

NewCommonAPI initializes a new CommonAPI

func (*CommonAPI) AuthNew

func (a *CommonAPI) AuthNew(ctx context.Context, payload *types.JWTPayload) (string, error)

AuthNew generates a new JWT token with the provided permissions

func (*CommonAPI) AuthVerify

func (a *CommonAPI) AuthVerify(ctx context.Context, token string) (*types.JWTPayload, error)

AuthVerify verifies a JWT token and returns the permissions associated with it

func (*CommonAPI) Closing

func (a *CommonAPI) Closing(context.Context) (<-chan struct{}, error)

Closing jsonrpc closing

func (*CommonAPI) Discover

func (a *CommonAPI) Discover(ctx context.Context) (types.OpenRPCDocument, error)

Discover returns an OpenRPC document describing an RPC API.

func (*CommonAPI) LogAlerts

func (a *CommonAPI) LogAlerts(ctx context.Context) ([]alerting.Alert, error)

LogAlerts returns an empty list of alerts

func (*CommonAPI) LogList

func (a *CommonAPI) LogList(context.Context) ([]string, error)

LogList returns a list of available logging subsystems

func (*CommonAPI) LogSetLevel

func (a *CommonAPI) LogSetLevel(ctx context.Context, subsystem, level string) error

LogSetLevel sets the log level for a given subsystem

func (*CommonAPI) Session

func (a *CommonAPI) Session(ctx context.Context) (uuid.UUID, error)

Session returns a UUID of api provider session

func (*CommonAPI) Shutdown

func (a *CommonAPI) Shutdown(context.Context) error

Shutdown trigger graceful shutdown

func (*CommonAPI) Version

func (a *CommonAPI) Version(context.Context) (api.APIVersion, error)

Version provides information about API provider

type SessionCallbackFunc

type SessionCallbackFunc func(string, string)

SessionCallbackFunc will be called after node connection

Jump to

Keyboard shortcuts

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