Documentation
¶
Index ¶
- type FlagrAPI
- func (o *FlagrAPI) AddMiddlewareFor(method, path string, builder middleware.Builder)
- func (o *FlagrAPI) AuthenticatorsFor(schemes map[string]spec.SecurityScheme) map[string]runtime.Authenticator
- func (o *FlagrAPI) Authorizer() runtime.Authorizer
- func (o *FlagrAPI) ConsumersFor(mediaTypes []string) map[string]runtime.Consumer
- func (o *FlagrAPI) Context() *middleware.Context
- func (o *FlagrAPI) DefaultConsumes() string
- func (o *FlagrAPI) DefaultProduces() string
- func (o *FlagrAPI) Formats() strfmt.Registry
- func (o *FlagrAPI) HandlerFor(method, path string) (http.Handler, bool)
- func (o *FlagrAPI) Init()
- func (o *FlagrAPI) ProducersFor(mediaTypes []string) map[string]runtime.Producer
- func (o *FlagrAPI) RegisterConsumer(mediaType string, consumer runtime.Consumer)
- func (o *FlagrAPI) RegisterFormat(name string, format strfmt.Format, validator strfmt.Validator)
- func (o *FlagrAPI) RegisterProducer(mediaType string, producer runtime.Producer)
- func (o *FlagrAPI) Serve(builder middleware.Builder) http.Handler
- func (o *FlagrAPI) ServeErrorFor(operationID string) func(http.ResponseWriter, *http.Request, error)
- func (o *FlagrAPI) SetDefaultConsumes(mediaType string)
- func (o *FlagrAPI) SetDefaultProduces(mediaType string)
- func (o *FlagrAPI) SetSpec(spec *loads.Document)
- func (o *FlagrAPI) UseRedoc()
- func (o *FlagrAPI) UseSwaggerUI()
- func (o *FlagrAPI) Validate() error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type FlagrAPI ¶
type FlagrAPI struct {
Middleware func(middleware.Builder) http.Handler
// BasicAuthenticator generates a runtime.Authenticator from the supplied basic auth function.
// It has a default implementation 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 implementation 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 implementation 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 the following mime types:
// - application/json
JSONConsumer runtime.Consumer
// BinProducer registers a producer for the following mime types:
// - application/octet-stream
BinProducer runtime.Producer
// JSONProducer registers a producer for the following mime types:
// - application/json
JSONProducer runtime.Producer
// ConstraintCreateConstraintHandler sets the operation handler for the create constraint operation
ConstraintCreateConstraintHandler constraint.CreateConstraintHandler
// FlagCreateFlagHandler sets the operation handler for the create flag operation
FlagCreateFlagHandler flag.CreateFlagHandler
// LatchCreateLatchHandler sets the operation handler for the create latch operation
LatchCreateLatchHandler latch.CreateLatchHandler
// SegmentCreateSegmentHandler sets the operation handler for the create segment operation
SegmentCreateSegmentHandler segment.CreateSegmentHandler
// TagCreateTagHandler sets the operation handler for the create tag operation
TagCreateTagHandler tag.CreateTagHandler
// VariantCreateVariantHandler sets the operation handler for the create variant operation
VariantCreateVariantHandler variant.CreateVariantHandler
// ConstraintDeleteConstraintHandler sets the operation handler for the delete constraint operation
ConstraintDeleteConstraintHandler constraint.DeleteConstraintHandler
// FlagDeleteFlagHandler sets the operation handler for the delete flag operation
FlagDeleteFlagHandler flag.DeleteFlagHandler
// SegmentDeleteSegmentHandler sets the operation handler for the delete segment operation
SegmentDeleteSegmentHandler segment.DeleteSegmentHandler
// TagDeleteTagHandler sets the operation handler for the delete tag operation
TagDeleteTagHandler tag.DeleteTagHandler
// VariantDeleteVariantHandler sets the operation handler for the delete variant operation
VariantDeleteVariantHandler variant.DeleteVariantHandler
// TagFindAllTagsHandler sets the operation handler for the find all tags operation
TagFindAllTagsHandler tag.FindAllTagsHandler
// ConstraintFindConstraintsHandler sets the operation handler for the find constraints operation
ConstraintFindConstraintsHandler constraint.FindConstraintsHandler
// DistributionFindDistributionsHandler sets the operation handler for the find distributions operation
DistributionFindDistributionsHandler distribution.FindDistributionsHandler
// FlagFindFlagsHandler sets the operation handler for the find flags operation
FlagFindFlagsHandler flag.FindFlagsHandler
// SegmentFindSegmentsHandler sets the operation handler for the find segments operation
SegmentFindSegmentsHandler segment.FindSegmentsHandler
// TagFindTagsHandler sets the operation handler for the find tags operation
TagFindTagsHandler tag.FindTagsHandler
// VariantFindVariantsHandler sets the operation handler for the find variants operation
VariantFindVariantsHandler variant.FindVariantsHandler
// ExportGetExportEvalCacheJSONHandler sets the operation handler for the get export eval cache JSON operation
ExportGetExportEvalCacheJSONHandler export.GetExportEvalCacheJSONHandler
// ExportGetExportSqliteHandler sets the operation handler for the get export sqlite operation
ExportGetExportSqliteHandler export.GetExportSqliteHandler
// FlagGetFlagHandler sets the operation handler for the get flag operation
FlagGetFlagHandler flag.GetFlagHandler
// FlagGetFlagEntityTypesHandler sets the operation handler for the get flag entity types operation
FlagGetFlagEntityTypesHandler flag.GetFlagEntityTypesHandler
// FlagGetFlagSnapshotsHandler sets the operation handler for the get flag snapshots operation
FlagGetFlagSnapshotsHandler flag.GetFlagSnapshotsHandler
// HealthGetHealthHandler sets the operation handler for the get health operation
HealthGetHealthHandler health.GetHealthHandler
// EvaluationPostEvaluationHandler sets the operation handler for the post evaluation operation
EvaluationPostEvaluationHandler evaluation.PostEvaluationHandler
// EvaluationPostEvaluationBatchHandler sets the operation handler for the post evaluation batch operation
EvaluationPostEvaluationBatchHandler evaluation.PostEvaluationBatchHandler
// ConstraintPutConstraintHandler sets the operation handler for the put constraint operation
ConstraintPutConstraintHandler constraint.PutConstraintHandler
// DistributionPutDistributionsHandler sets the operation handler for the put distributions operation
DistributionPutDistributionsHandler distribution.PutDistributionsHandler
// FlagPutFlagHandler sets the operation handler for the put flag operation
FlagPutFlagHandler flag.PutFlagHandler
// SegmentPutSegmentHandler sets the operation handler for the put segment operation
SegmentPutSegmentHandler segment.PutSegmentHandler
// SegmentPutSegmentsReorderHandler sets the operation handler for the put segments reorder operation
SegmentPutSegmentsReorderHandler segment.PutSegmentsReorderHandler
// VariantPutVariantHandler sets the operation handler for the put variant operation
VariantPutVariantHandler variant.PutVariantHandler
// FlagRestoreFlagHandler sets the operation handler for the restore flag operation
FlagRestoreFlagHandler flag.RestoreFlagHandler
// FlagSetFlagEnabledHandler sets the operation handler for the set flag enabled operation
FlagSetFlagEnabledHandler flag.SetFlagEnabledHandler
// 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)
// PreServerShutdown is called before the HTTP(S) server is shutdown
// This allows for custom functions to get executed before the HTTP(S) server stops accepting traffic
PreServerShutdown func()
// 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
}
FlagrAPI Flagr is a feature flagging, A/B testing and dynamic configuration microservice. The base path for all the APIs is "/api/v1".
func NewFlagrAPI ¶
NewFlagrAPI creates a new Flagr instance
func (*FlagrAPI) AddMiddlewareFor ¶
func (o *FlagrAPI) AddMiddlewareFor(method, path string, builder middleware.Builder)
AddMiddlewareFor adds a http middleware to existing handler
func (*FlagrAPI) AuthenticatorsFor ¶
func (o *FlagrAPI) AuthenticatorsFor(schemes map[string]spec.SecurityScheme) map[string]runtime.Authenticator
AuthenticatorsFor gets the authenticators for the specified security schemes
func (*FlagrAPI) Authorizer ¶
func (o *FlagrAPI) Authorizer() runtime.Authorizer
Authorizer returns the registered authorizer
func (*FlagrAPI) ConsumersFor ¶
ConsumersFor gets the consumers for the specified media types. MIME type parameters are ignored here.
func (*FlagrAPI) Context ¶
func (o *FlagrAPI) Context() *middleware.Context
Context returns the middleware context for the flagr API
func (*FlagrAPI) DefaultConsumes ¶
DefaultConsumes returns the default consumes media type
func (*FlagrAPI) DefaultProduces ¶
DefaultProduces returns the default produces media type
func (*FlagrAPI) HandlerFor ¶
HandlerFor gets a http.Handler for the provided operation method and path
func (*FlagrAPI) Init ¶
func (o *FlagrAPI) Init()
Init allows you to just initialize the handler cache, you can then recompose the middleware as you see fit
func (*FlagrAPI) ProducersFor ¶
ProducersFor gets the producers for the specified media types. MIME type parameters are ignored here.
func (*FlagrAPI) RegisterConsumer ¶
RegisterConsumer allows you to add (or override) a consumer for a media type.
func (*FlagrAPI) RegisterFormat ¶
RegisterFormat registers a custom format validator
func (*FlagrAPI) RegisterProducer ¶
RegisterProducer allows you to add (or override) a producer for a media type.
func (*FlagrAPI) Serve ¶
func (o *FlagrAPI) 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 (*FlagrAPI) ServeErrorFor ¶
func (o *FlagrAPI) ServeErrorFor(operationID string) func(http.ResponseWriter, *http.Request, error)
ServeErrorFor gets a error handler for a given operation id
func (*FlagrAPI) SetDefaultConsumes ¶
SetDefaultConsumes returns the default consumes media type
func (*FlagrAPI) SetDefaultProduces ¶
SetDefaultProduces sets the default produces media type
func (*FlagrAPI) UseSwaggerUI ¶
func (o *FlagrAPI) UseSwaggerUI()
UseSwaggerUI for documentation at /docs