core

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: May 23, 2022 License: GPL-3.0 Imports: 31 Imported by: 0

Documentation

Overview

Package core is a generated GoMock package.

Package core is a generated GoMock package.

Index

Constants

View Source
const MinTLSVersion uint16 = tls.VersionTLS12

MinTLSVersion defines the minimal TLS version used by all components that use TLS

View Source
const ModuleNameContextKey = "!!ModuleName"

ModuleNameContextKey contains the key for the Echo context parameter that specifies the module that contains the OpenAPI operation being called, for logging/error returning.

View Source
const OperationIDContextKey = "!!OperationId"

OperationIDContextKey contains the key for the Echo context parameter that specifies the name of the OpenAPI operation being called, for logging/error returning.

View Source
const StatusCodeResolverContextKey = "!!StatusCodeResolver"

StatusCodeResolverContextKey contains the key for the Echo context parameter that specifies a custom HTTP status code resolver.

Variables

View Source
var GitBranch string = "development"

GitBranch holds the branch from where the binary is built.

View Source
var GitCommit string = "0"

GitCommit holds the latest git commit hash for this build.

View Source
var GitVersion string

GitVersion holds the tagged version belonging to the git commit.

Functions

func BuildInfo

func BuildInfo() string

BuildInfo returns a formatted version of the current branch/tag/version/os/arch

func ClientConfigFlags

func ClientConfigFlags() *pflag.FlagSet

ClientConfigFlags returns the flags for configuring the client config.

func DecodeURIPath

func DecodeURIPath(next echo.HandlerFunc) echo.HandlerFunc

DecodeURIPath is a echo middleware that decodes path parameters

func Error

func Error(statusCode int, errStr string, args ...interface{}) error

Error returns an error that maps to a HTTP status

func FlagSet

func FlagSet() *pflag.FlagSet

FlagSet returns the default server flags

func InvalidInputError

func InvalidInputError(errStr string, args ...interface{}) error

InvalidInputError returns an error that maps to a HTTP 400 Bad Request.

func Logger

func Logger() *logrus.Entry

Logger returns a logger which should be used for logging in this engine. It adds fields so log entries from this engine can be recognized as such.

func NotFoundError

func NotFoundError(errStr string, args ...interface{}) error

NotFoundError returns an error that maps to a HTTP 404 Status Not Found.

func OSArch

func OSArch() string

OSArch returns the OS and Arch

func PreconditionFailedError

func PreconditionFailedError(errStr string, args ...interface{}) error

PreconditionFailedError returns an error that maps to a HTTP 412 Status Precondition Failed.

func ResolveStatusCode

func ResolveStatusCode(err error, mapping map[error]int) int

ResolveStatusCode looks tries to find the first error in the given map that satisfies errors.Is() for the given error, and returns the associated integer as HTTP status code. If no match is found it returns 0.

func TestResponseCode

func TestResponseCode(expectedStatusCode int, response *http.Response) error

func Version

func Version() string

Version gives the current version according to the git tag or the branch if there's no tag.

Types

type ClientConfig

type ClientConfig struct {
	Address   string        `koanf:"address"`
	Verbosity string        `koanf:"verbosity"`
	Timeout   time.Duration `koanf:"timeout"`
}

ClientConfig has CLI client settings.

func DefaultClientConfig

func DefaultClientConfig() ClientConfig

DefaultClientConfig creates a new CLI client config with default values set.

func NewClientConfig

func NewClientConfig(flags *pflag.FlagSet) ClientConfig

NewClientConfig creates a ClientConfig and loads the values from the given flags.

func (ClientConfig) GetAddress

func (cfg ClientConfig) GetAddress() string

GetAddress normalizes and gets the address of the remote server

type Configurable

type Configurable interface {
	Configure(config ServerConfig) error
}

Configurable is the interface that contains the Configure method. When an engine implements the Configurable interface, it will be called before startup. Configure should only be called once per engine instance

type Diagnosable

