Documentation
¶
Overview ¶
Package summary provides primitives to interact with the openapi HTTP API.
Code generated by github.com/deepmap/oapi-codegen/v2 version v2.1.0 DO NOT EDIT.
Package summary provides primitives to interact with the openapi HTTP API.
Code generated by github.com/deepmap/oapi-codegen/v2 version v2.1.0 DO NOT EDIT.
Index ¶
- Constants
- Variables
- func Handler(si ServerInterface) http.Handler
- func HandlerFromMux(si ServerInterface, r *mux.Router) http.Handler
- func HandlerFromMuxWithBaseURL(si ServerInterface, r *mux.Router, baseURL string) http.Handler
- func HandlerWithOptions(si ServerInterface, options GorillaServerOptions) http.Handler
- func Point[T comparable](v T) *T
- type AuthOption
- type Environment
- type GorillaServerOptions
- type InvalidParamFormatError
- type Message
- type MiddlewareFunc
- type Node
- type NodesResponse
- type PuppetReport
- type PuppetReportSummary
- type RequiredHeaderError
- type RequiredParamError
- type Resource
- type ServerInterface
- type ServerInterfaceWrapper
- func (siw *ServerInterfaceWrapper) GetAllNodes(w http.ResponseWriter, r *http.Request)
- func (siw *ServerInterfaceWrapper) GetAllNodesByEnvironment(w http.ResponseWriter, r *http.Request)
- func (siw *ServerInterfaceWrapper) GetAllNodesByState(w http.ResponseWriter, r *http.Request)
- func (siw *ServerInterfaceWrapper) GetNodeByFqdn(w http.ResponseWriter, r *http.Request)
- func (siw *ServerInterfaceWrapper) GetReportById(w http.ResponseWriter, r *http.Request)
- func (siw *ServerInterfaceWrapper) UploadPuppetReport(w http.ResponseWriter, r *http.Request)
- type State
- type TooManyValuesForParamError
- type UnescapedCookieParamError
- type UnmarshalingParamError
Constants ¶
const (
BearerAuthScopes = "bearerAuth.Scopes"
)
Variables ¶
var Environments = []Environment{ Environment_DEVELOPMENT, Environment_PRODUCTION, Environment_STAGING, }
var States = []State{ State_CHANGED, State_FAILED, State_SKIPPED, State_UNCHANGED, }
Functions ¶
func Handler ¶
func Handler(si ServerInterface) http.Handler
Handler creates http.Handler with routing matching OpenAPI spec.
func HandlerFromMux ¶
func HandlerFromMux(si ServerInterface, r *mux.Router) http.Handler
HandlerFromMux creates http.Handler with routing matching OpenAPI spec based on the provided mux.
func HandlerWithOptions ¶
func HandlerWithOptions(si ServerInterface, options GorillaServerOptions) http.Handler
HandlerWithOptions creates http.Handler with additional options
func Point ¶
func Point[T comparable](v T) *T
Types ¶
type AuthOption ¶
type AuthOption int
const ( // AuthOptionNone is the option for no authentication. AuthOptionNone AuthOption = iota // AuthOptionInternal is the option to only allow internal traffic. AuthOptionInternal // AuthOptionRequired is the option for required authentication. AuthOptionRequired )
type Environment ¶
type Environment string
Environment defines the model for environment.
const ( Environment_DEVELOPMENT Environment = "DEVELOPMENT" Environment_PRODUCTION Environment = "PRODUCTION" Environment_STAGING Environment = "STAGING" )
List of Environment
func (Environment) IsIn ¶
func (t Environment) IsIn(values ...Environment) bool
IsIn checks if the value is in the list of Environment
func (Environment) IsValid ¶
func (t Environment) IsValid() bool
IsValid checks if the value is valid
type GorillaServerOptions ¶
type GorillaServerOptions struct { BaseURL string BaseRouter *mux.Router Middlewares []MiddlewareFunc ErrorHandlerFunc func(w http.ResponseWriter, r *http.Request, err error) }
type InvalidParamFormatError ¶
func (*InvalidParamFormatError) Error ¶
func (e *InvalidParamFormatError) Error() string
func (*InvalidParamFormatError) Unwrap ¶
func (e *InvalidParamFormatError) Unwrap() error
type Message ¶
type Message struct {
Message *string `json:"message,omitempty"`
}
Message defines the model for message.
type MiddlewareFunc ¶
type MiddlewareFunc func(http.Handler, AuthOption) http.HandlerFunc
type Node ¶
type Node struct { // Env The environment that a machine is reporting from. Env *Environment `json:"env,omitempty"` // ExecTime The time of when the Puppet Report Ran. (time.RFC3339 format) ExecTime *string `json:"exec_time,omitempty"` // Fqdn The Hostname of the machine. Fqdn *string `json:"fqdn,omitempty"` // Runtime How long the puppet apply took. Runtime *string `json:"runtime,omitempty"` // State The estate of the machine from the report. State *State `json:"state,omitempty"` }
Node defines the model for node.
type NodesResponse ¶
type NodesResponse struct {
Nodes *[]Node `json:"nodes,omitempty"`
}
NodesResponse defines the model for nodesResponse.
type PuppetReport ¶
type PuppetReport struct { Changed *int `json:"changed,omitempty"` // Env The environment that a machine is reporting from. Env *Environment `json:"env,omitempty"` ExecTime *time.Time `json:"exec_time,omitempty"` Failed *int `json:"failed,omitempty"` Fqdn *string `json:"fqdn,omitempty"` Id *string `json:"id,omitempty"` LogMessages *[]string `json:"log_messages,omitempty"` PuppetVersion *float32 `json:"puppet_version,omitempty"` ResourcesChanged *[]Resource `json:"resources_changed,omitempty"` ResourcesFailed *[]Resource `json:"resources_failed,omitempty"` ResourcesOk *[]Resource `json:"resources_ok,omitempty"` ResourcesSkipped *[]Resource `json:"resources_skipped,omitempty"` Runtime *string `json:"runtime,omitempty"` Skipped *int `json:"skipped,omitempty"` // State The estate of the machine from the report. State *State `json:"state,omitempty"` Total *int `json:"total,omitempty"` }
PuppetReport defines the model for puppetReport.
type PuppetReportSummary ¶
type PuppetReportSummary struct { Changed *int `json:"changed,omitempty"` // Env The environment that a machine is reporting from. Env *Environment `json:"env,omitempty"` ExecTime *time.Time `json:"exec_time,omitempty"` Failed *int `json:"failed,omitempty"` Fqdn *string `json:"fqdn,omitempty"` Id *string `json:"id,omitempty"` Runtime *string `json:"runtime,omitempty"` Skipped *int `json:"skipped,omitempty"` // State The estate of the machine from the report. State *State `json:"state,omitempty"` Total *int `json:"total,omitempty"` }
PuppetReportSummary defines the model for puppetReportSummary.
type RequiredHeaderError ¶
func (*RequiredHeaderError) Error ¶
func (e *RequiredHeaderError) Error() string
func (*RequiredHeaderError) Unwrap ¶
func (e *RequiredHeaderError) Unwrap() error
type RequiredParamError ¶
type RequiredParamError struct {
ParamName string
}
func (*RequiredParamError) Error ¶
func (e *RequiredParamError) Error() string
type Resource ¶
type Resource struct { File *string `json:"file,omitempty"` Line *string `json:"line,omitempty"` Name *string `json:"name,omitempty"` Type *string `json:"type,omitempty"` }
Resource defines the model for Resource.
type ServerInterface ¶
type ServerInterface interface { // Get all nodes // (GET /nodes) GetAllNodes(w http.ResponseWriter, r *http.Request) // Get all nodes by environment // (GET /nodes/enviroment/{env}) GetAllNodesByEnvironment(w http.ResponseWriter, r *http.Request, env Environment) // Get a node by fqdn // (GET /nodes/{fqdn}) GetNodeByFqdn(w http.ResponseWriter, r *http.Request, fqdn string) // Get a report by id // (GET /reports/{id}) GetReportById(w http.ResponseWriter, r *http.Request, id string) // Get all nodes by state // (GET /states/{state}) GetAllNodesByState(w http.ResponseWriter, r *http.Request, state State) // Upload a puppet report // (POST /upload) UploadPuppetReport(w http.ResponseWriter, r *http.Request) }
ServerInterface represents all server handlers.
type ServerInterfaceWrapper ¶
type ServerInterfaceWrapper struct { Handler ServerInterface HandlerMiddlewares []MiddlewareFunc ErrorHandlerFunc func(w http.ResponseWriter, r *http.Request, err error) }
ServerInterfaceWrapper converts contexts to parameters.
func (*ServerInterfaceWrapper) GetAllNodes ¶
func (siw *ServerInterfaceWrapper) GetAllNodes(w http.ResponseWriter, r *http.Request)
GetAllNodes operation middleware
func (*ServerInterfaceWrapper) GetAllNodesByEnvironment ¶
func (siw *ServerInterfaceWrapper) GetAllNodesByEnvironment(w http.ResponseWriter, r *http.Request)
GetAllNodesByEnvironment operation middleware
func (*ServerInterfaceWrapper) GetAllNodesByState ¶
func (siw *ServerInterfaceWrapper) GetAllNodesByState(w http.ResponseWriter, r *http.Request)
GetAllNodesByState operation middleware
func (*ServerInterfaceWrapper) GetNodeByFqdn ¶
func (siw *ServerInterfaceWrapper) GetNodeByFqdn(w http.ResponseWriter, r *http.Request)
GetNodeByFqdn operation middleware
func (*ServerInterfaceWrapper) GetReportById ¶
func (siw *ServerInterfaceWrapper) GetReportById(w http.ResponseWriter, r *http.Request)
GetReportById operation middleware
func (*ServerInterfaceWrapper) UploadPuppetReport ¶
func (siw *ServerInterfaceWrapper) UploadPuppetReport(w http.ResponseWriter, r *http.Request)
UploadPuppetReport operation middleware
type State ¶
type State string
State defines the model for state.
const ( State_CHANGED State = "CHANGED" State_FAILED State = "FAILED" State_SKIPPED State = "SKIPPED" State_UNCHANGED State = "UNCHANGED" )
List of State
type TooManyValuesForParamError ¶
func (*TooManyValuesForParamError) Error ¶
func (e *TooManyValuesForParamError) Error() string
type UnescapedCookieParamError ¶
func (*UnescapedCookieParamError) Error ¶
func (e *UnescapedCookieParamError) Error() string
func (*UnescapedCookieParamError) Unwrap ¶
func (e *UnescapedCookieParamError) Unwrap() error
type UnmarshalingParamError ¶
func (*UnmarshalingParamError) Error ¶
func (e *UnmarshalingParamError) Error() string
func (*UnmarshalingParamError) Unwrap ¶
func (e *UnmarshalingParamError) Unwrap() error