gen

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Oct 1, 2026 License: MIT Imports: 10 Imported by: 0

Documentation

Overview

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

Code generated by github.com/oapi-codegen/oapi-codegen/v2 version v2.7.1 DO NOT EDIT.

Package gen contains generated code for the audit API.

Index

Constants

View Source
const (
	BearerAuthScopes bearerAuthContextKey = "BearerAuth.Scopes"
)

Variables

This section is empty.

Functions

func RegisterHandlers

func RegisterHandlers(router EchoRouter, si ServerInterface)

RegisterHandlers adds each server route to the EchoRouter.

func RegisterHandlersWithBaseURL

func RegisterHandlersWithBaseURL(router EchoRouter, si ServerInterface, baseURL string)

RegisterHandlersWithBaseURL registers handlers and prepends BaseURL to the paths so the API can be served under a prefix.

func RegisterHandlersWithOptions

func RegisterHandlersWithOptions(router EchoRouter, si ServerInterface, options RegisterHandlersOptions)

RegisterHandlersWithOptions registers handlers using the supplied options, including any per-operation middleware.

Types

type AuditEntry

type AuditEntry struct {
	// DurationMs Request duration in milliseconds.
	DurationMs int64 `json:"duration_ms"`

	// Id Unique identifier for the audit entry.
	Id openapi_types.UUID `json:"id"`

	// JobId The job this request created, absent when it created none. Joins the entry to that job's own status timeline.
	JobId *string `json:"job_id,omitempty"`

	// Method HTTP method.
	Method string `json:"method"`

	// OperationId OpenAPI operation ID.
	OperationId *string `json:"operation_id,omitempty"`

	// Path Request URL path.
	Path string `json:"path"`

	// RequestSummary What the request asked for, with sensitive values replaced. Recorded for methods that change something.
	RequestSummary *string `json:"request_summary,omitempty"`

	// ResponseCode HTTP response status code.
	ResponseCode int `json:"response_code"`

	// Roles Roles from the JWT token.
	Roles []string `json:"roles"`

	// SourceIp Client IP address.
	SourceIp string `json:"source_ip"`

	// Timestamp When the request was processed.
	Timestamp time.Time `json:"timestamp"`

	// TraceId OpenTelemetry trace ID for correlation.
	TraceId *string `json:"trace_id,omitempty"`

	// User Authenticated user (JWT subject).
	User string `json:"user"`
}

AuditEntry defines model for AuditEntry.

type AuditEntryResponse

type AuditEntryResponse struct {
	Entry AuditEntry `json:"entry"`
}

AuditEntryResponse defines model for AuditEntryResponse.

type EchoRouter

This is a simple interface which specifies echo.Route addition functions which are present on both echo.Echo and echo.Group, since we want to allow using either of them for path registration

type ErrorResponse

type ErrorResponse = externalRef0.ErrorResponse

ErrorResponse defines model for ErrorResponse.

type GetAuditExport200JSONResponse

type GetAuditExport200JSONResponse ListAuditResponse

func (GetAuditExport200JSONResponse) VisitGetAuditExportResponse

func (response GetAuditExport200JSONResponse) VisitGetAuditExportResponse(w http.ResponseWriter) error

type GetAuditExport401JSONResponse

type GetAuditExport401JSONResponse externalRef0.ErrorResponse

func (GetAuditExport401JSONResponse) VisitGetAuditExportResponse

func (response GetAuditExport401JSONResponse) VisitGetAuditExportResponse(w http.ResponseWriter) error

type GetAuditExport403JSONResponse

type GetAuditExport403JSONResponse externalRef0.ErrorResponse

func (GetAuditExport403JSONResponse) VisitGetAuditExportResponse

func (response GetAuditExport403JSONResponse) VisitGetAuditExportResponse(w http.ResponseWriter) error

type GetAuditExport500JSONResponse

type GetAuditExport500JSONResponse externalRef0.ErrorResponse

func (GetAuditExport500JSONResponse) VisitGetAuditExportResponse