type Diagnosable interface {
	Diagnostics() []DiagnosticResult
}

Diagnosable allows the implementer, mostly engines, to return diagnostics.

type DiagnosticResult

type DiagnosticResult interface {
	// Name returns a simple and understandable name of the check
	Name() string

	// Result returns the outcome of the check in its original format. This may be any type that can be marshalled by the JSON package.
	Result() interface{}

	// String returns the outcome of the check formatted as string
	String() string
}

DiagnosticResult are the result of different checks giving information on how well the system is doing

type DiagnosticResultMap

type DiagnosticResultMap struct {
	Title string
	Items []DiagnosticResult
}

DiagnosticResultMap is a DiagnosticResult that presents the given Items as a map, rather than a list.

func (DiagnosticResultMap) Name

func (g DiagnosticResultMap) Name() string

Name returns the of the diagnostic, which is used as key.

func (DiagnosticResultMap) Result

func (g DiagnosticResultMap) Result() interface{}

Result returns the result of the diagnostic, which is Items converted to a map.

func (DiagnosticResultMap) String

func (g DiagnosticResultMap) String() string

String returns the string representation of Result()

type EchoRouter

type EchoRouter interface {
	Add(method, path string, handler echo.HandlerFunc, middleware ...echo.MiddlewareFunc) *echo.Route
}

EchoRouter is the interface the generated server API's will require as the Routes func argument

type EchoServer

type EchoServer interface {
	EchoRouter
	Start(address string) error
	Shutdown(ctx context.Context) error
}

EchoServer implements both the EchoRouter interface and Start function to aid testing.

type Engine

type Engine interface{}

Engine is the base interface for a modular design

func NewMetricsEngine

func NewMetricsEngine() Engine

NewMetricsEngine creates a new Engine for exposing prometheus metrics via http. Metrics are exposed on /metrics, by default the GoCollector and ProcessCollector are enabled.

type ErrorStatusCodeResolver

type ErrorStatusCodeResolver interface {
	ResolveStatusCode(err error) int
}

ErrorStatusCodeResolver defines the API of a type that resolves an HTTP status code from a Go error.

type GenericDiagnosticResult

type GenericDiagnosticResult struct {
	Title   string
	Outcome interface{}
}

GenericDiagnosticResult is a simple implementation of the DiagnosticResult interface

func (GenericDiagnosticResult) Name

func (gdr GenericDiagnosticResult) Name() string

Name returns the name of the GenericDiagnosticResult

func (GenericDiagnosticResult) Result

func (gdr GenericDiagnosticResult) Result() interface{}

Result returns the raw outcome of the GenericDiagnosticResult

func (GenericDiagnosticResult) String

func (gdr GenericDiagnosticResult) String() string

String returns the outcome of the GenericDiagnosticResult

type GlobalHTTPConfig

type GlobalHTTPConfig struct {
	// HTTPConfig contains the config for the default HTTP interface.
	HTTPConfig `koanf:"default"`
	// AltBinds contains binds for alternative HTTP interfaces. The key of the map is the first part of the path
	// of the URL (e.g. `/internal/some-api` -> `internal`), the value is the HTTP interface it must be bound to.
	AltBinds map[string]HTTPConfig `koanf:"alt"`
}

GlobalHTTPConfig is the top-level config struct for HTTP interfaces.

type HTTPCORSConfig

type HTTPCORSConfig struct {
	// Origin specifies the AllowOrigin option. If no origins are given CORS is considered to be disabled.
	Origin []string `koanf:"origin"`
}

HTTPCORSConfig contains configuration for Cross Origin Resource Sharing.

func (HTTPCORSConfig) Enabled

func (cors HTTPCORSConfig) Enabled() bool

Enabled returns whether CORS is enabled according to this configuration.

type HTTPConfig

type HTTPConfig struct {
	// Address holds the interface address the HTTP service must be bound to, in the format of `interface:port` (e.g. localhost:5555).
	Address string `koanf:"address"`
	// CORS holds the configuration for Cross Origin Resource Sharing.
	CORS HTTPCORSConfig `koanf:"cors"`
}

