testutil

package
v0.29.4 Latest Latest
Warning

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

Go to latest
Published: Sep 1, 2024 License: Apache-2.0 Imports: 30 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CertPath

func CertPath(ca string, certname string) string

func CreateChoriaTokenAndKeys added in v0.27.0

func CreateChoriaTokenAndKeys(targetDir string, tokenSignerFile string, public ed25519.PublicKey, create func(pubK ed25519.PublicKey) (jwt.Claims, error)) (tokenFile string, signedToken string, pubFile string, priFile string, err error)

func CreateRSAKeyAndCert

func CreateRSAKeyAndCert(td string) (pri *rsa.PrivateKey, err error)

CreateRSAKeyAndCert public.pem and private.pem in td

func CreateSignedClientJWT

func CreateSignedClientJWT(pk any, claims map[string]any) (string, error)

func CreateSignedServerJWT

func CreateSignedServerJWT(pk any, pubK []byte, claims map[string]any) (string, error)

func GbytesLogger

func GbytesLogger(level logrus.Level) (*gbytes.Buffer, *logrus.Logger)

func KeyPath

func KeyPath(ca string, certname string) string

func LoadRSAKey

func LoadRSAKey(key string) (pri *rsa.PrivateKey, err error)

func NewFuncSigner added in v0.27.0

func NewFuncSigner(fn func(context.Context, []byte, inter.RequestSignerConfig) ([]byte, error)) *funcSigner

func StartServerInstance

func StartServerInstance(ctx context.Context, wg *sync.WaitGroup, cfgFile string, log *logrus.Logger, opts ...ServerInstanceOption) (*server.Instance, error)

Types

type ServerInstanceOption added in v0.27.0

type ServerInstanceOption func(options *ServerInstanceOptions)

func ServerWithChoriaUtilAgent added in v0.27.0

func ServerWithChoriaUtilAgent() ServerInstanceOption

func ServerWithDiscovery added in v0.27.0

func ServerWithDiscovery() ServerInstanceOption

func ServerWithOutDataPlugins added in v0.27.0

func ServerWithOutDataPlugins() ServerInstanceOption

func ServerWithRPCUtilAgent added in v0.27.0

func ServerWithRPCUtilAgent() ServerInstanceOption

type ServerInstanceOptions added in v0.27.0

type ServerInstanceOptions struct {
	NoDataPlugins   bool
	Discovery       bool
	RPCUtilAgent    bool
	ChoriaUtilAgent bool
}

Jump to

Keyboard shortcuts

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