Documentation ¶
Index ¶
- type MockStore
- func (mk *MockStore) AppendToACL(projectUUID string, resource string, name string, acl []string) error
- func (mk *MockStore) AppendToUserProjects(userUUID string, projectUUID string, pRoles ...string) error
- func (mk *MockStore) Clone() Store
- func (mk *MockStore) Close()
- func (mk *MockStore) ExistsInACL(projectUUID string, resource string, resourceName string, userUUID string) error
- func (mk *MockStore) GetAllRoles() []string
- func (mk *MockStore) GetOpMetrics() []QopMetric
- func (mk *MockStore) GetUserFromToken(token string) (QUser, error)
- func (mk *MockStore) GetUserRoles(projectUUID string, token string) ([]string, string)
- func (mk *MockStore) HasProject(name string) bool
- func (mk *MockStore) HasResourceRoles(resource string, roles []string) bool
- func (mk *MockStore) HasUsers(projectUUID string, users []string) (bool, []string)
- func (mk *MockStore) IncrementDailyTopicMsgCount(projectUUID string, topicName string, num int64, date time.Time) error
- func (mk *MockStore) IncrementSubBytes(projectUUID string, name string, totalBytes int64) error
- func (mk *MockStore) IncrementSubMsgNum(projectUUID string, name string, num int64) error
- func (mk *MockStore) IncrementTopicBytes(projectUUID string, name string, totalBytes int64) error
- func (mk *MockStore) IncrementTopicMsgNum(projectUUID string, name string, num int64) error
- func (mk *MockStore) Initialize()
- func (mk *MockStore) InsertOpMetric(hostname string, cpu float64, mem float64) error
- func (mk *MockStore) InsertProject(uuid string, name string, createdOn time.Time, modifiedOn time.Time, ...) error
- func (mk *MockStore) InsertSub(projectUUID string, name string, topic string, offset int64, ack int, ...) error
- func (mk *MockStore) InsertTopic(projectUUID string, name string) error
- func (mk *MockStore) InsertUser(uuid string, projects []QProjectRoles, name string, token string, email string, ...) error
- func (mk *MockStore) ModACL(projectUUID string, resource string, name string, acl []string) error
- func (mk *MockStore) ModAck(projectUUID string, name string, ack int) error
- func (mk *MockStore) ModSubPush(projectUUID string, name string, push string, rPolicy string, rPeriod int, ...) error
- func (mk *MockStore) ModSubPushStatus(projectUUID string, name string, status string) error
- func (mk *MockStore) PaginatedQueryUsers(pageToken string, pageSize int32) ([]QUser, int32, string, error)
- func (mk *MockStore) QueryACL(projectUUID string, resource string, name string) (QAcl, error)
- func (mk *MockStore) QueryDailyProjectMsgCount(projectUUID string) ([]QDailyProjectMsgCount, error)
- func (mk *MockStore) QueryDailyTopicMsgCount(projectUUID string, topicName string, date time.Time) ([]QDailyTopicMsgCount, error)
- func (mk *MockStore) QueryOneSub(projectUUID string, name string) (QSub, error)
- func (mk *MockStore) QueryProjects(uuid string, name string) ([]QProject, error)
- func (mk *MockStore) QueryPushSubs() []QSub
- func (mk *MockStore) QuerySubs(projectUUID, userUUID, name, pageToken string, pageSize int32) ([]QSub, int32, string, error)
- func (mk *MockStore) QuerySubsByACL(projectUUID, user string) ([]QSub, error)
- func (mk *MockStore) QuerySubsByTopic(projectUUID, topic string) ([]QSub, error)
- func (mk *MockStore) QueryTopics(projectUUID, userUUID, name, pageToken string, pageSize int32) ([]QTopic, int32, string, error)
- func (mk *MockStore) QueryTopicsByACL(projectUUID, user string) ([]QTopic, error)
- func (mk *MockStore) QueryUsers(projectUUID string, uuid string, name string) ([]QUser, error)
- func (mk *MockStore) RemoveFromACL(projectUUID string, resource string, name string, acl []string) error
- func (mk *MockStore) RemoveProject(uuid string) error
- func (mk *MockStore) RemoveProjectSubs(projectUUID string) error
- func (mk *MockStore) RemoveProjectTopics(projectUUID string) error
- func (mk *MockStore) RemoveSub(projectUUID string, name string) error
- func (mk *MockStore) RemoveTopic(projectUUID string, name string) error
- func (mk *MockStore) RemoveUser(uuid string) error
- func (mk *MockStore) UpdateProject(projectUUID string, name string, description string, modifiedOn time.Time) error
- func (mk *MockStore) UpdateSubOffset(projectUUID string, name string, offset int64)
- func (mk *MockStore) UpdateSubOffsetAck(projectUUID string, name string, offset int64, ts string) error
- func (mk *MockStore) UpdateSubPull(projectUUID string, name string, offset int64, ts string) error
- func (mk *MockStore) UpdateUser(uuid string, projects []QProjectRoles, name string, email string, ...) error
- func (mk *MockStore) UpdateUserToken(uuid string, token string) error
- type MongoStore
- func (mong *MongoStore) AppendToACL(projectUUID string, resource string, name string, acl []string) error
- func (mong *MongoStore) AppendToUserProjects(userUUID string, projectUUID string, pRoles ...string) error
- func (mong *MongoStore) Clone() Store
- func (mong *MongoStore) Close()
- func (mong *MongoStore) ExistsInACL(projectUUID string, resource string, resourceName string, userUUID string) error
- func (mong *MongoStore) GetAllRoles() []string
- func (mong *MongoStore) GetOpMetrics() []QopMetric
- func (mong *MongoStore) GetUserFromToken(token string) (QUser, error)
- func (mong *MongoStore) GetUserRoles(projectUUID string, token string) ([]string, string)
- func (mong *MongoStore) HasProject(name string) bool
- func (mong *MongoStore) HasResourceRoles(resource string, roles []string) bool
- func (mong *MongoStore) HasUsers(projectUUID string, users []string) (bool, []string)
- func (mong *MongoStore) IncrementDailyTopicMsgCount(projectUUID string, topicName string, num int64, date time.Time) error
- func (mong *MongoStore) IncrementSubBytes(projectUUID string, name string, totalBytes int64) error
- func (mong *MongoStore) IncrementSubMsgNum(projectUUID string, name string, num int64) error
- func (mong *MongoStore) IncrementTopicBytes(projectUUID string, name string, totalBytes int64) error
- func (mong *MongoStore) IncrementTopicMsgNum(projectUUID string, name string, num int64) error
- func (mong *MongoStore) Initialize()
- func (mong *MongoStore) InsertOpMetric(hostname string, cpu float64, mem float64) error
- func (mong *MongoStore) InsertProject(uuid string, name string, createdOn time.Time, modifiedOn time.Time, ...) error
- func (mong *MongoStore) InsertResource(col string, res interface{}) error
- func (mong *MongoStore) InsertSub(projectUUID string, name string, topic string, offset int64, ack int, ...) error
- func (mong *MongoStore) InsertTopic(projectUUID string, name string) error
- func (mong *MongoStore) InsertUser(uuid string, projects []QProjectRoles, name string, token string, email string, ...) error
- func (mong *MongoStore) ModACL(projectUUID string, resource string, name string, acl []string) error
- func (mong *MongoStore) ModAck(projectUUID string, name string, ack int) error
- func (mong *MongoStore) ModSubPush(projectUUID string, name string, push string, rPolicy string, rPeriod int, ...) error
- func (mong *MongoStore) ModSubPushStatus(projectUUID string, name string, status string) error
- func (mong *MongoStore) PaginatedQueryUsers(pageToken string, pageSize int32) ([]QUser, int32, string, error)
- func (mong *MongoStore) QueryACL(projectUUID string, resource string, name string) (QAcl, error)
- func (mong *MongoStore) QueryDailyProjectMsgCount(projectUUID string) ([]QDailyProjectMsgCount, error)
- func (mong *MongoStore) QueryDailyTopicMsgCount(projectUUID string, topicName string, date time.Time) ([]QDailyTopicMsgCount, error)
- func (mong *MongoStore) QueryOneSub(projectUUID string, name string) (QSub, error)
- func (mong *MongoStore) QueryProjects(uuid string, name string) ([]QProject, error)
- func (mong *MongoStore) QueryPushSubs() []QSub
- func (mong *MongoStore) QuerySubs(projectUUID, userUUID, name, pageToken string, pageSize int32) ([]QSub, int32, string, error)
- func (mong *MongoStore) QuerySubsByACL(projectUUID, user string) ([]QSub, error)
- func (mong *MongoStore) QuerySubsByTopic(projectUUID, topic string) ([]QSub, error)
- func (mong *MongoStore) QueryTopics(projectUUID, userUUID, name, pageToken string, pageSize int32) ([]QTopic, int32, string, error)
- func (mong *MongoStore) QueryTopicsByACL(projectUUID, user string) ([]QTopic, error)
- func (mong *MongoStore) QueryUsers(projectUUID string, uuid string, name string) ([]QUser, error)
- func (mong *MongoStore) RemoveAll(col string, res interface{}) error
- func (mong *MongoStore) RemoveFromACL(projectUUID string, resource string, name string, acl []string) error
- func (mong *MongoStore) RemoveProject(uuid string) error
- func (mong *MongoStore) RemoveProjectSubs(projectUUID string) error
- func (mong *MongoStore) RemoveProjectTopics(projectUUID string) error
- func (mong *MongoStore) RemoveResource(col string, res interface{}) error
- func (mong *MongoStore) RemoveSub(projectUUID string, name string) error
- func (mong *MongoStore) RemoveTopic(projectUUID string, name string) error
- func (mong *MongoStore) RemoveUser(uuid string) error
- func (mong *MongoStore) UpdateProject(projectUUID string, name string, description string, modifiedOn time.Time) error
- func (mong *MongoStore) UpdateSubOffset(projectUUID string, name string, offset int64)
- func (mong *MongoStore) UpdateSubOffsetAck(projectUUID string, name string, offset int64, ts string) error
- func (mong *MongoStore) UpdateSubPull(projectUUID string, name string, nextOff int64, ts string) error
- func (mong *MongoStore) UpdateUser(uuid string, projects []QProjectRoles, name string, email string, ...) error
- func (mong *MongoStore) UpdateUserToken(uuid string, token string) error
- type QAcl
- type QDailyProjectMsgCount
- type QDailyTopicMsgCount
- type QProject
- type QProjectRoles
- type QRole
- type QSub
- type QTopic
- type QUser
- type QopMetric
- type Store
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type MockStore ¶
type MockStore struct { Server string Database string SubList []QSub TopicList []QTopic DailyTopicMsgCount []QDailyTopicMsgCount ProjectList []QProject UserList []QUser RoleList []QRole 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 (*MockStore) AppendToUserProjects ¶
func (*MockStore) ExistsInACL ¶
func (*MockStore) GetAllRoles ¶
GetAllRoles returns a list of all available roles
func (*MockStore) GetOpMetrics ¶
func (*MockStore) GetUserFromToken ¶
func (*MockStore) GetUserRoles ¶
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) IncrementDailyTopicMsgCount ¶
func (mk *MockStore) IncrementDailyTopicMsgCount(projectUUID string, topicName string, num int64, date time.Time) error
IncrementTopicMsgNum increase number of messages published in a topic
func (*MockStore) IncrementSubBytes ¶
IncrementSubBytes increases the total number of bytes published in a subscription
func (*MockStore) IncrementSubMsgNum ¶
IncrementSubMsgNum increase number of messages pulled in a subscription
func (*MockStore) IncrementTopicBytes ¶
IncrementTopicBytes increases the total number of bytes published in a topic
func (*MockStore) IncrementTopicMsgNum ¶
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 (*MockStore) InsertProject ¶
func (mk *MockStore) InsertProject(uuid string, name string, createdOn time.Time, modifiedOn time.Time, createdBy string, description string) error
InsertProject inserts a project to the store
func (*MockStore) InsertSub ¶
func (mk *MockStore) InsertSub(projectUUID string, name string, topic string, offset int64, ack int, push string, rPolicy string, rPeriod int, vhash string, verified bool) error
InsertSub inserts a new sub object to the store
func (*MockStore) InsertTopic ¶
InsertTopic inserts a new topic object to the store
func (*MockStore) InsertUser ¶
func (mk *MockStore) InsertUser(uuid string, projects []QProjectRoles, name 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) ModSubPush ¶
func (mk *MockStore) ModSubPush(projectUUID string, name string, push string, rPolicy string, rPeriod int, vhash string, verified bool) error
ModSubPush modifies the subscription push configuration
func (*MockStore) ModSubPushStatus ¶
ModSubPush modifies the subscription push configuration
func (*MockStore) PaginatedQueryUsers ¶
func (*MockStore) QueryDailyProjectMsgCount ¶
func (mk *MockStore) QueryDailyProjectMsgCount(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(projectUUID string, topicName string, date time.Time) ([]QDailyTopicMsgCount, error)
IncrementTopicMsgNum increase number of messages published in a topic
func (*MockStore) QueryOneSub ¶
QueryOneSub returns one sub exactly
func (*MockStore) QueryProjects ¶
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) QuerySubs ¶
func (mk *MockStore) QuerySubs(projectUUID, userUUID, name, pageToken string, pageSize int32) ([]QSub, int32, string, error)
QuerySubs Query Subscription info from store
func (*MockStore) QuerySubsByACL ¶
func (*MockStore) QuerySubsByTopic ¶
func (*MockStore) QueryTopics ¶
func (mk *MockStore) QueryTopics(projectUUID, userUUID, name, pageToken string, pageSize int32) ([]QTopic, int32, string, error)
QueryTopics Query Subscription info from store
func (*MockStore) QueryTopicsByACL ¶
func (*MockStore) QueryUsers ¶
QueryUsers queries the datastore for user information
func (*MockStore) RemoveFromACL ¶
func (*MockStore) RemoveProject ¶
RemoveProject removes an existing project
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) UpdateProject ¶
func (mk *MockStore) UpdateProject(projectUUID string, name string, description string, modifiedOn time.Time) error
UpdateProject updates project information
func (*MockStore) UpdateSubOffset ¶
UpdateSubOffset updates the offset of the current subscription
func (*MockStore) UpdateSubOffsetAck ¶
func (mk *MockStore) UpdateSubOffsetAck(projectUUID string, name string, offset int64, ts string) error
UpdateSubOffsetAck updates the offset of the current subscription
func (*MockStore) UpdateSubPull ¶
UpdateSubPull updates next offset info after a pull
type MongoStore ¶
MongoStore holds configuration
func NewMongoStore ¶
func NewMongoStore(server string, db string) *MongoStore
NewMongoStore creates new mongo store
func (*MongoStore) AppendToACL ¶
func (*MongoStore) AppendToUserProjects ¶
func (mong *MongoStore) AppendToUserProjects(userUUID string, projectUUID string, pRoles ...string) error
AppendToUserProjects appends a new unique project to the user's projects
func (*MongoStore) Clone ¶
func (mong *MongoStore) Clone() Store
Clone the store with a cloned session
func (*MongoStore) ExistsInACL ¶
func (mong *MongoStore) ExistsInACL(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 (*MongoStore) GetAllRoles ¶
func (mong *MongoStore) GetAllRoles() []string
GetAllRoles returns a list of all available roles
func (*MongoStore) GetOpMetrics ¶
func (mong *MongoStore) GetOpMetrics() []QopMetric
GetOpMetrics returns the operational metrics from datastore
func (*MongoStore) GetUserFromToken ¶
func (mong *MongoStore) GetUserFromToken(token string) (QUser, error)
GetUserFromToken returns user information from a specific token
func (*MongoStore) GetUserRoles ¶
func (mong *MongoStore) GetUserRoles(projectUUID string, token string) ([]string, string)
GetUserRoles returns the roles of a user in a project
func (*MongoStore) HasProject ¶
func (mong *MongoStore) HasProject(name string) bool
HasProject Returns true if project exists
func (*MongoStore) HasResourceRoles ¶
func (mong *MongoStore) HasResourceRoles(resource string, roles []string) bool
HasResourceRoles returns the roles of a user in a project
func (*MongoStore) HasUsers ¶
func (mong *MongoStore) HasUsers(projectUUID string, users []string) (bool, []string)
HasUsers accepts a user array of usernames and returns the not found
func (*MongoStore) IncrementDailyTopicMsgCount ¶
func (mong *MongoStore) IncrementDailyTopicMsgCount(projectUUID string, topicName string, num int64, date time.Time) error
IncrementDailyTopicMsgCount increments the daily count of published messages to a specific topic
func (*MongoStore) IncrementSubBytes ¶
func (mong *MongoStore) IncrementSubBytes(projectUUID string, name string, totalBytes int64) error
IncrementSubMsgNum increases the total number of bytes consumed from a subscripion
func (*MongoStore) IncrementSubMsgNum ¶
func (mong *MongoStore) IncrementSubMsgNum(projectUUID string, name string, num int64) error
IncrementTopicMsgNum increments the number of messages pulled in a subscription
func (*MongoStore) IncrementTopicBytes ¶
func (mong *MongoStore) IncrementTopicBytes(projectUUID string, name string, totalBytes int64) error
IncrementTopicBytes increases the total number of bytes published in a topic
func (*MongoStore) IncrementTopicMsgNum ¶
func (mong *MongoStore) IncrementTopicMsgNum(projectUUID string, name string, num int64) error
IncrementTopicMsgNum increments the number of messages published in a topic
func (*MongoStore) Initialize ¶
func (mong *MongoStore) Initialize()
Initialize initializes the mongo store struct
func (*MongoStore) InsertOpMetric ¶
func (mong *MongoStore) InsertOpMetric(hostname string, cpu float64, mem float64) error
InsertOpMetric inserts an operational metric
func (*MongoStore) InsertProject ¶
func (mong *MongoStore) InsertProject(uuid string, name string, createdOn time.Time, modifiedOn time.Time, createdBy string, description string) error
InsertProject inserts a project to the store
func (*MongoStore) InsertResource ¶
func (mong *MongoStore) InsertResource(col string, res interface{}) error
InsertResource inserts a new topic object to the datastore
func (*MongoStore) InsertSub ¶
func (mong *MongoStore) InsertSub(projectUUID string, name string, topic string, offset int64, ack int, push string, rPolicy string, rPeriod int, vhash string, verified bool) error
InsertSub inserts a subscription to the store
func (*MongoStore) InsertTopic ¶
func (mong *MongoStore) InsertTopic(projectUUID string, name string) error
InsertTopic inserts a topic to the store
func (*MongoStore) InsertUser ¶
func (mong *MongoStore) InsertUser(uuid string, projects []QProjectRoles, name 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 (*MongoStore) ModACL ¶
func (mong *MongoStore) ModACL(projectUUID string, resource string, name string, acl []string) error
ModACL modifies the push configuration
func (*MongoStore) ModAck ¶
func (mong *MongoStore) ModAck(projectUUID string, name string, ack int) error
ModAck modifies the subscription's ack timeout field in mongodb
func (*MongoStore) ModSubPush ¶
func (mong *MongoStore) ModSubPush(projectUUID string, name string, push string, rPolicy string, rPeriod int, vhash string, verified bool) error
ModSubPush modifies the push configuration
func (*MongoStore) ModSubPushStatus ¶
func (mong *MongoStore) ModSubPushStatus(projectUUID string, name string, status string) error
ModSubPushStatus modifies the push status
func (*MongoStore) PaginatedQueryUsers ¶
func (mong *MongoStore) PaginatedQueryUsers(pageToken string, pageSize int32) ([]QUser, int32, string, error)
PaginatedQueryUsers returns a page of users
func (*MongoStore) QueryDailyProjectMsgCount ¶
func (mong *MongoStore) QueryDailyProjectMsgCount(projectUUID string) ([]QDailyProjectMsgCount, error)
func (*MongoStore) QueryDailyTopicMsgCount ¶
func (mong *MongoStore) QueryDailyTopicMsgCount(projectUUID string, topicName string, date time.Time) ([]QDailyTopicMsgCount, error)
QueryDailyTopicMsgCount returns results regarding the number of messages published to a topic
func (*MongoStore) QueryOneSub ¶
func (mong *MongoStore) QueryOneSub(projectUUID string, name string) (QSub, error)
QueryOneSub queries and returns specific sub of project
func (*MongoStore) QueryProjects ¶
func (mong *MongoStore) QueryProjects(uuid string, name string) ([]QProject, error)
QueryProjects queries the database for a specific project or a list of all projects
func (*MongoStore) QueryPushSubs ¶
func (mong *MongoStore) QueryPushSubs() []QSub
QueryPushSubs retrieves subscriptions that have a push_endpoint defined
func (*MongoStore) QuerySubs ¶
func (mong *MongoStore) QuerySubs(projectUUID, userUUID, name, pageToken string, pageSize int32) ([]QSub, int32, string, error)
QuerySubs Query Subscription info from store
func (*MongoStore) QuerySubsByACL ¶
func (mong *MongoStore) QuerySubsByACL(projectUUID, user string) ([]QSub, error)
QuerySubsByACL returns subscriptions that a specific username has access to
func (*MongoStore) QuerySubsByTopic ¶
func (mong *MongoStore) QuerySubsByTopic(projectUUID, topic string) ([]QSub, error)
QuerySubsByTopic returns subscriptions of a specific topic
func (*MongoStore) QueryTopics ¶
func (mong *MongoStore) QueryTopics(projectUUID, userUUID, name, pageToken string, pageSize int32) ([]QTopic, int32, string, error)
QueryTopics Query Subscription info from store
func (*MongoStore) QueryTopicsByACL ¶
func (mong *MongoStore) QueryTopicsByACL(projectUUID, user string) ([]QTopic, error)
QueryTopicsByACL returns topics that a specific username has access to
func (*MongoStore) QueryUsers ¶
QueryUsers queries user(s) information belonging to a project
func (*MongoStore) RemoveAll ¶
func (mong *MongoStore) RemoveAll(col string, res interface{}) error
RemoveAll removes all occurences matched with a resource from the store
func (*MongoStore) RemoveFromACL ¶
func (*MongoStore) RemoveProject ¶
func (mong *MongoStore) RemoveProject(uuid string) error
RemoveProject removes a project from the store
func (*MongoStore) RemoveProjectSubs ¶
func (mong *MongoStore) RemoveProjectSubs(projectUUID string) error
RemoveProjectSubs removes all subscriptions related to a project UUID
func (*MongoStore) RemoveProjectTopics ¶
func (mong *MongoStore) RemoveProjectTopics(projectUUID string) error
RemoveProjectTopics removes all topics related to a project UUID
func (*MongoStore) RemoveResource ¶
func (mong *MongoStore) RemoveResource(col string, res interface{}) error
RemoveResource removes a resource from the store
func (*MongoStore) RemoveSub ¶
func (mong *MongoStore) RemoveSub(projectUUID string, name string) error
RemoveSub removes a subscription from the store
func (*MongoStore) RemoveTopic ¶
func (mong *MongoStore) RemoveTopic(projectUUID string, name string) error
RemoveTopic removes a topic from the store
func (*MongoStore) RemoveUser ¶
func (mong *MongoStore) RemoveUser(uuid string) error
RemoveUser removes a user entry from the store
func (*MongoStore) UpdateProject ¶
func (mong *MongoStore) UpdateProject(projectUUID string, name string, description string, modifiedOn time.Time) error
UpdateProject updates project information
func (*MongoStore) UpdateSubOffset ¶
func (mong *MongoStore) UpdateSubOffset(projectUUID string, name string, offset int64)
UpdateSubOffset updates a subscription offset
func (*MongoStore) UpdateSubOffsetAck ¶
func (mong *MongoStore) UpdateSubOffsetAck(projectUUID string, name string, offset int64, ts string) error
UpdateSubOffsetAck updates a subscription offset after Ack
func (*MongoStore) UpdateSubPull ¶
func (mong *MongoStore) UpdateSubPull(projectUUID string, name string, nextOff int64, ts string) error
UpdateSubPull updates next offset and sets timestamp for Ack
func (*MongoStore) UpdateUser ¶
func (mong *MongoStore) UpdateUser(uuid string, projects []QProjectRoles, name string, email string, serviceRoles []string, modifiedOn time.Time) error
UpdateUser updates user information
func (*MongoStore) UpdateUserToken ¶
func (mong *MongoStore) UpdateUserToken(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 QProjectRoles ¶
type QProjectRoles struct { ProjectUUID string `bson:"project_uuid"` Roles []string `bson:"roles"` }
QProjectRoles include information about projects and roles that user has
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"` PushEndpoint string `bson:"push_endpoint"` Ack int `bson:"ack"` RetPolicy string `bson:"retry_policy"` RetPeriod int `bson:"retry_period"` MsgNum int64 `bson:"msg_num"` TotalBytes int64 `bson:"total_bytes"` PushStatus string `bson:"push_status,omitempty"` VerificationHash string `bson:"verification_hash"` Verified bool `bson:"verified"` }
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"` }
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"` 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 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() QuerySubsByTopic(projectUUID, topic string) ([]QSub, error) QueryTopicsByACL(projectUUID, user string) ([]QTopic, error) QuerySubsByACL(projectUUID, user string) ([]QSub, error) QuerySubs(projectUUID string, userUUID string, name string, pageToken string, pageSize int32) ([]QSub, int32, string, error) QueryTopics(projectUUID string, userUUID string, name string, pageToken string, pageSize int32) ([]QTopic, int32, string, error) QueryDailyTopicMsgCount(projectUUID string, name string, date time.Time) ([]QDailyTopicMsgCount, error) RemoveTopic(projectUUID string, name string) error RemoveSub(projectUUID string, name string) error PaginatedQueryUsers(pageToken string, pageSize int32) ([]QUser, int32, string, error) QueryUsers(projectUUID string, uuid string, name string) ([]QUser, error) UpdateUser(uuid string, projects []QProjectRoles, name string, email string, serviceRoles []string, modifiedOn time.Time) error AppendToUserProjects(userUUID string, projectUUID string, pRoles ...string) error UpdateUserToken(uuid string, token string) error RemoveUser(uuid string) error QueryProjects(uuid string, name string) ([]QProject, error) UpdateProject(projectUUID string, name string, description string, modifiedOn time.Time) error RemoveProject(uuid string) error RemoveProjectTopics(projectUUID string) error RemoveProjectSubs(projectUUID string) error QueryDailyProjectMsgCount(projectUUID string) ([]QDailyProjectMsgCount, error) InsertUser(uuid string, projects []QProjectRoles, name string, token string, email string, serviceRoles []string, createdOn time.Time, modifiedOn time.Time, createdBy string) error InsertProject(uuid string, name string, createdOn time.Time, modifiedOn time.Time, createdBy string, description string) error InsertOpMetric(hostname string, cpu float64, mem float64) error InsertTopic(projectUUID string, name string) error IncrementTopicMsgNum(projectUUID string, name string, num int64) error IncrementDailyTopicMsgCount(projectUUID string, topicName string, num int64, date time.Time) error IncrementTopicBytes(projectUUID string, name string, totalBytes int64) error IncrementSubBytes(projectUUID string, name string, totalBytes int64) error IncrementSubMsgNum(projectUUID string, name string, num int64) error InsertSub(projectUUID string, name string, topic string, offest int64, ack int, push string, rPolicy string, rPeriod int, vhash string, verified bool) error HasProject(name string) bool HasUsers(projectUUID string, users []string) (bool, []string) QueryOneSub(projectUUID string, name string) (QSub, error) QueryPushSubs() []QSub HasResourceRoles(resource string, roles []string) bool GetOpMetrics() []QopMetric GetUserRoles(projectUUID string, token string) ([]string, string) GetUserFromToken(token string) (QUser, error) UpdateSubOffset(projectUUID string, name string, offset int64) UpdateSubPull(projectUUID string, name string, offset int64, ts string) error UpdateSubOffsetAck(projectUUID string, name string, offset int64, ts string) error ModSubPush(projectUUID string, name string, push string, rPolicy string, rPeriod int, vhash string, verified bool) error ModSubPushStatus(projectUUID string, name string, status string) error QueryACL(projectUUID string, resource string, name string) (QAcl, error) ExistsInACL(projectUUID string, resource string, resourceName string, userUUID string) error ModACL(projectUUID string, resource string, name string, acl []string) error AppendToACL(projectUUID string, resource string, name string, acl []string) error RemoveFromACL(projectUUID string, resource string, name string, acl []string) error ModAck(projectUUID string, name string, ack int) error GetAllRoles() []string Clone() Store Close() }
Store encapsulates the generic store interface