HTTPConfig contains configuration for an HTTP interface, e.g. address. It will probably contain security related properties in the future (TLS configuration, user/pwd requirements).

type HTTPStatusCodeError

type HTTPStatusCodeError interface {
	StatusCode() int
}

HTTPStatusCodeError defines an interface for HTTP errors that includes a HTTP statuscode

type Injectable

type Injectable interface {
	Named
	// Config returns a pointer to the struct that holds the Config.
	Config() interface{}
}

Injectable marks an engine capable of Config injection

type LandingPage

type LandingPage struct{}

LandingPage is a Routable that exposes a landing page at the node's HTTP root (`/`).

func (LandingPage) Routes

func (l LandingPage) Routes(router EchoRouter)

Routes registers the landing page on the given EchoRouter.

type Migratable

type Migratable interface {
	Migrate() error
}

Migratable is the interface that defines if an engine is migratable. If an engine is migratable, Migrate is called between Configure() and Start(). Migrations may require their own DB connection, they are closed before Start() is called.

type MockConfigurable

type MockConfigurable struct {
	// contains filtered or unexported fields
}

MockConfigurable is a mock of Configurable interface.

func NewMockConfigurable

func NewMockConfigurable(ctrl *gomock.Controller) *MockConfigurable

NewMockConfigurable creates a new mock instance.

func (*MockConfigurable) Configure

func (m *MockConfigurable) Configure(config ServerConfig) error

Configure mocks base method.

func (*MockConfigurable) EXPECT

EXPECT returns an object that allows the caller to indicate expected use.

type MockConfigurableMockRecorder

type MockConfigurableMockRecorder struct {
	// contains filtered or unexported fields
}

MockConfigurableMockRecorder is the mock recorder for MockConfigurable.

func (*MockConfigurableMockRecorder) Configure

func (mr *MockConfigurableMockRecorder) Configure(config interface{}) *gomock.Call

Configure indicates an expected call of Configure.

type MockDiagnosable

type MockDiagnosable struct {
	// contains filtered or unexported fields
}

MockDiagnosable is a mock of Diagnosable interface.

func NewMockDiagnosable

func NewMockDiagnosable(ctrl *gomock.Controller) *MockDiagnosable

NewMockDiagnosable creates a new mock instance.

func (*MockDiagnosable) Diagnostics

func (m *MockDiagnosable) Diagnostics() []DiagnosticResult

Diagnostics mocks base method.

func (*MockDiagnosable) EXPECT

EXPECT returns an object that allows the caller to indicate expected use.

type MockDiagnosableMockRecorder

type MockDiagnosableMockRecorder struct {
	// contains filtered or unexported fields
}

MockDiagnosableMockRecorder is the mock recorder for MockDiagnosable.

func (*MockDiagnosableMockRecorder) Diagnostics

func (mr *MockDiagnosableMockRecorder) Diagnostics() *gomock.Call

Diagnostics indicates an expected call of Diagnostics.

type MockEchoRouter

type MockEchoRouter struct {
	// contains filtered or unexported fields
}

MockEchoRouter is a mock of EchoRouter interface.

func NewMockEchoRouter

func NewMockEchoRouter(ctrl *gomock.Controller) *MockEchoRouter

NewMockEchoRouter creates a new mock instance.

func (*MockEchoRouter) Add

func (m *MockEchoRouter) Add(method, path string, handler echo.HandlerFunc, middleware ...echo.MiddlewareFunc) *echo.Route

Add mocks base method.

func (*MockEchoRouter) EXPECT

EXPECT returns an object that allows the caller to indicate expected use.

type MockEchoRouterMockRecorder

type MockEchoRouterMockRecorder struct {
	// contains filtered or unexported fields
}

MockEchoRouterMockRecorder is the mock recorder for MockEchoRouter.

