openapi

package
v0.0.0-...-3752bed Latest Latest
Warning

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

Go to latest
Published: Feb 24, 2026 License: MIT Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func EncodeJSONResponse

func EncodeJSONResponse(i interface{}, status *int, w http.ResponseWriter) error

EncodeJSONResponse uses the json encoder to write an interface to the http response with an optional status code

func NewRouter

func NewRouter(routers ...Router) chi.Router

NewRouter creates a new router for any number of api routers

func ReadFormFileToTempFile

func ReadFormFileToTempFile(r *http.Request, key string) (*os.File, error)

ReadFormFileToTempFile reads file data from a request form and writes it to a temporary file

func ReadFormFilesToTempFiles

func ReadFormFilesToTempFiles(r *http.Request, key string) ([]*os.File, error)

ReadFormFilesToTempFiles reads files array data from a request form and writes it to a temporary files

Types

type AssetAdministrationShellBasicDiscoveryAPIAPIController

type AssetAdministrationShellBasicDiscoveryAPIAPIController struct {
	// contains filtered or unexported fields
}

AssetAdministrationShellBasicDiscoveryAPIAPIController binds http requests to an api service and writes the service results to the http response

func NewAssetAdministrationShellBasicDiscoveryAPIAPIController

NewAssetAdministrationShellBasicDiscoveryAPIAPIController creates a default api controller

func (*AssetAdministrationShellBasicDiscoveryAPIAPIController) DeleteAllAssetLinksByID

DeleteAllAssetLinksByID - Deletes all specific Asset identifiers linked to an Asset Administration Shell to edit discoverable content

func (c *AssetAdministrationShellBasicDiscoveryAPIAPIController) GetAllAssetAdministrationShellIdsByAssetLink(w http.ResponseWriter, r *http.Request)

GetAllAssetAdministrationShellIdsByAssetLink - Returns a list of Asset Administration Shell ids linked to specific Asset identifiers

func (*AssetAdministrationShellBasicDiscoveryAPIAPIController) GetAllAssetLinksByID

GetAllAssetLinksByID - Returns a list of specific Asset identifiers based on an Asset Administration Shell id to edit discoverable content

func (*AssetAdministrationShellBasicDiscoveryAPIAPIController) PostAllAssetLinksByID

PostAllAssetLinksByID - Creates specific Asset identifiers linked to an Asset Administration Shell to edit discoverable content

func (*AssetAdministrationShellBasicDiscoveryAPIAPIController) Routes

Routes returns all the api routes for the AssetAdministrationShellBasicDiscoveryAPIAPIController

func (c *AssetAdministrationShellBasicDiscoveryAPIAPIController) SearchAllAssetAdministrationShellIdsByAssetLink(w http.ResponseWriter, r *http.Request)

SearchAllAssetAdministrationShellIdsByAssetLink - Returns a list of Asset Administration Shell IDs linked to specific asset identifiers or the global asset ID

type AssetAdministrationShellBasicDiscoveryAPIAPIOption

type AssetAdministrationShellBasicDiscoveryAPIAPIOption func(*AssetAdministrationShellBasicDiscoveryAPIAPIController)

AssetAdministrationShellBasicDiscoveryAPIAPIOption for how the controller is set up.

func WithAssetAdministrationShellBasicDiscoveryAPIAPIErrorHandler

func WithAssetAdministrationShellBasicDiscoveryAPIAPIErrorHandler(h model.ErrorHandler) AssetAdministrationShellBasicDiscoveryAPIAPIOption

WithAssetAdministrationShellBasicDiscoveryAPIAPIErrorHandler inject ErrorHandler into controller

type AssetAdministrationShellBasicDiscoveryAPIAPIRouter

type AssetAdministrationShellBasicDiscoveryAPIAPIRouter interface {
	GetAllAssetAdministrationShellIdsByAssetLink(http.ResponseWriter, *http.Request)
	GetAllAssetLinksByID(http.ResponseWriter, *http.Request)
	PostAllAssetLinksByID(http.ResponseWriter, *http.Request)
	DeleteAllAssetLinksByID(http.ResponseWriter, *http.Request)
}

AssetAdministrationShellBasicDiscoveryAPIAPIRouter defines the required methods for binding the api requests to a responses for the AssetAdministrationShellBasicDiscoveryAPIAPI The AssetAdministrationShellBasicDiscoveryAPIAPIRouter implementation should parse necessary information from the http request, pass the data to a AssetAdministrationShellBasicDiscoveryAPIAPIServicer to perform the required actions, then write the service results to the http response.

type AssetAdministrationShellBasicDiscoveryAPIAPIServicer

