Documentation
¶
Overview ¶
Package generated provides primitives to interact with the openapi HTTP API.
Code generated by github.com/oapi-codegen/oapi-codegen/v2 version v2.5.0 DO NOT EDIT.
Package generated provides primitives to interact with the openapi HTTP API.
Code generated by github.com/oapi-codegen/oapi-codegen/v2 version v2.5.0 DO NOT EDIT.
Index ¶
- func GetSwagger() (swagger *openapi3.T, err error)
- func PathToRawSpec(pathToFile string) map[string]func() ([]byte, error)
- func RegisterHandlers(router gin.IRouter, si ServerInterface)
- func RegisterHandlersWithOptions(router gin.IRouter, si ServerInterface, options GinServerOptions)
- type Configuration
- type ConfigurationValue
- func (t ConfigurationValue) AsConfigurationValue2() (ConfigurationValue2, error)
- func (t ConfigurationValue) AsMetricsConfiguration() (MetricsConfiguration, error)
- func (t ConfigurationValue) AsSummaryConfiguration() (SummaryConfiguration, error)
- func (t *ConfigurationValue) FromConfigurationValue2(v ConfigurationValue2) error
- func (t *ConfigurationValue) FromMetricsConfiguration(v MetricsConfiguration) error
- func (t *ConfigurationValue) FromSummaryConfiguration(v SummaryConfiguration) error
- func (t ConfigurationValue) MarshalJSON() ([]byte, error)
- func (t *ConfigurationValue) MergeConfigurationValue2(v ConfigurationValue2) error
- func (t *ConfigurationValue) MergeMetricsConfiguration(v MetricsConfiguration) error
- func (t *ConfigurationValue) MergeSummaryConfiguration(v SummaryConfiguration) error
- func (t *ConfigurationValue) UnmarshalJSON(b []byte) error
- type ConfigurationValue2
- type CreateFoodLogEntry
- type CreateFoodLogJSONRequestBody
- type EditFoodLogEntry
- type Error
- type FoodLogEntry
- type GinServerOptions
- type MetricConfigItem
- type MetricsConfiguration
- type MiddlewareFunc
- type QueryFoodLogsParams
- type ServerInterface
- type ServerInterfaceWrapper
- func (siw *ServerInterfaceWrapper) CreateFoodLog(c *gin.Context)
- func (siw *ServerInterfaceWrapper) DeleteFoodLog(c *gin.Context)
- func (siw *ServerInterfaceWrapper) ExportFoodLogs(c *gin.Context)
- func (siw *ServerInterfaceWrapper) GetFoodLog(c *gin.Context)
- func (siw *ServerInterfaceWrapper) GetUserConfig(c *gin.Context)
- func (siw *ServerInterfaceWrapper) PurgeFoodLogs(c *gin.Context)
- func (siw *ServerInterfaceWrapper) QueryFoodLogs(c *gin.Context)
- func (siw *ServerInterfaceWrapper) StoreUserConfig(c *gin.Context)
- func (siw *ServerInterfaceWrapper) TestEndpoint(c *gin.Context)
- func (siw *ServerInterfaceWrapper) UpdateFoodLog(c *gin.Context)
- type StoreUserConfigJSONRequestBody
- type SummaryConfiguration
- type TimeRange
- type UnexpectedError
- type UpdateFoodLogJSONRequestBody
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetSwagger ¶
GetSwagger returns the Swagger specification corresponding to the generated code in this file. The external references of Swagger specification are resolved. The logic of resolving external references is tightly connected to "import-mapping" feature. Externally referenced files must be embedded in the corresponding golang packages. Urls can be supported but this task was out of the scope.
func PathToRawSpec ¶
Constructs a synthetic filesystem for resolving external references when loading openapi specifications.
func RegisterHandlers ¶
func RegisterHandlers(router gin.IRouter, si ServerInterface)
RegisterHandlers creates http.Handler with routing matching OpenAPI spec.
func RegisterHandlersWithOptions ¶
func RegisterHandlersWithOptions(router gin.IRouter, si ServerInterface, options GinServerOptions)
RegisterHandlersWithOptions creates http.Handler with additional options
Types ¶
type Configuration ¶
type Configuration struct {
Id string `json:"id"`
Value ConfigurationValue `json:"value"`
}
Configuration defines model for Configuration.
type ConfigurationValue ¶
type ConfigurationValue struct {
// contains filtered or unexported fields
}
ConfigurationValue defines model for ConfigurationValue.
func (ConfigurationValue) AsConfigurationValue2 ¶
func (t ConfigurationValue) AsConfigurationValue2() (ConfigurationValue2, error)
AsConfigurationValue2 returns the union data inside the ConfigurationValue as a ConfigurationValue2
func (ConfigurationValue) AsMetricsConfiguration ¶
func (t ConfigurationValue) AsMetricsConfiguration() (MetricsConfiguration, error)
AsMetricsConfiguration returns the union data inside the ConfigurationValue as a MetricsConfiguration
func (ConfigurationValue) AsSummaryConfiguration ¶
func (t ConfigurationValue) AsSummaryConfiguration() (SummaryConfiguration, error)
AsSummaryConfiguration returns the union data inside the ConfigurationValue as a SummaryConfiguration
func (*ConfigurationValue) FromConfigurationValue2 ¶
func (t *ConfigurationValue) FromConfigurationValue2(v ConfigurationValue2) error
FromConfigurationValue2 overwrites any union data inside the ConfigurationValue as the provided ConfigurationValue2
func (*ConfigurationValue) FromMetricsConfiguration ¶
func (t *ConfigurationValue) FromMetricsConfiguration(v MetricsConfiguration) error
FromMetricsConfiguration overwrites any union data inside the ConfigurationValue as the provided MetricsConfiguration
func (*ConfigurationValue) FromSummaryConfiguration ¶
func (t *ConfigurationValue) FromSummaryConfiguration(v SummaryConfiguration) error
FromSummaryConfiguration overwrites any union data inside the ConfigurationValue as the provided SummaryConfiguration
func (ConfigurationValue) MarshalJSON ¶
func (t ConfigurationValue) MarshalJSON() ([]byte, error)
func (*ConfigurationValue) MergeConfigurationValue2 ¶
func (t *ConfigurationValue) MergeConfigurationValue2(v ConfigurationValue2) error
MergeConfigurationValue2 performs a merge with any union data inside the ConfigurationValue, using the provided ConfigurationValue2
func (*ConfigurationValue) MergeMetricsConfiguration ¶
func (t *ConfigurationValue) MergeMetricsConfiguration(v MetricsConfiguration) error
MergeMetricsConfiguration performs a merge with any union data inside the ConfigurationValue, using the provided MetricsConfiguration
func (*ConfigurationValue) MergeSummaryConfiguration ¶
func (t *ConfigurationValue) MergeSummaryConfiguration(v SummaryConfiguration) error
MergeSummaryConfiguration performs a merge with any union data inside the ConfigurationValue, using the provided SummaryConfiguration
func (*ConfigurationValue) UnmarshalJSON ¶
func (t *ConfigurationValue) UnmarshalJSON(b []byte) error
type ConfigurationValue2 ¶
type ConfigurationValue2 = map[string]interface{}
ConfigurationValue2 defines model for .
type CreateFoodLogEntry ¶
type CreateFoodLogEntry struct {
Labels []string `json:"labels"`
Metrics map[string]float64 `json:"metrics"`
Name string `json:"name"`
Time TimeRange `json:"time"`
}
CreateFoodLogEntry defines model for CreateFoodLogEntry.
type CreateFoodLogJSONRequestBody ¶
type CreateFoodLogJSONRequestBody = CreateFoodLogEntry
CreateFoodLogJSONRequestBody defines body for CreateFoodLog for application/json ContentType.
type EditFoodLogEntry ¶
type EditFoodLogEntry struct {
Id string `json:"id"`
Labels *[]string `json:"labels,omitempty"`
Metrics *map[string]float64 `json:"metrics,omitempty"`
Name *string `json:"name,omitempty"`
Time *TimeRange `json:"time,omitempty"`
}
EditFoodLogEntry defines model for EditFoodLogEntry.
type FoodLogEntry ¶
type FoodLogEntry struct {
Id string `json:"id"`
Labels []string `json:"labels"`
Metrics map[string]float64 `json:"metrics"`
Name string `json:"name"`
Time TimeRange `json:"time"`
}
FoodLogEntry defines model for FoodLogEntry.
type GinServerOptions ¶
type GinServerOptions struct {
BaseURL string
Middlewares []MiddlewareFunc
ErrorHandler func(*gin.Context, error, int)
}
GinServerOptions provides options for the Gin server.
type MetricConfigItem ¶
MetricConfigItem defines model for MetricConfigItem.
type MetricsConfiguration ¶
type MetricsConfiguration map[string]MetricConfigItem
MetricsConfiguration Mapping of metric keys to metric configuration
type MiddlewareFunc ¶
type QueryFoodLogsParams ¶
type QueryFoodLogsParams struct {
StartDate time.Time `form:"startDate" json:"startDate"`
EndDate time.Time `form:"endDate" json:"endDate"`
}
QueryFoodLogsParams defines parameters for QueryFoodLogs.
type ServerInterface ¶
type ServerInterface interface {
// Get user configuration
// (GET /api/config/{configId})
GetUserConfig(c *gin.Context, configId string)
// Store user configuration
// (POST /api/config/{configId})
StoreUserConfig(c *gin.Context, configId string)
// Purge all food logs for user
// (DELETE /api/logs)
PurgeFoodLogs(c *gin.Context)
// Query food logs
// (GET /api/logs)
QueryFoodLogs(c *gin.Context, params QueryFoodLogsParams)
// Create food log entry
// (POST /api/logs)
CreateFoodLog(c *gin.Context)
// Export all food logs for user
// (GET /api/logs/export)
ExportFoodLogs(c *gin.Context)
// Delete food log entry
// (DELETE /api/logs/{itemId})
DeleteFoodLog(c *gin.Context, itemId string)
// Get food log entry
// (GET /api/logs/{itemId})
GetFoodLog(c *gin.Context, itemId string)
// Update food log entry
// (PUT /api/logs/{itemId})
UpdateFoodLog(c *gin.Context, itemId string)
// Test endpoint
// (GET /api/ping)
TestEndpoint(c *gin.Context)
}
ServerInterface represents all server handlers.
type ServerInterfaceWrapper ¶
type ServerInterfaceWrapper struct {
Handler ServerInterface
HandlerMiddlewares []MiddlewareFunc
ErrorHandler func(*gin.Context, error, int)
}
ServerInterfaceWrapper converts contexts to parameters.
func (*ServerInterfaceWrapper) CreateFoodLog ¶
func (siw *ServerInterfaceWrapper) CreateFoodLog(c *gin.Context)
CreateFoodLog operation middleware
func (*ServerInterfaceWrapper) DeleteFoodLog ¶
func (siw *ServerInterfaceWrapper) DeleteFoodLog(c *gin.Context)
DeleteFoodLog operation middleware
func (*ServerInterfaceWrapper) ExportFoodLogs ¶
func (siw *ServerInterfaceWrapper) ExportFoodLogs(c *gin.Context)
ExportFoodLogs operation middleware
func (*ServerInterfaceWrapper) GetFoodLog ¶
func (siw *ServerInterfaceWrapper) GetFoodLog(c *gin.Context)
GetFoodLog operation middleware
func (*ServerInterfaceWrapper) GetUserConfig ¶
func (siw *ServerInterfaceWrapper) GetUserConfig(c *gin.Context)
GetUserConfig operation middleware
func (*ServerInterfaceWrapper) PurgeFoodLogs ¶
func (siw *ServerInterfaceWrapper) PurgeFoodLogs(c *gin.Context)
PurgeFoodLogs operation middleware
func (*ServerInterfaceWrapper) QueryFoodLogs ¶
func (siw *ServerInterfaceWrapper) QueryFoodLogs(c *gin.Context)
QueryFoodLogs operation middleware
func (*ServerInterfaceWrapper) StoreUserConfig ¶
func (siw *ServerInterfaceWrapper) StoreUserConfig(c *gin.Context)
StoreUserConfig operation middleware
func (*ServerInterfaceWrapper) TestEndpoint ¶
func (siw *ServerInterfaceWrapper) TestEndpoint(c *gin.Context)
TestEndpoint operation middleware
func (*ServerInterfaceWrapper) UpdateFoodLog ¶
func (siw *ServerInterfaceWrapper) UpdateFoodLog(c *gin.Context)
UpdateFoodLog operation middleware
type StoreUserConfigJSONRequestBody ¶
type StoreUserConfigJSONRequestBody = ConfigurationValue
StoreUserConfigJSONRequestBody defines body for StoreUserConfig for application/json ContentType.
type SummaryConfiguration ¶
type SummaryConfiguration struct {
ShowMetricSummary []string `json:"showMetricSummary"`
}
SummaryConfiguration defines model for SummaryConfiguration.
type UnexpectedError ¶
type UnexpectedError = Error
UnexpectedError defines model for UnexpectedError.
type UpdateFoodLogJSONRequestBody ¶
type UpdateFoodLogJSONRequestBody = EditFoodLogEntry
UpdateFoodLogJSONRequestBody defines body for UpdateFoodLog for application/json ContentType.