func (*MockEchoRouterMockRecorder) Add

func (mr *MockEchoRouterMockRecorder) Add(method, path, handler interface{}, middleware ...interface{}) *gomock.Call

Add indicates an expected call of Add.

type MockEchoServer

type MockEchoServer struct {
	// contains filtered or unexported fields
}

MockEchoServer is a mock of EchoServer interface.

func NewMockEchoServer

func NewMockEchoServer(ctrl *gomock.Controller) *MockEchoServer

NewMockEchoServer creates a new mock instance.

func (*MockEchoServer) Add

func (m *MockEchoServer) Add(method, path string, handler echo.HandlerFunc, middleware ...echo.MiddlewareFunc) *echo.Route

Add mocks base method.

func (*MockEchoServer) EXPECT

EXPECT returns an object that allows the caller to indicate expected use.

func (*MockEchoServer) Shutdown

func (m *MockEchoServer) Shutdown(ctx context.Context) error

Shutdown mocks base method.

func (*MockEchoServer) Start

func (m *MockEchoServer) Start(address string) error

Start mocks base method.

type MockEchoServerMockRecorder

type MockEchoServerMockRecorder struct {
	// contains filtered or unexported fields
}

MockEchoServerMockRecorder is the mock recorder for MockEchoServer.

func (*MockEchoServerMockRecorder) Add

func (mr *MockEchoServerMockRecorder) Add(method, path, handler interface{}, middleware ...interface{}) *gomock.Call

Add indicates an expected call of Add.

func (*MockEchoServerMockRecorder) Shutdown

func (mr *MockEchoServerMockRecorder) Shutdown(ctx interface{}) *gomock.Call

Shutdown indicates an expected call of Shutdown.

func (*MockEchoServerMockRecorder) Start

func (mr *MockEchoServerMockRecorder) Start(address interface{}) *gomock.Call

Start indicates an expected call of Start.

type MockEngine

type MockEngine struct {
	// contains filtered or unexported fields
}

MockEngine is a mock of Engine interface.

func NewMockEngine

func NewMockEngine(ctrl *gomock.Controller) *MockEngine

NewMockEngine creates a new mock instance.

func (*MockEngine) EXPECT

func (m *MockEngine) EXPECT() *MockEngineMockRecorder

EXPECT returns an object that allows the caller to indicate expected use.

type MockEngineMockRecorder

type MockEngineMockRecorder struct {
	// contains filtered or unexported fields
}

MockEngineMockRecorder is the mock recorder for MockEngine.

type MockInjectable

type MockInjectable struct {
	// contains filtered or unexported fields
}

MockInjectable is a mock of Injectable interface.

func NewMockInjectable

func NewMockInjectable(ctrl *gomock.Controller) *MockInjectable

NewMockInjectable creates a new mock instance.

func (*MockInjectable) Config

func (m *MockInjectable) Config() interface{}

Config mocks base method.

func (*MockInjectable) EXPECT

EXPECT returns an object that allows the caller to indicate expected use.

func (*MockInjectable) Name

func (m *MockInjectable) Name() string

Name mocks base method.

type MockInjectableMockRecorder

type MockInjectableMockRecorder struct {
	// contains filtered or unexported fields
}

MockInjectableMockRecorder is the mock recorder for MockInjectable.

func (*MockInjectableMockRecorder) Config

func (mr *MockInjectableMockRecorder) Config() *gomock.Call

Config indicates an expected call of Config.

func (*MockInjectableMockRecorder) Name

Name indicates an expected call of Name.

type MockMigratable

type MockMigratable struct {
	// contains filtered or unexported fields
}

MockMigratable is a mock of Migratable interface.

func NewMockMigratable

func NewMockMigratable(ctrl *gomock.Controller) *MockMigratable

NewMockMigratable creates a new mock instance.

func (*MockMigratable) EXPECT

EXPECT returns an object that allows the caller to indicate expected use.

func (*MockMigratable) Migrate