func (response GetAuditExport500JSONResponse) VisitGetAuditExportResponse(w http.ResponseWriter) error

type GetAuditExportRequestObject

type GetAuditExportRequestObject struct {
}

type GetAuditExportResponseObject

type GetAuditExportResponseObject interface {
	VisitGetAuditExportResponse(w http.ResponseWriter) error
}

type GetAuditLogByID200JSONResponse

type GetAuditLogByID200JSONResponse AuditEntryResponse

func (GetAuditLogByID200JSONResponse) VisitGetAuditLogByIDResponse

func (response GetAuditLogByID200JSONResponse) VisitGetAuditLogByIDResponse(w http.ResponseWriter) error

type GetAuditLogByID401JSONResponse

type GetAuditLogByID401JSONResponse externalRef0.ErrorResponse

func (GetAuditLogByID401JSONResponse) VisitGetAuditLogByIDResponse

func (response GetAuditLogByID401JSONResponse) VisitGetAuditLogByIDResponse(w http.ResponseWriter) error

type GetAuditLogByID403JSONResponse

type GetAuditLogByID403JSONResponse externalRef0.ErrorResponse

func (GetAuditLogByID403JSONResponse) VisitGetAuditLogByIDResponse

func (response GetAuditLogByID403JSONResponse) VisitGetAuditLogByIDResponse(w http.ResponseWriter) error

type GetAuditLogByID404JSONResponse

type GetAuditLogByID404JSONResponse externalRef0.ErrorResponse

func (GetAuditLogByID404JSONResponse) VisitGetAuditLogByIDResponse

func (response GetAuditLogByID404JSONResponse) VisitGetAuditLogByIDResponse(w http.ResponseWriter) error

type GetAuditLogByID500JSONResponse

type GetAuditLogByID500JSONResponse externalRef0.ErrorResponse

func (GetAuditLogByID500JSONResponse) VisitGetAuditLogByIDResponse

func (response GetAuditLogByID500JSONResponse) VisitGetAuditLogByIDResponse(w http.ResponseWriter) error

type GetAuditLogByIDRequestObject

type GetAuditLogByIDRequestObject struct {
	Id openapi_types.UUID `json:"id"`
}

type GetAuditLogByIDResponseObject

type GetAuditLogByIDResponseObject interface {
	VisitGetAuditLogByIDResponse(w http.ResponseWriter) error
}

type GetAuditLogs200JSONResponse

type GetAuditLogs200JSONResponse ListAuditResponse

func (GetAuditLogs200JSONResponse) VisitGetAuditLogsResponse

func (response GetAuditLogs200JSONResponse) VisitGetAuditLogsResponse(w http.ResponseWriter) error

type GetAuditLogs400JSONResponse

type GetAuditLogs400JSONResponse externalRef0.ErrorResponse

func (GetAuditLogs400JSONResponse) VisitGetAuditLogsResponse

func (response GetAuditLogs400JSONResponse) VisitGetAuditLogsResponse(w http.ResponseWriter) error

type GetAuditLogs401JSONResponse

type GetAuditLogs401JSONResponse externalRef0.ErrorResponse

func (GetAuditLogs401JSONResponse) VisitGetAuditLogsResponse

func (response GetAuditLogs401JSONResponse) VisitGetAuditLogsResponse(w http.ResponseWriter) error

type GetAuditLogs403JSONResponse

type GetAuditLogs403JSONResponse externalRef0.ErrorResponse

func (GetAuditLogs403JSONResponse) VisitGetAuditLogsResponse

func (response GetAuditLogs403JSONResponse) VisitGetAuditLogsResponse(w http.ResponseWriter) error

type GetAuditLogs500JSONResponse

type GetAuditLogs500JSONResponse externalRef0.ErrorResponse

func (GetAuditLogs500JSONResponse) VisitGetAuditLogsResponse

func (response GetAuditLogs500JSONResponse) VisitGetAuditLogsResponse(w http.ResponseWriter) error

type GetAuditLogsParams

