tc

package
v0.6.0-RC2 Latest Latest
Warning

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

Go to latest
Published: May 19, 2020 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const ErrConsistencyFail = "consistency check fail at index %d"

ErrConsistencyFail happens when a consistency check fails. Check the log to retrieve details on which element is failing

Variables

This section is empty.

Functions

This section is empty.

Types

type ImmuTc

type ImmuTc interface {
	Start(context.Context) (err error)
	Stop(context.Context)
	GetStatus(context.Context) bool
}

ImmuTc trust checker interface

func NewImmuTc

func NewImmuTc(c client.ImmuClient, l logger.Logger) ImmuTc

NewImmuTc returns new trust checker service

type ImmuTcServer

type ImmuTcServer struct {
	Options     Options
	Done        chan bool
	Quit        chan os.Signal
	HttpServer  *http.Server
	Checker     ImmuTc
	Logger      logger.Logger
	LogFile     *os.File
	RootService client.RootService
	Pid         server.PIDFile
	Client      schema.ImmuServiceClient
}

func DefaultServer

func DefaultServer() *ImmuTcServer

func NewServer

func NewServer(options Options) (immutcServer *ImmuTcServer, err error)

NewServer return a new trust checker server

func (*ImmuTcServer) Start

func (s *ImmuTcServer) Start() (err error)

Start launch trust checker and status http server

func (*ImmuTcServer) Stop

func (s *ImmuTcServer) Stop()

Stop shutdown trust checker and status http server

func (*ImmuTcServer) WithChecker

func (c *ImmuTcServer) WithChecker(checker ImmuTc) *ImmuTcServer

func (*ImmuTcServer) WithClient

func (c *ImmuTcServer) WithClient(client schema.ImmuServiceClient) *ImmuTcServer

func (*ImmuTcServer) WithLogger

func (c *ImmuTcServer) WithLogger(logger logger.Logger) *ImmuTcServer

func (*ImmuTcServer) WithOptions

func (c *ImmuTcServer) WithOptions(options Options) *ImmuTcServer

func (*ImmuTcServer) WithRootService

func (c *ImmuTcServer) WithRootService(rootService client.RootService) *ImmuTcServer

type MTLsOptions

type MTLsOptions struct {
	Servername  string
	Pkey        string
	Certificate string
	ClientCAs   string
}

func DefaultMTLsOptions

func DefaultMTLsOptions() MTLsOptions

func (MTLsOptions) WithCertificate

func (o MTLsOptions) WithCertificate(certificate string) MTLsOptions

func (MTLsOptions) WithClientCAs

func (o MTLsOptions) WithClientCAs(clientCAs string) MTLsOptions

func (MTLsOptions) WithPkey

func (o MTLsOptions) WithPkey(pkey string) MTLsOptions

func (MTLsOptions) WithServername

func (o MTLsOptions) WithServername(servername string) MTLsOptions

type Options

type Options struct {
	Dir           string
	Address       string
	Port          int
	ImmudbAddress string
	ImmudbPort    int
	Detached      bool
	MTLs          bool
	MTLsOptions   client.MTLsOptions
	Config        string
	Pidfile       string
	Logfile       string
}

Options trust checker options

func DefaultOptions

func DefaultOptions() Options

DefaultOptions trust checker default options

func (Options) Bind

func (o Options) Bind() string

func (Options) String

func (o Options) String() string

func (Options) WithAddress

func (o Options) WithAddress(address string) Options

WithAddress sets address

func (Options) WithConfig

func (o Options) WithConfig(config string) Options

WithConfig sets config

func (Options) WithDetached

func (o Options) WithDetached(detached bool) Options

WithDetached sets immutc to be run in background

func (Options) WithDir

func (o Options) WithDir(dir string) Options

WithDir sets dir

func (Options) WithImmudbAddress

func (o Options) WithImmudbAddress(immudbAddress string) Options

WithImmudbAddress sets immudbAddress

func (Options) WithImmudbPort

func (o Options) WithImmudbPort(immudbPort int) Options

WithImmudbPort sets immudbPort

func (Options) WithLogfile

func (o Options) WithLogfile(logfile string) Options

WithLogfile sets logfile

func (Options) WithMTLs

func (o Options) WithMTLs(MTLs bool) Options

WithMTLs sets MTLs

func (Options) WithMTLsOptions

func (o Options) WithMTLsOptions(MTLsOptions client.MTLsOptions) Options

WithMTLsOptions sets MTLsOptions

func (Options) WithPidfile

func (o Options) WithPidfile(pidfile string) Options

WithPidfile sets pidfile

func (Options) WithPort

func (o Options) WithPort(port int) Options

WithPort sets port

type Service

type Service struct {
	ImmuTcServer
}

func (Service) Run

func (s Service) Run()

Run - blocking run service

func (Service) Start

func (s Service) Start()

Start - non-blocking start service

func (Service) Stop

func (s Service) Stop()

Stop - non-blocking stop service

Jump to

Keyboard shortcuts

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