func (m *MockMigratable) Migrate() error

Migrate mocks base method.

type MockMigratableMockRecorder

type MockMigratableMockRecorder struct {
	// contains filtered or unexported fields
}

MockMigratableMockRecorder is the mock recorder for MockMigratable.

func (*MockMigratableMockRecorder) Migrate

func (mr *MockMigratableMockRecorder) Migrate() *gomock.Call

Migrate indicates an expected call of Migrate.

type MockNamed

type MockNamed struct {
	// contains filtered or unexported fields
}

MockNamed is a mock of Named interface.

func NewMockNamed

func NewMockNamed(ctrl *gomock.Controller) *MockNamed

NewMockNamed creates a new mock instance.

func (*MockNamed) EXPECT

func (m *MockNamed) EXPECT() *MockNamedMockRecorder

EXPECT returns an object that allows the caller to indicate expected use.

func (*MockNamed) Name

func (m *MockNamed) Name() string

Name mocks base method.

type MockNamedMockRecorder

type MockNamedMockRecorder struct {
	// contains filtered or unexported fields
}

MockNamedMockRecorder is the mock recorder for MockNamed.

func (*MockNamedMockRecorder) Name

func (mr *MockNamedMockRecorder) Name() *gomock.Call

Name indicates an expected call of Name.

type MockRoutable

type MockRoutable struct {
	// contains filtered or unexported fields
}

MockRoutable is a mock of Routable interface.

func NewMockRoutable

func NewMockRoutable(ctrl *gomock.Controller) *MockRoutable

NewMockRoutable creates a new mock instance.

func (*MockRoutable) EXPECT

EXPECT returns an object that allows the caller to indicate expected use.

func (*MockRoutable) Routes

func (m *MockRoutable) Routes(router EchoRouter)

Routes mocks base method.

type MockRoutableMockRecorder

type MockRoutableMockRecorder struct {
	// contains filtered or unexported fields
}

MockRoutableMockRecorder is the mock recorder for MockRoutable.

func (*MockRoutableMockRecorder) Routes

func (mr *MockRoutableMockRecorder) Routes(router interface{}) *gomock.Call

Routes indicates an expected call of Routes.

type MockRunnable

type MockRunnable struct {
	// contains filtered or unexported fields
}

MockRunnable is a mock of Runnable interface.

func NewMockRunnable

func NewMockRunnable(ctrl *gomock.Controller) *MockRunnable

NewMockRunnable creates a new mock instance.

func (*MockRunnable) EXPECT

EXPECT returns an object that allows the caller to indicate expected use.

func (*MockRunnable) Shutdown

func (m *MockRunnable) Shutdown() error

Shutdown mocks base method.

func (*MockRunnable) Start

func (m *MockRunnable) Start() error

Start mocks base method.

type MockRunnableMockRecorder

type MockRunnableMockRecorder struct {
	// contains filtered or unexported fields
}

MockRunnableMockRecorder is the mock recorder for MockRunnable.

func (*MockRunnableMockRecorder) Shutdown

func (mr *MockRunnableMockRecorder) Shutdown() *gomock.Call

Shutdown indicates an expected call of Shutdown.

func (*MockRunnableMockRecorder) Start

func (mr *MockRunnableMockRecorder) Start() *gomock.Call

Start indicates an expected call of Start.

type MockViewableDiagnostics

type MockViewableDiagnostics struct {
	// contains filtered or unexported fields
}

MockViewableDiagnostics is a mock of ViewableDiagnostics interface.

func NewMockViewableDiagnostics

func NewMockViewableDiagnostics(ctrl *gomock.Controller) *MockViewableDiagnostics

NewMockViewableDiagnostics creates a new mock instance.

func (*MockViewableDiagnostics) Diagnostics

func (m *MockViewableDiagnostics) Diagnostics() []DiagnosticResult

Diagnostics mocks base method.

func (*MockViewableDiagnostics) EXPECT

