solarisapi

package
v0.24.0 Latest Latest
Warning

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

Go to latest
Published: Apr 18, 2024 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Overview

Package solarisapi provides primitives to interact with the openapi HTTP API.

Code generated by github.com/deepmap/oapi-codegen version v1.16.2 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 CreateLogJSONRequestBody

type CreateLogJSONRequestBody = CreateLogRequest

CreateLogJSONRequestBody defines body for CreateLog for application/json ContentType.

type CreateLogRequest

type CreateLogRequest struct {
	// Tags The log tags.
	Tags Tags `json:"tags"`
}

CreateLogRequest The request object to create log.

type CreateRecordRequest

type CreateRecordRequest struct {
	// Payload The record payload.
	Payload []byte `json:"payload"`
}

CreateRecordRequest The request object to create a record.

type CreateRecordsJSONRequestBody

type CreateRecordsJSONRequestBody = CreateRecordsRequest

CreateRecordsJSONRequestBody defines body for CreateRecords for application/json ContentType.

type CreateRecordsRequest

type CreateRecordsRequest struct {
	// Records The list of records to be created.
	Records []CreateRecordRequest `json:"records"`
}

CreateRecordsRequest The request object to create records.

type CreateRecordsResponse

type CreateRecordsResponse struct {
	// Added The number of records added.
	Added int `json:"added"`
}

CreateRecordsResponse The response object to the create records request.

type DeleteLogsJSONRequestBody

type DeleteLogsJSONRequestBody = DeleteLogsRequest

DeleteLogsJSONRequestBody defines body for DeleteLogs for application/json ContentType.

type DeleteLogsRequest

type DeleteLogsRequest struct {
	// FilterCondition The filter condition.
	FilterCondition string `json:"filterCondition"`
}

DeleteLogsRequest The request object to delete logs.

type DeleteLogsResponse

type DeleteLogsResponse struct {
	// Deleted The number of logs deleted.
	Deleted int `json:"deleted"`
}

DeleteLogsResponse The response object to the delete logs request.

type Desc

type Desc = bool

Desc defines model for Desc.

type FromPageId

type FromPageId = string

FromPageId defines model for FromPageId.

type GinServerOptions

type GinServerOptions struct {
	BaseURL      string
	Middlewares  []MiddlewareFunc
	ErrorHandler func(*gin.Context, error, int)
}

GinServerOptions provides options for the Gin server.

type Limit

type Limit = int

Limit defines model for Limit.

type Log

type Log struct {
	// CreatedAt The timestamp when the log was created.
	CreatedAt time.Time `json:"createdAt"`

	// Id The log identifier.
	Id string `json:"id"`

	// Tags The log tags.
	Tags Tags `json:"tags"`

	// UpdatedAt The timestamp when the log was updated (new records added or tags are applied).
	UpdatedAt time.Time `json:"updatedAt"`
}

Log The log object.

type LogId

type LogId = string

LogId defines model for LogId.

type LogIds

type LogIds = []string

LogIds defines model for LogIds.

type LogsCondFilter

type LogsCondFilter = string

LogsCondFilter defines model for LogsCondFilter.

type MiddlewareFunc

type MiddlewareFunc func(c *gin.Context)

type QueryLogsParams

type QueryLogsParams struct {
	// LogsCondFilter The condition for filtering the logs.
	LogsCondFilter *LogsCondFilter `form:"logsCondFilter,omitempty" json:"logsCondFilter,omitempty"`

	// FromPageId The id of the page to start returning the results from.
	FromPageId *FromPageId `form:"fromPageId,omitempty" json:"fromPageId,omitempty"`

	// Limit The max number of objects to return per page.
	Limit *Limit `form:"limit,omitempty" json:"limit,omitempty"`
}

QueryLogsParams defines parameters for QueryLogs.

type QueryLogsResult

type QueryLogsResult struct {
	// Items The list of found logs.
	Items []Log `json:"items"`

	// NextPageId The id of the next page.
	NextPageId *string `json:"nextPageId,omitempty"`

	// Total The total number of found logs.
	Total int `json:"total"`
}

QueryLogsResult The response object to the query logs request.

type QueryRecordsParams

