Versions in this module Expand all Collapse all v1 v1.0.2 Sep 23, 2024 v1.0.1 Sep 3, 2024 v1.0.0 Jul 29, 2024 Changes in this version + const SubtopicWildcard + type Attribute struct + Channel string + Name string + PersistState bool + Subtopic string + type Definition struct + Attributes []Attribute + Created time.Time + Delta int64 + ID int + type Metadata map[string]interface + type Page struct + Twins []Twin + type PageMetadata struct + Limit uint64 + Offset uint64 + Total uint64 + type Service interface + AddTwin func(ctx context.Context, token string, twin Twin, def Definition) (tw Twin, err error) + ListStates func(ctx context.Context, token string, offset uint64, limit uint64, twinID string) (StatesPage, error) + ListTwins func(ctx context.Context, token string, offset uint64, limit uint64, name string, ...) (Page, error) + RemoveTwin func(ctx context.Context, token, twinID string) (err error) + SaveStates func(ctx context.Context, msg *messaging.Message) error + UpdateTwin func(ctx context.Context, token string, twin Twin, def Definition) (err error) + ViewTwin func(ctx context.Context, token, twinID string) (tw Twin, err error) + func New(publisher messaging.Publisher, auth magistrala.AuthServiceClient, ...) Service + type State struct + Created time.Time + Definition int + ID int64 + Payload map[string]interface{} + TwinID string + type StateRepository interface + Count func(ctx context.Context, twin Twin) (int64, error) + RetrieveAll func(ctx context.Context, offset uint64, limit uint64, twinID string) (StatesPage, error) + RetrieveLast func(ctx context.Context, twinID string) (State, error) + Save func(ctx context.Context, state State) error + Update func(ctx context.Context, state State) error + type StatesPage struct + States []State + type Twin struct + Created time.Time + Definitions []Definition + ID string + Metadata Metadata + Name string + Owner string + Revision int + Updated time.Time + type TwinCache interface + IDs func(ctx context.Context, channel, subtopic string) ([]string, error) + Remove func(ctx context.Context, twinID string) error + Save func(ctx context.Context, twin Twin) error + SaveIDs func(ctx context.Context, channel, subtopic string, twinIDs []string) error + Update func(ctx context.Context, twin Twin) error + type TwinRepository interface + Remove func(ctx context.Context, twinID string) error + RetrieveAll func(ctx context.Context, owner string, offset, limit uint64, name string, ...) (Page, error) + RetrieveByAttribute func(ctx context.Context, channel, subtopic string) ([]string, error) + RetrieveByID func(ctx context.Context, twinID string) (Twin, error) + Save func(ctx context.Context, twin Twin) (string, error) + Update func(ctx context.Context, twin Twin) error