Documentation ¶
Index ¶
- type GaexporterAPI
- func (o *GaexporterAPI) AddMiddlewareFor(method, path string, builder middleware.Builder)
- func (o *GaexporterAPI) AuthenticatorsFor(schemes map[string]spec.SecurityScheme) map[string]runtime.Authenticator
- func (o *GaexporterAPI) Authorizer() runtime.Authorizer
- func (o *GaexporterAPI) ConsumersFor(mediaTypes []string) map[string]runtime.Consumer
- func (o *GaexporterAPI) Context() *middleware.Context
- func (o *GaexporterAPI) DefaultConsumes() string
- func (o *GaexporterAPI) DefaultProduces() string
- func (o *GaexporterAPI) Formats() strfmt.Registry
- func (o *GaexporterAPI) HandlerFor(method, path string) (http.Handler, bool)
- func (o *GaexporterAPI) Init()
- func (o *GaexporterAPI) ProducersFor(mediaTypes []string) map[string]runtime.Producer
- func (o *GaexporterAPI) RegisterConsumer(mediaType string, consumer runtime.Consumer)
- func (o *GaexporterAPI) RegisterFormat(name string, format strfmt.Format, validator strfmt.Validator)
- func (o *GaexporterAPI) RegisterProducer(mediaType string, producer runtime.Producer)
- func (o *GaexporterAPI) Serve(builder middleware.Builder) http.Handler
- func (o *GaexporterAPI) ServeErrorFor(operationID string) func(http.ResponseWriter, *http.Request, error)
- func (o *GaexporterAPI) SetDefaultConsumes(mediaType string)
- func (o *GaexporterAPI) SetDefaultProduces(mediaType string)
- func (o *GaexporterAPI) SetSpec(spec *loads.Document)
- func (o *GaexporterAPI) UseRedoc()
- func (o *GaexporterAPI) UseSwaggerUI()
- func (o *GaexporterAPI) Validate() error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type GaexporterAPI ¶
type GaexporterAPI 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 // JSONProducer registers a producer for the following mime types: // - application/json JSONProducer runtime.Producer // VisitorsVisitorListHandler sets the operation handler for the visitor list operation VisitorsVisitorListHandler visitors.VisitorListHandler // 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 }
GaexporterAPI The GA Exporter API makes use of the [Core Reporting API version 3.0](https://developers.google.com/analytics/devguides/reporting/core/v3/reference) to access information about visitors to a web property. It pulls data from an existing and preconfigured [reporting view](https://support.google.com/analytics/answer/2649553?hl=en) in a Google Analytics account.
# Errors The API uses standard HTTP status codes to indicate the success or failure of the API call. The body of the response will be JSON in the following format: ```
{ "code": 405, "message": "method POST is not allowed, but [GET] are" }
```
func NewGaexporterAPI ¶
func NewGaexporterAPI(spec *loads.Document) *GaexporterAPI
NewGaexporterAPI creates a new Gaexporter instance
func (*GaexporterAPI) AddMiddlewareFor ¶
func (o *GaexporterAPI) AddMiddlewareFor(method, path string, builder middleware.Builder)
AddMiddlewareFor adds a http middleware to existing handler
func (*GaexporterAPI) AuthenticatorsFor ¶
func (o *GaexporterAPI) AuthenticatorsFor(schemes map[string]spec.SecurityScheme) map[string]runtime.Authenticator
AuthenticatorsFor gets the authenticators for the specified security schemes
func (*GaexporterAPI) Authorizer ¶
func (o *GaexporterAPI) Authorizer() runtime.Authorizer
Authorizer returns the registered authorizer
func (*GaexporterAPI) ConsumersFor ¶
func (o *GaexporterAPI) ConsumersFor(mediaTypes []string) map[string]runtime.Consumer
ConsumersFor gets the consumers for the specified media types. MIME type parameters are ignored here.
func (*GaexporterAPI) Context ¶
func (o *GaexporterAPI) Context() *middleware.Context
Context returns the middleware context for the gaexporter API
func (*GaexporterAPI) DefaultConsumes ¶
func (o *GaexporterAPI) DefaultConsumes() string
DefaultConsumes returns the default consumes media type
func (*GaexporterAPI) DefaultProduces ¶
func (o *GaexporterAPI) DefaultProduces() string
DefaultProduces returns the default produces media type
func (*GaexporterAPI) Formats ¶
func (o *GaexporterAPI) Formats() strfmt.Registry
Formats returns the registered string formats
func (*GaexporterAPI) HandlerFor ¶
func (o *GaexporterAPI) HandlerFor(method, path string) (http.Handler, bool)
HandlerFor gets a http.Handler for the provided operation method and path
func (*GaexporterAPI) Init ¶
func (o *GaexporterAPI) Init()
Init allows you to just initialize the handler cache, you can then recompose the middleware as you see fit
func (*GaexporterAPI) ProducersFor ¶
func (o *GaexporterAPI) ProducersFor(mediaTypes []string) map[string]runtime.Producer
ProducersFor gets the producers for the specified media types. MIME type parameters are ignored here.
func (*GaexporterAPI) RegisterConsumer ¶
func (o *GaexporterAPI) RegisterConsumer(mediaType string, consumer runtime.Consumer)
RegisterConsumer allows you to add (or override) a consumer for a media type.
func (*GaexporterAPI) RegisterFormat ¶
func (o *GaexporterAPI) RegisterFormat(name string, format strfmt.Format, validator strfmt.Validator)
RegisterFormat registers a custom format validator
func (*GaexporterAPI) RegisterProducer ¶
func (o *GaexporterAPI) RegisterProducer(mediaType string, producer runtime.Producer)
RegisterProducer allows you to add (or override) a producer for a media type.
func (*GaexporterAPI) Serve ¶
func (o *GaexporterAPI) 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 (*GaexporterAPI) ServeErrorFor ¶
func (o *GaexporterAPI) ServeErrorFor(operationID string) func(http.ResponseWriter, *http.Request, error)
ServeErrorFor gets a error handler for a given operation id
func (*GaexporterAPI) SetDefaultConsumes ¶
func (o *GaexporterAPI) SetDefaultConsumes(mediaType string)
SetDefaultConsumes returns the default consumes media type
func (*GaexporterAPI) SetDefaultProduces ¶
func (o *GaexporterAPI) SetDefaultProduces(mediaType string)
SetDefaultProduces sets the default produces media type
func (*GaexporterAPI) SetSpec ¶
func (o *GaexporterAPI) SetSpec(spec *loads.Document)
SetSpec sets a spec that will be served for the clients.
func (*GaexporterAPI) UseRedoc ¶
func (o *GaexporterAPI) UseRedoc()
UseRedoc for documentation at /docs
func (*GaexporterAPI) UseSwaggerUI ¶
func (o *GaexporterAPI) UseSwaggerUI()
UseSwaggerUI for documentation at /docs
func (*GaexporterAPI) Validate ¶
func (o *GaexporterAPI) Validate() error
Validate validates the registrations in the GaexporterAPI