openapi

package
v1.0.0-rc.2 Latest Latest
Warning

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

Go to latest
Published: May 22, 2026 License: MIT Imports: 23 Imported by: 0

Documentation

Overview

Package openapi Submodel Repository API

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrTypeAssertionError is thrown when type an interface does not match the asserted type
	ErrTypeAssertionError = errors.New("unable to assert type")
)

Functions

func AssertRecurseInterfaceRequired

func AssertRecurseInterfaceRequired[T any](obj interface{}, callback func(T) error) error

AssertRecurseInterfaceRequired recursively checks each struct in a slice against the callback. This method traverse nested slices in a preorder fashion.

func AssertRecurseValueRequired

func AssertRecurseValueRequired[T any](value reflect.Value, callback func(T) error) error

AssertRecurseValueRequired checks each struct in the nested slice against the callback. This method traverse nested slices in a preorder fashion. ErrTypeAssertionError is thrown if the underlying struct does not match type T.

func DefaultErrorHandler

func DefaultErrorHandler(w http.ResponseWriter, _ *http.Request, err error, result *model.ImplResponse)

DefaultErrorHandler defines the default logic on how to handle errors from the controller. Any errors from parsing request params will return a StatusBadRequest. Otherwise, the error code originating from the servicer will be used.

func EncodeJSONResponse

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

EncodeJSONResponse encodes a response as JSON and writes it to the HTTP response writer.

This function handles both file responses (detected by *os.File type) and JSON responses. For files, it sets appropriate Content-Type and Content-Disposition headers. For other types, it encodes the response as JSON with application/json content type.

Parameters:

  • i: The interface to encode (can be *os.File for file downloads or any JSON-serializable type)
  • status: Optional HTTP status code (uses 200 OK if nil)
  • w: The HTTP response writer

Returns:

  • error: An error if encoding or writing fails, nil on success

func IsZeroValue

func IsZeroValue(val interface{}) bool

IsZeroValue checks if the val is the zero-ed value.

func Logger

func Logger(inner http.Handler, name string) http.Handler

Logger wraps an HTTP handler to log request details including method, URI, handler name, and duration. It logs the HTTP method, request URI, the name of the handler, and the time taken to process the request.

func NewRouter

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

NewRouter creates a new chi router for any number of API routers.

This function initializes a chi router with logging middleware and CORS support, then registers all routes from the provided Router implementations.

Parameters:

  • routers: One or more Router implementations to register

Returns:

  • chi.Router: A configured chi router with all registered routes

func ReadFormFileToTempFile

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

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

The temporary file is created with the original filename as a prefix and a random suffix.

Parameters:

  • r: The HTTP request containing the multipart form data
  • key: The form field name containing the file

Returns:

  • *os.File: A pointer to the temporary file
  • error: An error if reading or writing fails

func ReadFormFilesToTempFiles

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

ReadFormFilesToTempFiles reads multiple files from a multipart form request and writes them to temporary files.

Parameters:

  • r: The HTTP request containing the multipart form data
  • key: The form field name containing the files

Returns:

  • []*os.File: A slice of pointers to the temporary files
  • error: An error if reading or writing fails

Types

type Constraint

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

Constraint is a generic function type for validating parameter values.

Parameters:

  • actual: The value to validate

Returns:

  • error: An error if validation fails, nil if the constraint is satisfied

func WithMaximum

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

WithMaximum creates a Constraint that validates a maximum value.

Parameters:

  • expected: The maximum allowed value

Returns:

  • Constraint[T]: A function that validates the actual value is <= the maximum

func WithMinimum

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

WithMinimum creates a Constraint that validates a minimum value.

Parameters:

  • expected: The minimum allowed value

Returns:

  • Constraint[T]: A function that validates the actual value is >= the minimum

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

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

GetSelfDescription - 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 ErrorHandler) DescriptionAPIAPIOption

WithDescriptionAPIAPIErrorHandler inject ErrorHandler into controller

type DescriptionAPIAPIRouter

