Documentation
¶
Index ¶
- Constants
- type AuthzReq
- type Config
- type Group
- type GroupInvite
- type GroupMembership
- type GroupMembershipsPage
- type GroupPage
- type Identity
- type JSONMessagesPage
- type JSONPageMetadata
- type Key
- type KeysPage
- type Message
- type MessagesPage
- type Metadata
- type Org
- type OrgAccessReq
- type OrgInvite
- type OrgInvitesPage
- type OrgMembership
- type OrgMembershipsPage
- type OrgsPage
- type PlatformInvite
- type PlatformInvitesPage
- type Profile
- type ProfilesPage
- type PubConfigInfo
- type SenMLMessagesPage
- type SenMLPageMetadata
- type Thing
- type ThingAccessReq
- type ThingCommandReq
- type ThingGroupCommandReq
- type ThingKey
- type ThingsPage
- type Transformer
- type User
- type UserAccessReq
- type UsersPage
Constants ¶
const ( RootSub = "root" OrgSub = "org" )
Subject type constants for authorization.
const ( OrgAdmin = "admin" OrgOwner = "owner" OrgEditor = "editor" OrgViewer = "viewer" )
Org role constants.
const ( // RoleRootAdmin is the super admin role. RoleRootAdmin = "root" // RoleAdmin is the admin role. RoleAdmin = "admin" )
Platform role constants.
const ( LoginKey uint32 = iota RecoveryKey APIKey )
Key type constants.
const ( KeyTypeInternal = "internal" KeyTypeExternal = "external" )
Thing key type constants.
const ( GroupViewer = "viewer" GroupEditor = "editor" GroupAdmin = "admin" GroupOwner = "owner" )
Group role constants.
const ( EnabledStatusKey = "enabled" DisabledStatusKey = "disabled" AllStatusKey = "all" )
Status key constants for user filtering.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct {
ContentType string `json:"content_type"`
Transformer Transformer `json:"transformer"`
}
Config represents profile configuration.
type Group ¶
type Group struct {
ID string `json:"id,omitempty"`
OrgID string `json:"org_id,omitempty"`
Name string `json:"name,omitempty"`
Description string `json:"description,omitempty"`
Metadata Metadata `json:"metadata,omitempty"`
CreatedAt time.Time `json:"created_at"`
UpdatedAt time.Time `json:"updated_at"`
}
Group represents group information.
type GroupInvite ¶
type GroupInvite struct {
GroupID string `json:"group_id,omitempty"`
MemberRole string `json:"member_role,omitempty"`
}
GroupInvite represents a group membership invite.
type GroupMembership ¶
type GroupMembership struct {
GroupID string `json:"group_id,omitempty"`
MemberID string `json:"member_id,omitempty"`
Email string `json:"email,omitempty"`
Role string `json:"role,omitempty"`
}
GroupMembership represents a group membership.
type GroupMembershipsPage ¶
type GroupMembershipsPage struct {
Total uint64 `json:"total"`
GroupMemberships []GroupMembership `json:"group_memberships"`
}
GroupMembershipsPage contains page metadata and list of group memberships.
type JSONMessagesPage ¶
type JSONMessagesPage struct {
JSONPageMetadata
MessagesPage
}
JSONMessagesPage contains a page of JSON messages.
type JSONPageMetadata ¶
type JSONPageMetadata struct {
Offset uint64 `json:"offset"`
Limit uint64 `json:"limit"`
Subtopic string `json:"subtopic,omitempty"`
Publisher string `json:"publisher,omitempty"`
Protocol string `json:"protocol,omitempty"`
From int64 `json:"from,omitempty"`
To int64 `json:"to,omitempty"`
Filter string `json:"filter,omitempty"`
AggInterval string `json:"agg_interval,omitempty"`
AggValue uint64 `json:"agg_value,omitempty"`
AggType string `json:"agg_type,omitempty"`
AggFields []string `json:"agg_fields,omitempty"`
Dir string `json:"dir,omitempty"`
}
JSONPageMetadata represents the parameters used to create database queries.
type Key ¶
type Key struct {
ID string `json:"id,omitempty"`
Type uint32 `json:"type,omitempty"`
IssuerID string `json:"issuer_id,omitempty"`
Subject string `json:"subject,omitempty"`
IssuedAt time.Time `json:"issued_at,omitempty"`
ExpiresAt time.Time `json:"expires_at,omitempty"`
}
Key represents API key.
type MessagesPage ¶
MessagesPage contains a page of messages.
type Org ¶
type Org struct {
ID string `json:"id,omitempty"`
OwnerID string `json:"owner_id,omitempty"`
Name string `json:"name,omitempty"`
Description string `json:"description,omitempty"`
Metadata Metadata `json:"metadata,omitempty"`
CreatedAt time.Time `json:"created_at,omitempty"`
UpdatedAt time.Time `json:"updated_at,omitempty"`
}
Org represents org information.
type OrgAccessReq ¶
OrgAccessReq represents an org access request.
type OrgInvite ¶
type OrgInvite struct {
ID string `json:"id,omitempty"`
OrgID string `json:"org_id,omitempty"`
OrgName string `json:"org_name,omitempty"`
InviteeRole string `json:"invitee_role,omitempty"`
GroupInvites []GroupInvite `json:"group_invites,omitempty"`
InviteeID string `json:"invitee_id,omitempty"`
InviteeEmail string `json:"invitee_email,omitempty"`
InviterID string `json:"inviter_id,omitempty"`
InviterEmail string `json:"inviter_email,omitempty"`
CreatedAt time.Time `json:"created_at,omitempty"`
ExpiresAt time.Time `json:"expires_at,omitempty"`
State string `json:"state,omitempty"`
}
OrgInvite represents org invite information.
type OrgInvitesPage ¶
OrgInvitesPage contains page metadata and list of org invites.
type OrgMembership ¶
type OrgMembership struct {
MemberID string `json:"member_id,omitempty"`
OrgID string `json:"org_id,omitempty"`
Role string `json:"role,omitempty"`
CreatedAt time.Time `json:"created_at,omitempty"`
UpdatedAt time.Time `json:"updated_at,omitempty"`
Email string `json:"email,omitempty"`
}
OrgMembership represents org membership information.
type OrgMembershipsPage ¶
type OrgMembershipsPage struct {
Total uint64 `json:"total"`
OrgMemberships []OrgMembership `json:"org_memberships"`
}
OrgMembershipsPage contains page metadata and list of org memberships.
type PlatformInvite ¶
type PlatformInvite struct {
ID string `json:"id,omitempty"`
InviteeEmail string `json:"invitee_email,omitempty"`
CreatedAt time.Time `json:"created_at,omitempty"`
ExpiresAt time.Time `json:"expires_at,omitempty"`
State string `json:"state,omitempty"`
OrgInvite *OrgInvite `json:"org_invite"`
}
PlatformInvite represents platform invite information.
type PlatformInvitesPage ¶
type PlatformInvitesPage struct {
Total uint64 `json:"total"`
Invites []PlatformInvite `json:"invites"`
}
PlatformInvitesPage contains page metadata and list of platform invites.
type Profile ¶
type Profile struct {
ID string `json:"id,omitempty"`
GroupID string `json:"group_id,omitempty"`
Name string `json:"name,omitempty"`
Config map[string]any `json:"config,omitempty"`
Metadata Metadata `json:"metadata,omitempty"`
}
Profile represents a communication group (things that can exchange messages).
type ProfilesPage ¶
ProfilesPage contains page metadata and list of profiles.
type PubConfigInfo ¶
PubConfigInfo represents publisher config from GetPubConfigByKey.
type SenMLMessagesPage ¶
type SenMLMessagesPage struct {
SenMLPageMetadata
MessagesPage
}
SenMLMessagesPage contains a page of SenML messages.
type SenMLPageMetadata ¶
type SenMLPageMetadata struct {
Offset uint64 `json:"offset"`
Limit uint64 `json:"limit"`
Subtopic string `json:"subtopic,omitempty"`
Publisher string `json:"publisher,omitempty"`
Protocol string `json:"protocol,omitempty"`
Name string `json:"name,omitempty"`
Value float64 `json:"v,omitempty"`
Comparator string `json:"comparator,omitempty"`
BoolValue bool `json:"vb,omitempty"`
StringValue string `json:"vs,omitempty"`
DataValue string `json:"vd,omitempty"`
From int64 `json:"from,omitempty"`
To int64 `json:"to,omitempty"`
AggInterval string `json:"agg_interval,omitempty"`
AggValue uint64 `json:"agg_value,omitempty"`
AggType string `json:"agg_type,omitempty"`
AggFields []string `json:"agg_fields,omitempty"`
Dir string `json:"dir,omitempty"`
}
SenMLPageMetadata represents the parameters used to create database queries.
type Thing ¶
type Thing struct {
ID string `json:"id,omitempty"`
GroupID string `json:"group_id,omitempty"`
ProfileID string `json:"profile_id,omitempty"`
Name string `json:"name,omitempty"`
Type string `json:"type,omitempty"`
Key string `json:"key,omitempty"`
ExternalKey string `json:"external_key,omitempty"`
Metadata Metadata `json:"metadata,omitempty"`
}
Thing represents a Mainflux thing. Each thing is owned by one user, and it is assigned with the unique identifier and (temporary) access key.
type ThingAccessReq ¶
ThingAccessReq represents a thing access request.
type ThingCommandReq ¶
ThingCommandReq represents a request to authorize an inter-thing command.
type ThingGroupCommandReq ¶
ThingGroupCommandReq represents a request to authorize a thing group command.
type ThingsPage ¶
ThingsPage contains page related metadata as well as list of things that belong to this page.
type Transformer ¶
type Transformer struct {
DataFilters []string `json:"data_filters"`
DataField string `json:"data_field"`
TimeField string `json:"time_field"`
TimeFormat string `json:"time_format"`
TimeLocation string `json:"time_location"`
}
Transformer represents message transformation config.
type User ¶
type User struct {
ID string `json:"id,omitempty"`
Email string `json:"email,omitempty"`
Password string `json:"password,omitempty"`
Metadata Metadata `json:"metadata,omitempty"`
Status string `json:"status,omitempty"`
Role string `json:"role,omitempty"`
}
User represents user account information.
type UserAccessReq ¶
UserAccessReq represents a user access request.