Help us shape the future of Go! Take the 2026 Go Developer Survey

gen

package
v0.0.0-...-b9a5b38 Latest Latest
Warning

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

Go to latest
Published: Oct 16, 2026 License: MIT Imports: 7 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.8.0 DO NOT EDIT.

Package gen contains code generated from api/openapi.yaml. Do not edit.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Handler

func Handler(si ServerInterface) http.Handler

Handler creates http.Handler with routing matching OpenAPI spec.

func HandlerFromMux

func HandlerFromMux(si ServerInterface, m ServeMux) http.Handler

HandlerFromMux creates http.Handler with routing matching OpenAPI spec based on the provided mux.

func HandlerFromMuxWithBaseURL

func HandlerFromMuxWithBaseURL(si ServerInterface, m ServeMux, baseURL string) http.Handler

func HandlerWithOptions

func HandlerWithOptions(si ServerInterface, options StdHTTPServerOptions) http.Handler

HandlerWithOptions creates http.Handler with additional options

Types

type FieldError

type FieldError struct {
	Field   string `json:"field"`
	Message string `json:"message"`
}

FieldError defines model for FieldError.

type GetMe200JSONResponse

type GetMe200JSONResponse Me

func (GetMe200JSONResponse) VisitGetMeResponse

func (response GetMe200JSONResponse) VisitGetMeResponse(w http.ResponseWriter) error

type GetMeRequestObject

type GetMeRequestObject struct {
}

type GetMeResponseObject

type GetMeResponseObject interface {
	VisitGetMeResponse(w http.ResponseWriter) error
}

type GetMedefaultApplicationProblemPlusJSONResponse

type GetMedefaultApplicationProblemPlusJSONResponse struct {
	Body       Problem
	StatusCode int
}

func (GetMedefaultApplicationProblemPlusJSONResponse) VisitGetMeResponse

type GetMeta200JSONResponse

type GetMeta200JSONResponse Meta

func (GetMeta200JSONResponse) VisitGetMetaResponse

func (response GetMeta200JSONResponse) VisitGetMetaResponse(w http.ResponseWriter) error

type GetMetaRequestObject

type GetMetaRequestObject struct {
}

type GetMetaResponseObject

type GetMetaResponseObject interface {
	VisitGetMetaResponse(w http.ResponseWriter) error
}

type GetMetadefaultApplicationProblemPlusJSONResponse

type GetMetadefaultApplicationProblemPlusJSONResponse struct {
	Body       Problem
	StatusCode int
}

func (GetMetadefaultApplicationProblemPlusJSONResponse) VisitGetMetaResponse

type GetOrganization200JSONResponse

type GetOrganization200JSONResponse Organization

func (GetOrganization200JSONResponse) VisitGetOrganizationResponse

func (response GetOrganization200JSONResponse) VisitGetOrganizationResponse(w http.ResponseWriter) error

type GetOrganizationRequestObject

type GetOrganizationRequestObject struct {
	OrgId OrgId `json:"orgId"`
}

type GetOrganizationResponseObject

type GetOrganizationResponseObject interface {
	VisitGetOrganizationResponse(w http.ResponseWriter) error
}

type GetOrganizationdefaultApplicationProblemPlusJSONResponse

type GetOrganizationdefaultApplicationProblemPlusJSONResponse struct {
	Body       Problem
	StatusCode int
}

func (GetOrganizationdefaultApplicationProblemPlusJSONResponse) VisitGetOrganizationResponse

func (response GetOrganizationdefaultApplicationProblemPlusJSONResponse) VisitGetOrganizationResponse(w http.ResponseWriter) error

type InvalidParamFormatError

type InvalidParamFormatError struct {
	ParamName string
	Err       error
}

func (*InvalidParamFormatError) Error

func (e *InvalidParamFormatError) Error() string

func (*InvalidParamFormatError) Unwrap

func (e *InvalidParamFormatError) Unwrap() error

type Me

type Me struct {
	Memberships []MeMembership `json:"memberships"`
	User        MeUser         `json:"user"`
}

Me defines model for Me.

type MeMembership

type MeMembership struct {
	Name           string             `json:"name"`
	OrganizationId openapi_types.UUID `json:"organizationId"`

	// Permissions Expanded permission strings for this membership's role.
	Permissions []string       `json:"permissions"`
	Role        MembershipRole `json:"role"`
	Slug        string         `json:"slug"`
}

