ngsild

package
v0.0.0-...-f90bd80 Latest Latest
Warning

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

Go to latest
Published: Apr 24, 2024 License: AGPL-3.0 Imports: 28 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TraceAttributeEntityID     string = "entity-id"
	TraceAttributeNGSILDTenant string = "ngsild-tenant"
)
View Source
const DefaultContext string = `` /* 143-byte string literal not displayed */

TODO: Load from file in file system instead of hardcoding a constant

Variables

This section is empty.

Functions

func GetTenantFromContext

func GetTenantFromContext(ctx context.Context) string

GetTenantFromContext extracts the tenant name, if any, from the provided context

func NGSIMiddleware

func NGSIMiddleware() func(http.Handler) http.Handler

NGSIMiddleware packs any tenant id into the context

func NewCreateEntityHandler

func NewCreateEntityHandler(
	contextInformationManager cim.EntityCreator,
	authenticator auth.Enticator,
	logger *slog.Logger,
	onsuccess CreateEntityCompletionCallback) http.HandlerFunc

NewCreateEntityHandler handles incoming POST requests for NGSI entities

func NewDeleteEntityHandler

func NewDeleteEntityHandler(
	contextInformationManager cim.EntityDeleter,
	authenticator auth.Enticator,
	logger *slog.Logger) http.HandlerFunc

func NewMergeEntityHandler

func NewMergeEntityHandler(
	contextInformationManager cim.EntityMerger,
	authenticator auth.Enticator,
	logger *slog.Logger) http.HandlerFunc

NewMergeEntityHandler handles PATCH requests for NGSI entitities

func NewQueryEntitiesHandler

func NewQueryEntitiesHandler(
	contextInformationManager cim.EntityQuerier,
	authenticator auth.Enticator,
	logger *slog.Logger) http.HandlerFunc

NewQueryEntitiesHandler handles GET requests for NGSI entities

func NewQueryTemporalEvolutionOfEntitiesHandler

func NewQueryTemporalEvolutionOfEntitiesHandler(
	contextInformationManager cim.EntityTemporalQuerier,
	authenticator auth.Enticator,
	logger *slog.Logger) http.HandlerFunc

func NewRetrieveAvailableEntityTypesHandler

func NewRetrieveAvailableEntityTypesHandler(
	contextInformationManager cim.TypesRetriever,
	authenticator auth.Enticator,
	logger *slog.Logger) http.HandlerFunc

NewRetrieveAvailableEntityTypesHandler handles GET requests for the entity types available in this NGSI-LD system

func NewRetrieveEntityHandler

func NewRetrieveEntityHandler(
	contextInformationManager cim.EntityRetriever,
	authenticator auth.Enticator,
	logger *slog.Logger) http.HandlerFunc

NewRetrieveEntityHandler retrieves entity by ID.

func NewRetrieveTemporalEvolutionOfAnEntityHandler

func NewRetrieveTemporalEvolutionOfAnEntityHandler(
	contextInformationManager cim.EntityTemporalRetriever,
	authenticator auth.Enticator,
	logger *slog.Logger) http.HandlerFunc

func NewServeContextHandler

func NewServeContextHandler(logger *slog.Logger) http.HandlerFunc

func NewTemporalQueryParamsFromRequest

func NewTemporalQueryParamsFromRequest(r *http.Request) (cim.TemporalQueryParams, error)

func NewUpdateEntityAttributesHandler

func NewUpdateEntityAttributesHandler(
	contextInformationManager cim.EntityAttributesUpdater,
	authenticator auth.Enticator,
	logger *slog.Logger) http.HandlerFunc

NewUpdateEntityAttributesHandler handles PATCH requests for NGSI entitity attributes

func RegisterHandlers

func RegisterHandlers(ctx context.Context, r chi.Router, policies io.Reader, app cim.ContextInformationManager) error

Types

type CreateEntityCompletionCallback

type CreateEntityCompletionCallback func(ctx context.Context, entityType, entityID string, logger *slog.Logger)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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