EXPECT returns an object that allows the caller to indicate expected use.

func (*MockViewableDiagnostics) Name

func (m *MockViewableDiagnostics) Name() string

Name mocks base method.

type MockViewableDiagnosticsMockRecorder

type MockViewableDiagnosticsMockRecorder struct {
	// contains filtered or unexported fields
}

MockViewableDiagnosticsMockRecorder is the mock recorder for MockViewableDiagnostics.

func (*MockViewableDiagnosticsMockRecorder) Diagnostics

func (mr *MockViewableDiagnosticsMockRecorder) Diagnostics() *gomock.Call

Diagnostics indicates an expected call of Diagnostics.

func (*MockViewableDiagnosticsMockRecorder) Name

Name indicates an expected call of Name.

type MultiEcho

type MultiEcho struct {
	// contains filtered or unexported fields
}

MultiEcho allows to bind specific URLs to specific HTTP interfaces

func NewMultiEcho

func NewMultiEcho(creatorFn func(cfg HTTPConfig) (EchoServer, error), defaultInterface HTTPConfig) *MultiEcho

NewMultiEcho creates a new MultiEcho which uses the given function to create EchoServers. If a route is registered for an unknown group is is bound to the given defaultInterface.

func (*MultiEcho) Add

func (c *MultiEcho) Add(method, path string, handler echo.HandlerFunc, middleware ...echo.MiddlewareFunc) *echo.Route

Add adds a route to the Echo server.

func (*MultiEcho) Bind

func (c *MultiEcho) Bind(group string, interfaceConfig HTTPConfig) error

Bind binds the given group (first part of the URL) to the given HTTP interface. Calling Bind for the same group twice results in an error being returned.

func (MultiEcho) Shutdown

func (c MultiEcho) Shutdown()

Shutdown stops all Echo servers.

func (MultiEcho) Start

func (c MultiEcho) Start() error

Start starts all Echo servers.

type Named

type Named interface {
	// Name returns the name of the engine
	Name() string
}

Named is the interface for all engines that have a name

type Period

type Period struct {
	Begin time.Time  `json:"begin"`
	End   *time.Time `json:"end,omitempty"`
}

Period is a convenience type for a dateTime range.

func (Period) Contains

func (p Period) Contains(when time.Time) bool

Contains checks if the given time falls within this period. The bounds are inclusive.

type RFC3339Time

type RFC3339Time struct {
	time.Time
}

RFC3339Time is a time that marshals as RFC3339

func (RFC3339Time) MarshalText

func (j RFC3339Time) MarshalText() ([]byte, error)

MarshalText marshals the time in RFC3339 format

func (*RFC3339Time) UnmarshalJSON

func (j *RFC3339Time) UnmarshalJSON(bytes []byte) error

UnmarshalJSON parses the time string using RFC3339 format

type Routable

type Routable interface {
	// Routes configures the HTTP routes on the given router
	Routes(router EchoRouter)
}

Routable enables connecting a REST API to the echo server. The API wrappers should implement this interface

type Runnable

type Runnable interface {
	Start() error
	Shutdown() error
}

Runnable is the interface that groups the Start and Shutdown methods. When an engine implements these they will be called on startup and shutdown. Start and Shutdown should not be called more than once

type ServerConfig

type ServerConfig struct {
	Verbosity    string           `koanf:"verbosity"`
	LoggerFormat string           `koanf:"loggerformat"`
	Strictmode   bool             `koanf:"strictmode"`
	Datadir      string           `koanf:"datadir"`
	HTTP         GlobalHTTPConfig `koanf:"http"`
	// contains filtered or unexported fields
}

ServerConfig has global server settings.

func NewServerConfig

func NewServerConfig() *ServerConfig

NewServerConfig creates a new config with some defaults

func (*ServerConfig) InjectIntoEngine

func (ngc *ServerConfig) InjectIntoEngine(e Injectable) error

InjectIntoEngine takes the loaded config and sets the engine's config struct

