common

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Apr 15, 2021 License: MIT, Apache-2.0, MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type APIAlg

type APIAlg jwt.HMACSHA

type Common

type Common struct {
	fx.In
	APISecret *APIAlg
}

func (*Common) AuthNew

func (a *Common) AuthNew(ctx context.Context, perms []permission.Permission) ([]byte, error)

func (*Common) AuthVerify

func (a *Common) AuthVerify(ctx context.Context, token string) ([]permission.Permission, error)

func (*Common) LogList

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

func (*Common) LogSetLevel

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

func (*Common) Version

func (a *Common) Version(context.Context) (Version, error)

type ICommon

type ICommon interface {
	// Auth
	AuthVerify(ctx context.Context, token string) ([]permission.Permission, error)
	AuthNew(ctx context.Context, perms []permission.Permission) ([]byte, error)

	// Version provides information about API provider
	Version(context.Context) (Version, error)

	LogList(context.Context) ([]string, error)
	LogSetLevel(context.Context, string, string) error
}

type Version

type Version struct {
	Version string

	// APIVersion is a binary encoded semver version of the remote implementing
	// this api
	//
	// See APIVersion in build/version.go
	APIVersion version.Version
}

Version provides various build-time information

func (Version) String

func (v Version) String() string

Jump to

Keyboard shortcuts

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