MeMembership defines model for MeMembership.

type MeUser

type MeUser struct {
	DisplayName string               `json:"displayName"`
	Email       *openapi_types.Email `json:"email,omitempty"`
	Id          openapi_types.UUID   `json:"id"`
}

MeUser defines model for MeUser.

type MembershipRole

type MembershipRole string

MembershipRole defines model for MembershipRole.

const (
	Admin      MembershipRole = "admin"
	Dispatcher MembershipRole = "dispatcher"
	Owner      MembershipRole = "owner"
	Technician MembershipRole = "technician"
	Viewer     MembershipRole = "viewer"
)

Defines values for MembershipRole.

func (MembershipRole) Valid

func (e MembershipRole) Valid() bool

Valid indicates whether the value is a known member of the MembershipRole enum.

type Meta

type Meta struct {
	// Commit Abbreviated git commit of the build.
	Commit  string      `json:"commit"`
	Service MetaService `json:"service"`

	// Version Examples: v1.0.0, dev
	Version string `json:"version"`
}

Meta defines model for Meta.

type MetaService

type MetaService string

MetaService defines model for Meta.Service.

const (
	Opsgrid MetaService = "opsgrid"
)

Defines values for MetaService.

func (MetaService) Valid

func (e MetaService) Valid() bool

Valid indicates whether the value is a known member of the MetaService enum.

type MiddlewareFunc

type MiddlewareFunc func(http.Handler) http.Handler

type OrgId

type OrgId = openapi_types.UUID

OrgId defines model for OrgId.

type Organization

type Organization struct {
	Id   openapi_types.UUID `json:"id"`
	Name string             `json:"name"`
	Slug string             `json:"slug"`
}

Organization defines model for Organization.

type Problem

type Problem struct {
	// Code Stable, machine-readable error identifier (never renamed).
	Code      ProblemCode             `json:"code"`
	Detail    *string                 `json:"detail,omitempty"`
	Details   *map[string]interface{} `json:"details,omitempty"`
	Errors    *[]FieldError           `json:"errors,omitempty"`
	Instance  *string                 `json:"instance,omitempty"`
	RequestId *string                 `json:"requestId,omitempty"`
	Status    int                     `json:"status"`
	Title     string                  `json:"title"`
	TraceId   *string                 `json:"traceId,omitempty"`
	Type      string                  `json:"type"`
}

Problem RFC 9457 problem details with OpsGrid extension members.

type ProblemApplicationProblemPlusJSONResponse

type ProblemApplicationProblemPlusJSONResponse Problem

type ProblemCode

type ProblemCode string

ProblemCode Stable, machine-readable error identifier (never renamed).

const (
	AUTHENTICATIONREQUIRED ProblemCode = "AUTHENTICATION_REQUIRED"
	DEPENDENCYUNAVAILABLE  ProblemCode = "DEPENDENCY_UNAVAILABLE"
	FORBIDDEN              ProblemCode = "FORBIDDEN"
	IDEMPOTENCYCONFLICT    ProblemCode = "IDEMPOTENCY_CONFLICT"
	IDEMPOTENCYKEYREQUIRED ProblemCode = "IDEMPOTENCY_KEY_REQUIRED"
	INTERNALERROR          ProblemCode = "INTERNAL_ERROR"
	INVALIDTRANSITION      ProblemCode = "INVALID_TRANSITION"
	PRECONDITIONREQUIRED   ProblemCode = "PRECONDITION_REQUIRED"
	RATELIMITED            ProblemCode = "RATE_LIMITED"
	REQUESTTOOLARGE        ProblemCode = "REQUEST_TOO_LARGE"
	RESOURCENOTFOUND       ProblemCode = "RESOURCE_NOT_FOUND"
	SCHEDULECONFLICT       ProblemCode = "SCHEDULE_CONFLICT"
	TENANTNOTFOUND         ProblemCode = "TENANT_NOT_FOUND"
	UNSUPPORTEDMEDIATYPE   ProblemCode = "UNSUPPORTED_MEDIA_TYPE"
	VALIDATIONFAILED       ProblemCode = "VALIDATION_FAILED"
	VERSIONCONFLICT        ProblemCode = "VERSION_CONFLICT"
)

Defines values for ProblemCode.

func (ProblemCode) Valid

func (e ProblemCode) Valid() bool

Valid indicates whether the value is a known member of the ProblemCode enum.

type RequiredHeaderError

