server

package
v0.0.0-...-d983439 Latest Latest
Warning

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

Go to latest
Published: Dec 24, 2024 License: Apache-2.0 Imports: 88 Imported by: 1

Documentation

Index

Constants

View Source
const (
	// DBName is the basename of the boltdb database file
	DBName = "bolt.db"
)
View Source
const MigrationCompletedStatus = "The Migration of compliance controls and assets have completed."
View Source
const MigrationInProgressStatus = "The Migration of compliance controls and assets is in progress."
View Source
const MigrationNotConfiguredStatus = "Automate is not configured to support enhance compliance reporting."
View Source
const MigrationNotStartedStatus = "The Migration of compliance controls and assets is yet to start."

Variables

View Source
var (
	// ErrorNoDeployment is returned when a command that requires
	// a configured deployment is called when deployment is
	// nil. We shouldn't ever return this anymore as we now always
	// create a deployment.
	ErrorNoDeployment = status.Error(codes.FailedPrecondition, "No deployment has been created yet.")
	// ErrorNotConfigured is returned when a command that requires
	// a configured deployment is called before
	// ConfigureDeployment has been called.
	ErrorNotConfigured = status.Error(codes.FailedPrecondition, "The deployment has not been configured.")
	// ErrorNoSuchService is returned when a command that takes a
	// service has been given a service identifier that is not recognized.
	ErrorNoSuchService = status.Error(codes.NotFound, "No service with the given name was found.")
	// ErrorNoSuchTask is returned when a command that takes a
	// TaskID has been given an ID that doesn't exist.
	ErrorNoSuchTask = status.Error(codes.NotFound, "No task with the given TaskID was found.")
	// ErrorServiceNameInvalid is returned when a command that
	// takes a service has been given a service identifier that
	// could not be parsed.
	ErrorServiceNameInvalid = status.Error(codes.InvalidArgument, "Service name had invalid format.")
	// ErrorNoReleaseManifest is returned when a command requires
	// a release manifest but we do not yet have one.
	ErrorNoReleaseManifest = status.Error(codes.FailedPrecondition, "No release manifest has been fetched for this deployment.")
	// ErrorNoBackupDirectory is returned by backup commands when
	// a backup directory is not configured but one is needed by
	// the command.
	ErrorNoBackupDirectory = status.Error(codes.FailedPrecondition, "No backup directory has been configured for this Chef Automate deployment.")
)
View Source
var DataDir = "/hab/svc/deployment-service/data/"

DataDir is the path where data is stored. It's only variable for testing purposes.

Functions

func IfEqual

func IfEqual(req *api.PatchAutomateConfigRequest, existingCopy *deployment.AutomateConfig) bool

func LogRotateConf

func LogRotateConf(path string, params ...string) string

func StartServer

func StartServer(config *Config) error

StartServer starts the automate deployment gRPC server

func UpdateByMergingStructs

func UpdateByMergingStructs(req *api.PatchAutomateConfigRequest, existingCopy *deployment.AutomateConfig) (*api.PatchAutomateConfigRequest, error)

UpdateOfLogroateConfigMergingStructs merges existing config to requested config if the keys are missing in requested structs

Types

type Config

type Config struct {
	ListenAddress            string `mapstructure:"listen_address"`
	Port                     uint32 `mapstructure:"port"`
	LogLevel                 string `mapstructure:"log_level"`
	LogFormat                string `mapstructure:"log_format"`
	StagingDir               string `mapstructure:"staging_dir"`
	ConvergeIntervalSecs     uint32 `mapstructure:"converge_interval_secs"`
	ConvergeDisableFile      string `mapstructure:"converge_disable_file"`
	EnsureStatusTimeoutSecs  uint32 `mapstructure:"ensure_status_timeout_secs"`
	EnsureStatusIntervalSecs uint32 `mapstructure:"ensure_status_interval_secs"`
}

Config - runtime configuration options for the server

func DefaultServerConfig

func DefaultServerConfig() *Config

DefaultServerConfig returns a new instance of the server config with default values applied.

type ConfigRenderer

type ConfigRenderer func(service *deployment.Service) (string, error)

type Looper

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

A Looper runs a user-supplied func repeatedly. The Looper will wait at least the length of the interval between calls to the user-supplied function.

func NewLooper

func NewLooper(interval time.Duration, userFunc func()) *Looper

NewLooper returns a Looper

func (*Looper) IsRunning

func (l *Looper) IsRunning() bool

func (*Looper) Start

func (l *Looper) Start()

Start starts the Looper. Start is safe to call multiple times; Calls to Start on a running Looper will do nothing. Start is safe to call on a Looper that has been previously stopped and will restart Looper.

func (*Looper) Stop

func (l *Looper) Stop()

Stop will stop a running Looper. Stop is safe to call on an already stopped Looper. Stop will not kill any currently running userFunc.

Jump to

Keyboard shortcuts

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