type DescriptionAPIAPIRouter interface {
	GetSelfDescription(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 DescriptionAPIAPIServicer

type DescriptionAPIAPIServicer interface {
	GetSelfDescription(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 ErrorHandler

type ErrorHandler func(w http.ResponseWriter, r *http.Request, err error, result *model.ImplResponse)

ErrorHandler defines the required method for handling error. You may implement it and inject this into a controller if you would like errors to be handled differently from the DefaultErrorHandler

type FileDownload

type FileDownload struct {
	Content     []byte
	ContentType string
	Filename    string
}

FileDownload is a helper payload type for file downloads with custom content type.

type ImplResponse

type ImplResponse struct {
	Code int
	Body interface{}
}

ImplResponse defines an implementation response with error code and the associated body

func Response

func Response(code int, body interface{}) ImplResponse

Response return a ImplResponse struct filled

type Number

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

Number is a constraint interface for numeric types.

This interface restricts type parameters to numeric types (int32, int64, float32, float64) for use in generic parsing and validation functions.

type OpenAPIOperation

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

OpenAPIOperation is a generic function type for OpenAPI parameter operations.

This function type encapsulates parsing, validation, and default value handling for OpenAPI parameters.

Parameters:

  • actual: The actual string value from the request

Returns:

  • T: The parsed value of type T (constrained to Number, string, or bool)
  • bool: True if a default value was used, false otherwise
  • error: An error if parsing or validation fails

nolint:all

func WithDefaultOrParse

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

WithDefaultOrParse creates an OpenAPIOperation that uses a default value if the parameter is empty.

If the actual parameter is empty, the default value is returned. Otherwise, the value is parsed.

Parameters:

  • def: The default value to use when the parameter is empty
  • parse: The parsing function to apply to non-empty values

Returns:

  • OpenAPIOperation[T]: A function that provides default value handling and parses non-empty values

func WithParse

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

WithParse creates an OpenAPIOperation that simply parses the value without defaults or requirements.

Parameters:

  • parse: The parsing function to apply to the value

Returns:

  • OpenAPIOperation[T]: A function that parses the value without additional constraints

func WithRequire

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

WithRequire creates an OpenAPIOperation that requires a non-empty value.

If the actual parameter is empty, an error is returned indicating the required parameter is missing.

Parameters:

  • parse: The parsing function to apply to non-empty values

Returns:

  • OpenAPIOperation[T]: A function that enforces the required constraint and parses the value

type ParseString

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

ParseString is a generic function type for parsing string values to specific types.

Parameters:

  • v: The string value to parse

Returns:

  • T: The parsed value of type T (constrained to Number, string, or bool)
  • error: An error if parsing fails

type ParsingError

type ParsingError struct {
	Param string
	Err   error
}

ParsingError indicates that an error has occurred when parsing request parameters

func (*ParsingError) Error

func (e *ParsingError) Error() string

func (*ParsingError) Unwrap

func (e *ParsingError) Unwrap() error

type Redirect

type Redirect struct {
	Location string
}

Redirect is a helper payload type that signals the response encoder to send an HTTP redirect.

type RequiredError

type RequiredError struct {
	Field string
}

RequiredError indicates that an error has occurred when parsing request parameters

func (*RequiredError) Error

func (e *RequiredError) Error() string

type Route

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

Route defines the parameters for an API endpoint.

It encapsulates the HTTP method, URL pattern, and handler function for a single API route in the Submodel Repository Service.

type Router

type Router interface {
	Routes() Routes
}

Router defines the required methods for retrieving API routes.

Implementations of this interface provide the route definitions for their respective API controllers in the Submodel Repository Service.

type Routes

type Routes map[string]Route

Routes is a map of defined API endpoints.

The map key is a unique identifier for the route, and the value contains the route's method, pattern, and handler function.

type SerializationAPIAPIController

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

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

func NewSerializationAPIAPIController

func NewSerializationAPIAPIController(s SerializationAPIAPIServicer, contextPath string, opts ...SerializationAPIAPIOption) *SerializationAPIAPIController

NewSerializationAPIAPIController creates a default api controller

func (*SerializationAPIAPIController) GenerateSerializationByIds

func (c *SerializationAPIAPIController) GenerateSerializationByIds(w http.ResponseWriter, r *http.Request)

GenerateSerializationByIds - Returns an appropriate serialization based on the specified format (see SerializationFormat)

func (*SerializationAPIAPIController) Routes

Routes returns all the api routes for the SerializationAPIAPIController

type SerializationAPIAPIOption

type SerializationAPIAPIOption func(*SerializationAPIAPIController)

SerializationAPIAPIOption for how the controller is set up.

func WithSerializationAPIAPIErrorHandler

func WithSerializationAPIAPIErrorHandler(h ErrorHandler) SerializationAPIAPIOption

WithSerializationAPIAPIErrorHandler inject ErrorHandler into controller

type SerializationAPIAPIRouter

type SerializationAPIAPIRouter interface {
	GenerateSerializationByIds(http.ResponseWriter, *http.Request)
}

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

type SerializationAPIAPIService

type SerializationAPIAPIService struct {
}

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

func NewSerializationAPIAPIService

func NewSerializationAPIAPIService() *SerializationAPIAPIService

NewSerializationAPIAPIService creates a default api service

func (*SerializationAPIAPIService) GenerateSerializationByIds

func (s *SerializationAPIAPIService) GenerateSerializationByIds(_ context.Context, _ []string, _ []string, _ bool) (ImplResponse, error)

GenerateSerializationByIds - Returns an appropriate serialization based on the specified format (see SerializationFormat)

type SerializationAPIAPIServicer

type SerializationAPIAPIServicer interface {
	GenerateSerializationByIds(context.Context, []string, []string, bool) (model.ImplResponse, error)
}

SerializationAPIAPIServicer defines the api actions for the SerializationAPIAPI 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 SubmodelRepositoryAPIAPIController

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

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

func NewSubmodelRepositoryAPIAPIController

func NewSubmodelRepositoryAPIAPIController(s SubmodelRepositoryAPIAPIServicer, contextPath string, strictVerification string, opts ...SubmodelRepositoryAPIAPIOption) *SubmodelRepositoryAPIAPIController

NewSubmodelRepositoryAPIAPIController creates a default api controller

func (*SubmodelRepositoryAPIAPIController) DeleteFileByPathSubmodelRepo

func (c *SubmodelRepositoryAPIAPIController) DeleteFileByPathSubmodelRepo(w http.ResponseWriter, r *http.Request)

DeleteFileByPathSubmodelRepo - Deletes file content of an existing submodel element at a specified path within submodel elements hierarchy

func (*SubmodelRepositoryAPIAPIController) DeleteSubmodelByID

func (c *SubmodelRepositoryAPIAPIController) DeleteSubmodelByID(w http.ResponseWriter, r *http.Request)

DeleteSubmodelByID - Deletes a Submodel

func (*SubmodelRepositoryAPIAPIController) DeleteSubmodelElementByPathSubmodelRepo

func (c *SubmodelRepositoryAPIAPIController) DeleteSubmodelElementByPathSubmodelRepo(w http.ResponseWriter, r *http.Request)

DeleteSubmodelElementByPathSubmodelRepo - Deletes a submodel element at a specified path within the submodel elements hierarchy

func (*SubmodelRepositoryAPIAPIController) GetAllSubmodelElements

func (c *SubmodelRepositoryAPIAPIController) GetAllSubmodelElements(w http.ResponseWriter, r *http.Request)

GetAllSubmodelElements - Returns all submodel elements including their hierarchy

func (*SubmodelRepositoryAPIAPIController) GetAllSubmodelElementsMetadataSubmodelRepo

func (c *SubmodelRepositoryAPIAPIController) GetAllSubmodelElementsMetadataSubmodelRepo(w http.ResponseWriter, r *http.Request)

GetAllSubmodelElementsMetadataSubmodelRepo - Returns the metadata attributes of all submodel elements including their hierarchy

func (*SubmodelRepositoryAPIAPIController) GetAllSubmodelElementsPathSubmodelRepo

func (c *SubmodelRepositoryAPIAPIController) GetAllSubmodelElementsPathSubmodelRepo(w http.ResponseWriter, r *http.Request)

GetAllSubmodelElementsPathSubmodelRepo - Returns all submodel elements including their hierarchy in the Path notation

func (*SubmodelRepositoryAPIAPIController) GetAllSubmodelElementsReferenceSubmodelRepo

func (c *SubmodelRepositoryAPIAPIController) GetAllSubmodelElementsReferenceSubmodelRepo(w http.ResponseWriter, r *http.Request)

GetAllSubmodelElementsReferenceSubmodelRepo - Returns the References of all submodel elements

func (*SubmodelRepositoryAPIAPIController) GetAllSubmodelElementsValueOnlySubmodelRepo

func (c *SubmodelRepositoryAPIAPIController) GetAllSubmodelElementsValueOnlySubmodelRepo(w http.ResponseWriter, r *http.Request)

GetAllSubmodelElementsValueOnlySubmodelRepo - Returns all submodel elements including their hierarchy in the ValueOnly representation

func (*SubmodelRepositoryAPIAPIController) GetAllSubmodels

GetAllSubmodels - Returns all Submodels

func (*SubmodelRepositoryAPIAPIController) GetAllSubmodelsMetadata

func (c *SubmodelRepositoryAPIAPIController) GetAllSubmodelsMetadata(w http.ResponseWriter, r *http.Request)

GetAllSubmodelsMetadata - Returns the metadata attributes of all Submodels

func (*SubmodelRepositoryAPIAPIController) GetAllSubmodelsPath

func (c *SubmodelRepositoryAPIAPIController) GetAllSubmodelsPath(w http.ResponseWriter, r *http.Request)

GetAllSubmodelsPath - Returns all Submodels in the Path notation

func (*SubmodelRepositoryAPIAPIController) GetAllSubmodelsReference

func (c *SubmodelRepositoryAPIAPIController) GetAllSubmodelsReference(w http.ResponseWriter, r *http.Request)

GetAllSubmodelsReference - Returns the References for all Submodels

func (*SubmodelRepositoryAPIAPIController) GetAllSubmodelsValueOnly

func (c *SubmodelRepositoryAPIAPIController) GetAllSubmodelsValueOnly(w http.ResponseWriter, r *http.Request)

GetAllSubmodelsValueOnly - Returns all Submodels in their ValueOnly representation

func (*SubmodelRepositoryAPIAPIController) GetFileByPathSubmodelRepo

func (c *SubmodelRepositoryAPIAPIController) GetFileByPathSubmodelRepo(w http.ResponseWriter, r *http.Request)

GetFileByPathSubmodelRepo - Downloads file content from a specific submodel element from the Submodel at a specified path

func (*SubmodelRepositoryAPIAPIController) GetOperationAsyncResult

func (c *SubmodelRepositoryAPIAPIController) GetOperationAsyncResult(w http.ResponseWriter, r *http.Request)

GetOperationAsyncResult - Returns the Operation result of an asynchronously invoked Operation

func (*SubmodelRepositoryAPIAPIController) GetOperationAsyncResultValueOnly

func (c *SubmodelRepositoryAPIAPIController) GetOperationAsyncResultValueOnly(w http.ResponseWriter, r *http.Request)

GetOperationAsyncResultValueOnly - Returns the Operation result of an asynchronously invoked Operation

func (*SubmodelRepositoryAPIAPIController) GetOperationAsyncStatus

func (c *SubmodelRepositoryAPIAPIController) GetOperationAsyncStatus(w http.ResponseWriter, r *http.Request)

GetOperationAsyncStatus - Returns the status of an asynchronously invoked Operation

func (*SubmodelRepositoryAPIAPIController) GetSignedSubmodelByID

func (c *SubmodelRepositoryAPIAPIController) GetSignedSubmodelByID(w http.ResponseWriter, r *http.Request)

GetSignedSubmodelByID - Returns a specific Submodel

func (*SubmodelRepositoryAPIAPIController) GetSignedSubmodelByIDValueOnly

func (c *SubmodelRepositoryAPIAPIController) GetSignedSubmodelByIDValueOnly(w http.ResponseWriter, r *http.Request)

GetSignedSubmodelByIDValueOnly - Returns a specific Submodel in ValueOnly representation

func (*SubmodelRepositoryAPIAPIController) GetSubmodelByID

GetSubmodelByID - Returns a specific Submodel

func (*SubmodelRepositoryAPIAPIController) GetSubmodelByIDMetadata

func (c *SubmodelRepositoryAPIAPIController) GetSubmodelByIDMetadata(w http.ResponseWriter, r *http.Request)

GetSubmodelByIDMetadata - Returns the metadata attributes of a specific Submodel

func (*SubmodelRepositoryAPIAPIController) GetSubmodelByIDPath

func (c *SubmodelRepositoryAPIAPIController) GetSubmodelByIDPath(w http.ResponseWriter, r *http.Request)

GetSubmodelByIDPath - Returns a specific Submodel in the Path notation

func (*SubmodelRepositoryAPIAPIController) GetSubmodelByIDReference

func (c *SubmodelRepositoryAPIAPIController) GetSubmodelByIDReference(w http.ResponseWriter, r *http.Request)

GetSubmodelByIDReference - Returns the Reference of a specific Submodel

func (*SubmodelRepositoryAPIAPIController) GetSubmodelByIDValueOnly

func (c *SubmodelRepositoryAPIAPIController) GetSubmodelByIDValueOnly(w http.ResponseWriter, r *http.Request)

GetSubmodelByIDValueOnly - Returns a specific Submodel in the ValueOnly representation

func (*SubmodelRepositoryAPIAPIController) GetSubmodelElementByPathMetadataSubmodelRepo

func (c *SubmodelRepositoryAPIAPIController) GetSubmodelElementByPathMetadataSubmodelRepo(w http.ResponseWriter, r *http.Request)

GetSubmodelElementByPathMetadataSubmodelRepo - Returns the matadata attributes of a specific submodel element from the Submodel at a specified path

func (*SubmodelRepositoryAPIAPIController) GetSubmodelElementByPathPathSubmodelRepo

func (c *SubmodelRepositoryAPIAPIController) GetSubmodelElementByPathPathSubmodelRepo(w http.ResponseWriter, r *http.Request)

GetSubmodelElementByPathPathSubmodelRepo - Returns a specific submodel element from the Submodel at a specified path in the Path notation

func (*SubmodelRepositoryAPIAPIController) GetSubmodelElementByPathReferenceSubmodelRepo

func (c *SubmodelRepositoryAPIAPIController) GetSubmodelElementByPathReferenceSubmodelRepo(w http.ResponseWriter, r *http.Request)

GetSubmodelElementByPathReferenceSubmodelRepo - Returns the Reference of a specific submodel element from the Submodel at a specified path

func (*SubmodelRepositoryAPIAPIController) GetSubmodelElementByPathSubmodelRepo

func (c *SubmodelRepositoryAPIAPIController) GetSubmodelElementByPathSubmodelRepo(w http.ResponseWriter, r *http.Request)

GetSubmodelElementByPathSubmodelRepo - Returns a specific submodel element from the Submodel at a specified path

func (*SubmodelRepositoryAPIAPIController) GetSubmodelElementByPathValueOnlySubmodelRepo

func (c *SubmodelRepositoryAPIAPIController) GetSubmodelElementByPathValueOnlySubmodelRepo(w http.ResponseWriter, r *http.Request)

GetSubmodelElementByPathValueOnlySubmodelRepo - Returns a specific submodel element from the Submodel at a specified path in the ValueOnly representation

func (*SubmodelRepositoryAPIAPIController) InvokeOperationAsync

func (c *SubmodelRepositoryAPIAPIController) InvokeOperationAsync(w http.ResponseWriter, r *http.Request)

InvokeOperationAsync - Asynchronously invokes an Operation at a specified path

func (*SubmodelRepositoryAPIAPIController) InvokeOperationAsyncValueOnly

func (c *SubmodelRepositoryAPIAPIController) InvokeOperationAsyncValueOnly(w http.ResponseWriter, r *http.Request)

InvokeOperationAsyncValueOnly - Asynchronously invokes an Operation at a specified path

func (*SubmodelRepositoryAPIAPIController) InvokeOperationSubmodelRepo

func (c *SubmodelRepositoryAPIAPIController) InvokeOperationSubmodelRepo(w http.ResponseWriter, r *http.Request)

InvokeOperationSubmodelRepo - Synchronously or asynchronously invokes an Operation at a specified path

func (*SubmodelRepositoryAPIAPIController) InvokeOperationValueOnly

func (c *SubmodelRepositoryAPIAPIController) InvokeOperationValueOnly(w http.ResponseWriter, r *http.Request)

InvokeOperationValueOnly - Synchronously or asynchronously invokes an Operation at a specified path

func (*SubmodelRepositoryAPIAPIController) PatchSubmodelByID

PatchSubmodelByID - Updates an existing Submodel

func (*SubmodelRepositoryAPIAPIController) PatchSubmodelByIDMetadata

func (c *SubmodelRepositoryAPIAPIController) PatchSubmodelByIDMetadata(w http.ResponseWriter, r *http.Request)

PatchSubmodelByIDMetadata - Updates the metadata attributes of an existing Submodel

func (*SubmodelRepositoryAPIAPIController) PatchSubmodelByIDValueOnly

func (c *SubmodelRepositoryAPIAPIController) PatchSubmodelByIDValueOnly(w http.ResponseWriter, r *http.Request)

PatchSubmodelByIDValueOnly - Updates the values of an existing Submodel

func (*SubmodelRepositoryAPIAPIController) PatchSubmodelElementByPathMetadataSubmodelRepo

func (c *SubmodelRepositoryAPIAPIController) PatchSubmodelElementByPathMetadataSubmodelRepo(w http.ResponseWriter, r *http.Request)

PatchSubmodelElementByPathMetadataSubmodelRepo - Updates the metadata attributes an existing SubmodelElement

func (*SubmodelRepositoryAPIAPIController) PatchSubmodelElementByPathSubmodelRepo

func (c *SubmodelRepositoryAPIAPIController) PatchSubmodelElementByPathSubmodelRepo(w http.ResponseWriter, r *http.Request)

PatchSubmodelElementByPathSubmodelRepo - Updates an existing SubmodelElement

func (*SubmodelRepositoryAPIAPIController) PatchSubmodelElementByPathValueOnlySubmodelRepo

func (c *SubmodelRepositoryAPIAPIController) PatchSubmodelElementByPathValueOnlySubmodelRepo(w http.ResponseWriter, r *http.Request)

PatchSubmodelElementByPathValueOnlySubmodelRepo - Updates the value of an existing SubmodelElement

func (*SubmodelRepositoryAPIAPIController) PostSubmodel

PostSubmodel - Creates a new Submodel

func (*SubmodelRepositoryAPIAPIController) PostSubmodelElementByPathSubmodelRepo

func (c *SubmodelRepositoryAPIAPIController) PostSubmodelElementByPathSubmodelRepo(w http.ResponseWriter, r *http.Request)

PostSubmodelElementByPathSubmodelRepo - Creates a new submodel element at a specified path within submodel elements hierarchy

func (*SubmodelRepositoryAPIAPIController) PostSubmodelElementSubmodelRepo

func (c *SubmodelRepositoryAPIAPIController) PostSubmodelElementSubmodelRepo(w http.ResponseWriter, r *http.Request)

PostSubmodelElementSubmodelRepo - Creates a new submodel element

func (*SubmodelRepositoryAPIAPIController) PutFileByPathSubmodelRepo

func (c *SubmodelRepositoryAPIAPIController) PutFileByPathSubmodelRepo(w http.ResponseWriter, r *http.Request)

PutFileByPathSubmodelRepo - Uploads file content to an existing submodel element at a specified path within submodel elements hierarchy

func (*SubmodelRepositoryAPIAPIController) PutSubmodelByID

PutSubmodelByID - Updates an existing Submodel

func (*SubmodelRepositoryAPIAPIController) PutSubmodelElementByPathSubmodelRepo

func (c *SubmodelRepositoryAPIAPIController) PutSubmodelElementByPathSubmodelRepo(w http.ResponseWriter, r *http.Request)

PutSubmodelElementByPathSubmodelRepo - Updates an existing submodel element at a specified path within submodel elements hierarchy

func (*SubmodelRepositoryAPIAPIController) QuerySubmodels

QuerySubmodels - Returns all Submodels that match the input query

func (*SubmodelRepositoryAPIAPIController) Routes

Routes returns all the api routes for the SubmodelRepositoryAPIAPIController

type SubmodelRepositoryAPIAPIOption

type SubmodelRepositoryAPIAPIOption func(*SubmodelRepositoryAPIAPIController)

SubmodelRepositoryAPIAPIOption for how the controller is set up.

func WithSubmodelRepositoryAPIAPIErrorHandler

func WithSubmodelRepositoryAPIAPIErrorHandler(h ErrorHandler) SubmodelRepositoryAPIAPIOption

WithSubmodelRepositoryAPIAPIErrorHandler inject ErrorHandler into controller

type SubmodelRepositoryAPIAPIRouter

type SubmodelRepositoryAPIAPIRouter interface {
	QuerySubmodels(http.ResponseWriter, *http.Request)
	GetAllSubmodels(http.ResponseWriter, *http.Request)
	PostSubmodel(http.ResponseWriter, *http.Request)
	GetAllSubmodelsMetadata(http.ResponseWriter, *http.Request)
	GetAllSubmodelsValueOnly(http.ResponseWriter, *http.Request)
	GetAllSubmodelsReference(http.ResponseWriter, *http.Request)
	GetAllSubmodelsPath(http.ResponseWriter, *http.Request)
	GetSubmodelByID(http.ResponseWriter, *http.Request)
	PutSubmodelByID(http.ResponseWriter, *http.Request)
	DeleteSubmodelByID(http.ResponseWriter, *http.Request)
	PatchSubmodelByID(http.ResponseWriter, *http.Request)
	GetSubmodelByIDMetadata(http.ResponseWriter, *http.Request)
	PatchSubmodelByIDMetadata(http.ResponseWriter, *http.Request)
	GetSubmodelByIDValueOnly(http.ResponseWriter, *http.Request)
	PatchSubmodelByIDValueOnly(http.ResponseWriter, *http.Request)
	GetSubmodelByIDReference(http.ResponseWriter, *http.Request)
	GetSubmodelByIDPath(http.ResponseWriter, *http.Request)
	GetAllSubmodelElements(http.ResponseWriter, *http.Request)
	PostSubmodelElementSubmodelRepo(http.ResponseWriter, *http.Request)
	GetAllSubmodelElementsMetadataSubmodelRepo(http.ResponseWriter, *http.Request)
	GetAllSubmodelElementsValueOnlySubmodelRepo(http.ResponseWriter, *http.Request)
	GetAllSubmodelElementsReferenceSubmodelRepo(http.ResponseWriter, *http.Request)
	GetAllSubmodelElementsPathSubmodelRepo(http.ResponseWriter, *http.Request)
	GetSubmodelElementByPathSubmodelRepo(http.ResponseWriter, *http.Request)
	PutSubmodelElementByPathSubmodelRepo(http.ResponseWriter, *http.Request)
	PostSubmodelElementByPathSubmodelRepo(http.ResponseWriter, *http.Request)
	DeleteSubmodelElementByPathSubmodelRepo(http.ResponseWriter, *http.Request)
	PatchSubmodelElementByPathSubmodelRepo(http.ResponseWriter, *http.Request)
	GetSubmodelElementByPathMetadataSubmodelRepo(http.ResponseWriter, *http.Request)
	PatchSubmodelElementByPathMetadataSubmodelRepo(http.ResponseWriter, *http.Request)
	GetSubmodelElementByPathValueOnlySubmodelRepo(http.ResponseWriter, *http.Request)
	PatchSubmodelElementByPathValueOnlySubmodelRepo(http.ResponseWriter, *http.Request)
	GetSubmodelElementByPathReferenceSubmodelRepo(http.ResponseWriter, *http.Request)
	GetSubmodelElementByPathPathSubmodelRepo(http.ResponseWriter, *http.Request)
	GetFileByPathSubmodelRepo(http.ResponseWriter, *http.Request)
	PutFileByPathSubmodelRepo(http.ResponseWriter, *http.Request)
	DeleteFileByPathSubmodelRepo(http.ResponseWriter, *http.Request)
	InvokeOperationSubmodelRepo(http.ResponseWriter, *http.Request)
	InvokeOperationValueOnly(http.ResponseWriter, *http.Request)
	InvokeOperationAsync(http.ResponseWriter, *http.Request)
	InvokeOperationAsyncValueOnly(http.ResponseWriter, *http.Request)
	GetOperationAsyncStatus(http.ResponseWriter, *http.Request)
	GetOperationAsyncResult(http.ResponseWriter, *http.Request)
	GetOperationAsyncResultValueOnly(http.ResponseWriter, *http.Request)
}

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

type SubmodelRepositoryAPIAPIServicer

type SubmodelRepositoryAPIAPIServicer interface {
	QuerySubmodels(context.Context, int32, string, grammar.Query) (model.ImplResponse, error)
	GetAllSubmodels(context.Context, string, string, int32, string, string, string) (model.ImplResponse, error)
	PostSubmodel(context.Context, types.ISubmodel) (model.ImplResponse, error)
	GetAllSubmodelsMetadata(context.Context, string, string, int32, string) (model.ImplResponse, error)
	GetAllSubmodelsValueOnly(context.Context, string, string, int32, string, string, string) (model.ImplResponse, error)
	GetAllSubmodelsReference(context.Context, string, string, int32, string, string) (model.ImplResponse, error)
	GetAllSubmodelsPath(context.Context, string, string, int32, string, string) (model.ImplResponse, error)
	GetSubmodelByID(context.Context, string, string, string) (model.ImplResponse, error)
	GetSignedSubmodelByID(context.Context, string, string, string) (model.ImplResponse, error)
	GetSignedSubmodelByIDValueOnly(context.Context, string, string, string) (model.ImplResponse, error)
	PutSubmodelByID(context.Context, string, types.ISubmodel) (model.ImplResponse, error)
	DeleteSubmodelByID(context.Context, string) (model.ImplResponse, error)
	PatchSubmodelByID(context.Context, string, types.ISubmodel, string) (model.ImplResponse, error)
	GetSubmodelByIDMetadata(context.Context, string) (model.ImplResponse, error)
	PatchSubmodelByIDMetadata(context.Context, string, model.SubmodelMetadata) (model.ImplResponse, error)
	GetSubmodelByIDValueOnly(context.Context, string, string, string) (model.ImplResponse, error)
	PatchSubmodelByIDValueOnly(context.Context, string, model.SubmodelValue, string) (model.ImplResponse, error)
	GetSubmodelByIDReference(context.Context, string) (model.ImplResponse, error)
	GetSubmodelByIDPath(context.Context, string, string) (model.ImplResponse, error)
	GetAllSubmodelElements(context.Context, string, int32, string, string, string) (model.ImplResponse, error)
	PostSubmodelElementSubmodelRepo(context.Context, string, types.ISubmodelElement) (model.ImplResponse, error)
	GetAllSubmodelElementsMetadataSubmodelRepo(context.Context, string, int32, string) (model.ImplResponse, error)
	GetAllSubmodelElementsValueOnlySubmodelRepo(context.Context, string, int32, string, string, string) (model.ImplResponse, error)
	GetAllSubmodelElementsReferenceSubmodelRepo(context.Context, string, int32, string, string) (model.ImplResponse, error)
	GetAllSubmodelElementsPathSubmodelRepo(context.Context, string, int32, string, string) (model.ImplResponse, error)
	GetSubmodelElementByPathSubmodelRepo(context.Context, string, string, string, string) (model.ImplResponse, error)
	PutSubmodelElementByPathSubmodelRepo(context.Context, string, string, types.ISubmodelElement, string) (model.ImplResponse, error)
	PostSubmodelElementByPathSubmodelRepo(context.Context, string, string, types.ISubmodelElement) (model.ImplResponse, error)
	DeleteSubmodelElementByPathSubmodelRepo(context.Context, string, string) (model.ImplResponse, error)
	PatchSubmodelElementByPathSubmodelRepo(context.Context, string, string, types.ISubmodelElement, string) (model.ImplResponse, error)
	GetSubmodelElementByPathMetadataSubmodelRepo(context.Context, string, string) (model.ImplResponse, error)
	PatchSubmodelElementByPathMetadataSubmodelRepo(context.Context, string, string, model.SubmodelElementMetadata) (model.ImplResponse, error)
	GetSubmodelElementByPathValueOnlySubmodelRepo(context.Context, string, string, string, string) (model.ImplResponse, error)
	PatchSubmodelElementByPathValueOnlySubmodelRepo(context.Context, string, string, model.SubmodelElementValue, string) (model.ImplResponse, error)
	GetSubmodelElementByPathReferenceSubmodelRepo(context.Context, string, string) (model.ImplResponse, error)
	GetSubmodelElementByPathPathSubmodelRepo(context.Context, string, string, string) (model.ImplResponse, error)
	GetFileByPathSubmodelRepo(context.Context, string, string) (model.ImplResponse, error)
	PutFileByPathSubmodelRepo(context.Context, string, string, string, *os.File) (model.ImplResponse, error)
	DeleteFileByPathSubmodelRepo(context.Context, string, string) (model.ImplResponse, error)
	InvokeOperationSubmodelRepo(context.Context, string, string, model.OperationRequest, bool) (model.ImplResponse, error)
	InvokeOperationValueOnly(context.Context, string, string, string, model.OperationRequestValueOnly, bool) (model.ImplResponse, error)
	InvokeOperationAsync(context.Context, string, string, model.OperationRequest) (model.ImplResponse, error)
	InvokeOperationAsyncValueOnly(context.Context, string, string, string, model.OperationRequestValueOnly) (model.ImplResponse, error)
	GetOperationAsyncStatus(context.Context, string, string, string) (model.ImplResponse, error)
	GetOperationAsyncResult(context.Context, string, string, string) (model.ImplResponse, error)
	GetOperationAsyncResultValueOnly(context.Context, string, string, string) (model.ImplResponse, error)
}

SubmodelRepositoryAPIAPIServicer defines the api actions for the SubmodelRepositoryAPIAPI 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.

Jump to

Keyboard shortcuts

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