type RequiredHeaderError struct {
	ParamName string
	Err       error
}

func (*RequiredHeaderError) Error

func (e *RequiredHeaderError) Error() string

func (*RequiredHeaderError) Unwrap

func (e *RequiredHeaderError) Unwrap() error

type RequiredParamError

type RequiredParamError struct {
	ParamName string
}

func (*RequiredParamError) Error

func (e *RequiredParamError) Error() string

type ServeMux

type ServeMux interface {
	HandleFunc(pattern string, handler func(http.ResponseWriter, *http.Request))
	http.Handler
}

ServeMux is an abstraction of http.ServeMux.

type ServerInterface

type ServerInterface interface {
	// GetMe Current user, memberships and permissions
	// (GET /v1/me)
	GetMe(w http.ResponseWriter, r *http.Request)
	// GetMeta Service build information
	// (GET /v1/meta)
	GetMeta(w http.ResponseWriter, r *http.Request)
	// GetOrganization Organization summary for an active member
	// (GET /v1/organizations/{orgId})
	GetOrganization(w http.ResponseWriter, r *http.Request, orgId OrgId)
}

ServerInterface represents all server handlers.

func NewStrictHandler

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

func NewStrictHandlerWithOptions

func NewStrictHandlerWithOptions(ssi StrictServerInterface, middlewares []StrictMiddlewareFunc, options StrictHTTPServerOptions) ServerInterface

type ServerInterfaceWrapper

type ServerInterfaceWrapper struct {
	Handler            ServerInterface
	HandlerMiddlewares []MiddlewareFunc
	ErrorHandlerFunc   func(w http.ResponseWriter, r *http.Request, err error)
}

ServerInterfaceWrapper converts contexts to parameters.

func (*ServerInterfaceWrapper) GetMe

GetMe operation middleware

func (*ServerInterfaceWrapper) GetMeta

GetMeta operation middleware

func (*ServerInterfaceWrapper) GetOrganization

func (siw *ServerInterfaceWrapper) GetOrganization(w http.ResponseWriter, r *http.Request)

GetOrganization operation middleware

type StdHTTPServerOptions

type StdHTTPServerOptions struct {
	BaseURL          string
	BaseRouter       ServeMux
	Middlewares      []MiddlewareFunc
	ErrorHandlerFunc func(w http.ResponseWriter, r *http.Request, err error)
}

type StrictHTTPServerOptions

type StrictHTTPServerOptions struct {
	RequestErrorHandlerFunc  func(w http.ResponseWriter, r *http.Request, err error)
	ResponseErrorHandlerFunc func(w http.ResponseWriter, r *http.Request, err error)
}

type StrictHandlerFunc

type StrictHandlerFunc func(ctx context.Context, w http.ResponseWriter, r *http.Request, request any) (any, error)

type StrictMiddlewareFunc

type StrictMiddlewareFunc func(f StrictHandlerFunc, operationID string) StrictHandlerFunc

type StrictServerInterface

type StrictServerInterface interface {
	// GetMe Current user, memberships and permissions
	// (GET /v1/me)
	GetMe(ctx context.Context, request GetMeRequestObject) (GetMeResponseObject, error)
	// GetMeta Service build information
	// (GET /v1/meta)
	GetMeta(ctx context.Context, request GetMetaRequestObject) (GetMetaResponseObject, error)
	// GetOrganization Organization summary for an active member
	// (GET /v1/organizations/{orgId})
	GetOrganization(ctx context.Context, request GetOrganizationRequestObject) (GetOrganizationResponseObject, error)
}

StrictServerInterface represents all server handlers.

type TooManyValuesForParamError

type TooManyValuesForParamError struct {
	ParamName string
	Count     int
}

func (*TooManyValuesForParamError) Error

type UnescapedCookieParamError

type UnescapedCookieParamError struct {
	ParamName string
	Err       error
}

func (*UnescapedCookieParamError) Error

func (e *UnescapedCookieParamError) Error() string

func (*UnescapedCookieParamError) Unwrap

func (e *UnescapedCookieParamError) Unwrap() error

type UnmarshalingParamError

type UnmarshalingParamError struct {
	ParamName string
	Err       error
}

func (*UnmarshalingParamError) Error

func (e *UnmarshalingParamError) Error() string

func (*UnmarshalingParamError) Unwrap

func (e *UnmarshalingParamError) Unwrap() error

Jump to

Keyboard shortcuts

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