Documentation ¶
Index ¶
- Constants
- Variables
- type Database
- func (this *Database) AdminListResourceIds(ctx context.Context, topicId string, listOptions model.ListOptions) (result []string, err error)
- func (this *Database) AdminListResources(ctx context.Context, topicId string, listOptions model.ListOptions) (result []model.Resource, err error)
- func (this *Database) CheckMultipleResourcePermissions(ctx context.Context, topicId string, ids []string, userId string, ...) (result map[string]bool, err error)
- func (this *Database) CheckResourcePermissions(ctx context.Context, topicId string, id string, userId string, ...) (bool, error)
- func (this *Database) CreateId() string
- func (this *Database) DeleteResource(ctx context.Context, topicId string, id string) error
- func (this *Database) DeleteTopic(ctx context.Context, id string) error
- func (this *Database) Disconnect()
- func (this *Database) GetResource(ctx context.Context, topicId string, id string, options model.GetOptions) (resource model.Resource, err error)
- func (this *Database) GetTopic(ctx context.Context, id string) (result model.Topic, exists bool, err error)
- func (this *Database) ListResourceIdsByPermissions(ctx context.Context, topicId string, userId string, roleIds []string, ...) ([]string, error)
- func (this *Database) ListResourcesByPermissions(ctx context.Context, topicId string, userId string, roleIds []string, ...) (result []model.Resource, err error)
- func (this *Database) ListTopics(ctx context.Context, listOptions model.ListOptions) (result []model.Topic, err error)
- func (this *Database) ListUnsyncedResources(ctx context.Context) (result []model.Resource, err error)
- func (this *Database) MarkResourceAsSynced(ctx context.Context, topicId string, id string) error
- func (this *Database) SetPermissions(ctx context.Context, topic string, id string, ...) (err error)
- func (this *Database) SetResource(ctx context.Context, r model.Resource, t time.Time, synced bool) (err error)
- func (this *Database) SetTopic(ctx context.Context, topic model.Topic) error
- type PermissionsEntry
Constants ¶
View Source
const PermissionsEntrySyncedBson = "synced"
View Source
const PermissionsEntryTimestampBson = "timestamp"
Variables ¶
View Source
var CreateCollections = []func(db *Database) error{}
View Source
var PermissionsEntryBson = getBsonFieldObject[PermissionsEntry]()
View Source
var TopicBson = getBsonFieldObject[model.Topic]()
Functions ¶
This section is empty.
Types ¶
type Database ¶
type Database struct {
// contains filtered or unexported fields
}
func (*Database) AdminListResourceIds ¶ added in v0.0.9
func (*Database) AdminListResources ¶ added in v0.0.15
func (*Database) CheckMultipleResourcePermissions ¶
func (*Database) CheckResourcePermissions ¶
func (*Database) DeleteResource ¶
func (*Database) DeleteTopic ¶
func (*Database) Disconnect ¶
func (this *Database) Disconnect()
func (*Database) GetResource ¶
func (*Database) ListResourceIdsByPermissions ¶
func (*Database) ListResourcesByPermissions ¶
func (*Database) ListTopics ¶
func (*Database) ListUnsyncedResources ¶ added in v0.0.16
func (*Database) MarkResourceAsSynced ¶ added in v0.0.16
func (*Database) SetPermissions ¶
func (*Database) SetResource ¶ added in v0.0.16
type PermissionsEntry ¶
type PermissionsEntry struct { TopicId string `json:"topic_id" bson:"topic_id"` Id string `json:"id" bson:"id"` Timestamp int64 `json:"timestamp" bson:"timestamp"` Synced bool `json:"synced" bson:"synced"` AdminUsers []string `json:"admin_users" bson:"admin_users"` AdminGroups []string `json:"admin_groups" bson:"admin_groups"` AdminRoles []string `json:"admin_roles" bson:"admin_roles"` ReadUsers []string `json:"read_users" bson:"read_users"` ReadGroups []string `json:"read_groups" bson:"read_groups"` ReadRoles []string `json:"read_roles" bson:"read_roles"` WriteUsers []string `json:"write_users" bson:"write_users"` WriteGroups []string `json:"write_groups" bson:"write_groups"` WriteRoles []string `json:"write_roles" bson:"write_roles"` ExecuteUsers []string `json:"execute_users" bson:"execute_users"` ExecuteGroups []string `json:"execute_groups" bson:"execute_groups"` ExecuteRoles []string `json:"execute_roles" bson:"execute_roles"` }
func (*PermissionsEntry) ToResource ¶
func (this *PermissionsEntry) ToResource() model.Resource
Click to show internal directories.
Click to hide internal directories.