Documentation
¶
Index ¶
- func AddCommand(mainCMD *cobra.Command, v *viper.Viper, schema *field.Configuration, ...) (*cobra.Command, error)
- func AdditionalCommands(_ string, _ []field.SchemaField) []*cobra.Command
- func MakeCapabilitiesCommand[T field.Configurable](ctx context.Context, name string, v *viper.Viper, ...) func(*cobra.Command, []string) error
- func MakeConfigSchemaCommand[T field.Configurable](ctx context.Context, name string, v *viper.Viper, ...) func(*cobra.Command, []string) error
- func MakeGRPCServerCommand[T field.Configurable](ctx context.Context, name string, v *viper.Viper, ...) func(*cobra.Command, []string) error
- func MakeGenericConfiguration[T field.Configurable](v *viper.Viper, opts ...field.DecodeHookOption) (T, error)
- func MakeHealthCheckCommand(ctx context.Context, v *viper.Viper) func(*cobra.Command, []string) error
- func MakeMainCommand[T field.Configurable](ctx context.Context, name string, v *viper.Viper, ...) func(*cobra.Command, []string) error
- func NewLazyCachingSessionStore(constructor sessions.SessionStoreConstructor, otterAdjuster OtterAdjuster) *lazyCachingSessionStore
- func OptionallyAddLambdaCommand[T field.Configurable](ctx context.Context, name string, v *viper.Viper, ...) error
- func SetFlagsAndConstraints(command *cobra.Command, schema field.Configuration) error
- func VisitFlags(cmd *cobra.Command, v *viper.Viper)
- func WithSessionCache(ctx context.Context, constructor sessions.SessionStoreConstructor) (context.Context, error)
- type ConnectorOpts
- type ContrainstSetter
- type GetConnectorFunc
- type GetConnectorFunc2
- type NewConnector
- type OtterAdjuster
- type RunTimeOpts
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddCommand ¶ added in v0.2.71
func AdditionalCommands ¶ added in v0.2.0
func AdditionalCommands(_ string, _ []field.SchemaField) []*cobra.Command
func MakeCapabilitiesCommand ¶ added in v0.2.0
func MakeCapabilitiesCommand[T field.Configurable]( ctx context.Context, name string, v *viper.Viper, confschema field.Configuration, getconnector GetConnectorFunc2[T], opts ...connectorrunner.Option, ) func(*cobra.Command, []string) error
func MakeConfigSchemaCommand ¶ added in v0.2.68
func MakeConfigSchemaCommand[T field.Configurable]( ctx context.Context, name string, v *viper.Viper, confschema field.Configuration, getconnector GetConnectorFunc2[T], ) func(*cobra.Command, []string) error
func MakeGRPCServerCommand ¶ added in v0.2.0
func MakeGRPCServerCommand[T field.Configurable]( ctx context.Context, name string, v *viper.Viper, confschema field.Configuration, getconnector GetConnectorFunc2[T], ) func(*cobra.Command, []string) error
func MakeGenericConfiguration ¶ added in v0.2.71
func MakeGenericConfiguration[T field.Configurable](v *viper.Viper, opts ...field.DecodeHookOption) (T, error)
func MakeHealthCheckCommand ¶ added in v0.7.6
func MakeMainCommand ¶ added in v0.2.0
func MakeMainCommand[T field.Configurable]( ctx context.Context, name string, v *viper.Viper, confschema field.Configuration, getconnector GetConnectorFunc2[T], opts ...connectorrunner.Option, ) func(*cobra.Command, []string) error
func NewLazyCachingSessionStore ¶ added in v0.5.7
func NewLazyCachingSessionStore(constructor sessions.SessionStoreConstructor, otterAdjuster OtterAdjuster) *lazyCachingSessionStore
func OptionallyAddLambdaCommand ¶ added in v0.2.71
func OptionallyAddLambdaCommand[T field.Configurable]( ctx context.Context, name string, v *viper.Viper, getconnector GetConnectorFunc2[T], connectorSchema field.Configuration, mainCmd *cobra.Command, sessionStoreEnabled bool, ) error
func SetFlagsAndConstraints ¶ added in v0.2.71
func SetFlagsAndConstraints(command *cobra.Command, schema field.Configuration) error
func VisitFlags ¶ added in v0.2.71
NOTE(shackra): Set all values from Viper to the flags so... that Cobra won't complain that a flag is missing in case we... pass values through environment variables.
func WithSessionCache ¶ added in v0.3.58
func WithSessionCache(ctx context.Context, constructor sessions.SessionStoreConstructor) (context.Context, error)
WithSessionCache creates a session cache using the provided constructor and adds it to the context.
Types ¶
type ConnectorOpts ¶ added in v0.5.0
type ConnectorOpts struct {
TokenSource oauth2.TokenSource
SelectedAuthMethod string
// SyncResourceTypeIDs is the set of resource type IDs the user has requested
// to sync. An empty slice means "sync everything the connector advertises"
// (subject to OptInRequired{} annotations on resource types). A non-empty
// slice means "sync only these types; skip everything else." Connectors
// should prefer the helper methods (WillSyncResourceType,
// SyncFilterIsExplicit, SyncResourceTypeSet) over reading this slice
// directly.
SyncResourceTypeIDs []string
// contains filtered or unexported fields
}
ConnectorOpts holds runtime options passed to a connector at initialization time.
func (*ConnectorOpts) SyncFilterIsExplicit ¶ added in v0.8.28
func (o *ConnectorOpts) SyncFilterIsExplicit() bool
SyncFilterIsExplicit reports whether the user has explicitly narrowed the set of resource types to sync. Returns false when SyncResourceTypeIDs is empty, meaning "sync all types the connector advertises".
func (*ConnectorOpts) SyncResourceTypeSet ¶ added in v0.8.28
func (o *ConnectorOpts) SyncResourceTypeSet() map[string]struct{}
SyncResourceTypeSet returns the user's selection as a set for O(1) lookup, or nil if no filter was specified (meaning all resource types should be synced). The set is computed lazily on first call and cached for subsequent calls.
func (*ConnectorOpts) WillSyncResourceType ¶ added in v0.8.28
func (o *ConnectorOpts) WillSyncResourceType(resourceTypeID string) bool
WillSyncResourceType reports whether the given resource type ID will be synced under the current configuration. Returns true when the user has not specified any filter (the "default to all" case).
type ContrainstSetter ¶ added in v0.2.71
type ContrainstSetter func(*cobra.Command, field.Configuration) error
type GetConnectorFunc ¶ added in v0.2.0
type GetConnectorFunc[T field.Configurable] func(ctx context.Context, cfg T) (types.ConnectorServer, error)
GetConnectorFunc is a function type that creates a connector instance. It takes a context and configuration. The session cache constructor is retrieved from the context.
type GetConnectorFunc2 ¶ added in v0.5.0
type GetConnectorFunc2[T field.Configurable] func(ctx context.Context, cfg T, runTimeOpts RunTimeOpts) (types.ConnectorServer, error)
type NewConnector ¶ added in v0.5.0
type NewConnector[T field.Configurable] func(ctx context.Context, cfg T, opts *ConnectorOpts) (connectorbuilder.ConnectorBuilderV2, []connectorbuilder.Opt, error)
type OtterAdjuster ¶ added in v0.5.7
type RunTimeOpts ¶ added in v0.5.0
type RunTimeOpts struct {
SessionStore sessions.SessionStore
TokenSource oauth2.TokenSource
SelectedAuthMethod string
SyncResourceTypeIDs []string
}