Documentation
¶
Index ¶
- type LunaformAPI
- func (o *LunaformAPI) AuthenticatorsFor(schemes map[string]spec.SecurityScheme) map[string]runtime.Authenticator
- func (o *LunaformAPI) Authorizer() runtime.Authorizer
- func (o *LunaformAPI) ConsumersFor(mediaTypes []string) map[string]runtime.Consumer
- func (o *LunaformAPI) Context() *middleware.Context
- func (o *LunaformAPI) DefaultConsumes() string
- func (o *LunaformAPI) DefaultProduces() string
- func (o *LunaformAPI) Formats() strfmt.Registry
- func (o *LunaformAPI) HandlerFor(method, path string) (http.Handler, bool)
- func (o *LunaformAPI) Init()
- func (o *LunaformAPI) ProducersFor(mediaTypes []string) map[string]runtime.Producer
- func (o *LunaformAPI) RegisterConsumer(mediaType string, consumer runtime.Consumer)
- func (o *LunaformAPI) RegisterFormat(name string, format strfmt.Format, validator strfmt.Validator)
- func (o *LunaformAPI) RegisterProducer(mediaType string, producer runtime.Producer)
- func (o *LunaformAPI) Serve(builder middleware.Builder) http.Handler
- func (o *LunaformAPI) ServeErrorFor(operationID string) func(http.ResponseWriter, *http.Request, error)
- func (o *LunaformAPI) SetDefaultConsumes(mediaType string)
- func (o *LunaformAPI) SetDefaultProduces(mediaType string)
- func (o *LunaformAPI) SetSpec(spec *loads.Document)
- func (o *LunaformAPI) Validate() error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type LunaformAPI ¶
type LunaformAPI struct {
Middleware func(middleware.Builder) http.Handler
// BasicAuthenticator generates a runtime.Authenticator from the supplied basic auth function.
// It has a default implemention in the security package, however you can replace it for your particular usage.
BasicAuthenticator func(security.UserPassAuthentication) runtime.Authenticator
// APIKeyAuthenticator generates a runtime.Authenticator from the supplied token auth function.
// It has a default implemention in the security package, however you can replace it for your particular usage.
APIKeyAuthenticator func(string, string, security.TokenAuthentication) runtime.Authenticator
// BearerAuthenticator generates a runtime.Authenticator from the supplied bearer token auth function.
// It has a default implemention in the security package, however you can replace it for your particular usage.
BearerAuthenticator func(string, security.ScopedTokenAuthentication) runtime.Authenticator
// JSONConsumer registers a consumer for a "application/vnd.lunaform.v1+json" mime type
JSONConsumer runtime.Consumer
// JSONProducer registers a producer for a "application/vnd.lunaform.v1+json" mime type
JSONProducer runtime.Producer
// APIKeyAuth registers a function that takes a token and returns a principal
// it performs authentication based on an api key x-lunaform-auth provided in the header
APIKeyAuth func(string) (*models.ResourceAuthUser, error)
// APIAuthorizer provides access control (ACL/RBAC/ABAC) by providing access to the request and authenticated principal
APIAuthorizer runtime.Authorizer
// ModulesCreateModuleHandler sets the operation handler for the create module operation
ModulesCreateModuleHandler modules.CreateModuleHandler
// ProvidersCreateProviderHandler sets the operation handler for the create provider operation
ProvidersCreateProviderHandler providers.CreateProviderHandler
// ProvidersCreateProviderConfigurationHandler sets the operation handler for the create provider configuration operation
ProvidersCreateProviderConfigurationHandler providers.CreateProviderConfigurationHandler
// StateBackendsCreateStateBackendHandler sets the operation handler for the create state backend operation
StateBackendsCreateStateBackendHandler state_backends.CreateStateBackendHandler
// WorkspacesCreateWorkspaceHandler sets the operation handler for the create workspace operation
WorkspacesCreateWorkspaceHandler workspaces.CreateWorkspaceHandler
// ModulesDeleteModuleHandler sets the operation handler for the delete module operation
ModulesDeleteModuleHandler modules.DeleteModuleHandler
// ProvidersDeleteProviderHandler sets the operation handler for the delete provider operation
ProvidersDeleteProviderHandler providers.DeleteProviderHandler
// ProvidersDeleteProviderConfigurationHandler sets the operation handler for the delete provider configuration operation
ProvidersDeleteProviderConfigurationHandler providers.DeleteProviderConfigurationHandler
// StacksDeployStackHandler sets the operation handler for the deploy stack operation
StacksDeployStackHandler stacks.DeployStackHandler
// WorkspacesDescribeWorkspaceHandler sets the operation handler for the describe workspace operation
WorkspacesDescribeWorkspaceHandler workspaces.DescribeWorkspaceHandler
// ModulesGetModuleHandler sets the operation handler for the get module operation
ModulesGetModuleHandler modules.GetModuleHandler
// ProvidersGetProviderHandler sets the operation handler for the get provider operation
ProvidersGetProviderHandler providers.GetProviderHandler
// ProvidersGetProviderConfigurationHandler sets the operation handler for the get provider configuration operation
ProvidersGetProviderConfigurationHandler providers.GetProviderConfigurationHandler
// StacksGetStackHandler sets the operation handler for the get stack operation
StacksGetStackHandler stacks.GetStackHandler
// StacksListDeploymentsHandler sets the operation handler for the list deployments operation
StacksListDeploymentsHandler stacks.ListDeploymentsHandler
// ModulesListModulesHandler sets the operation handler for the list modules operation
ModulesListModulesHandler modules.ListModulesHandler
// ProvidersListProviderConfigurationsHandler sets the operation handler for the list provider configurations operation
ProvidersListProviderConfigurationsHandler providers.ListProviderConfigurationsHandler
// ProvidersListProvidersHandler sets the operation handler for the list providers operation
ProvidersListProvidersHandler providers.ListProvidersHandler
// ResourcesListResourceGroupsHandler sets the operation handler for the list resource groups operation
ResourcesListResourceGroupsHandler resources.ListResourceGroupsHandler
// ResourcesListResourcesHandler sets the operation handler for the list resources operation
ResourcesListResourcesHandler resources.ListResourcesHandler
// StacksListStacksHandler sets the operation handler for the list stacks operation
StacksListStacksHandler stacks.ListStacksHandler
// StateBackendsListStateBackendsHandler sets the operation handler for the list state backends operation
StateBackendsListStateBackendsHandler state_backends.ListStateBackendsHandler
// WorkspacesListWorkspacesHandler sets the operation handler for the list workspaces operation
WorkspacesListWorkspacesHandler workspaces.ListWorkspacesHandler
// StacksUndeployStackHandler sets the operation handler for the undeploy stack operation
StacksUndeployStackHandler stacks.UndeployStackHandler
// ProvidersUpdateProviderHandler sets the operation handler for the update provider operation
ProvidersUpdateProviderHandler providers.UpdateProviderHandler
// StateBackendsUpdateStateBackendHandler sets the operation handler for the update state backend operation
StateBackendsUpdateStateBackendHandler state_backends.UpdateStateBackendHandler
// ServeError is called when an error is received, there is a default handler
// but you can set your own with this
ServeError func(http.ResponseWriter, *http.Request, error)
// ServerShutdown is called when the HTTP(S) server is shut down and done
// handling all active connections and does not accept connections any more
ServerShutdown func()
// Custom command line argument groups with their descriptions
CommandLineOptionsGroups []swag.CommandLineOptionsGroup
// User defined logger function.
Logger func(string, ...interface{})
// contains filtered or unexported fields
}
LunaformAPI This is a RESTful server for managing Terraform plan and apply jobs and the auditing of actions to approve those apply jobs. The inspiration for this project is the AWS CloudFormation API's. The intention is to implement a locking mechanism not only for the terraform state, but for the plan and apply of terraform modules. Once a `module` plan starts, it is instantiated as a `stack` within the nomencalture of `lunaform`.
func NewLunaformAPI ¶
func NewLunaformAPI(spec *loads.Document) *LunaformAPI
NewLunaformAPI creates a new Lunaform instance
func (*LunaformAPI) AuthenticatorsFor ¶
func (o *LunaformAPI) AuthenticatorsFor(schemes map[string]spec.SecurityScheme) map[string]runtime.Authenticator
AuthenticatorsFor gets the authenticators for the specified security schemes
func (*LunaformAPI) Authorizer ¶
func (o *LunaformAPI) Authorizer() runtime.Authorizer
Authorizer returns the registered authorizer
func (*LunaformAPI) ConsumersFor ¶
func (o *LunaformAPI) ConsumersFor(mediaTypes []string) map[string]runtime.Consumer
ConsumersFor gets the consumers for the specified media types
func (*LunaformAPI) Context ¶
func (o *LunaformAPI) Context() *middleware.Context
Context returns the middleware context for the lunaform API
func (*LunaformAPI) DefaultConsumes ¶
func (o *LunaformAPI) DefaultConsumes() string
DefaultConsumes returns the default consumes media type
func (*LunaformAPI) DefaultProduces ¶
func (o *LunaformAPI) DefaultProduces() string
DefaultProduces returns the default produces media type
func (*LunaformAPI) Formats ¶
func (o *LunaformAPI) Formats() strfmt.Registry
Formats returns the registered string formats
func (*LunaformAPI) HandlerFor ¶
func (o *LunaformAPI) HandlerFor(method, path string) (http.Handler, bool)
HandlerFor gets a http.Handler for the provided operation method and path
func (*LunaformAPI) Init ¶
func (o *LunaformAPI) Init()
Init allows you to just initialize the handler cache, you can then recompose the middleware as you see fit
func (*LunaformAPI) ProducersFor ¶
func (o *LunaformAPI) ProducersFor(mediaTypes []string) map[string]runtime.Producer
ProducersFor gets the producers for the specified media types
func (*LunaformAPI) RegisterConsumer ¶
func (o *LunaformAPI) RegisterConsumer(mediaType string, consumer runtime.Consumer)
RegisterConsumer allows you to add (or override) a consumer for a media type.
func (*LunaformAPI) RegisterFormat ¶
RegisterFormat registers a custom format validator
func (*LunaformAPI) RegisterProducer ¶
func (o *LunaformAPI) RegisterProducer(mediaType string, producer runtime.Producer)
RegisterProducer allows you to add (or override) a producer for a media type.
func (*LunaformAPI) Serve ¶
func (o *LunaformAPI) Serve(builder middleware.Builder) http.Handler
Serve creates a http handler to serve the API over HTTP can be used directly in http.ListenAndServe(":8000", api.Serve(nil))
func (*LunaformAPI) ServeErrorFor ¶
func (o *LunaformAPI) ServeErrorFor(operationID string) func(http.ResponseWriter, *http.Request, error)
ServeErrorFor gets a error handler for a given operation id
func (*LunaformAPI) SetDefaultConsumes ¶
func (o *LunaformAPI) SetDefaultConsumes(mediaType string)
SetDefaultConsumes returns the default consumes media type
func (*LunaformAPI) SetDefaultProduces ¶
func (o *LunaformAPI) SetDefaultProduces(mediaType string)
SetDefaultProduces sets the default produces media type
func (*LunaformAPI) SetSpec ¶
func (o *LunaformAPI) SetSpec(spec *loads.Document)
SetSpec sets a spec that will be served for the clients.
func (*LunaformAPI) Validate ¶
func (o *LunaformAPI) Validate() error
Validate validates the registrations in the LunaformAPI