Documentation
¶
Index ¶
- Constants
- type DocNotFound
- type MockStore
- func (mk *MockStore) AppendToACL(ctx context.Context, projectUUID string, resource string, name string, ...) error
- func (mk *MockStore) AppendToUserProjects(ctx context.Context, userUUID string, projectUUID string, pRoles ...string) error
- func (mk *MockStore) Clone() Store
- func (mk *MockStore) Close()
- func (mk *MockStore) DeleteRegistration(ctx context.Context, regUUID string) error
- func (mk *MockStore) DeleteSchema(ctx context.Context, schemaUUID string) error
- func (mk *MockStore) ExistsInACL(ctx context.Context, projectUUID string, resource string, resourceName string, ...) error
- func (mk *MockStore) GetAllRoles(ctx context.Context) []string
- func (mk *MockStore) GetOpMetrics(ctx context.Context) []QopMetric
- func (mk *MockStore) GetUserFromToken(ctx context.Context, token string) (QUser, error)
- func (mk *MockStore) GetUserRoles(ctx context.Context, projectUUID string, token string) ([]string, string)
- func (mk *MockStore) HasProject(ctx context.Context, name string) bool
- func (mk *MockStore) HasResourceRoles(ctx context.Context, resource string, roles []string) bool
- func (mk *MockStore) HasUsers(ctx context.Context, projectUUID string, users []string) (bool, []string)
- func (mk *MockStore) IncrementDailyTopicMsgCount(ctx context.Context, projectUUID string, topicName string, num int64, ...) error
- func (mk *MockStore) IncrementSubBytes(ctx context.Context, projectUUID string, name string, totalBytes int64) error
- func (mk *MockStore) IncrementSubMsgNum(ctx context.Context, projectUUID string, name string, num int64) error
- func (mk *MockStore) IncrementTopicBytes(ctx context.Context, projectUUID string, name string, totalBytes int64) error
- func (mk *MockStore) IncrementTopicMsgNum(ctx context.Context, projectUUID string, name string, num int64) error
- func (mk *MockStore) Initialize()
- func (mk *MockStore) InsertOpMetric(ctx context.Context, hostname string, cpu float64, mem float64) error
- func (mk *MockStore) InsertProject(ctx context.Context, uuid string, name string, createdOn time.Time, ...) error
- func (mk *MockStore) InsertResourceRoles(ctx context.Context, resource string, roles []string) error
- func (mk *MockStore) InsertSchema(ctx context.Context, ...) error
- func (mk *MockStore) InsertSub(ctx context.Context, projectUUID string, name string, topic string, ...) error
- func (mk *MockStore) InsertTopic(ctx context.Context, projectUUID string, name string, schemaUUID string, ...) error
- func (mk *MockStore) InsertUser(ctx context.Context, uuid string, projects []QProjectRoles, name string, ...) error
- func (mk *MockStore) LinkTopicSchema(ctx context.Context, projectUUID, name, schemaUUID string) error
- func (mk *MockStore) ModACL(ctx context.Context, projectUUID string, resource string, name string, ...) error
- func (mk *MockStore) ModAck(ctx context.Context, projectUUID string, name string, ack int) error
- func (mk *MockStore) ModSubPush(ctx context.Context, projectUUID string, name string, config QPushConfig) error
- func (mk *MockStore) PaginatedQueryUsers(ctx context.Context, pageToken string, pageSize int64, projectUUID string) ([]QUser, int64, string, error)
- func (mk *MockStore) QueryACL(ctx context.Context, projectUUID string, resource string, name string) (QAcl, error)
- func (mk *MockStore) QueryDailyProjectMsgCount(ctx context.Context, projectUUID string) ([]QDailyProjectMsgCount, error)
- func (mk *MockStore) QueryDailyTopicMsgCount(ctx context.Context, projectUUID string, topicName string, date time.Time) ([]QDailyTopicMsgCount, error)
- func (mk *MockStore) QueryOneSub(ctx context.Context, projectUUID string, name string) (QSub, error)
- func (mk *MockStore) QueryProjects(ctx context.Context, uuid string, name string) ([]QProject, error)
- func (mk *MockStore) QueryPushSubs(ctx context.Context) []QSub
- func (mk *MockStore) QueryRegistrations(ctx context.Context, regUUID, status, activationToken, name, email, org string) ([]QUserRegistration, error)
- func (mk *MockStore) QuerySchemas(ctx context.Context, projectUUID, schemaUUID, name string) ([]QSchema, error)
- func (mk *MockStore) QuerySubs(ctx context.Context, projectUUID, userUUID, name, pageToken string, ...) ([]QSub, int64, string, error)
- func (mk *MockStore) QuerySubsByACL(ctx context.Context, projectUUID, user string) ([]QSub, error)
- func (mk *MockStore) QuerySubsByTopic(ctx context.Context, projectUUID, topic string) ([]QSub, error)
- func (mk *MockStore) QueryTopics(ctx context.Context, projectUUID, userUUID, name, pageToken string, ...) ([]QTopic, int64, string, error)
- func (mk *MockStore) QueryTopicsByACL(ctx context.Context, projectUUID, user string) ([]QTopic, error)
- func (mk *MockStore) QueryTotalMessagesPerProject(ctx context.Context, projectUUIDs []string, startDate time.Time, ...) ([]QProjectMessageCount, error)
- func (mk *MockStore) QueryUsers(ctx context.Context, projectUUID string, uuid string, name string) ([]QUser, error)
- func (mk *MockStore) RegisterUser(ctx context.Context, ...) error
- func (mk *MockStore) RemoveFromACL(ctx context.Context, projectUUID string, resource string, name string, ...) error
- func (mk *MockStore) RemoveProject(ctx context.Context, uuid string) error
- func (mk *MockStore) RemoveProjectDailyMessageCounters(ctx context.Context, projectUUID string) error
- func (mk *MockStore) RemoveProjectSubs(ctx context.Context, projectUUID string) error
- func (mk *MockStore) RemoveProjectTopics(ctx context.Context, projectUUID string) error
- func (mk *MockStore) RemoveSub(ctx context.Context, projectUUID string, name string) error
- func (mk *MockStore) RemoveTopic(ctx context.Context, projectUUID string, name string) error
- func (mk *MockStore) RemoveUser(ctx context.Context, uuid string) error
- func (mk *MockStore) SubscriptionsCount(ctx context.Context, startDate, endDate time.Time, projectUUIDs []string) (map[string]int64, error)
- func (mk *MockStore) TopicsCount(ctx context.Context, startDate, endDate time.Time, projectUUIDs []string) (map[string]int64, error)
- func (mk *MockStore) UpdateProject(ctx context.Context, projectUUID string, name string, description string, ...) error
- func (mk *MockStore) UpdateRegistration(ctx context.Context, ...) error
- func (mk *MockStore) UpdateSchema(ctx context.Context, schemaUUID, name, schemaType, rawSchemaString string) error
- func (mk *MockStore) UpdateSubConsumeRate(ctx context.Context, projectUUID string, name string, rate float64) error
- func (mk *MockStore) UpdateSubLatestConsume(ctx context.Context, projectUUID string, name string, date time.Time) error
- func (mk *MockStore) UpdateSubOffset(ctx context.Context, projectUUID string, name string, offset int64)
- func (mk *MockStore) UpdateSubOffsetAck(ctx context.Context, projectUUID string, name string, offset int64, ts string) error
- func (mk *MockStore) UpdateSubPull(ctx context.Context, projectUUID string, name string, offset int64, ts string) error
- func (mk *MockStore) UpdateTopicLatestPublish(ctx context.Context, projectUUID string, name string, date time.Time) error
- func (mk *MockStore) UpdateTopicPublishRate(ctx context.Context, projectUUID string, name string, rate float64) error
- func (mk *MockStore) UpdateUser(ctx context.Context, uuid, fname, lname, org, desc string, ...) error
- func (mk *MockStore) UpdateUserToken(ctx context.Context, uuid string, token string) error
- func (mk *MockStore) UsersCount(ctx context.Context, startDate, endDate time.Time, projectUUIDs []string) (map[string]int64, error)
- type MongoStoreWithOfficialDriver
- func (store *MongoStoreWithOfficialDriver) AppendToACL(ctx context.Context, projectUUID string, resource string, name string, ...) error
- func (store *MongoStoreWithOfficialDriver) AppendToUserProjects(ctx context.Context, userUUID string, projectUUID string, pRoles ...string) error
- func (store *MongoStoreWithOfficialDriver) Clone() Store
- func (store *MongoStoreWithOfficialDriver) Close()
- func (store *MongoStoreWithOfficialDriver) DeleteRegistration(ctx context.Context, uuid string) error
- func (store *MongoStoreWithOfficialDriver) DeleteSchema(ctx context.Context, schemaUUID string) error
- func (store *MongoStoreWithOfficialDriver) ExistsInACL(ctx context.Context, projectUUID string, resource string, resourceName string, ...) error
- func (store *MongoStoreWithOfficialDriver) GetAllRoles(ctx context.Context) []string
- func (store *MongoStoreWithOfficialDriver) GetOpMetrics(ctx context.Context) []QopMetric
- func (store *MongoStoreWithOfficialDriver) GetUserFromToken(ctx context.Context, token string) (QUser, error)
- func (store *MongoStoreWithOfficialDriver) GetUserRoles(ctx context.Context, projectUUID string, token string) ([]string, string)
- func (store *MongoStoreWithOfficialDriver) HasProject(ctx context.Context, name string) bool
- func (store *MongoStoreWithOfficialDriver) HasResourceRoles(ctx context.Context, resource string, roles []string) bool
- func (store *MongoStoreWithOfficialDriver) HasUsers(ctx context.Context, projectUUID string, users []string) (bool, []string)
- func (store *MongoStoreWithOfficialDriver) IncrementDailyTopicMsgCount(ctx context.Context, projectUUID string, topicName string, num int64, ...) error
- func (store *MongoStoreWithOfficialDriver) IncrementSubBytes(ctx context.Context, projectUUID string, name string, totalBytes int64) error
- func (store *MongoStoreWithOfficialDriver) IncrementSubMsgNum(ctx context.Context, projectUUID string, name string, num int64) error
- func (store *MongoStoreWithOfficialDriver) IncrementTopicBytes(ctx context.Context, projectUUID string, name string, totalBytes int64) error
- func (store *MongoStoreWithOfficialDriver) IncrementTopicMsgNum(ctx context.Context, projectUUID string, name string, num int64) error
- func (store *MongoStoreWithOfficialDriver) Initialize()
- func (store *MongoStoreWithOfficialDriver) InsertOpMetric(ctx context.Context, hostname string, cpu float64, mem float64) error
- func (store *MongoStoreWithOfficialDriver) InsertProject(ctx context.Context, uuid string, name string, createdOn time.Time, ...) error
- func (store *MongoStoreWithOfficialDriver) InsertResourceRoles(ctx context.Context, resource string, roles []string) error
- func (store *MongoStoreWithOfficialDriver) InsertSchema(ctx context.Context, ...) error
- func (store *MongoStoreWithOfficialDriver) InsertSub(ctx context.Context, projectUUID string, name string, topic string, ...) error
- func (store *MongoStoreWithOfficialDriver) InsertTopic(ctx context.Context, projectUUID string, name string, schemaUUID string, ...) error
- func (store *MongoStoreWithOfficialDriver) InsertUser(ctx context.Context, uuid string, projects []QProjectRoles, name string, ...) error
- func (store *MongoStoreWithOfficialDriver) LinkTopicSchema(ctx context.Context, projectUUID, name, schemaUUID string) error
- func (store *MongoStoreWithOfficialDriver) ModACL(ctx context.Context, projectUUID string, resource string, name string, ...) error
- func (store *MongoStoreWithOfficialDriver) ModAck(ctx context.Context, projectUUID string, name string, ack int) error
- func (store *MongoStoreWithOfficialDriver) ModSubPush(ctx context.Context, projectUUID string, name string, pushCfg QPushConfig) error
- func (store *MongoStoreWithOfficialDriver) PaginatedQueryUsers(ctx context.Context, pageToken string, pageSize int64, projectUUID string) ([]QUser, int64, string, error)
- func (store *MongoStoreWithOfficialDriver) QueryACL(ctx context.Context, projectUUID string, resource string, name string) (QAcl, error)
- func (store *MongoStoreWithOfficialDriver) QueryDailyProjectMsgCount(ctx context.Context, projectUUID string) ([]QDailyProjectMsgCount, error)
- func (store *MongoStoreWithOfficialDriver) QueryDailyTopicMsgCount(ctx context.Context, projectUUID string, topicName string, date time.Time) ([]QDailyTopicMsgCount, error)
- func (store *MongoStoreWithOfficialDriver) QueryOneSub(ctx context.Context, projectUUID string, name string) (QSub, error)
- func (store *MongoStoreWithOfficialDriver) QueryProjects(ctx context.Context, uuid string, name string) ([]QProject, error)
- func (store *MongoStoreWithOfficialDriver) QueryPushSubs(ctx context.Context) []QSub
- func (store *MongoStoreWithOfficialDriver) QueryRegistrations(ctx context.Context, regUUID, status, activationToken, name, email, org string) ([]QUserRegistration, error)
- func (store *MongoStoreWithOfficialDriver) QuerySchemas(ctx context.Context, projectUUID, schemaUUID, name string) ([]QSchema, error)
- func (store *MongoStoreWithOfficialDriver) QuerySubs(ctx context.Context, projectUUID string, userUUID string, name string, ...) ([]QSub, int64, string, error)
- func (store *MongoStoreWithOfficialDriver) QuerySubsByACL(ctx context.Context, projectUUID, user string) ([]QSub, error)
- func (store *MongoStoreWithOfficialDriver) QuerySubsByTopic(ctx context.Context, projectUUID, topic string) ([]QSub, error)
- func (store *MongoStoreWithOfficialDriver) QueryTopics(ctx context.Context, projectUUID string, userUUID string, name string, ...) ([]QTopic, int64, string, error)
- func (store *MongoStoreWithOfficialDriver) QueryTopicsByACL(ctx context.Context, projectUUID, user string) ([]QTopic, error)
- func (store *MongoStoreWithOfficialDriver) QueryTotalMessagesPerProject(ctx context.Context, projectUUIDs []string, startDate time.Time, ...) ([]QProjectMessageCount, error)
- func (store *MongoStoreWithOfficialDriver) QueryUsers(ctx context.Context, projectUUID string, uuid string, name string) ([]QUser, error)
- func (store *MongoStoreWithOfficialDriver) RegisterUser(ctx context.Context, ...) error
- func (store *MongoStoreWithOfficialDriver) RemoveFromACL(ctx context.Context, projectUUID string, resource string, name string, ...) error
- func (store *MongoStoreWithOfficialDriver) RemoveProject(ctx context.Context, uuid string) error
- func (store *MongoStoreWithOfficialDriver) RemoveProjectDailyMessageCounters(ctx context.Context, projectUUID string) error
- func (store *MongoStoreWithOfficialDriver) RemoveProjectSubs(ctx context.Context, projectUUID string) error
- func (store *MongoStoreWithOfficialDriver) RemoveProjectTopics(ctx context.Context, projectUUID string) error
- func (store *MongoStoreWithOfficialDriver) RemoveSub(ctx context.Context, projectUUID string, name string) error
- func (store *MongoStoreWithOfficialDriver) RemoveTopic(ctx context.Context, projectUUID string, name string) error
- func (store *MongoStoreWithOfficialDriver) RemoveUser(ctx context.Context, uuid string) error
- func (store *MongoStoreWithOfficialDriver) SubscriptionsCount(ctx context.Context, startDate, endDate time.Time, projectUUIDs []string) (map[string]int64, error)
- func (store *MongoStoreWithOfficialDriver) TopicsCount(ctx context.Context, startDate, endDate time.Time, projectUUIDs []string) (map[string]int64, error)
- func (store *MongoStoreWithOfficialDriver) UpdateProject(ctx context.Context, projectUUID string, name string, description string, ...) error
- func (store *MongoStoreWithOfficialDriver) UpdateRegistration(ctx context.Context, ...) error
- func (store *MongoStoreWithOfficialDriver) UpdateSchema(ctx context.Context, schemaUUID, name, schemaType, rawSchemaString string) error
- func (store *MongoStoreWithOfficialDriver) UpdateSubConsumeRate(ctx context.Context, projectUUID string, name string, rate float64) error
- func (store *MongoStoreWithOfficialDriver) UpdateSubLatestConsume(ctx context.Context, projectUUID string, name string, date time.Time) error
- func (store *MongoStoreWithOfficialDriver) UpdateSubOffset(ctx context.Context, projectUUID string, name string, offset int64)
- func (store *MongoStoreWithOfficialDriver) UpdateSubOffsetAck(ctx context.Context, projectUUID string, name string, offset int64, ts string) error
- func (store *MongoStoreWithOfficialDriver) UpdateSubPull(ctx context.Context, projectUUID string, name string, nextOff int64, ts string) error
- func (store *MongoStoreWithOfficialDriver) UpdateTopicLatestPublish(ctx context.Context, projectUUID string, name string, date time.Time) error
- func (store *MongoStoreWithOfficialDriver) UpdateTopicPublishRate(ctx context.Context, projectUUID string, name string, rate float64) error
- func (store *MongoStoreWithOfficialDriver) UpdateUser(ctx context.Context, uuid, fname, lname, org, desc string, ...) error
- func (store *MongoStoreWithOfficialDriver) UpdateUserToken(ctx context.Context, uuid string, token string) error
- func (store *MongoStoreWithOfficialDriver) UsersCount(ctx context.Context, startDate, endDate time.Time, projectUUIDs []string) (map[string]int64, error)
- type QAcl
- type QDailyProjectMsgCount
- type QDailyTopicMsgCount
- type QProject
- type QProjectMessageCount
- type QProjectResourceCount
- type QProjectRoles
- type QPushConfig
- type QRole
- type QSchema
- type QSub
- type QTopic
- type QUser
- type QUserRegistration
- type QopMetric
- type Store
Constants ¶
const ( TopicsCollection string = "topics" SubscriptionsCollection string = "subscriptions" DailyTopicMsgCountCollection string = "daily_topic_msg_count" UsersCollection string = "users" ProjectsCollection string = "projects" UserRegistrationsCollection string = "user_registrations" SchemasCollection string = "schemas" OpMetricsCollection string = "op_metrics" RolesCollection string = "roles" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DocNotFound ¶
type DocNotFound struct{}
func (DocNotFound) Error ¶
func (DocNotFound) Error() string
type MockStore ¶
type MockStore struct {
Server string
Database string
UserRegistrations []QUserRegistration
SubList []QSub
TopicList []QTopic
DailyTopicMsgCount []QDailyTopicMsgCount
ProjectList []QProject
UserList []QUser
RoleList []QRole
SchemaList []QSchema
Session bool
TopicsACL map[string]QAcl
SubsACL map[string]QAcl
OpMetrics map[string]QopMetric
}
MockStore holds configuration
func NewMockStore ¶
NewMockStore creates new mock store
func (*MockStore) AppendToACL ¶
func (mk *MockStore) AppendToACL(ctx context.Context, projectUUID string, resource string, name string, acl []string) error
AppendToACL adds given users to an existing ACL
func (*MockStore) AppendToUserProjects ¶
func (mk *MockStore) AppendToUserProjects(ctx context.Context, userUUID string, projectUUID string, pRoles ...string) error
AppendToUserProjects adds project and specific roles to a users role list
func (*MockStore) DeleteRegistration ¶
func (*MockStore) DeleteSchema ¶
func (*MockStore) ExistsInACL ¶
func (mk *MockStore) ExistsInACL(ctx context.Context, projectUUID string, resource string, resourceName string, userUUID string) error
ExistsInACL checks if a users exists in an ACL resource (topic or subscription)
func (*MockStore) GetAllRoles ¶
GetAllRoles returns a list of all available roles
func (*MockStore) GetOpMetrics ¶
GetOpMetrics returns operation metrics
func (*MockStore) GetUserFromToken ¶
GetUserFromToken retrieves specific user info from a given token
func (*MockStore) GetUserRoles ¶
func (mk *MockStore) GetUserRoles(ctx context.Context, projectUUID string, token string) ([]string, string)
GetUserRoles returns the roles of a user in a project
func (*MockStore) HasProject ¶
HasProject returns true if project exists in store
func (*MockStore) HasResourceRoles ¶
HasResourceRoles returns the roles of a user in a project
func (*MockStore) HasUsers ¶
func (mk *MockStore) HasUsers(ctx context.Context, projectUUID string, users []string) (bool, []string)
HasUsers accepts a user array of usernames and returns the not found
func (*MockStore) IncrementDailyTopicMsgCount ¶
func (mk *MockStore) IncrementDailyTopicMsgCount(ctx context.Context, projectUUID string, topicName string, num int64, date time.Time) error
IncrementDailyTopicMsgCount increase number of messages published in a topic
func (*MockStore) IncrementSubBytes ¶
func (mk *MockStore) IncrementSubBytes(ctx context.Context, projectUUID string, name string, totalBytes int64) error
IncrementSubBytes increases the total number of bytes published in a subscription
func (*MockStore) IncrementSubMsgNum ¶
func (mk *MockStore) IncrementSubMsgNum(ctx context.Context, projectUUID string, name string, num int64) error
IncrementSubMsgNum increase number of messages pulled in a subscription
func (*MockStore) IncrementTopicBytes ¶
func (mk *MockStore) IncrementTopicBytes(ctx context.Context, projectUUID string, name string, totalBytes int64) error
IncrementTopicBytes increases the total number of bytes published in a topic
func (*MockStore) IncrementTopicMsgNum ¶
func (mk *MockStore) IncrementTopicMsgNum(ctx context.Context, projectUUID string, name string, num int64) error
IncrementTopicMsgNum increase number of messages published in a topic
func (*MockStore) Initialize ¶
func (mk *MockStore) Initialize()
Initialize is used to initialize the mock
func (*MockStore) InsertOpMetric ¶
func (mk *MockStore) InsertOpMetric(ctx context.Context, hostname string, cpu float64, mem float64) error
InsertOpMetric inserts a new operation metric
func (*MockStore) InsertProject ¶
func (mk *MockStore) InsertProject(ctx context.Context, uuid string, name string, createdOn time.Time, modifiedOn time.Time, createdBy string, description string) error
InsertProject inserts a project to the store
func (*MockStore) InsertResourceRoles ¶
func (*MockStore) InsertSchema ¶
func (*MockStore) InsertSub ¶
func (mk *MockStore) InsertSub(ctx context.Context, projectUUID string, name string, topic string, offset int64, ack int, pushCfg QPushConfig, createdOn time.Time) error
InsertSub inserts a new sub object to the store
func (*MockStore) InsertTopic ¶
func (mk *MockStore) InsertTopic(ctx context.Context, projectUUID string, name string, schemaUUID string, createdOn time.Time) error
InsertTopic inserts a new topic object to the store
func (*MockStore) InsertUser ¶
func (mk *MockStore) InsertUser(ctx context.Context, uuid string, projects []QProjectRoles, name string, fname string, lname string, org string, desc string, token string, email string, serviceRoles []string, createdOn time.Time, modifiedOn time.Time, createdBy string) error
InsertUser inserts a new user to the store
func (*MockStore) LinkTopicSchema ¶
func (*MockStore) ModACL ¶
func (mk *MockStore) ModACL(ctx context.Context, projectUUID string, resource string, name string, acl []string) error
ModACL changes the acl in a function
func (*MockStore) ModSubPush ¶
func (mk *MockStore) ModSubPush(ctx context.Context, projectUUID string, name string, config QPushConfig) error
ModSubPush modifies the subscription push configuration
func (*MockStore) PaginatedQueryUsers ¶
func (mk *MockStore) PaginatedQueryUsers(ctx context.Context, pageToken string, pageSize int64, projectUUID string) ([]QUser, int64, string, error)
PaginatedQueryUsers provides query to the list of users using pagination parameters
func (*MockStore) QueryACL ¶
func (mk *MockStore) QueryACL(ctx context.Context, projectUUID string, resource string, name string) (QAcl, error)
QueryACL Topic/Subscription ACL
func (*MockStore) QueryDailyProjectMsgCount ¶
func (mk *MockStore) QueryDailyProjectMsgCount(ctx context.Context, projectUUID string) ([]QDailyProjectMsgCount, error)
QueryDailyProjectMsgCount retrieves the number of total messages that have been published to all project's topics daily
func (*MockStore) QueryDailyTopicMsgCount ¶
func (mk *MockStore) QueryDailyTopicMsgCount(ctx context.Context, projectUUID string, topicName string, date time.Time) ([]QDailyTopicMsgCount, error)
QueryDailyTopicMsgCount returns results regarding the number of messages published to a topic
func (*MockStore) QueryOneSub ¶
func (mk *MockStore) QueryOneSub(ctx context.Context, projectUUID string, name string) (QSub, error)
QueryOneSub returns one sub exactly
func (*MockStore) QueryProjects ¶
func (mk *MockStore) QueryProjects(ctx context.Context, uuid string, name string) ([]QProject, error)
QueryProjects function queries for a specific project or for a list of all projects
func (*MockStore) QueryPushSubs ¶
QueryPushSubs Query push Subscription info from store
func (*MockStore) QueryRegistrations ¶
func (*MockStore) QuerySchemas ¶
func (*MockStore) QuerySubs ¶
func (mk *MockStore) QuerySubs(ctx context.Context, projectUUID, userUUID, name, pageToken string, pageSize int64) ([]QSub, int64, string, error)
QuerySubs Query Subscription info from store
func (*MockStore) QuerySubsByACL ¶
QuerySubsByACL returns subscriptions that contain a specific user in their ACL
func (*MockStore) QuerySubsByTopic ¶
func (mk *MockStore) QuerySubsByTopic(ctx context.Context, projectUUID, topic string) ([]QSub, error)
QuerySubsByTopic returns subscriptions attached to a given topic
func (*MockStore) QueryTopics ¶
func (mk *MockStore) QueryTopics(ctx context.Context, projectUUID, userUUID, name, pageToken string, pageSize int64) ([]QTopic, int64, string, error)
QueryTopics Query Subscription info from store
func (*MockStore) QueryTopicsByACL ¶
func (mk *MockStore) QueryTopicsByACL(ctx context.Context, projectUUID, user string) ([]QTopic, error)
QueryTopicsByACL returns topics that contain a specific user in their ACL
func (*MockStore) QueryTotalMessagesPerProject ¶
func (*MockStore) QueryUsers ¶
func (mk *MockStore) QueryUsers(ctx context.Context, projectUUID string, uuid string, name string) ([]QUser, error)
QueryUsers queries the datastore for user information
func (*MockStore) RegisterUser ¶
func (*MockStore) RemoveFromACL ¶
func (mk *MockStore) RemoveFromACL(ctx context.Context, projectUUID string, resource string, name string, acl []string) error
RemoveFromACL removes given users from an existing acl
func (*MockStore) RemoveProject ¶
RemoveProject removes an existing project
func (*MockStore) RemoveProjectDailyMessageCounters ¶
func (mk *MockStore) RemoveProjectDailyMessageCounters(ctx context.Context, projectUUID string) error
RemoveProjectDailyMessageCounters removes all existing message counters belonging to a specific project uuid
func (*MockStore) RemoveProjectSubs ¶
RemoveProjectSubs removes all existing subs belonging to a specific project uuid
func (*MockStore) RemoveProjectTopics ¶
RemoveProjectTopics removes all topics belonging to a specific project uuid
func (*MockStore) RemoveTopic ¶
RemoveTopic removes an existing topic
func (*MockStore) RemoveUser ¶
RemoveUser removes an existing user
func (*MockStore) SubscriptionsCount ¶
func (*MockStore) TopicsCount ¶
func (*MockStore) UpdateProject ¶
func (mk *MockStore) UpdateProject(ctx context.Context, projectUUID string, name string, description string, modifiedOn time.Time) error
UpdateProject updates project information
func (*MockStore) UpdateRegistration ¶
func (*MockStore) UpdateSchema ¶
func (*MockStore) UpdateSubConsumeRate ¶
func (mk *MockStore) UpdateSubConsumeRate(ctx context.Context, projectUUID string, name string, rate float64) error
UpdateSubConsumeRate updates the subscription's consume rate
func (*MockStore) UpdateSubLatestConsume ¶
func (mk *MockStore) UpdateSubLatestConsume(ctx context.Context, projectUUID string, name string, date time.Time) error
UpdateSubLatestConsume updates the subscription's latest consume time
func (*MockStore) UpdateSubOffset ¶
func (mk *MockStore) UpdateSubOffset(ctx context.Context, projectUUID string, name string, offset int64)
UpdateSubOffset updates the offset of the current subscription
func (*MockStore) UpdateSubOffsetAck ¶
func (mk *MockStore) UpdateSubOffsetAck(ctx context.Context, projectUUID string, name string, offset int64, ts string) error
UpdateSubOffsetAck updates the offset of the current subscription
func (*MockStore) UpdateSubPull ¶
func (mk *MockStore) UpdateSubPull(ctx context.Context, projectUUID string, name string, offset int64, ts string) error
UpdateSubPull updates next offset info after a pull
func (*MockStore) UpdateTopicLatestPublish ¶
func (mk *MockStore) UpdateTopicLatestPublish(ctx context.Context, projectUUID string, name string, date time.Time) error
UpdateTopicLatestPublish updates the topic's latest publish time
func (*MockStore) UpdateTopicPublishRate ¶
func (mk *MockStore) UpdateTopicPublishRate(ctx context.Context, projectUUID string, name string, rate float64) error
UpdateTopicPublishRate updates the topic's publishing rate
func (*MockStore) UpdateUser ¶
func (mk *MockStore) UpdateUser(ctx context.Context, uuid, fname, lname, org, desc string, projects []QProjectRoles, name string, email string, serviceRoles []string, modifiedOn time.Time) error
UpdateUser updates user information
func (*MockStore) UpdateUserToken ¶
UpdateUserToken updates user's token
type MongoStoreWithOfficialDriver ¶
type MongoStoreWithOfficialDriver struct {
Server string
Database string
// contains filtered or unexported fields
}
func NewMongoStoreWithOfficialDriver ¶
func NewMongoStoreWithOfficialDriver(server, database string) *MongoStoreWithOfficialDriver
func (*MongoStoreWithOfficialDriver) AppendToACL ¶
func (store *MongoStoreWithOfficialDriver) AppendToACL(ctx context.Context, projectUUID string, resource string, name string, acl []string) error
AppendToACL adds additional users to an existing ACL
func (*MongoStoreWithOfficialDriver) AppendToUserProjects ¶
func (store *MongoStoreWithOfficialDriver) AppendToUserProjects(ctx context.Context, userUUID string, projectUUID string, pRoles ...string) error
AppendToUserProjects appends a new unique project to the user's projects
func (*MongoStoreWithOfficialDriver) Clone ¶
func (store *MongoStoreWithOfficialDriver) Clone() Store
func (*MongoStoreWithOfficialDriver) Close ¶
func (store *MongoStoreWithOfficialDriver) Close()
func (*MongoStoreWithOfficialDriver) DeleteRegistration ¶
func (store *MongoStoreWithOfficialDriver) DeleteRegistration(ctx context.Context, uuid string) error
DeleteRegistration removes the respective registration from the
func (*MongoStoreWithOfficialDriver) DeleteSchema ¶
func (store *MongoStoreWithOfficialDriver) DeleteSchema(ctx context.Context, schemaUUID string) error
DeleteSchema removes the schema from the store It also clears all the respective topics from the schema_uuid of the deleted schema
func (*MongoStoreWithOfficialDriver) ExistsInACL ¶
func (store *MongoStoreWithOfficialDriver) ExistsInACL(ctx context.Context, projectUUID string, resource string, resourceName string, userUUID string) error
ExistsInACL checks if a user is part of a topic's or sub's acl
func (*MongoStoreWithOfficialDriver) GetAllRoles ¶
func (store *MongoStoreWithOfficialDriver) GetAllRoles(ctx context.Context) []string
GetAllRoles returns a list of all available roles
func (*MongoStoreWithOfficialDriver) GetOpMetrics ¶
func (store *MongoStoreWithOfficialDriver) GetOpMetrics(ctx context.Context) []QopMetric
GetOpMetrics returns the operational metrics from datastore
func (*MongoStoreWithOfficialDriver) GetUserFromToken ¶
func (store *MongoStoreWithOfficialDriver) GetUserFromToken(ctx context.Context, token string) (QUser, error)
GetUserFromToken returns user information from a specific token
func (*MongoStoreWithOfficialDriver) GetUserRoles ¶
func (*MongoStoreWithOfficialDriver) HasProject ¶
func (store *MongoStoreWithOfficialDriver) HasProject(ctx context.Context, name string) bool
func (*MongoStoreWithOfficialDriver) HasResourceRoles ¶
func (*MongoStoreWithOfficialDriver) HasUsers ¶
func (store *MongoStoreWithOfficialDriver) HasUsers(ctx context.Context, projectUUID string, users []string) (bool, []string)
HasUsers accepts a user array of usernames and returns the not found
func (*MongoStoreWithOfficialDriver) IncrementDailyTopicMsgCount ¶
func (store *MongoStoreWithOfficialDriver) IncrementDailyTopicMsgCount(ctx context.Context, projectUUID string, topicName string, num int64, date time.Time) error
IncrementDailyTopicMsgCount increments the daily count of published messages to a specific topic
func (*MongoStoreWithOfficialDriver) IncrementSubBytes ¶
func (store *MongoStoreWithOfficialDriver) IncrementSubBytes(ctx context.Context, projectUUID string, name string, totalBytes int64) error
IncrementSubBytes increases the total number of bytes consumed from a subscription
func (*MongoStoreWithOfficialDriver) IncrementSubMsgNum ¶
func (store *MongoStoreWithOfficialDriver) IncrementSubMsgNum(ctx context.Context, projectUUID string, name string, num int64) error
IncrementSubMsgNum increments the number of messages pulled in a subscription
func (*MongoStoreWithOfficialDriver) IncrementTopicBytes ¶
func (store *MongoStoreWithOfficialDriver) IncrementTopicBytes(ctx context.Context, projectUUID string, name string, totalBytes int64) error
IncrementTopicBytes increases the total number of bytes published in a topic
func (*MongoStoreWithOfficialDriver) IncrementTopicMsgNum ¶
func (store *MongoStoreWithOfficialDriver) IncrementTopicMsgNum(ctx context.Context, projectUUID string, name string, num int64) error
IncrementTopicMsgNum increments the number of messages published in a topic
func (*MongoStoreWithOfficialDriver) Initialize ¶
func (store *MongoStoreWithOfficialDriver) Initialize()
func (*MongoStoreWithOfficialDriver) InsertOpMetric ¶
func (store *MongoStoreWithOfficialDriver) InsertOpMetric(ctx context.Context, hostname string, cpu float64, mem float64) error
InsertOpMetric inserts an operational metric
func (*MongoStoreWithOfficialDriver) InsertProject ¶
func (*MongoStoreWithOfficialDriver) InsertResourceRoles ¶
func (*MongoStoreWithOfficialDriver) InsertSchema ¶
func (store *MongoStoreWithOfficialDriver) InsertSchema(ctx context.Context, projectUUID, schemaUUID, name, schemaType, rawSchemaString string) error
func (*MongoStoreWithOfficialDriver) InsertTopic ¶
func (*MongoStoreWithOfficialDriver) InsertUser ¶
func (store *MongoStoreWithOfficialDriver) InsertUser(ctx context.Context, uuid string, projects []QProjectRoles, name string, firstName string, lastName string, org string, desc string, token string, email string, serviceRoles []string, createdOn time.Time, modifiedOn time.Time, createdBy string) error
InsertUser inserts a new user to the store
func (*MongoStoreWithOfficialDriver) LinkTopicSchema ¶
func (store *MongoStoreWithOfficialDriver) LinkTopicSchema(ctx context.Context, projectUUID, name, schemaUUID string) error
func (*MongoStoreWithOfficialDriver) ModACL ¶
func (store *MongoStoreWithOfficialDriver) ModACL(ctx context.Context, projectUUID string, resource string, name string, acl []string) error
ModACL modifies the push configuration
func (*MongoStoreWithOfficialDriver) ModAck ¶
func (store *MongoStoreWithOfficialDriver) ModAck(ctx context.Context, projectUUID string, name string, ack int) error
ModAck modifies the subscription's ack timeout field in mongodb
func (*MongoStoreWithOfficialDriver) ModSubPush ¶
func (store *MongoStoreWithOfficialDriver) ModSubPush(ctx context.Context, projectUUID string, name string, pushCfg QPushConfig) error
ModSubPush modifies the push configuration
func (*MongoStoreWithOfficialDriver) PaginatedQueryUsers ¶
func (store *MongoStoreWithOfficialDriver) PaginatedQueryUsers(ctx context.Context, pageToken string, pageSize int64, projectUUID string) ([]QUser, int64, string, error)
PaginatedQueryUsers returns a page of users
func (*MongoStoreWithOfficialDriver) QueryACL ¶
func (store *MongoStoreWithOfficialDriver) QueryACL(ctx context.Context, projectUUID string, resource string, name string) (QAcl, error)
QueryACL queries topic or subscription for a list of authorized users
func (*MongoStoreWithOfficialDriver) QueryDailyProjectMsgCount ¶
func (store *MongoStoreWithOfficialDriver) QueryDailyProjectMsgCount(ctx context.Context, projectUUID string) ([]QDailyProjectMsgCount, error)
QueryDailyProjectMsgCount queries the total messages per day for a given project
func (*MongoStoreWithOfficialDriver) QueryDailyTopicMsgCount ¶
func (store *MongoStoreWithOfficialDriver) QueryDailyTopicMsgCount(ctx context.Context, projectUUID string, topicName string, date time.Time) ([]QDailyTopicMsgCount, error)
QueryDailyTopicMsgCount returns results regarding the number of messages published to a topic
func (*MongoStoreWithOfficialDriver) QueryOneSub ¶
func (store *MongoStoreWithOfficialDriver) QueryOneSub(ctx context.Context, projectUUID string, name string) (QSub, error)
QueryOneSub queries and returns specific sub of project
func (*MongoStoreWithOfficialDriver) QueryProjects ¶
func (store *MongoStoreWithOfficialDriver) QueryProjects(ctx context.Context, uuid string, name string) ([]QProject, error)
QueryProjects queries the database for a specific project or a list of all projects
func (*MongoStoreWithOfficialDriver) QueryPushSubs ¶
func (store *MongoStoreWithOfficialDriver) QueryPushSubs(ctx context.Context) []QSub
QueryPushSubs retrieves subscriptions that have a push_endpoint defined
func (*MongoStoreWithOfficialDriver) QueryRegistrations ¶
func (store *MongoStoreWithOfficialDriver) QueryRegistrations(ctx context.Context, regUUID, status, activationToken, name, email, org string) ([]QUserRegistration, error)
func (*MongoStoreWithOfficialDriver) QuerySchemas ¶
func (*MongoStoreWithOfficialDriver) QuerySubs ¶
func (store *MongoStoreWithOfficialDriver) QuerySubs(ctx context.Context, projectUUID string, userUUID string, name string, pageToken string, pageSize int64) ([]QSub, int64, string, error)
QuerySubs Query Subscription info from store
func (*MongoStoreWithOfficialDriver) QuerySubsByACL ¶
func (store *MongoStoreWithOfficialDriver) QuerySubsByACL(ctx context.Context, projectUUID, user string) ([]QSub, error)
QuerySubsByACL returns subscriptions that a specific username has access to
func (*MongoStoreWithOfficialDriver) QuerySubsByTopic ¶
func (store *MongoStoreWithOfficialDriver) QuerySubsByTopic(ctx context.Context, projectUUID, topic string) ([]QSub, error)
QuerySubsByTopic returns subscriptions of a specific topic
func (*MongoStoreWithOfficialDriver) QueryTopics ¶
func (*MongoStoreWithOfficialDriver) QueryTopicsByACL ¶
func (store *MongoStoreWithOfficialDriver) QueryTopicsByACL(ctx context.Context, projectUUID, user string) ([]QTopic, error)
QueryTopicsByACL returns topics that a specific username has access to
func (*MongoStoreWithOfficialDriver) QueryTotalMessagesPerProject ¶
func (store *MongoStoreWithOfficialDriver) QueryTotalMessagesPerProject(ctx context.Context, projectUUIDs []string, startDate time.Time, endDate time.Time) ([]QProjectMessageCount, error)
func (*MongoStoreWithOfficialDriver) QueryUsers ¶
func (store *MongoStoreWithOfficialDriver) QueryUsers(ctx context.Context, projectUUID string, uuid string, name string) ([]QUser, error)
QueryUsers queries user(s) information belonging to a project
func (*MongoStoreWithOfficialDriver) RegisterUser ¶
func (store *MongoStoreWithOfficialDriver) RegisterUser(ctx context.Context, uuid, name, firstName, lastName, email, org, desc, registeredAt, atkn, status string) error
RegisterUser inserts a new user registration to the database
func (*MongoStoreWithOfficialDriver) RemoveFromACL ¶
func (store *MongoStoreWithOfficialDriver) RemoveFromACL(ctx context.Context, projectUUID string, resource string, name string, acl []string) error
RemoveFromACL removes users for a given ACL
func (*MongoStoreWithOfficialDriver) RemoveProject ¶
func (store *MongoStoreWithOfficialDriver) RemoveProject(ctx context.Context, uuid string) error
RemoveProject removes a project from the store
func (*MongoStoreWithOfficialDriver) RemoveProjectDailyMessageCounters ¶
func (store *MongoStoreWithOfficialDriver) RemoveProjectDailyMessageCounters(ctx context.Context, projectUUID string) error
RemoveProjectDailyMessageCounters removes all message counts related to a project UUID
func (*MongoStoreWithOfficialDriver) RemoveProjectSubs ¶
func (store *MongoStoreWithOfficialDriver) RemoveProjectSubs(ctx context.Context, projectUUID string) error
RemoveProjectSubs removes all subscriptions related to a project UUID
func (*MongoStoreWithOfficialDriver) RemoveProjectTopics ¶
func (store *MongoStoreWithOfficialDriver) RemoveProjectTopics(ctx context.Context, projectUUID string) error
RemoveProjectTopics removes all topics related to a project UUID
func (*MongoStoreWithOfficialDriver) RemoveSub ¶
func (store *MongoStoreWithOfficialDriver) RemoveSub(ctx context.Context, projectUUID string, name string) error
RemoveSub removes a subscription from the store
func (*MongoStoreWithOfficialDriver) RemoveTopic ¶
func (*MongoStoreWithOfficialDriver) RemoveUser ¶
func (store *MongoStoreWithOfficialDriver) RemoveUser(ctx context.Context, uuid string) error
func (*MongoStoreWithOfficialDriver) SubscriptionsCount ¶
func (store *MongoStoreWithOfficialDriver) SubscriptionsCount(ctx context.Context, startDate, endDate time.Time, projectUUIDs []string) (map[string]int64, error)
SubscriptionsCount returns the amount of subscriptions created in the given time period per project
func (*MongoStoreWithOfficialDriver) TopicsCount ¶
func (store *MongoStoreWithOfficialDriver) TopicsCount(ctx context.Context, startDate, endDate time.Time, projectUUIDs []string) (map[string]int64, error)
TopicsCount returns the amount of topics created in the given time period per project
func (*MongoStoreWithOfficialDriver) UpdateProject ¶
func (store *MongoStoreWithOfficialDriver) UpdateProject(ctx context.Context, projectUUID string, name string, description string, modifiedOn time.Time) error
UpdateProject updates project information
func (*MongoStoreWithOfficialDriver) UpdateRegistration ¶
func (store *MongoStoreWithOfficialDriver) UpdateRegistration(ctx context.Context, regUUID, status, declineComment, modifiedBy, modifiedAt string) error
func (*MongoStoreWithOfficialDriver) UpdateSchema ¶
func (store *MongoStoreWithOfficialDriver) UpdateSchema(ctx context.Context, schemaUUID, name, schemaType, rawSchemaString string) error
func (*MongoStoreWithOfficialDriver) UpdateSubConsumeRate ¶
func (store *MongoStoreWithOfficialDriver) UpdateSubConsumeRate(ctx context.Context, projectUUID string, name string, rate float64) error
UpdateSubConsumeRate updates the subscription's consume rate
func (*MongoStoreWithOfficialDriver) UpdateSubLatestConsume ¶
func (store *MongoStoreWithOfficialDriver) UpdateSubLatestConsume(ctx context.Context, projectUUID string, name string, date time.Time) error
UpdateSubLatestConsume updates the subscription's latest consume time
func (*MongoStoreWithOfficialDriver) UpdateSubOffset ¶
func (store *MongoStoreWithOfficialDriver) UpdateSubOffset(ctx context.Context, projectUUID string, name string, offset int64)
UpdateSubOffset updates a subscription offset
func (*MongoStoreWithOfficialDriver) UpdateSubOffsetAck ¶
func (*MongoStoreWithOfficialDriver) UpdateSubPull ¶
func (*MongoStoreWithOfficialDriver) UpdateTopicLatestPublish ¶
func (*MongoStoreWithOfficialDriver) UpdateTopicPublishRate ¶
func (*MongoStoreWithOfficialDriver) UpdateUser ¶
func (store *MongoStoreWithOfficialDriver) UpdateUser(ctx context.Context, uuid, fname, lname, org, desc string, projects []QProjectRoles, name string, email string, serviceRoles []string, modifiedOn time.Time) error
UpdateUser updates user information
func (*MongoStoreWithOfficialDriver) UpdateUserToken ¶
func (store *MongoStoreWithOfficialDriver) UpdateUserToken(ctx context.Context, uuid string, token string) error
UpdateUserToken updates user's token
type QAcl ¶
type QAcl struct {
ACL []string `bson:"acl"`
}
QAcl holds a list of authorized users queried from topic or subscription collections
type QDailyProjectMsgCount ¶
type QDailyProjectMsgCount struct {
Date time.Time `bson:"date"`
NumberOfMessages int64 `bson:"msg_count"`
}
QDailyProjectMsgCount holds information about the total amount of messages published to all of a project's topics daily
type QDailyTopicMsgCount ¶
type QDailyTopicMsgCount struct {
Date time.Time `bson:"date"`
ProjectUUID string `bson:"project_uuid"`
TopicName string `bson:"topic_name"`
NumberOfMessages int64 `bson:"msg_count"`
}
QDailyTopicMsgCount holds information about the daily number of messages published to a topic
type QProject ¶
type QProject struct {
UUID string `bson:"uuid"`
Name string `bson:"name"`
CreatedOn time.Time `bson:"created_on"`
ModifiedOn time.Time `bson:"modified_on"`
CreatedBy string `bson:"created_by"`
Description string `bson:"description"`
}
QProject are the results of the QProject query
type QProjectMessageCount ¶
type QProjectMessageCount struct {
ProjectUUID string `bson:"project_uuid"`
NumberOfMessages int64 `bson:"msg_count"`
AverageDailyMessages float64 `bson:"avg_daily_msg"`
}
QProjectMessageCount holds information about the total messages and average daily messages for a specific project
type QProjectResourceCount ¶
type QProjectRoles ¶
type QProjectRoles struct {
ProjectUUID string `bson:"project_uuid"`
Roles []string `bson:"roles"`
}
QProjectRoles include information about projects and roles that user has
type QPushConfig ¶
type QPushConfig struct {
Type string `bson:"type"`
PushEndpoint string `bson:"push_endpoint"`
MaxMessages int64 `bson:"max_messages"`
AuthorizationType string `bson:"authorization_type"`
AuthorizationHeader string `bson:"authorization_header"`
RetPolicy string `bson:"retry_policy"`
RetPeriod int `bson:"retry_period"`
VerificationHash string `bson:"verification_hash"`
Verified bool `bson:"verified"`
MattermostURL string `bson:"mattermost_url"`
MattermostUsername string `bson:"mattermost_username"`
MattermostChannel string `bson:"mattermost_channel"`
Base64Decode bool `bson:"base_64_decode"`
}
QPushConfig holds optional configuration for push operations
type QSchema ¶
type QSchema struct {
ProjectUUID string `bson:"project_uuid"`
UUID string `bson:"uuid"`
Name string `bson:"name"`
Type string `bson:"type"`
RawSchema string `bson:"raw_schema"`
}
QSchema is the query model representing a schema
type QSub ¶
type QSub struct {
ID interface{} `bson:"_id,omitempty"`
ProjectUUID string `bson:"project_uuid"`
Name string `bson:"name"`
Topic string `bson:"topic"`
Offset int64 `bson:"offset"`
NextOffset int64 `bson:"next_offset"`
PendingAck string `bson:"pending_ack"`
PushType string `bson:"push_type"`
PushEndpoint string `bson:"push_endpoint"`
MaxMessages int64 `bson:"max_messages"`
AuthorizationType string `bson:"authorization_type"`
AuthorizationHeader string `bson:"authorization_header"`
Ack int `bson:"ack"`
RetPolicy string `bson:"retry_policy"`
RetPeriod int `bson:"retry_period"`
MsgNum int64 `bson:"msg_num"`
TotalBytes int64 `bson:"total_bytes"`
VerificationHash string `bson:"verification_hash"`
Verified bool `bson:"verified"`
MattermostURL string `bson:"mattermost_url"`
MattermostUsername string `bson:"mattermost_username"`
MattermostChannel string `bson:"mattermost_channel"`
Base64Decode bool `bson:"base_64_decode"`
LatestConsume time.Time `bson:"latest_consume"`
ConsumeRate float64 `bson:"consume_rate"`
CreatedOn time.Time `bson:"created_on"`
ACL []string `bson:"acl"`
}
QSub are the results of the Qsub query
type QTopic ¶
type QTopic struct {
ID interface{} `bson:"_id,omitempty"`
ProjectUUID string `bson:"project_uuid"`
Name string `bson:"name"`
MsgNum int64 `bson:"msg_num"`
TotalBytes int64 `bson:"total_bytes"`
LatestPublish time.Time `bson:"latest_publish"`
PublishRate float64 `bson:"publish_rate"`
SchemaUUID string `bson:"schema_uuid"`
CreatedOn time.Time `bson:"created_on"`
ACL []string `bson:"acl"`
}
QTopic are the results of the QTopic query
type QUser ¶
type QUser struct {
ID interface{} `bson:"_id,omitempty"`
UUID string `bson:"uuid"`
Projects []QProjectRoles `bson:"projects"`
Name string `bson:"name"`
FirstName string `bson:"first_name,omitempty"`
LastName string `bson:"last_name,omitempty"`
Organization string `bson:"organization,omitempty"`
Description string `bson:"description,omitempty"`
Token string `bson:"token"`
Email string `bson:"email"`
ServiceRoles []string `bson:"service_roles"`
CreatedOn time.Time `bson:"created_on"`
ModifiedOn time.Time `bson:"modified_on"`
CreatedBy string `bson:"created_by"`
}
QUser are the results of the QUser query
type QUserRegistration ¶
type QUserRegistration struct {
UUID string `bson:"uuid"`
Name string `bson:"name"`
FirstName string `bson:"first_name"`
LastName string `bson:"last_name"`
Organization string `bson:"organization"`
Description string `bson:"description"`
Email string `bson:"email"`
ActivationToken string `bson:"activation_token"`
Status string `bson:"status"`
DeclineComment string `bson:"decline_comment"`
RegisteredAt string `bson:"registered_at"`
ModifiedBy string `bson:"modified_by"`
ModifiedAt string `bson:"modified_at"`
}
QUserRegistration holds information about a UserRegister query
type QopMetric ¶
type QopMetric struct {
Hostname string `bson:"hostname"`
CPU float64 `bson:"cpu"`
MEM float64 `bson:"mem"`
}
QopMetric are the results of the QopMetric query
type Store ¶
type Store interface {
Initialize()
Clone() Store
Close()
LinkTopicSchema(ctx context.Context, projectUUID, name, schemaUUID string) error
QueryTopicsByACL(ctx context.Context, projectUUID, user string) ([]QTopic, error)
QueryTopics(ctx context.Context, projectUUID string, userUUID string, name string, pageToken string, pageSize int64) ([]QTopic, int64, string, error)
UpdateTopicLatestPublish(ctx context.Context, projectUUID string, name string, date time.Time) error
UpdateTopicPublishRate(ctx context.Context, projectUUID string, name string, rate float64) error
RemoveTopic(ctx context.Context, projectUUID string, name string) error
InsertTopic(ctx context.Context, projectUUID string, name string, schemaUUID string, createdOn time.Time) error
TopicsCount(ctx context.Context, startDate, endDate time.Time, projectUUIDs []string) (map[string]int64, error)
QueryDailyTopicMsgCount(ctx context.Context, projectUUID string, name string, date time.Time) ([]QDailyTopicMsgCount, error)
IncrementTopicMsgNum(ctx context.Context, projectUUID string, name string, num int64) error
IncrementDailyTopicMsgCount(ctx context.Context, projectUUID string, topicName string, num int64, date time.Time) error
IncrementTopicBytes(ctx context.Context, projectUUID string, name string, totalBytes int64) error
QuerySubsByTopic(ctx context.Context, projectUUID, topic string) ([]QSub, error)
QuerySubsByACL(ctx context.Context, projectUUID, user string) ([]QSub, error)
QuerySubs(ctx context.Context, projectUUID string, userUUID string, name string, pageToken string, pageSize int64) ([]QSub, int64, string, error)
UpdateSubLatestConsume(ctx context.Context, projectUUID string, name string, date time.Time) error
UpdateSubConsumeRate(ctx context.Context, projectUUID string, name string, rate float64) error
RemoveSub(ctx context.Context, projectUUID string, name string) error
IncrementSubBytes(ctx context.Context, projectUUID string, name string, totalBytes int64) error
IncrementSubMsgNum(ctx context.Context, projectUUID string, name string, num int64) error
InsertSub(ctx context.Context, projectUUID string, name string, topic string, offest int64, ack int, pushCfg QPushConfig, createdOn time.Time) error
QueryOneSub(ctx context.Context, projectUUID string, name string) (QSub, error)
QueryPushSubs(ctx context.Context) []QSub
SubscriptionsCount(ctx context.Context, startDate, endDate time.Time, projectUUIDs []string) (map[string]int64, error)
ModAck(ctx context.Context, projectUUID string, name string, ack int) error
UpdateSubOffset(ctx context.Context, projectUUID string, name string, offset int64)
UpdateSubPull(ctx context.Context, projectUUID string, name string, offset int64, ts string) error
UpdateSubOffsetAck(ctx context.Context, projectUUID string, name string, offset int64, ts string) error
ModSubPush(ctx context.Context, projectUUID string, name string, pushCfg QPushConfig) error
HasUsers(ctx context.Context, projectUUID string, users []string) (bool, []string)
PaginatedQueryUsers(ctx context.Context, pageToken string, pageSize int64, projectUUID string) ([]QUser, int64, string, error)
QueryUsers(ctx context.Context, projectUUID string, uuid string, name string) ([]QUser, error)
UpdateUser(ctx context.Context, uuid, fname, lname, org, desc string, projects []QProjectRoles, name string, email string, serviceRoles []string, modifiedOn time.Time) error
AppendToUserProjects(ctx context.Context, userUUID string, projectUUID string, pRoles ...string) error
UpdateUserToken(ctx context.Context, uuid string, token string) error
RemoveUser(ctx context.Context, uuid string) error
InsertUser(ctx context.Context, uuid string, projects []QProjectRoles, name string, firstName string, lastName string, org string, desc string, token string, email string, serviceRoles []string, createdOn time.Time, modifiedOn time.Time, createdBy string) error
GetUserFromToken(ctx context.Context, token string) (QUser, error)
UsersCount(ctx context.Context, startDate, endDate time.Time, projectUUIDs []string) (map[string]int64, error)
GetUserRoles(ctx context.Context, projectUUID string, token string) ([]string, string)
QueryProjects(ctx context.Context, uuid string, name string) ([]QProject, error)
UpdateProject(ctx context.Context, projectUUID string, name string, description string, modifiedOn time.Time) error
RemoveProject(ctx context.Context, uuid string) error
RemoveProjectTopics(ctx context.Context, projectUUID string) error
RemoveProjectSubs(ctx context.Context, projectUUID string) error
RemoveProjectDailyMessageCounters(ctx context.Context, projectUUID string) error
QueryDailyProjectMsgCount(ctx context.Context, projectUUID string) ([]QDailyProjectMsgCount, error)
QueryTotalMessagesPerProject(ctx context.Context, projectUUIDs []string, startDate time.Time, endDate time.Time) ([]QProjectMessageCount, error)
InsertProject(ctx context.Context, uuid string, name string, createdOn time.Time, modifiedOn time.Time, createdBy string, description string) error
HasProject(ctx context.Context, name string) bool
RegisterUser(ctx context.Context, uuid, name, firstName, lastName, email, org, desc, registeredAt, atkn, status string) error
DeleteRegistration(ctx context.Context, uuid string) error
QueryRegistrations(ctx context.Context, regUUID, status, activationToken, name, email, org string) ([]QUserRegistration, error)
UpdateRegistration(ctx context.Context, regUUID, status, declineComment, modifiedBy, modifiedAt string) error
InsertSchema(ctx context.Context, projectUUID, schemaUUID, name, schemaType, rawSchemaString string) error
QuerySchemas(ctx context.Context, projectUUID, schemaUUID, name string) ([]QSchema, error)
UpdateSchema(ctx context.Context, schemaUUID, name, schemaType, rawSchemaString string) error
DeleteSchema(ctx context.Context, schemaUUID string) error
// ##### ACL QUERIES ######
QueryACL(ctx context.Context, projectUUID string, resource string, name string) (QAcl, error)
ExistsInACL(ctx context.Context, projectUUID string, resource string, resourceName string, userUUID string) error
ModACL(ctx context.Context, projectUUID string, resource string, name string, acl []string) error
AppendToACL(ctx context.Context, projectUUID string, resource string, name string, acl []string) error
RemoveFromACL(ctx context.Context, projectUUID string, resource string, name string, acl []string) error
// ##### ROLES QUERIES #####
HasResourceRoles(ctx context.Context, resource string, roles []string) bool
InsertResourceRoles(ctx context.Context, resource string, roles []string) error
GetAllRoles(ctx context.Context) []string
// ##### OP METRICS QUERIES #####
InsertOpMetric(ctx context.Context, hostname string, cpu float64, mem float64) error
GetOpMetrics(ctx context.Context) []QopMetric
}
Store encapsulates the generic store interface