type QueryRecordsParams struct {
	// LogsCondFilter The condition for filtering the logs.
	LogsCondFilter *LogsCondFilter `form:"logsCondFilter,omitempty" json:"logsCondFilter,omitempty"`

	// RecordsCondFilter The condition for filtering the records.
	RecordsCondFilter *RecordsCondFilter `form:"recordsCondFilter,omitempty" json:"recordsCondFilter,omitempty"`

	// LogIds The ids of the logs to consider. If specified, the `logsCondFilter` is ignored.
	LogIds *LogIds `form:"logIds,omitempty" json:"logIds,omitempty"`

	// Desc The flag specifies the descending order for pagination.
	Desc *Desc `form:"desc,omitempty" json:"desc,omitempty"`

	// FromPageId The id of the page to start returning the results from.
	FromPageId *FromPageId `form:"fromPageId,omitempty" json:"fromPageId,omitempty"`

	// Limit The max number of objects to return per page.
	Limit *Limit `form:"limit,omitempty" json:"limit,omitempty"`
}

QueryRecordsParams defines parameters for QueryRecords.

type QueryRecordsResult

type QueryRecordsResult struct {
	// Items The list of found records.
	Items []Record `json:"items"`

	// NextPageId The id of the next page.
	NextPageId *string `json:"nextPageId,omitempty"`

	// Total The total number of found records.
	Total int `json:"total"`
}

QueryRecordsResult The response object to the query records request.

type Record

type Record struct {
	// CreatedAt The timestamp when the record was created.
	CreatedAt time.Time `json:"createdAt"`

	// Id The record identifier.
	Id string `json:"id"`

	// LogId The log identifier.
	LogId string `json:"logId"`

	// Payload The record payload.
	Payload []byte `json:"payload"`
}

Record The record object.

type RecordsCondFilter

type RecordsCondFilter = string

RecordsCondFilter defines model for RecordsCondFilter.

type ServerInterface

type ServerInterface interface {
	// Delete logs
	// (DELETE /logs)
	DeleteLogs(c *gin.Context)
	// Query logs
	// (GET /logs)
	QueryLogs(c *gin.Context, params QueryLogsParams)
	// Create log
	// (POST /logs)
	CreateLog(c *gin.Context)
	// Update log
	// (PUT /logs/{logId})
	UpdateLog(c *gin.Context, logId LogId)
	// Create records
	// (POST /logs/{logId}/records)
	CreateRecords(c *gin.Context, logId LogId)
	// Health check
	// (GET /ping)
	Ping(c *gin.Context)
	// Query records
	// (GET /records)
	QueryRecords(c *gin.Context, params QueryRecordsParams)
}

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) CreateLog

func (siw *ServerInterfaceWrapper) CreateLog(c *gin.Context)

CreateLog operation middleware

func (*ServerInterfaceWrapper) CreateRecords

func (siw *ServerInterfaceWrapper) CreateRecords(c *gin.Context)

CreateRecords operation middleware

func (*ServerInterfaceWrapper) DeleteLogs

func (siw *ServerInterfaceWrapper) DeleteLogs(c *gin.Context)

DeleteLogs operation middleware

func (*ServerInterfaceWrapper) Ping

func (siw *ServerInterfaceWrapper) Ping(c *gin.Context)

Ping operation middleware

func (*ServerInterfaceWrapper) QueryLogs

func (siw *ServerInterfaceWrapper) QueryLogs(c *gin.Context)

QueryLogs operation middleware

func (*ServerInterfaceWrapper) QueryRecords

func (siw *ServerInterfaceWrapper) QueryRecords(c *gin.Context)

QueryRecords operation middleware

func (*ServerInterfaceWrapper) UpdateLog

func (siw *ServerInterfaceWrapper) UpdateLog(c *gin.Context)

UpdateLog operation middleware

type Tags

type Tags map[string]string

Tags The log tags.

type UpdateLogJSONRequestBody

type UpdateLogJSONRequestBody = UpdateLogRequest

UpdateLogJSONRequestBody defines body for UpdateLog for application/json ContentType.

type UpdateLogRequest

type UpdateLogRequest struct {
	// Tags The log tags.
	Tags Tags `json:"tags"`
}

UpdateLogRequest The request object to update log.

Jump to

Keyboard shortcuts

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