Versions in this module Expand all Collapse all v0 v0.0.1 Oct 16, 2020 Changes in this version + var ErrCerts = errors.New("failed to fetch certs data") + var ErrCertsRemove = errors.New("failed to remove certificate") + var ErrFailedCertUpdate = errors.New("failed to update certs in bootstrap config") + var ErrFailedConnect = errors.New("failed to connect thing to channel") + var ErrFailedCreation = errors.New("failed to create entity") + var ErrFailedDisconnect = errors.New("failed to disconnect thing from channel") + var ErrFailedFetch = errors.New("failed to fetch entity") + var ErrFailedPublish = errors.New("failed to publish message") + var ErrFailedRead = errors.New("failed to read messages") + var ErrFailedRemoval = errors.New("failed to remove entity") + var ErrFailedUpdate = errors.New("failed to update entity") + var ErrFailedUserAdd = errors.New("failed to add user to group") + var ErrFailedWhitelist = errors.New("failed to whitelist") + var ErrFetchVersion = errors.New("failed to fetch version") + var ErrInvalidContentType = errors.New("Unknown Content Type") + var ErrUnauthorized = errors.New("unauthorized, missing credentials") + type BootstrapConfig struct + CACert string + Channels []string + ClientCert string + ClientKey string + Content string + ExternalID string + ExternalKey string + MFChannels []Channel + MFKey string + MFThing string + Name string + State int + ThingID string + type Cert struct + CACert string + ClientCert string + ClientKey string + type Channel struct + ID string + Metadata map[string]interface{} + Name string + type ChannelsPage struct + Channels []Channel + type Config struct + BaseURL string + BootstrapPrefix string + BootstrapURL string + CertsURL string + GroupsPrefix string + HTTPAdapterPrefix string + MsgContentType ContentType + ReaderPrefix string + ReaderURL string + TLSVerification bool + ThingsPrefix string + UsersPrefix string + type ConfigUpdateCertReq struct + CACert string + ClientCert string + ClientKey string + type ConnectionIDs struct + ChannelIDs []string + ThingIDs []string + type ContentType string + const CTBinary + const CTJSON + const CTJSONSenML + type Group struct + Description string + ID string + Metadata map[string]interface{} + Name string + ParentID string + type GroupsPage struct + Groups []Group + type MessagesPage struct + Messages []senml.Message + type SDK interface + AddBootstrap func(token string, cfg BootstrapConfig) (string, error) + Assign func(userID, groupID, token string) error + Bootstrap func(externalKey, externalID string) (BootstrapConfig, error) + Channel func(id, token string) (Channel, error) + Channels func(token string, offset, limit uint64, name string) (ChannelsPage, error) + ChannelsByThing func(token, thingID string, offset, limit uint64, connected bool) (ChannelsPage, error) + Connect func(conns ConnectionIDs, token string) error + CreateChannel func(channel Channel, token string) (string, error) + CreateChannels func(channels []Channel, token string) ([]Channel, error) + CreateGroup func(group Group, token string) (string, error) + CreateThing func(thing Thing, token string) (string, error) + CreateThings func(things []Thing, token string) ([]Thing, error) + CreateToken func(user User) (string, error) + CreateUser func(user User) (string, error) + DeleteChannel func(id, token string) error + DeleteGroup func(id, token string) error + DeleteThing func(id, token string) error + DisconnectThing func(thingID, chanID, token string) error + Group func(id, token string) (Group, error) + Groups func(token string, offset, limit uint64, name string) (GroupsPage, error) + IssueCert func(thingID string, keyBits int, keyType, valid, token string) (Cert, error) + Members func(groupID, token string, offset, limit uint64) (UsersPage, error) + Memberships func(userID, token string, offset, limit uint64) (GroupsPage, error) + ReadMessages func(chanID, token string) (MessagesPage, error) + RemoveBootstrap func(token, id string) error + RemoveCert func(id, token string) error + RevokeCert func(thingID, certID, token string) error + SendMessage func(chanID, msg, token string) error + SetContentType func(ct ContentType) error + Thing func(id, token string) (Thing, error) + Things func(token string, offset, limit uint64, name string) (ThingsPage, error) + ThingsByChannel func(token, chanID string, offset, limit uint64, connected bool) (ThingsPage, error) + Unassign func(userID, groupID, token string) error + UpdateBootstrap func(token string, cfg BootstrapConfig) error + UpdateBootstrapCerts func(token string, id string, clientCert, clientKey, ca string) error + UpdateChannel func(channel Channel, token string) error + UpdateGroup func(group Group, token string) error + UpdatePassword func(oldPass, newPass, token string) error + UpdateThing func(thing Thing, token string) error + UpdateUser func(user User, token string) error + User func(token string) (User, error) + Version func() (string, error) + ViewBootstrap func(token, id string) (BootstrapConfig, error) + Whitelist func(token string, cfg BootstrapConfig) error + func NewSDK(conf Config) SDK + type Thing struct + ID string + Key string + Metadata map[string]interface{} + Name string + type ThingsPage struct + Things []Thing + type User struct + Email string + Groups []string + ID string + Metadata map[string]interface{} + Password string + type UserPasswordReq struct + OldPassword string + Password string + type UsersPage struct + Users []User