Documentation ¶
Index ¶
- Constants
- Variables
- func Format(ui cli.Ui) string
- func MakeShutdownCh() chan struct{}
- func MakeSighupCh() chan struct{}
- func MaxAttributesLength(nonAttributesMap, attributesMap map[string]any, keySubstMap map[string]string) int
- func NewListener(l *listenerutil.ListenerConfig, ui cli.Ui) (net.Listener, map[string]string, reloadutil.ReloadFunc, error)
- func PluginInfoForOutput(plg *plugins.PluginInfo, maxLength int) string
- func ProcessLogLevelAndFormat(flagLogLevel, flagLogFormat, configLogLevel, configLogFormat string) (hclog.Level, logging.LogFormat, error)
- func ScopeInfoForOutput(scp *scopes.ScopeInfo, maxLength int) string
- func StartMemProfiler(_ context.Context)
- func TokenIdFromToken(token string) (string, error)
- func WrapAtLength(s string) string
- func WrapAtLengthWithPadding(s string, pad int) string
- func WrapForHelpText(lines []string) string
- func WrapMap(prefixSpaces, maxLengthOverride int, input map[string]any) string
- func WrapSlice(prefixSpaces int, input []string) string
- type BoolVar
- type BoundaryUI
- type CombinationSliceVar
- type CombinedSliceFlagValue
- type Command
- func (c *Command) Client(opt ...Option) (*api.Client, error)
- func (c *Command) DiscoverKeyringTokenInfo() (string, string, error)
- func (c *Command) FlagSet(bit FlagSetBit) *FlagSets
- func (c *Command) PrintApiError(in *api.Error, contextStr string, opt ...Option)
- func (c *Command) PrintCliError(err error)
- func (c *Command) PrintJson(input json.RawMessage, opt ...Option) bool
- func (c *Command) PrintJsonItem(resp *api.Response, opt ...Option) bool
- func (c *Command) PrintJsonItems(resp *api.Response) bool
- func (c *Command) ReadTokenFromKeyring(keyringType, tokenName string) *authtokens.AuthToken
- type ComposedOfEventArgs
- type DurationVar
- type EnabledPlugin
- type EventFlags
- type FlagBool
- type FlagExample
- type FlagSet
- func (f *FlagSet) BoolVar(i *BoolVar)
- func (f *FlagSet) CombinationSliceVar(i *CombinationSliceVar)
- func (f *FlagSet) DurationVar(i *DurationVar)
- func (f *FlagSet) Float64Var(i *Float64Var)
- func (f *FlagSet) Int64Var(i *Int64Var)
- func (f *FlagSet) IntVar(i *IntVar)
- func (f *FlagSet) Name() string
- func (f *FlagSet) StringMapVar(i *StringMapVar)
- func (f *FlagSet) StringSliceMapVar(i *StringSliceMapVar)
- func (f *FlagSet) StringSliceVar(i *StringSliceVar)
- func (f *FlagSet) StringVar(i *StringVar)
- func (f *FlagSet) Uint64Var(i *Uint64Var)
- func (f *FlagSet) UintVar(i *UintVar)
- func (f *FlagSet) Var(value flag.Value, name, usage string)
- func (f *FlagSet) VarFlag(i *VarFlag)
- func (f *FlagSet) Visit(fn func(*flag.Flag))
- func (f *FlagSet) VisitAll(fn func(*flag.Flag))
- type FlagSetBit
- type FlagSets
- type FlagVisibility
- type Float64Var
- type GRPCLogFaker
- type Int64Var
- type IntVar
- type JsonFormatter
- type ListenerFactory
- type Option
- func WithAttributeFieldPrefix(p string) Option
- func WithContainerImage(name string) Option
- func WithDatabaseTemplate(template string) Option
- func WithEventAuditWrapper(w wrapping.Wrapper) Option
- func WithEventFlags(flags *EventFlags) Option
- func WithEventGating(with bool) Option
- func WithEventerConfig(config *event.EventerConfig) Option
- func WithHostPlugin(pluginId string, plg plugin.HostPluginServiceClient) Option
- func WithNoTokenScope() Option
- func WithNoTokenValue() Option
- func WithSkipAuthMethodCreation() Option
- func WithSkipDatabaseDestruction() Option
- func WithSkipHostResourcesCreation() Option
- func WithSkipLdapAuthMethodCreation() Option
- func WithSkipOidcAuthMethodCreation() Option
- func WithSkipScopesCreation() Option
- func WithSkipTargetCreation() Option
- func WithStatusCode(statusCode int) Option
- type Options
- type Server
- func (b *Server) AddEventerToContext(ctx context.Context) (context.Context, error)
- func (b *Server) CreateDevDatabase(ctx context.Context, opt ...Option) error
- func (b *Server) CreateDevLdapAuthMethod(ctx context.Context) error
- func (b *Server) CreateDevOidcAuthMethod(ctx context.Context) error
- func (b *Server) CreateGlobalKmsKeys(ctx context.Context) error
- func (b *Server) CreateInitialHostResources(ctx context.Context) (*static.HostCatalog, *static.HostSet, *static.Host, error)
- func (b *Server) CreateInitialLoginRole(ctx context.Context) (*iam.Role, error)
- func (b *Server) CreateInitialPasswordAuthMethod(ctx context.Context) (*password.AuthMethod, *iam.User, error)
- func (b *Server) CreateInitialScopes(ctx context.Context) (*iam.Scope, *iam.Scope, error)
- func (b *Server) CreateInitialTargetWithAddress(ctx context.Context) (target.Target, error)
- func (b *Server) CreateInitialTargetWithHostSources(ctx context.Context) (target.Target, error)
- func (b *Server) DestroyDevDatabase(ctx context.Context) error
- func (b *Server) OpenAndSetServerDatabase(ctx context.Context, dialect string) error
- func (b *Server) OpenDatabase(ctx context.Context, dialect, url string) (*db.DB, error)
- func (b *Server) PrintInfo(ui cli.Ui)
- func (b *Server) RegisterPlugin(ctx context.Context, name string, hostClient plgpb.HostPluginServiceClient, ...) (*plugin.Plugin, error)
- func (b *Server) ReleaseLogGate() error
- func (b *Server) RemovePidFile(pidPath string) error
- func (b *Server) RunShutdownFuncs() error
- func (b *Server) SetupEventing(ctx context.Context, logger hclog.Logger, serializationLock *sync.Mutex, ...) error
- func (b *Server) SetupKMSes(ctx context.Context, ui cli.Ui, config *config.Config, opt ...Option) error
- func (b *Server) SetupListeners(ui cli.Ui, config *configutil.SharedConfig, allowedPurposes []string) error
- func (b *Server) SetupLogging(flagLogLevel, flagLogFormat, configLogLevel, configLogFormat string) error
- func (b *Server) SetupWorkerPublicAddress(conf *config.Config, flagValue string) error
- func (b *Server) StorePidFile(pidPath string) error
- func (b *Server) StoreWorkerAuthReq(authReq, workerAuthReqPath string) error
- type ServerListener
- type StringMapVar
- type StringSliceMapVar
- type StringSliceVar
- type StringVar
- type TCPKeepAliveListener
- type Uint64Var
- type UintVar
- type VarFlag
- type WorkerAuthInfo
Constants ¶
const ( CommandSuccess int = iota CommandApiError CommandCliError CommandUserError )
const ( EnvTokenName = "BOUNDARY_TOKEN_NAME" EnvKeyringType = "BOUNDARY_KEYRING_TYPE" StoredTokenName = "HashiCorp Boundary Auth Token" )
const ( // FlagNameAddr is the flag used in the base command to read in the // address of the Boundary server. FlagNameAddr = "addr" // FlagnameCACert is the flag used in the base command to read in the CA // cert. FlagNameCACert = "ca-cert" // FlagnameCAPath is the flag used in the base command to read in the CA // cert path. FlagNameCAPath = "ca-path" // FlagNameClientCert is the flag used in the base command to read in the // client key FlagNameClientKey = "client-key" // FlagNameClientCert is the flag used in the base command to read in the // client cert FlagNameClientCert = "client-cert" // FlagNameTLSInsecure is the flag used in the base command to read in // the option to ignore TLS certificate verification. FlagNameTLSInsecure = "tls-insecure" // FlagTLSServerName is the flag used in the base command to read in // the TLS server name. FlagTLSServerName = "tls-server-name" )
const ( EnvBoundaryCLINoColor = `BOUNDARY_CLI_NO_COLOR` EnvBoundaryCLIFormat = `BOUNDARY_CLI_FORMAT` )
const ( NoneKeyring = "none" AutoKeyring = "auto" WincredKeyring = "wincred" PassKeyring = "pass" KeychainKeyring = "keychain" SecretServiceKeyring = "secret-service" DefaultTokenName = "default" LoginCollection = "login" PassPrefix = "HashiCorp_Boundary" )
const (
// File name to use for storing workerAuth requests
WorkerAuthReqFile = "auth_request_token"
)
Variables ¶
var BuiltinListeners = map[string]ListenerFactory{
"tcp": tcpListenerFactory,
"unix": unixListenerFactory,
}
BuiltinListeners is the list of built-in listener types.
var DevOnlyControllerFlags = func(*Command, *FlagSet) {}
var TermWidth uint = 80
Functions ¶
func MakeShutdownCh ¶
func MakeShutdownCh() chan struct{}
MakeShutdownCh returns a channel that can be used for shutdown notifications for commands. This channel will send a message for every SIGINT or SIGTERM received.
func MakeSighupCh ¶ added in v0.1.8
func MakeSighupCh() chan struct{}
MakeSighupCh returns a channel that can be used for SIGHUP reloading. This channel will send a message for every SIGHUP received.
func MaxAttributesLength ¶
func NewListener ¶
func NewListener(l *listenerutil.ListenerConfig, ui cli.Ui) (net.Listener, map[string]string, reloadutil.ReloadFunc, error)
New creates a new listener of the given type with the given configuration. The type is looked up in the BuiltinListeners map.
func PluginInfoForOutput ¶ added in v0.7.0
func PluginInfoForOutput(plg *plugins.PluginInfo, maxLength int) string
func StartMemProfiler ¶
func TokenIdFromToken ¶ added in v0.2.1
func WrapAtLength ¶
WrapAtLength wraps the given text to maxLineLength.
func WrapAtLengthWithPadding ¶
WrapAtLengthWithPadding wraps the given text at the maxLineLength, taking into account any provided left padding.
func WrapForHelpText ¶
Types ¶
type BoolVar ¶
type BoolVar struct { Name string Aliases []string Usage string Default bool Hidden bool EnvVar string Target *bool Completion complete.Predictor }
-- BoolVar and boolValue
type BoundaryUI ¶
type CombinationSliceVar ¶ added in v0.7.0
type CombinationSliceVar struct { Name string Aliases []string Usage string Hidden bool Target *[]CombinedSliceFlagValue Completion complete.Predictor KvSplit bool KeyOnlyAllowed bool KeyDelimiter *string ProtoCompatKey bool }
CombinationSliceVar uses a wrapped value to allow storing values from different flags in one slice. This is useful if you need ordering to be maintained across flags. It does not currently support env vars.
If KvSplit is set true, each value will be split on the first = into Key and Value parts so that validation can happen at parsing time. If you don't want this kind of behavior, simply combine them, or set KvSplit to false.
If KeyOnlyAllowed is true then it is valid to parse an input with only a key segment and no value.
If KeyDelimiter is non-nil (along with KvSplit being true), the string will be used to split the key. Otherwise, the Keys will be a single-element slice containing the full value.
If ProtoCompat is true, the key will be validated against proto3 syntax requirements for identifiers. If the string is split via KeyDelimiter, each segment will be evaluated independently.
type CombinedSliceFlagValue ¶ added in v0.7.0
type CombinedSliceFlagValue struct { Name string Keys []string Value *wrapperspb.StringValue }
CombinedSliceValue holds the raw value (as a string) and the name of the flag that added it.
type Command ¶
type Command struct { Context context.Context ContextCancel context.CancelFunc UI cli.Ui ShutdownCh chan struct{} FlagToken string FlagTokenName string FlagKeyringType string FlagRecoveryConfig string FlagScopeId string FlagScopeName string FlagPluginId string FlagPluginName string FlagId string FlagName string FlagDescription string FlagAuthMethodId string FlagHostCatalogId string FlagCredentialStoreId string FlagVersion int FlagRecursive bool FlagFilter string FlagTags map[string][]string FlagOutputFile string // the output file for the command FlagNoClobber bool // Don't clobber the output file // Attribute values FlagAttributes string FlagAttrs []CombinedSliceFlagValue // Secret values FlagSecrets string FlagScrts []CombinedSliceFlagValue // Object values FlagObject string FlagKv []CombinedSliceFlagValue // This will be intialized, if needed, in Config() when instantiating a // recovery wrapper, if requested. It's then called as a deferred function // on the Run method of the various generated commands. WrapperCleanupFunc func() error // contains filtered or unexported fields }
func NewCommand ¶
New returns a new instance of a base.Command type
func NewServerCommand ¶ added in v0.11.0
New returns a new instance of a base.Command type that does not intercept the shutdown channel
func (*Command) Client ¶
Client returns the HTTP API client. The client is cached on the command to save performance on future calls.
func (*Command) DiscoverKeyringTokenInfo ¶ added in v0.1.1
func (*Command) FlagSet ¶
func (c *Command) FlagSet(bit FlagSetBit) *FlagSets
FlagSet creates the flags for this command. The result is cached on the command to save performance on future calls.
func (*Command) PrintApiError ¶ added in v0.1.8
PrintApiError prints the given API error, optionally with context information, to the UI in the appropriate format. WithAttributeFieldPrefix is used, all other options are ignored.
func (*Command) PrintCliError ¶ added in v0.1.8
PrintCliError prints the given CLI error to the UI in the appropriate format
func (*Command) PrintJson ¶ added in v0.4.0
func (c *Command) PrintJson(input json.RawMessage, opt ...Option) bool
PrintJson prints the given raw JSON in our common format
func (*Command) PrintJsonItem ¶ added in v0.1.8
PrintJsonItem prints the given item to the UI in JSON format
func (*Command) PrintJsonItems ¶ added in v0.1.8
PrintJsonItems prints the given items to the UI in JSON format
func (*Command) ReadTokenFromKeyring ¶
func (c *Command) ReadTokenFromKeyring(keyringType, tokenName string) *authtokens.AuthToken
type ComposedOfEventArgs ¶ added in v0.5.0
type DurationVar ¶
type DurationVar struct { Name string Aliases []string Usage string Default time.Duration Hidden bool EnvVar string Target *time.Duration Completion complete.Predictor }
-- DurationVar and durationValue
type EnabledPlugin ¶ added in v0.7.1
type EnabledPlugin uint
const ( EnabledPluginUnknown EnabledPlugin = iota EnabledPluginLoopback EnabledPluginAws EnabledPluginHostAzure )
func (EnabledPlugin) String ¶ added in v0.7.1
func (e EnabledPlugin) String() string
type EventFlags ¶ added in v0.5.0
type EventFlags struct { Format event.SinkFormat AuditEnabled *bool ObservationsEnabled *bool SysEventsEnabled *bool AllowFilters []string DenyFilters []string }
EventFlags represent the cmd flags supported overriding the configured or default event configuration
func NewEventFlags ¶ added in v0.5.0
func NewEventFlags(defaultFormat event.SinkFormat, c ComposedOfEventArgs) (*EventFlags, error)
NewEventFlags will create a new EventFlags based on the ComposedOfEventArgs which should be populated with command flags which have already been "parsed"
func (*EventFlags) Validate ¶ added in v0.5.0
func (ef *EventFlags) Validate() error
Validate simply validates the flags
type FlagBool ¶
type FlagBool interface {
IsBoolFlag() bool
}
FlagBool is an interface which boolean flags implement.
type FlagExample ¶
type FlagExample interface {
Example() string
}
FlagExample is an interface which declares an example value.
type FlagSet ¶
type FlagSet struct {
// contains filtered or unexported fields
}
FlagSet is a grouped wrapper around a real flag set and a grouped flag set.
func (*FlagSet) CombinationSliceVar ¶ added in v0.7.0
func (f *FlagSet) CombinationSliceVar(i *CombinationSliceVar)
func (*FlagSet) DurationVar ¶
func (f *FlagSet) DurationVar(i *DurationVar)
func (*FlagSet) Float64Var ¶
func (f *FlagSet) Float64Var(i *Float64Var)
func (*FlagSet) StringMapVar ¶
func (f *FlagSet) StringMapVar(i *StringMapVar)
func (*FlagSet) StringSliceMapVar ¶ added in v0.10.4
func (f *FlagSet) StringSliceMapVar(i *StringSliceMapVar)
func (*FlagSet) StringSliceVar ¶
func (f *FlagSet) StringSliceVar(i *StringSliceVar)
type FlagSetBit ¶
type FlagSetBit uint
const ( FlagSetNone FlagSetBit = 1 << iota FlagSetHTTP FlagSetClient FlagSetOutputFormat )
type FlagSets ¶
type FlagSets struct {
// contains filtered or unexported fields
}
FlagSets is a group of flag sets.
func (*FlagSets) Completions ¶
Completions returns the completions for this flag set.
func (*FlagSets) NewFlagSet ¶
NewFlagSet creates a new flag set from the given flag sets.
type FlagVisibility ¶
type FlagVisibility interface {
Hidden() bool
}
FlagVisibility is an interface which declares whether a flag should be hidden from help and completions. This is usually used for deprecations on "internal-only" flags.
type Float64Var ¶
type Float64Var struct { Name string Aliases []string Usage string Default float64 Hidden bool EnvVar string Target *float64 Completion complete.Predictor }
-- Float64Var and float64Value
type GRPCLogFaker ¶
type GRPCLogFaker struct { Logger hclog.Logger Log bool }
func (*GRPCLogFaker) Fatal ¶
func (g *GRPCLogFaker) Fatal(args ...any)
func (*GRPCLogFaker) Fatalf ¶
func (g *GRPCLogFaker) Fatalf(format string, args ...any)
func (*GRPCLogFaker) Fatalln ¶
func (g *GRPCLogFaker) Fatalln(args ...any)
func (*GRPCLogFaker) Print ¶
func (g *GRPCLogFaker) Print(args ...any)
func (*GRPCLogFaker) Printf ¶
func (g *GRPCLogFaker) Printf(format string, args ...any)
func (*GRPCLogFaker) Println ¶
func (g *GRPCLogFaker) Println(args ...any)
type Int64Var ¶
type Int64Var struct { Name string Aliases []string Usage string Default int64 Hidden bool EnvVar string Target *int64 Completion complete.Predictor }
-- Int64Var and int64Value
type IntVar ¶
type IntVar struct { Name string Aliases []string Usage string Default int Hidden bool EnvVar string Target *int Completion complete.Predictor }
-- IntVar and intValue
type ListenerFactory ¶
type ListenerFactory func(string, *listenerutil.ListenerConfig, cli.Ui) (string, net.Listener, error)
Factory is the factory function to create a listener.
type Option ¶
type Option func(*Options)
Option - how Options are passed as arguments.
func WithAttributeFieldPrefix ¶ added in v0.4.0
WithAttributeFieldPrefix tells the command what prefix to attach to attribute fields when they are returned as errors.
func WithContainerImage ¶ added in v0.2.1
WithContainerImage tells the command which container image to start a dev database with
func WithDatabaseTemplate ¶ added in v0.6.1
WithDatabaseTemplate allows for using an existing database template for initializing the boundary database.
func WithEventAuditWrapper ¶ added in v0.7.0
func WithEventFlags ¶ added in v0.5.0
func WithEventFlags(flags *EventFlags) Option
WithEventer allows an optional event configuration flags which override whatever is in the EventerConfig
func WithEventGating ¶ added in v0.8.0
WithEventGating starts the eventer in gated mode
func WithEventerConfig ¶ added in v0.5.0
func WithEventerConfig(config *event.EventerConfig) Option
WithEventer allows an optional eventer config
func WithHostPlugin ¶ added in v0.7.0
func WithHostPlugin(pluginId string, plg plugin.HostPluginServiceClient) Option
WithHostPlugin allows specifying a plugin ID and implementation to create at startup
func WithNoTokenScope ¶
func WithNoTokenScope() Option
WithNoTokenScope tells the client not to set a scope for the client from a saved token's scope, as this can cause confusing behavior at authentication time.
func WithNoTokenValue ¶
func WithNoTokenValue() Option
WithNoTokenValue tells the client not to set a token for the client from a saved token's value, as this can cause confusing behavior at authentication time.
func WithSkipAuthMethodCreation ¶
func WithSkipAuthMethodCreation() Option
WithSkipAuthMethodCreation tells the command not to instantiate any auth method on first run.
func WithSkipDatabaseDestruction ¶
func WithSkipDatabaseDestruction() Option
WithSkipDatabaseDestruction tells the command not to destroy the database even on error.
func WithSkipHostResourcesCreation ¶
func WithSkipHostResourcesCreation() Option
WithSkipHostResourcesCreation tells the command not to instantiate a host catalog and related resources on first run.
func WithSkipLdapAuthMethodCreation ¶ added in v0.13.0
func WithSkipLdapAuthMethodCreation() Option
WithSkipLdapAuthMethodCreation tells the command not to instantiate an LDAP auth method on first run, useful in some tests.
func WithSkipOidcAuthMethodCreation ¶ added in v0.3.0
func WithSkipOidcAuthMethodCreation() Option
WithSkipOidcAuthMethodCreation tells the command not to instantiate an OIDC auth method on first run, useful in some tests.
func WithSkipScopesCreation ¶
func WithSkipScopesCreation() Option
WithSkipScopesCreation tells the command not to instantiate scopes on first run.
func WithSkipTargetCreation ¶
func WithSkipTargetCreation() Option
WithSkipTargetCreation tells the command not to instantiate a target on first run.
func WithStatusCode ¶ added in v0.4.0
WithStatusCode allows passing status codes to functions
type Options ¶
type Options struct {
// contains filtered or unexported fields
}
Options - how Options are represented.
type Server ¶
type Server struct { *Command ServerSideShutdownCh chan struct{} InfoKeys []string Info map[string]string GatedWriter *gatedwriter.Writer Logger hclog.Logger CombineLogs bool StderrLock *sync.Mutex Eventer *event.Eventer // NOTE: Unlike the other wrappers below, if set, DownstreamWorkerAuthKms // should always be a PooledWrapper, so that we can allow multiple KMSes to // accept downstream connections. As such it's made explicit here. DownstreamWorkerAuthKms *multi.PooledWrapper RootKms wrapping.Wrapper WorkerAuthKms wrapping.Wrapper WorkerAuthStorageKms wrapping.Wrapper RecoveryKms wrapping.Wrapper BsrKms wrapping.Wrapper Kms *kms.Kms SecureRandomReader io.Reader WorkerAuthDebuggingEnabled *atomic.Bool PrometheusRegisterer prometheus.Registerer ReloadFuncsLock *sync.RWMutex ReloadFuncs map[string][]reloadutil.ReloadFunc ShutdownFuncs []func() error Listeners []*ServerListener DevPasswordAuthMethodId string DevOidcAuthMethodId string DevLdapAuthMethodId string DevLoginName string DevPassword string DevUserId string DevPasswordAccountId string DevOidcAccountId string DevUnprivilegedLoginName string DevUnprivilegedPassword string DevUnprivilegedUserId string DevUnprivilegedPasswordAccountId string DevUnprivilegedOidcAccountId string DevOrgId string DevProjectId string DevHostCatalogId string DevHostSetId string DevHostId string DevTargetId string // Target using address. DevSecondaryTargetId string // Target using host sources. DevHostAddress string // Host address for target using host sources. DevTargetAddress string // Network address for target with address. DevTargetDefaultPort int DevTargetSessionMaxSeconds int DevTargetSessionConnectionLimit int DevLoopbackPluginId string EnabledPlugins []EnabledPlugin HostPlugins map[string]plgpb.HostPluginServiceClient DevOidcSetup oidcSetup DevLdapSetup ldapSetup DatabaseUrl string DatabaseMaxOpenConnections int DatabaseMaxIdleConnections *int DatabaseConnMaxIdleTimeDuration *time.Duration DevDatabaseCleanupFunc func() error Database *db.DB // contains filtered or unexported fields }
func (*Server) AddEventerToContext ¶ added in v0.5.0
AddEventerToContext will add the server eventer to the context provided
func (*Server) CreateDevDatabase ¶
func (*Server) CreateDevLdapAuthMethod ¶ added in v0.13.0
func (*Server) CreateDevOidcAuthMethod ¶ added in v0.3.0
func (*Server) CreateGlobalKmsKeys ¶
func (*Server) CreateInitialHostResources ¶
func (*Server) CreateInitialLoginRole ¶
func (*Server) CreateInitialPasswordAuthMethod ¶ added in v0.2.0
func (*Server) CreateInitialScopes ¶
func (*Server) CreateInitialTargetWithAddress ¶ added in v0.12.0
func (*Server) CreateInitialTargetWithHostSources ¶ added in v0.12.0
func (*Server) OpenAndSetServerDatabase ¶ added in v0.10.4
OpenAndSetServerDatabase calls OpenDatabase and sets its result *db.DB to the Server's `Database` field.
func (*Server) OpenDatabase ¶ added in v0.10.4
OpenDatabase creates a database connection with the given URL and returns it to the caller. It supports various configuration options - The values must be set on the Server object beforehand.
func (*Server) RegisterPlugin ¶ added in v0.13.0
func (b *Server) RegisterPlugin(ctx context.Context, name string, hostClient plgpb.HostPluginServiceClient, flags []plugin.PluginType, opt ...plugin.Option) (*plugin.Plugin, error)
RegisterPlugin creates a plugin in the database if not present, and flags the plugin type based on the flags parameter. If the PluginTypeHost flag is set, it also registers the plugin in the shared map of running plugins. Since all boundary provided plugins must have a name, a name is required when calling RegisterPlugin and will be used even if WithName is provided. hostClient must not be nil when host flag is included.
func (*Server) ReleaseLogGate ¶
func (*Server) RemovePidFile ¶
func (*Server) RunShutdownFuncs ¶
func (*Server) SetupEventing ¶ added in v0.5.0
func (b *Server) SetupEventing(ctx context.Context, logger hclog.Logger, serializationLock *sync.Mutex, serverName string, opt ...Option) error
SetupEventing will setup the server's eventer and initialize the "system wide" eventer with a pointer to the same eventer
func (*Server) SetupKMSes ¶
func (b *Server) SetupKMSes(ctx context.Context, ui cli.Ui, config *config.Config, opt ...Option) error
SetupKMSes takes in a parsed config, does some minor checking on purposes, and sends each off to configutil to instantiate a wrapper.
func (*Server) SetupListeners ¶
func (b *Server) SetupListeners(ui cli.Ui, config *configutil.SharedConfig, allowedPurposes []string) error
func (*Server) SetupLogging ¶
func (b *Server) SetupLogging(flagLogLevel, flagLogFormat, configLogLevel, configLogFormat string) error
SetupLogging sets up the command's logger. This is mostly historical at this point since we switched to eventing; however, logging is still used as a fallback when events are unable to be sent.
func (*Server) SetupWorkerPublicAddress ¶
func (*Server) StorePidFile ¶
func (*Server) StoreWorkerAuthReq ¶ added in v0.9.0
type ServerListener ¶
type StringMapVar ¶
type StringMapVar struct { Name string Aliases []string Usage string Default map[string]string Hidden bool Target *map[string]string Completion complete.Predictor }
-- StringMapVar and stringMapValue
type StringSliceMapVar ¶ added in v0.10.4
type StringSliceMapVar struct { Name string Aliases []string Usage string Default map[string][]string Hidden bool Target *map[string][]string NullCheck func() bool Completion complete.Predictor }
StringSliceMapVar maps a key string to a slice of string values. This is useful for cases such as modifying Worker tags, which can have multiple values associated per key. Setting NullCheck to return true enables the string input value "null" to be accepted without throwing an error. This is useful for add/set/remove patterns where we want to enable "set null".
type StringSliceVar ¶
type StringSliceVar struct { Name string Aliases []string Usage string Default []string Hidden bool EnvVar string Target *[]string NullCheck func() bool Completion complete.Predictor }
StringSliceVar reads in parameters from the same flag into a string array. Setting NullCheck enables the following behavior: the function will be run whenever a "null" is seen in the input to determine whether or not it is allowed (and erroring if not); and even if allowed generally, the flag will ensure that "null" is the only value passed.
type StringVar ¶
type StringVar struct { Name string Aliases []string Usage string Default string Hidden bool EnvVar string Target *string Completion complete.Predictor }
-- StringVar and stringValue
type TCPKeepAliveListener ¶
type TCPKeepAliveListener struct {
*net.TCPListener
}
TCPKeepAliveListener sets TCP keep-alive timeouts on accepted connections. It's used by ListenAndServe and ListenAndServeTLS so dead TCP connections (e.g. closing laptop mid-download) eventually go away.
This is copied directly from the Go source code.
type Uint64Var ¶
type Uint64Var struct { Name string Aliases []string Usage string Default uint64 Hidden bool EnvVar string Target *uint64 Completion complete.Predictor }
-- Uint64Var and uint64Value
type UintVar ¶
type UintVar struct { Name string Aliases []string Usage string Default uint Hidden bool EnvVar string Target *uint Completion complete.Predictor }
-- UintVar && uintValue
type VarFlag ¶
type VarFlag struct { Name string Aliases []string Usage string Default string EnvVar string Value flag.Value Completion complete.Predictor }
-- VarFlag