func (*ServerConfig) Load

func (ngc *ServerConfig) Load(cmd *cobra.Command) (err error)

Load follows the load order of configfile, env vars and then commandline param

func (*ServerConfig) PrintConfig

func (ngc *ServerConfig) PrintConfig() string

PrintConfig return the current config in string form

type System

type System struct {

	// Config holds the global and raw config
	Config *ServerConfig
	// Routers is used to connect API handlers to the echo server
	Routers []Routable
	// EchoCreator is the function that's used to create the echo server/
	EchoCreator func(cfg HTTPConfig, strictmode bool) (EchoServer, error)
	// contains filtered or unexported fields
}

System is the control structure where engines are registered.

func NewSystem

func NewSystem() *System

NewSystem creates a new, empty System.

func (*System) Configure

func (system *System) Configure() error

Configure configures all engines in the system.

func (*System) Diagnostics

func (system *System) Diagnostics() []DiagnosticResult

Diagnostics returns the compound diagnostics for all engines.

func (*System) Load

func (system *System) Load(cmd *cobra.Command) error

Load loads the config and injects config values into engines

func (*System) Migrate

func (system *System) Migrate() error

Migrate migrates data structures in an engine if needed.

func (*System) RegisterEngine

func (system *System) RegisterEngine(engine Engine)

RegisterEngine is a helper func to add an engine to the list of engines from a different lib/pkg

func (*System) RegisterRoutes

func (system *System) RegisterRoutes(router Routable)

RegisterRoutes is a helper func to register API routers so they can be linked to the echo server

func (*System) Shutdown

func (system *System) Shutdown() error

Shutdown shuts down all engines in the system.

func (*System) Start

func (system *System) Start() error

Start starts all engines in the system.

func (*System) VisitEngines

func (system *System) VisitEngines(visitor func(engine Engine))

VisitEngines applies the given function on all engines in the system.

func (*System) VisitEnginesE

func (system *System) VisitEnginesE(visitor func(engine Engine) error) error

VisitEnginesE applies the given function on all engines in the system, stopping when an error is returned. The error is passed through.

type TestEngine

type TestEngine struct {
	TestConfig TestEngineConfig

	ShutdownError bool
	// contains filtered or unexported fields
}

func (*TestEngine) Config

func (i *TestEngine) Config() interface{}

func (*TestEngine) ConfigKey

func (i *TestEngine) ConfigKey() string

func (*TestEngine) FlagSet

func (i *TestEngine) FlagSet() *pflag.FlagSet

func (*TestEngine) Name

func (i *TestEngine) Name() string

func (*TestEngine) Shutdown

func (i *TestEngine) Shutdown() error

Shutdown does test stuff

func (*TestEngine) Start

func (i *TestEngine) Start() error

Start does test stuff

type TestEngineConfig

type TestEngineConfig struct {
	Key     string               `koanf:"key"`
	Datadir string               `koanf:"datadir"`
	Sub     TestEngineSubConfig  `koanf:"sub"`
	SubPtr  *TestEngineSubConfig `koanf:"subptr"`
}

TestEngineConfig defines the configuration for the test engine

type TestEngineSubConfig

type TestEngineSubConfig struct {
	Test string `koanf:"test"`
}

TestEngineSubConfig defines the `sub` configuration for the test engine

type TrustStore

type TrustStore struct {
	CertPool *x509.CertPool
	// contains filtered or unexported fields
}

TrustStore contains both a CertPool and the actual certificates

func LoadTrustStore

func LoadTrustStore(trustStoreFile string) (*TrustStore, error)

LoadTrustStore creates a x509 certificate pool based on a truststore file

func (*TrustStore) Certificates

func (store *TrustStore) Certificates() []*x509.Certificate

Certificates returns a copy of the certificates within the CertPool

type ViewableDiagnostics

type ViewableDiagnostics interface {
	Named
	Diagnosable
}

ViewableDiagnostics is used for engines that display diagnostics in an interface

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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