control

package
v0.0.0-...-cdef871 Latest Latest
Warning

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

Go to latest
Published: Oct 6, 2023 License: MIT Imports: 28 Imported by: 0

Documentation

Index

Constants

View Source
const (

	// DefaultPoolSize is the default size of the worker pool
	DefaultPoolSize = 5

	// DefaultPoolMaxPending is the default number of requests that can be
	// pending
	DefaultPoolMaxPending = 5

	// DefaultPoolMaxPendingDuration is the default max pending duration for a
	// a request
	DefaultPoolMaxPendingDuration = time.Second

	// DefaultMaxPurgeJobs is the default maxiumum number of purge jobs
	DefaultMaxPurgeJobs = 1

	// DefaultPurgeBatchSize is the default number of process that are purged
	// in one batch
	DefaultPurgeBatchSize = 200
)

Variables

This section is empty.

Functions

func AccountAccept

func AccountAccept(
	accountStorage storage.AccountStorage, accountID api.UUID,
	serverCert *x509.Certificate, serverKey interface{},
	expire time.Time,
) (api.Account, error)

AccountAccept accepts a pending account request; a certificate is generated from the CSR.

func AccountReject

func AccountReject(
	accountStorage storage.AccountStorage, accountID api.UUID,
) (api.Account, error)

AccountReject rejects a pending account request.

func HasPendingCSR

func HasPendingCSR(account api.Account) bool

HasPendingCSR returns true if the given account has a CSR pending

func RegisterDebugInfoEntry

func RegisterDebugInfoEntry(entry *DebugInfoEntry)

Types

type DebugInfoEntry

type DebugInfoEntry struct {
	Name        string
	Description string
	Help        string
	Run         func([]string, OutputFormatter) error
}

type MapItem

type MapItem struct {
	Key   string
	Value interface{}
}

type MapSlice

type MapSlice []MapItem

func (MapSlice) MarshalYAML

func (s MapSlice) MarshalYAML() (interface{}, error)

type OctetSteamWriter

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

func NewOctetStreamWriter

func NewOctetStreamWriter(
	ctx context.Context, send func(control.OctetStreamList),
) OctetSteamWriter

func (*OctetSteamWriter) Write

func (w *OctetSteamWriter) Write(data []byte) (int, error)

type Options

type Options struct {
	services.Options

	PoolSize               uint
	PoolMaxPending         uint
	PoolMaxPendingDuration time.Duration

	PurgeBatchSize int

	ServerCert *x509.Certificate
	ServerKey  interface{}

	MaxPurgeJobs int

	PipelineManager *pipeline.Manager
	ProcessManager  *process.Manager
	ProcessStorage  storage.ProcessStorage
	AccountStorage  storage.AccountStorage
	PasswordStorage storage.PasswordStorage
	ActorStorage    storage.ActorStorage
	EnvelopeStorage storage.EnvelopeStorage
	LogStorage      storage.LogStorage
	JobStorage      storage.JobStorage
}

Options for the Service

type OutputFormatter

type OutputFormatter interface {
	OpenSection(title string) error
	CloseSection() error

	OpenTable(columns ...string) error
	CloseTable() error

	AddValue(interface{}) error

	Raw(mimetype string, data []byte) error
	Writer() io.Writer
}

type Service

type Service struct {
	services.BaseService
	// contains filtered or unexported fields
}

Service provides an api for administrators

func NewService

func NewService(o Options) *Service

NewService instantiate a Service

func (*Service) Shutdown

func (s *Service) Shutdown() error

Shutdown stops the workers

func (*Service) Startup

func (s *Service) Startup() error

Startup starts the service

type TextFormatter

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

func (*TextFormatter) AddValue

func (f *TextFormatter) AddValue(value interface{}) error

func (*TextFormatter) CloseSection

func (f *TextFormatter) CloseSection() error

func (*TextFormatter) CloseTable

func (f *TextFormatter) CloseTable() error

func (*TextFormatter) OpenSection

func (f *TextFormatter) OpenSection(title string) error

func (*TextFormatter) OpenTable

func (f *TextFormatter) OpenTable(columns ...string) error

func (*TextFormatter) Raw

func (f *TextFormatter) Raw(_ string, data []byte) error

func (*TextFormatter) Writer

func (f *TextFormatter) Writer() io.Writer

Jump to

Keyboard shortcuts

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