generated

package
v0.8.5 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 2, 2026 License: GPL-3.0 Imports: 13 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetSwagger

func GetSwagger() (swagger *openapi3.T, err error)

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

func PathToRawSpec(pathToFile string) map[string]func() ([]byte, error)

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 Error

type Error struct {
	Code    int32  `json:"code"`
	Message string `json:"message"`
}

Error defines model for Error.

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

type MetricConfigItem struct {
	Label    string `json:"label"`
	Priority int    `json:"priority"`
}

MetricConfigItem defines model for MetricConfigItem.

type MetricsConfiguration

type MetricsConfiguration map[string]MetricConfigItem

MetricsConfiguration Mapping of metric keys to metric configuration

type MiddlewareFunc

type MiddlewareFunc func(c *gin.Context)

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 TimeRange

type TimeRange struct {
	End   time.Time `json:"end"`
	Start time.Time `json:"start"`
}

TimeRange defines model for TimeRange.

type UnexpectedError

type UnexpectedError = Error

UnexpectedError defines model for UnexpectedError.

type UpdateFoodLogJSONRequestBody

type UpdateFoodLogJSONRequestBody = EditFoodLogEntry

UpdateFoodLogJSONRequestBody defines body for UpdateFoodLog for application/json ContentType.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL