Documentation
¶
Overview ¶
Package restapi Flotta backend API
Flotta backend API for remote data storage Schemes: https Host: localhost BasePath: /api/flotta-backend/v1 Version: 1.0.0 License: Apache 2.0 http://www.apache.org/licenses/LICENSE-2.0.html Contact: Flotta flotta<flotta@redhat.com> https://github.com/project-flotta Consumes: - application/json Produces: - application/json
swagger:meta
Index ¶
- Constants
- Variables
- func Handler(c Config) (http.Handler, error)
- func HandlerAPI(c Config) (http.Handler, *operations.FlottaBackendAPIAPI, error)
- type BackendAPI
- type Config
- type MockBackendAPI
- func (_m *MockBackendAPI) EnrolDevice(ctx context.Context, params backend.EnrolDeviceParams) middleware.Responder
- func (_m *MockBackendAPI) GetDeviceConfiguration(ctx context.Context, params backend.GetDeviceConfigurationParams) middleware.Responder
- func (_m *MockBackendAPI) GetRegistrationStatus(ctx context.Context, params backend.GetRegistrationStatusParams) middleware.Responder
- func (_m *MockBackendAPI) RegisterDevice(ctx context.Context, params backend.RegisterDeviceParams) middleware.Responder
- func (_m *MockBackendAPI) UpdateHeartBeat(ctx context.Context, params backend.UpdateHeartBeatParams) middleware.Responder
Constants ¶
const AuthKey contextKey = "Auth"
Variables ¶
var ( // SwaggerJSON embedded version of the swagger document used at generation time SwaggerJSON json.RawMessage // FlatSwaggerJSON embedded flattened version of the swagger document used at generation time FlatSwaggerJSON json.RawMessage )
Functions ¶
func Handler ¶
Handler returns an http.Handler given the handler configuration It mounts all the business logic implementers in the right routing.
func HandlerAPI ¶
func HandlerAPI(c Config) (http.Handler, *operations.FlottaBackendAPIAPI, error)
HandlerAPI returns an http.Handler given the handler configuration and the corresponding *FlottaBackendAPI instance. It mounts all the business logic implementers in the right routing.
Types ¶
type BackendAPI ¶
type BackendAPI interface {
/* EnrolDevice Initiates the process of enrolling the device */
EnrolDevice(ctx context.Context, params backend.EnrolDeviceParams) middleware.Responder
/* GetDeviceConfiguration Returns the device configuration */
GetDeviceConfiguration(ctx context.Context, params backend.GetDeviceConfigurationParams) middleware.Responder
/* GetRegistrationStatus Returns a device registration status, which can be registered, unregistered or unknown. */
GetRegistrationStatus(ctx context.Context, params backend.GetRegistrationStatusParams) middleware.Responder
/* RegisterDevice Registers the device by providing its hardware configuration */
RegisterDevice(ctx context.Context, params backend.RegisterDeviceParams) middleware.Responder
/* UpdateHeartBeat Updates the heartbeat information of the device. */
UpdateHeartBeat(ctx context.Context, params backend.UpdateHeartBeatParams) middleware.Responder
}
BackendAPI
type Config ¶
type Config struct {
BackendAPI
Logger func(string, ...interface{})
// InnerMiddleware is for the handler executors. These do not apply to the swagger.json document.
// The middleware executes after routing but before authentication, binding and validation
InnerMiddleware func(http.Handler) http.Handler
// Authorizer is used to authorize a request after the Auth function was called using the "Auth*" functions
// and the principal was stored in the context in the "AuthKey" context value.
Authorizer func(*http.Request) error
// Authenticator to use for all APIKey authentication
APIKeyAuthenticator func(string, string, security.TokenAuthentication) runtime.Authenticator
// Authenticator to use for all Bearer authentication
BasicAuthenticator func(security.UserPassAuthentication) runtime.Authenticator
// Authenticator to use for all Basic authentication
BearerAuthenticator func(string, security.ScopedTokenAuthentication) runtime.Authenticator
}
Config is configuration for Handler
type MockBackendAPI ¶
MockBackendAPI is an autogenerated mock type for the BackendAPI type
func (*MockBackendAPI) EnrolDevice ¶
func (_m *MockBackendAPI) EnrolDevice(ctx context.Context, params backend.EnrolDeviceParams) middleware.Responder
EnrolDevice provides a mock function with given fields: ctx, params
func (*MockBackendAPI) GetDeviceConfiguration ¶
func (_m *MockBackendAPI) GetDeviceConfiguration(ctx context.Context, params backend.GetDeviceConfigurationParams) middleware.Responder
GetDeviceConfiguration provides a mock function with given fields: ctx, params
func (*MockBackendAPI) GetRegistrationStatus ¶
func (_m *MockBackendAPI) GetRegistrationStatus(ctx context.Context, params backend.GetRegistrationStatusParams) middleware.Responder
GetRegistrationStatus provides a mock function with given fields: ctx, params
func (*MockBackendAPI) RegisterDevice ¶
func (_m *MockBackendAPI) RegisterDevice(ctx context.Context, params backend.RegisterDeviceParams) middleware.Responder
RegisterDevice provides a mock function with given fields: ctx, params
func (*MockBackendAPI) UpdateHeartBeat ¶
func (_m *MockBackendAPI) UpdateHeartBeat(ctx context.Context, params backend.UpdateHeartBeatParams) middleware.Responder
UpdateHeartBeat provides a mock function with given fields: ctx, params