Documentation ¶
Index ¶
- Constants
- func Debug(enabled string) func(*cbClient)
- func QueryEntities[T any](ctx context.Context, broker, tenant, entityType string, attributes []string, ...) (count int, err error)
- func RequestHeader(key string, value []string) func(*cbClient)
- func Tenant(tenant string) func(*cbClient)
- func UserAgent(useragent string) func(*cbClient)
- type AggregationDurationDecoratorFunc
- func ByDay() AggregationDurationDecoratorFunc
- func ByHour() AggregationDurationDecoratorFunc
- func ByMonth() AggregationDurationDecoratorFunc
- func ByWeek() AggregationDurationDecoratorFunc
- func Days(numberOfDays uint64) AggregationDurationDecoratorFunc
- func Hours(numberOfHours uint64) AggregationDurationDecoratorFunc
- func Minutes(numberOfMinutes uint64) AggregationDurationDecoratorFunc
- func Months(numberOfMonths uint64) AggregationDurationDecoratorFunc
- func Weeks(numberOfWeeks uint64) AggregationDurationDecoratorFunc
- type AggregationMethod
- type ContextBrokerClient
- type RequestDecoratorFunc
- func After(timeAt time.Time) RequestDecoratorFunc
- func Aggregation(aggrMethods []AggregationMethod, ...) RequestDecoratorFunc
- func Attributes(attrs []string) RequestDecoratorFunc
- func Before(timeAt time.Time) RequestDecoratorFunc
- func Between(timeAt, endTimeAt time.Time) RequestDecoratorFunc
- func IDs(ids []string) RequestDecoratorFunc
- func LastN(count uint64) RequestDecoratorFunc
- func NearPoint(distance int, lon, lat float64) RequestDecoratorFunc
- func Types(typeNames []string) RequestDecoratorFunc
Constants ¶
View Source
const ( TraceAttributeEntityID string = "entity-id" TraceAttributeNGSILDTenant string = "ngsild-tenant" )
Variables ¶
This section is empty.
Functions ¶
func QueryEntities ¶
func RequestHeader ¶
Types ¶
type AggregationDurationDecoratorFunc ¶
func ByDay ¶
func ByDay() AggregationDurationDecoratorFunc
func ByHour ¶
func ByHour() AggregationDurationDecoratorFunc
func ByMonth ¶
func ByMonth() AggregationDurationDecoratorFunc
func ByWeek ¶
func ByWeek() AggregationDurationDecoratorFunc
func Days ¶
func Days(numberOfDays uint64) AggregationDurationDecoratorFunc
func Hours ¶
func Hours(numberOfHours uint64) AggregationDurationDecoratorFunc
func Minutes ¶
func Minutes(numberOfMinutes uint64) AggregationDurationDecoratorFunc
func Months ¶
func Months(numberOfMonths uint64) AggregationDurationDecoratorFunc
func Weeks ¶
func Weeks(numberOfWeeks uint64) AggregationDurationDecoratorFunc
type AggregationMethod ¶
type AggregationMethod string
const ( AggregatedAverage AggregationMethod = "avg" AggregatedDistinctCount AggregationMethod = "distinctCount" AggregatedMax AggregationMethod = "max" AggregatedMin AggregationMethod = "min" AggregatedStdDev AggregationMethod = "stddev" AggregatedSum AggregationMethod = "sum" AggregatedSumOfSquares AggregationMethod = "sumsq" AggregatedTotalCount AggregationMethod = "totalCount" )
type ContextBrokerClient ¶
type ContextBrokerClient interface { CreateEntity(ctx context.Context, entity types.Entity, headers map[string][]string) (*ngsild.CreateEntityResult, error) QueryEntities(ctx context.Context, entityTypes, entityAttributes []string, query string, headers map[string][]string) (*ngsild.QueryEntitiesResult, error) RetrieveEntity(ctx context.Context, entityID string, headers map[string][]string) (types.Entity, error) QueryTemporalEvolutionOfEntities(ctx context.Context, headers map[string][]string, parameters ...RequestDecoratorFunc) (*ngsild.QueryTemporalEntitiesResult, error) RetrieveTemporalEvolutionOfEntity(ctx context.Context, entityID string, headers map[string][]string, parameters ...RequestDecoratorFunc) (*ngsild.RetrieveTemporalEvolutionOfEntityResult, error) MergeEntity(ctx context.Context, entityID string, fragment types.EntityFragment, headers map[string][]string) (*ngsild.MergeEntityResult, error) UpdateEntityAttributes(ctx context.Context, entityID string, fragment types.EntityFragment, headers map[string][]string) (*ngsild.UpdateEntityAttributesResult, error) DeleteEntity(ctx context.Context, entityID string) (*ngsild.DeleteEntityResult, error) }
func NewContextBrokerClient ¶
func NewContextBrokerClient(broker string, options ...func(*cbClient)) ContextBrokerClient
type RequestDecoratorFunc ¶
func After ¶
func After(timeAt time.Time) RequestDecoratorFunc
func Aggregation ¶
func Aggregation(aggrMethods []AggregationMethod, decorators ...AggregationDurationDecoratorFunc) RequestDecoratorFunc
func Attributes ¶
func Attributes(attrs []string) RequestDecoratorFunc
func Before ¶
func Before(timeAt time.Time) RequestDecoratorFunc
func Between ¶
func Between(timeAt, endTimeAt time.Time) RequestDecoratorFunc
func IDs ¶
func IDs(ids []string) RequestDecoratorFunc
func LastN ¶
func LastN(count uint64) RequestDecoratorFunc
func NearPoint ¶
func NearPoint(distance int, lon, lat float64) RequestDecoratorFunc
func Types ¶
func Types(typeNames []string) RequestDecoratorFunc
Click to show internal directories.
Click to hide internal directories.