control

package
v0.0.0-...-e652847 Latest Latest
Warning

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

Go to latest
Published: Jan 15, 2020 License: MIT Imports: 19 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

Types

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 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 instanciate 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

Jump to

Keyboard shortcuts

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