type AssetAdministrationShellBasicDiscoveryAPIAPIServicer interface {
	GetAllAssetAdministrationShellIdsByAssetLink(context.Context, []string, int32, string) (model.ImplResponse, error)
	SearchAllAssetAdministrationShellIdsByAssetLink(ctx context.Context, limit int32, cursor string, assetLink []model.AssetLink) (model.ImplResponse, error)
	GetAllAssetLinksByID(context.Context, string) (model.ImplResponse, error)
	PostAllAssetLinksByID(context.Context, string, []types.ISpecificAssetID) (model.ImplResponse, error)
	DeleteAllAssetLinksByID(context.Context, string) (model.ImplResponse, error)
}

AssetAdministrationShellBasicDiscoveryAPIAPIServicer defines the api actions for the AssetAdministrationShellBasicDiscoveryAPIAPI service This interface intended to stay up to date with the openapi yaml used to generate it, while the service implementation can be ignored with the .openapi-generator-ignore file and updated with the logic required for the API.

type Constraint

type Constraint[T Number | string | bool] func(actual T) error

func WithMaximum

func WithMaximum[T Number](expected T) Constraint[T]

func WithMinimum

func WithMinimum[T Number](expected T) Constraint[T]

type DescriptionAPIAPIController

type DescriptionAPIAPIController struct {
	// contains filtered or unexported fields
}

DescriptionAPIAPIController binds http requests to an api service and writes the service results to the http response

func NewDescriptionAPIAPIController

func NewDescriptionAPIAPIController(s DescriptionAPIAPIServicer, opts ...DescriptionAPIAPIOption) *DescriptionAPIAPIController

NewDescriptionAPIAPIController creates a default api controller

func (*DescriptionAPIAPIController) GetDescription

func (c *DescriptionAPIAPIController) GetDescription(w http.ResponseWriter, r *http.Request)

GetDescription - Returns the self-describing information of a network resource (ServiceDescription)

func (*DescriptionAPIAPIController) Routes

func (c *DescriptionAPIAPIController) Routes() Routes

Routes returns all the api routes for the DescriptionAPIAPIController

type DescriptionAPIAPIOption

type DescriptionAPIAPIOption func(*DescriptionAPIAPIController)

DescriptionAPIAPIOption for how the controller is set up.

func WithDescriptionAPIAPIErrorHandler

func WithDescriptionAPIAPIErrorHandler(h model.ErrorHandler) DescriptionAPIAPIOption

WithDescriptionAPIAPIErrorHandler inject ErrorHandler into controller

type DescriptionAPIAPIRouter

type DescriptionAPIAPIRouter interface {
	GetDescription(http.ResponseWriter, *http.Request)
}

DescriptionAPIAPIRouter defines the required methods for binding the api requests to a responses for the DescriptionAPIAPI The DescriptionAPIAPIRouter implementation should parse necessary information from the http request, pass the data to a DescriptionAPIAPIServicer to perform the required actions, then write the service results to the http response.

type DescriptionAPIAPIService

type DescriptionAPIAPIService struct {
}

DescriptionAPIAPIService is a service that implements the logic for the DescriptionAPIAPIServicer This service should implement the business logic for every endpoint for the DescriptionAPIAPI API. Include any external packages or services that will be required by this service.

func NewDescriptionAPIAPIService

func NewDescriptionAPIAPIService() *DescriptionAPIAPIService

NewDescriptionAPIAPIService creates a default api service

func (*DescriptionAPIAPIService) GetDescription

func (s *DescriptionAPIAPIService) GetDescription(ctx context.Context) (model.ImplResponse, error)

GetDescription - Returns the self-describing information of a network resource (ServiceDescription)

type DescriptionAPIAPIServicer

type DescriptionAPIAPIServicer interface {
	GetDescription(context.Context) (model.ImplResponse, error)
}

DescriptionAPIAPIServicer defines the api actions for the DescriptionAPIAPI service This interface intended to stay up to date with the openapi yaml used to generate it, while the service implementation can be ignored with the .openapi-generator-ignore file and updated with the logic required for the API.

type Number

type Number interface {
	~int32 | ~int64 | ~float32 | ~float64
}

type OpenAPIOperation

type OpenAPIOperation[T Number | string | bool] func(actual string) (T, bool, error)

func WithDefaultOrParse

func WithDefaultOrParse[T Number | string | bool](def T, parse ParseString[T]) OpenAPIOperation[T]

func WithParse

func WithParse[T Number | string | bool](parse ParseString[T]) OpenAPIOperation[T]

func WithRequire

func WithRequire[T Number | string | bool](parse ParseString[T]) OpenAPIOperation[T]

type ParseString

type ParseString[T Number | string | bool] func(v string) (T, error)

type Route

type Route struct {
	Method      string
	Pattern     string
	HandlerFunc http.HandlerFunc
}

A Route defines the parameters for an api endpoint

type Router

type Router interface {
	Routes() Routes
}

Router defines the required methods for retrieving api routes

type Routes

type Routes map[string]Route

Routes is a map of defined api endpoints

Jump to

Keyboard shortcuts

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