type GetAuditLogsParams struct {
	// Limit Maximum number of entries to return.
	Limit *int `form:"limit,omitempty" json:"limit,omitempty" validate:"omitempty,min=1,max=100"`

	// Offset Number of entries to skip.
	Offset *int `form:"offset,omitempty" json:"offset,omitempty" validate:"omitempty,min=0"`
}

GetAuditLogsParams defines parameters for GetAuditLogs.

type GetAuditLogsRequestObject

type GetAuditLogsRequestObject struct {
	Params GetAuditLogsParams
}

type GetAuditLogsResponseObject

type GetAuditLogsResponseObject interface {
	VisitGetAuditLogsResponse(w http.ResponseWriter) error
}

type ListAuditResponse

type ListAuditResponse struct {
	// Items The audit entries for this page.
	Items []AuditEntry `json:"items"`

	// TotalItems Total number of audit entries.
	TotalItems int `json:"total_items"`
}

ListAuditResponse defines model for ListAuditResponse.

type RegisterHandlersOptions

type RegisterHandlersOptions struct {
	// BaseURL is prepended to every registered path so the API can be served
	// under a prefix.
	BaseURL string
	// OperationMiddlewares lets the caller attach per-operation middleware at
	// registration time. The map key is the OpenAPI `operationId` value as it
	// appears in the spec (the raw, un-normalized form). Operations that have
	// no entry are registered with no extra middleware. A nil map disables
	// per-operation middleware entirely.
	OperationMiddlewares map[string][]echo.MiddlewareFunc
}

RegisterHandlersOptions configures RegisterHandlersWithOptions.

type ServerInterface

type ServerInterface interface {
	// List audit log entries
	// (GET /api/audit)
	GetAuditLogs(ctx *echo.Context, params GetAuditLogsParams) error
	// Export all audit log entries
	// (GET /api/audit/export)
	GetAuditExport(ctx *echo.Context) error
	// Get a single audit log entry
	// (GET /api/audit/{id})
	GetAuditLogByID(ctx *echo.Context, id openapi_types.UUID) error
}

ServerInterface represents all server handlers.

func NewStrictHandler

func NewStrictHandler(ssi StrictServerInterface, middlewares []StrictMiddlewareFunc) ServerInterface

type ServerInterfaceWrapper

type ServerInterfaceWrapper struct {
	Handler ServerInterface
}

ServerInterfaceWrapper converts echo contexts to parameters.

func (*ServerInterfaceWrapper) GetAuditExport

func (w *ServerInterfaceWrapper) GetAuditExport(ctx *echo.Context) error

GetAuditExport converts echo context to params.

func (*ServerInterfaceWrapper) GetAuditLogByID

func (w *ServerInterfaceWrapper) GetAuditLogByID(ctx *echo.Context) error

GetAuditLogByID converts echo context to params.

func (*ServerInterfaceWrapper) GetAuditLogs

func (w *ServerInterfaceWrapper) GetAuditLogs(ctx *echo.Context) error

GetAuditLogs converts echo context to params.

type StrictHandlerFunc

type StrictHandlerFunc func(ctx *echo.Context, request any) (any, error)

type StrictMiddlewareFunc

type StrictMiddlewareFunc func(f StrictHandlerFunc, operationID string) StrictHandlerFunc

type StrictServerInterface

type StrictServerInterface interface {
	// List audit log entries
	// (GET /api/audit)
	GetAuditLogs(ctx context.Context, request GetAuditLogsRequestObject) (GetAuditLogsResponseObject, error)
	// Export all audit log entries
	// (GET /api/audit/export)
	GetAuditExport(ctx context.Context, request GetAuditExportRequestObject) (GetAuditExportResponseObject, error)
	// Get a single audit log entry
	// (GET /api/audit/{id})
	GetAuditLogByID(ctx context.Context, request GetAuditLogByIDRequestObject) (GetAuditLogByIDResponseObject, error)
}

StrictServerInterface represents all server handlers.

Jump to

Keyboard shortcuts

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