sqlstore

package
v5.22.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 4, 2020 License: AGPL-3.0, Apache-2.0 Imports: 23 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ALL_CLASS_MEMBERS_FOR_USER_CACHE_SIZE = model.SESSION_CACHE_SIZE
	ALL_CLASS_MEMBERS_FOR_USER_CACHE_SEC  = 900 // 15 mins

	ALL_CLASS_MEMBERS_NOTIFY_PROPS_FOR_CLASS_CACHE_SIZE = model.SESSION_CACHE_SIZE
	ALL_CLASS_MEMBERS_NOTIFY_PROPS_FOR_CLASS_CACHE_SEC  = 1800 // 30 mins

	CLASS_CACHE_SEC = 900 // 15 mins
)
View Source
const (
	INDEX_TYPE_FULL_TEXT = "full_text"
	INDEX_TYPE_DEFAULT   = "default"
	DB_PING_ATTEMPTS     = 18
	DB_PING_TIMEOUT_SECS = 10
)
View Source
const (
	EXIT_GENERIC_FAILURE             = 1
	EXIT_CREATE_TABLE                = 100
	EXIT_DB_OPEN                     = 101
	EXIT_PING                        = 102
	EXIT_NO_DRIVER                   = 103
	EXIT_TABLE_EXISTS                = 104
	EXIT_TABLE_EXISTS_MYSQL          = 105
	EXIT_COLUMN_EXISTS               = 106
	EXIT_DOES_COLUMN_EXISTS_POSTGRES = 107
	EXIT_DOES_COLUMN_EXISTS_MYSQL    = 108
	EXIT_DOES_COLUMN_EXISTS_MISSING  = 109
	EXIT_CREATE_COLUMN_POSTGRES      = 110
	EXIT_CREATE_COLUMN_MYSQL         = 111
	EXIT_CREATE_COLUMN_MISSING       = 112
	EXIT_REMOVE_COLUMN               = 113
	EXIT_RENAME_COLUMN               = 114
	EXIT_MAX_COLUMN                  = 115
	EXIT_ALTER_COLUMN                = 116
	EXIT_CREATE_INDEX_POSTGRES       = 117
	EXIT_CREATE_INDEX_MYSQL          = 118
	EXIT_CREATE_INDEX_FULL_MYSQL     = 119
	EXIT_CREATE_INDEX_MISSING        = 120
	EXIT_REMOVE_INDEX_POSTGRES       = 121
	EXIT_REMOVE_INDEX_MYSQL          = 122
	EXIT_REMOVE_INDEX_MISSING        = 123
	EXIT_REMOVE_TABLE                = 134
	EXIT_CREATE_INDEX_SQLITE         = 135
	EXIT_REMOVE_INDEX_SQLITE         = 136
	EXIT_TABLE_EXISTS_SQLITE         = 137
	EXIT_DOES_COLUMN_EXISTS_SQLITE   = 138
	EXIT_ALTER_PRIMARY_KEY           = 139
)
View Source
const (
	BRANCH_MEMBER_EXISTS_ERROR = "store.sql_branch.save_member.exists.app_error"
)
View Source
const (
	MAX_GROUP_CHANNELS_FOR_PROFILES = 50
)
View Source
const (
	MISSING_STATUS_ERROR = "store.sql_status.get.missing.app_error"
)
View Source
const (
	SESSIONS_CLEANUP_DELAY_MILLISECONDS = 100
)
View Source
const (
	UPDATE_POST_HAS_REACTIONS_ON_DELETE_QUERY = `` /* 148-byte string literal not displayed */

)

Variables

View Source
var (
	USER_SEARCH_TYPE_NAMES_NO_FULL_NAME = []string{"Username", "Nickname"}
	USER_SEARCH_TYPE_NAMES              = []string{"Username", "FirstName", "LastName", "Nickname"}
	USER_SEARCH_TYPE_ALL_NO_FULL_NAME   = []string{"Username", "Nickname", "Email"}
	USER_SEARCH_TYPE_ALL                = []string{"Username", "FirstName", "LastName", "Nickname", "Email"}
)
View Source
var CLASS_MEMBERS_WITH_SCHEME_SELECT_QUERY = `` /* 565-byte string literal not displayed */

Functions

func CheckRelationalIntegrity

func CheckRelationalIntegrity(ss *SqlSupplier, results chan<- store.IntegrityCheckResult)

func IsUniqueConstraintError

func IsUniqueConstraintError(err error, indexName []string) bool

func MapStringsToQueryParams

func MapStringsToQueryParams(list []string, paramPrefix string) (string, map[string]interface{})

Converts a list of strings into a list of query parameters and a named parameter map that can be used as part of a SQL query.

func NewBranchMemberFromModel

func NewBranchMemberFromModel(tm *model.BranchMember) *branchMember

func NewClassMemberFromModel

func NewClassMemberFromModel(cm *model.ClassMember) *classMember

Types

type JSONSerializable

type JSONSerializable interface {
	ToJson() string
}

type Role

type Role struct {
	Id            string
	Name          string
	DisplayName   string
	Description   string
	CreateAt      int64
	UpdateAt      int64
	DeleteAt      int64
	Permissions   string
	SchemeManaged bool
	BuiltIn       bool
}

func NewRoleFromModel

func NewRoleFromModel(role *model.Role) *Role

func (Role) ToModel

func (role Role) ToModel() *model.Role

type SqlAuditStore

type SqlAuditStore struct {
	SqlStore
}

func (SqlAuditStore) Get

func (s SqlAuditStore) Get(user_id string, offset int, limit int) (model.Audits, *model.AppError)

func (SqlAuditStore) PermanentDeleteByUser

func (s SqlAuditStore) PermanentDeleteByUser(userId string) *model.AppError

func (SqlAuditStore) Save

func (s SqlAuditStore) Save(audit *model.Audit) *model.AppError

type SqlBranchStore

type SqlBranchStore struct {
	SqlStore
}

func (SqlBranchStore) AnalyticsBranchCount

func (s SqlBranchStore) AnalyticsBranchCount(includeDeleted bool) (int64, *model.AppError)

func (SqlBranchStore) AnalyticsGetBranchCountForScheme

func (s SqlBranchStore) AnalyticsGetBranchCountForScheme(schemeId string) (int64, *model.AppError)

func (SqlBranchStore) ClearAllCustomRoleAssignments

func (s SqlBranchStore) ClearAllCustomRoleAssignments() *model.AppError

func (SqlBranchStore) ClearCaches

func (s SqlBranchStore) ClearCaches()

func (SqlBranchStore) Get

func (SqlBranchStore) GetActiveMemberCount

func (s SqlBranchStore) GetActiveMemberCount(branchId string, restrictions *model.ViewUsersRestrictions) (int64, *model.AppError)

func (SqlBranchStore) GetAll

func (s SqlBranchStore) GetAll() ([]*model.Branch, *model.AppError)

func (SqlBranchStore) GetAllForExportAfter

func (s SqlBranchStore) GetAllForExportAfter(limit int, afterId string) ([]*model.BranchForExport, *model.AppError)

func (SqlBranchStore) GetAllPage

func (s SqlBranchStore) GetAllPage(offset int, limit int) ([]*model.Branch, *model.AppError)

func (SqlBranchStore) GetBranchMembersForExport

func (s SqlBranchStore) GetBranchMembersForExport(userId string) ([]*model.BranchMemberForExport, *model.AppError)

func (SqlBranchStore) GetBranchesByScheme

func (s SqlBranchStore) GetBranchesByScheme(schemeId string, offset int, limit int) ([]*model.Branch, *model.AppError)

func (SqlBranchStore) GetBranchesByUserId

func (s SqlBranchStore) GetBranchesByUserId(userId string) ([]*model.Branch, *model.AppError)

func (SqlBranchStore) GetBranchesForUser

func (s SqlBranchStore) GetBranchesForUser(userId string) ([]*model.BranchMember, *model.AppError)

func (SqlBranchStore) GetBranchesForUserWithPagination

func (s SqlBranchStore) GetBranchesForUserWithPagination(userId string, page, perPage int) ([]*model.BranchMember, *model.AppError)

func (SqlBranchStore) GetByName

func (s SqlBranchStore) GetByName(name string) (*model.Branch, *model.AppError)

func (SqlBranchStore) GetByNames

func (s SqlBranchStore) GetByNames(names []string) ([]*model.Branch, *model.AppError)

func (SqlBranchStore) GetBySchoolId

func (s SqlBranchStore) GetBySchoolId(schoolId string) (*model.Branch, *model.AppError)

func (SqlBranchStore) GetMember

func (s SqlBranchStore) GetMember(branchId string, userId string) (*model.BranchMember, *model.AppError)

func (SqlBranchStore) GetMembers

func (s SqlBranchStore) GetMembers(branchId string, offset int, limit int, branchMembersGetOptions *model.BranchMembersGetOptions) ([]*model.BranchMember, *model.AppError)

func (SqlBranchStore) GetMembersByIds

func (s SqlBranchStore) GetMembersByIds(branchId string, userIds []string, restrictions *model.ViewUsersRestrictions) ([]*model.BranchMember, *model.AppError)

func (SqlBranchStore) GetTotalMemberCount

func (s SqlBranchStore) GetTotalMemberCount(branchId string, restrictions *model.ViewUsersRestrictions) (int64, *model.AppError)

func (SqlBranchStore) GetUserBranchIds

func (s SqlBranchStore) GetUserBranchIds(userID string, allowFromCache bool) ([]string, *model.AppError)

GetUserBranchIds get the branch ids to which the user belongs to. allowFromCache parameter does not have any effect in this Store

func (SqlBranchStore) InvalidateAllBranchIdsForUser

func (s SqlBranchStore) InvalidateAllBranchIdsForUser(userId string)

func (SqlBranchStore) MigrateBranchMembers

func (s SqlBranchStore) MigrateBranchMembers(fromBranchId string, fromUserId string) (map[string]string, *model.AppError)

This function does the Advanced Permissions Phase 2 migration for BranchMember objects. It performs the migration in batches as a single transaction per batch to ensure consistency but to also minimise execution time to avoid causing unnecessary table locks. **THIS FUNCTION SHOULD NOT BE USED FOR ANY OTHER PURPOSE.** Executing this function *after* the new Schemes functionality has been used on an installation will have unintended consequences.

func (SqlBranchStore) PermanentDelete

func (s SqlBranchStore) PermanentDelete(branchId string) *model.AppError

func (SqlBranchStore) RemoveAllMembersByBranch

func (s SqlBranchStore) RemoveAllMembersByBranch(branchId string) *model.AppError

func (SqlBranchStore) RemoveAllMembersByUser

func (s SqlBranchStore) RemoveAllMembersByUser(userId string) *model.AppError

func (SqlBranchStore) RemoveMember

func (s SqlBranchStore) RemoveMember(branchId string, userId string) *model.AppError

func (SqlBranchStore) RemoveMembers

func (s SqlBranchStore) RemoveMembers(branchId string, userIds []string) *model.AppError

func (SqlBranchStore) ResetAllBranchSchemes

func (s SqlBranchStore) ResetAllBranchSchemes() *model.AppError

func (SqlBranchStore) Save

func (s SqlBranchStore) Save(branch *model.Branch) (*model.Branch, *model.AppError)

Save adds the branch to the database if a branch with the same name does not already exist in the database. It returns the branch added if the operation is successful.

func (SqlBranchStore) SaveMember

func (s SqlBranchStore) SaveMember(member *model.BranchMember, maxUsersPerBranch int) (*model.BranchMember, *model.AppError)

func (SqlBranchStore) SaveMultipleMembers

func (s SqlBranchStore) SaveMultipleMembers(members []*model.BranchMember, maxUsersPerBranch int) ([]*model.BranchMember, *model.AppError)

func (SqlBranchStore) Update

func (s SqlBranchStore) Update(branch *model.Branch) (*model.Branch, *model.AppError)

Update updates the details of the branch passed as the parameter using the branch Id if the branch exists in the database. It returns the updated branch if the operation is successful.

func (SqlBranchStore) UpdateLastBranchIconUpdate

func (s SqlBranchStore) UpdateLastBranchIconUpdate(branchId string, curTime int64) *model.AppError

func (SqlBranchStore) UpdateMember

func (s SqlBranchStore) UpdateMember(member *model.BranchMember) (*model.BranchMember, *model.AppError)

func (SqlBranchStore) UpdateMembersRole

func (s SqlBranchStore) UpdateMembersRole(branchID string, userIDs []string) *model.AppError

func (SqlBranchStore) UpdateMultipleMembers

func (s SqlBranchStore) UpdateMultipleMembers(members []*model.BranchMember) ([]*model.BranchMember, *model.AppError)

func (SqlBranchStore) UserBelongsToBranches

func (s SqlBranchStore) UserBelongsToBranches(userId string, branchIds []string) (bool, *model.AppError)

type SqlClassStore

type SqlClassStore struct {
	SqlStore
	// contains filtered or unexported fields
}

func (SqlClassStore) ClearAllCustomRoleAssignments

func (s SqlClassStore) ClearAllCustomRoleAssignments() *model.AppError

func (SqlClassStore) ClearCaches

func (s SqlClassStore) ClearCaches()

func (SqlClassStore) CreateDirectClass

func (s SqlClassStore) CreateDirectClass(user *model.User, otherUser *model.User) (*model.Class, *model.AppError)

func (SqlClassStore) Delete

func (s SqlClassStore) Delete(classId string, time int64) *model.AppError

Delete records the given deleted timestamp to the class in question.

func (SqlClassStore) Get

func (s SqlClassStore) Get(id string, allowFromCache bool) (*model.Class, *model.AppError)

func (SqlClassStore) GetAll

func (s SqlClassStore) GetAll(branchId string) ([]*model.Class, *model.AppError)

func (SqlClassStore) GetAllClassMembersForUser

func (s SqlClassStore) GetAllClassMembersForUser(userId string, allowFromCache bool, includeDeleted bool) (map[string]string, *model.AppError)

func (SqlClassStore) GetAllClassMembersNotifyPropsForClass

func (s SqlClassStore) GetAllClassMembersNotifyPropsForClass(classId string, allowFromCache bool) (map[string]model.StringMap, *model.AppError)

func (SqlClassStore) GetAllClasses

func (s SqlClassStore) GetAllClasses(offset, limit int, opts store.ClassSearchOpts) (*model.ClassListWithBranchData, *model.AppError)

func (SqlClassStore) GetAllClassesCount

func (s SqlClassStore) GetAllClassesCount(opts store.ClassSearchOpts) (int64, *model.AppError)

func (SqlClassStore) GetAllClassesForExportAfter

func (s SqlClassStore) GetAllClassesForExportAfter(limit int, afterId string) ([]*model.ClassForExport, *model.AppError)

func (SqlClassStore) GetBranchClasses

func (s SqlClassStore) GetBranchClasses(branchId string) (*model.ClassList, *model.AppError)

func (SqlClassStore) GetByName

func (s SqlClassStore) GetByName(branchId string, name string, allowFromCache bool) (*model.Class, *model.AppError)

func (SqlClassStore) GetByNameIncludeDeleted

func (s SqlClassStore) GetByNameIncludeDeleted(branchId string, name string, allowFromCache bool) (*model.Class, *model.AppError)

func (SqlClassStore) GetByNames

func (s SqlClassStore) GetByNames(branchId string, names []string, allowFromCache bool) ([]*model.Class, *model.AppError)

func (SqlClassStore) GetClassMembersForExport

func (s SqlClassStore) GetClassMembersForExport(userId string, branchId string) ([]*model.ClassMemberForExport, *model.AppError)

func (SqlClassStore) GetClassMembersTimezones

func (s SqlClassStore) GetClassMembersTimezones(classId string) ([]model.StringMap, *model.AppError)

func (SqlClassStore) GetClasses

func (s SqlClassStore) GetClasses(branchId string, userId string, includeDeleted bool) (*model.ClassList, *model.AppError)

func (SqlClassStore) GetClassesBatchForIndexing

func (s SqlClassStore) GetClassesBatchForIndexing(startTime, endTime int64, limit int) ([]*model.Class, *model.AppError)

func (SqlClassStore) GetClassesByIds

func (s SqlClassStore) GetClassesByIds(classIds []string, includeDeleted bool) ([]*model.Class, *model.AppError)

func (SqlClassStore) GetClassesByScheme

func (s SqlClassStore) GetClassesByScheme(schemeId string, offset int, limit int) (model.ClassList, *model.AppError)

func (SqlClassStore) GetDeleted

func (s SqlClassStore) GetDeleted(branchId string, offset int, limit int, userId string) (*model.ClassList, *model.AppError)

func (SqlClassStore) GetDeletedByName

func (s SqlClassStore) GetDeletedByName(branchId string, name string) (*model.Class, *model.AppError)

func (SqlClassStore) GetFromMaster

func (s SqlClassStore) GetFromMaster(id string) (*model.Class, *model.AppError)

func (SqlClassStore) GetMember

func (s SqlClassStore) GetMember(classId string, userId string) (*model.ClassMember, *model.AppError)

func (SqlClassStore) GetMemberCount

func (s SqlClassStore) GetMemberCount(classId string, allowFromCache bool) (int64, *model.AppError)

func (SqlClassStore) GetMemberCountFromCache

func (s SqlClassStore) GetMemberCountFromCache(classId string) int64

func (SqlClassStore) GetMembers

func (s SqlClassStore) GetMembers(classId string, offset, limit int) (*model.ClassMembers, *model.AppError)

func (SqlClassStore) GetMembersByIds

func (s SqlClassStore) GetMembersByIds(classId string, userIds []string) (*model.ClassMembers, *model.AppError)

func (SqlClassStore) GetMembersForUser

func (s SqlClassStore) GetMembersForUser(branchId string, userId string) (*model.ClassMembers, *model.AppError)

func (SqlClassStore) GetMembersForUserWithPagination

func (s SqlClassStore) GetMembersForUserWithPagination(branchId, userId string, page, perPage int) (*model.ClassMembers, *model.AppError)

func (SqlClassStore) GetMoreClasses

func (s SqlClassStore) GetMoreClasses(branchId string, userId string, offset int, limit int) (*model.ClassList, *model.AppError)

func (SqlClassStore) GetPublicClassesForBranch

func (s SqlClassStore) GetPublicClassesForBranch(branchId string, offset int, limit int) (*model.ClassList, *model.AppError)

func (SqlClassStore) InvalidateAllClassMembersForUser

func (s SqlClassStore) InvalidateAllClassMembersForUser(userId string)

func (SqlClassStore) InvalidateCacheForClassMembersNotifyProps

func (s SqlClassStore) InvalidateCacheForClassMembersNotifyProps(classId string)

func (SqlClassStore) InvalidateClass

func (s SqlClassStore) InvalidateClass(id string)

func (SqlClassStore) InvalidateClassByName

func (s SqlClassStore) InvalidateClassByName(branchId, name string)

func (SqlClassStore) InvalidateGuestCount

func (s SqlClassStore) InvalidateGuestCount(classId string)

func (SqlClassStore) InvalidateMemberCount

func (s SqlClassStore) InvalidateMemberCount(classId string)

func (SqlClassStore) InvalidatePinnedPostCount

func (s SqlClassStore) InvalidatePinnedPostCount(classId string)

func (SqlClassStore) IsUserInClassUseCache

func (s SqlClassStore) IsUserInClassUseCache(userId string, classId string) bool

func (SqlClassStore) MigrateClassMembers

func (s SqlClassStore) MigrateClassMembers(fromClassId string, fromUserId string) (map[string]string, *model.AppError)

This function does the Advanced Permissions Phase 2 migration for ClassMember objects. It performs the migration in batches as a single transaction per batch to ensure consistency but to also minimise execution time to avoid causing unnecessary table locks. **THIS FUNCTION SHOULD NOT BE USED FOR ANY OTHER PURPOSE.** Executing this function *after* the new Schemes functionality has been used on an installation will have unintended consequences.

func (SqlClassStore) PermanentDelete

func (s SqlClassStore) PermanentDelete(classId string) *model.AppError

PermanentDelete removes the given class from the database.

func (SqlClassStore) PermanentDeleteByBranch

func (s SqlClassStore) PermanentDeleteByBranch(branchId string) *model.AppError

PermanentDeleteByBranch removes all classes for the given branch from the database.

func (SqlClassStore) PermanentDeleteMembersByClass

func (s SqlClassStore) PermanentDeleteMembersByClass(classId string) *model.AppError

func (SqlClassStore) PermanentDeleteMembersByUser

func (s SqlClassStore) PermanentDeleteMembersByUser(userId string) *model.AppError

func (SqlClassStore) RemoveAllDeactivatedMembers

func (s SqlClassStore) RemoveAllDeactivatedMembers(classId string) *model.AppError

func (SqlClassStore) RemoveMember

func (s SqlClassStore) RemoveMember(classId string, userId string) *model.AppError

func (SqlClassStore) RemoveMembers

func (s SqlClassStore) RemoveMembers(classId string, userIds []string) *model.AppError

func (SqlClassStore) ResetAllClassSchemes

func (s SqlClassStore) ResetAllClassSchemes() *model.AppError

func (SqlClassStore) Restore

func (s SqlClassStore) Restore(classId string, time int64) *model.AppError

Restore reverts a previous deleted timestamp from the class in question.

func (SqlClassStore) Save

func (s SqlClassStore) Save(class *model.Class, maxClassesPerBranch int64) (*model.Class, *model.AppError)

Save writes the (non-direct) class class to the database.

func (SqlClassStore) SaveDirectClass

func (s SqlClassStore) SaveDirectClass(directclass *model.Class, member1 *model.ClassMember, member2 *model.ClassMember) (*model.Class, *model.AppError)

func (SqlClassStore) SaveMember

func (s SqlClassStore) SaveMember(member *model.ClassMember) (*model.ClassMember, *model.AppError)

func (SqlClassStore) SaveMultipleMembers

func (s SqlClassStore) SaveMultipleMembers(members []*model.ClassMember) ([]*model.ClassMember, *model.AppError)

func (SqlClassStore) SetDeleteAt

func (s SqlClassStore) SetDeleteAt(classId string, deleteAt, updateAt int64) *model.AppError

SetDeleteAt records the given deleted and updated timestamp to the class in question.

func (SqlClassStore) Update

func (s SqlClassStore) Update(class *model.Class) (*model.Class, *model.AppError)

Update writes the updated class to the database.

func (SqlClassStore) UpdateMember

func (s SqlClassStore) UpdateMember(member *model.ClassMember) (*model.ClassMember, *model.AppError)

func (SqlClassStore) UpdateMembersRole

func (s SqlClassStore) UpdateMembersRole(classID string, userIDs []string) *model.AppError

func (SqlClassStore) UpdateMultipleMembers

func (s SqlClassStore) UpdateMultipleMembers(members []*model.ClassMember) ([]*model.ClassMember, *model.AppError)

func (SqlClassStore) UserBelongsToClasses

func (s SqlClassStore) UserBelongsToClasses(userId string, classIds []string) (bool, *model.AppError)

type SqlCommandStore

type SqlCommandStore struct {
	SqlStore
}

func (SqlCommandStore) AnalyticsCommandCount

func (s SqlCommandStore) AnalyticsCommandCount(teamId string) (int64, *model.AppError)

func (SqlCommandStore) Delete

func (s SqlCommandStore) Delete(commandId string, time int64) *model.AppError

func (SqlCommandStore) Get

func (SqlCommandStore) GetByTeam

func (s SqlCommandStore) GetByTeam(teamId string) ([]*model.Command, *model.AppError)

func (SqlCommandStore) GetByTrigger

func (s SqlCommandStore) GetByTrigger(teamId string, trigger string) (*model.Command, *model.AppError)

func (SqlCommandStore) PermanentDeleteByTeam

func (s SqlCommandStore) PermanentDeleteByTeam(teamId string) *model.AppError

func (SqlCommandStore) PermanentDeleteByUser

func (s SqlCommandStore) PermanentDeleteByUser(userId string) *model.AppError

func (SqlCommandStore) Save

func (s SqlCommandStore) Save(command *model.Command) (*model.Command, *model.AppError)

func (SqlCommandStore) Update

func (s SqlCommandStore) Update(cmd *model.Command) (*model.Command, *model.AppError)

type SqlCommandWebhookStore

type SqlCommandWebhookStore struct {
	SqlStore
}

func (SqlCommandWebhookStore) Cleanup

func (s SqlCommandWebhookStore) Cleanup()

func (SqlCommandWebhookStore) Get

func (SqlCommandWebhookStore) Save

func (SqlCommandWebhookStore) TryUse

func (s SqlCommandWebhookStore) TryUse(id string, limit int) *model.AppError

type SqlComplianceStore

type SqlComplianceStore struct {
	SqlStore
}

func (SqlComplianceStore) ComplianceExport

func (s SqlComplianceStore) ComplianceExport(job *model.Compliance) ([]*model.CompliancePost, *model.AppError)

func (SqlComplianceStore) Get

func (SqlComplianceStore) GetAll

func (s SqlComplianceStore) GetAll(offset, limit int) (model.Compliances, *model.AppError)

func (SqlComplianceStore) MessageExport

func (s SqlComplianceStore) MessageExport(after int64, limit int) ([]*model.MessageExport, *model.AppError)

func (SqlComplianceStore) Save

func (SqlComplianceStore) Update

func (s SqlComplianceStore) Update(compliance *model.Compliance) (*model.Compliance, *model.AppError)

type SqlEmojiStore

type SqlEmojiStore struct {
	SqlStore
	// contains filtered or unexported fields
}

func (SqlEmojiStore) Delete

func (es SqlEmojiStore) Delete(emoji *model.Emoji, time int64) *model.AppError

func (SqlEmojiStore) Get

func (es SqlEmojiStore) Get(id string, allowFromCache bool) (*model.Emoji, *model.AppError)

func (SqlEmojiStore) GetByName

func (es SqlEmojiStore) GetByName(name string, allowFromCache bool) (*model.Emoji, *model.AppError)

func (SqlEmojiStore) GetList

func (es SqlEmojiStore) GetList(offset, limit int, sort string) ([]*model.Emoji, *model.AppError)

func (SqlEmojiStore) GetMultipleByName

func (es SqlEmojiStore) GetMultipleByName(names []string) ([]*model.Emoji, *model.AppError)

func (SqlEmojiStore) Save

func (es SqlEmojiStore) Save(emoji *model.Emoji) (*model.Emoji, *model.AppError)

func (SqlEmojiStore) Search

func (es SqlEmojiStore) Search(name string, prefixOnly bool, limit int) ([]*model.Emoji, *model.AppError)

type SqlFileInfoStore

type SqlFileInfoStore struct {
	SqlStore
	// contains filtered or unexported fields
}

func (SqlFileInfoStore) AttachToPost

func (fs SqlFileInfoStore) AttachToPost(fileId, postId, creatorId string) *model.AppError

func (SqlFileInfoStore) ClearCaches

func (fs SqlFileInfoStore) ClearCaches()

func (SqlFileInfoStore) DeleteForPost

func (fs SqlFileInfoStore) DeleteForPost(postId string) (string, *model.AppError)

func (SqlFileInfoStore) Get

func (SqlFileInfoStore) GetByPath

func (fs SqlFileInfoStore) GetByPath(path string) (*model.FileInfo, *model.AppError)

func (SqlFileInfoStore) GetForPost

func (fs SqlFileInfoStore) GetForPost(postId string, readFromMaster, includeDeleted, allowFromCache bool) ([]*model.FileInfo, *model.AppError)

func (SqlFileInfoStore) GetForUser

func (fs SqlFileInfoStore) GetForUser(userId string) ([]*model.FileInfo, *model.AppError)

func (SqlFileInfoStore) GetWithOptions

func (fs SqlFileInfoStore) GetWithOptions(page, perPage int, opt *model.GetFileInfosOptions) ([]*model.FileInfo, *model.AppError)

func (SqlFileInfoStore) InvalidateFileInfosForPostCache

func (fs SqlFileInfoStore) InvalidateFileInfosForPostCache(postId string, deleted bool)

func (SqlFileInfoStore) PermanentDelete

func (fs SqlFileInfoStore) PermanentDelete(fileId string) *model.AppError

func (SqlFileInfoStore) PermanentDeleteBatch

func (fs SqlFileInfoStore) PermanentDeleteBatch(endTime int64, limit int64) (int64, *model.AppError)

func (SqlFileInfoStore) PermanentDeleteByUser

func (fs SqlFileInfoStore) PermanentDeleteByUser(userId string) (int64, *model.AppError)

func (SqlFileInfoStore) Save

type SqlJobStore

type SqlJobStore struct {
	SqlStore
}

func (SqlJobStore) Delete

func (jss SqlJobStore) Delete(id string) (string, *model.AppError)

func (SqlJobStore) Get

func (jss SqlJobStore) Get(id string) (*model.Job, *model.AppError)

func (SqlJobStore) GetAllByStatus

func (jss SqlJobStore) GetAllByStatus(status string) ([]*model.Job, *model.AppError)

func (SqlJobStore) GetAllByType

func (jss SqlJobStore) GetAllByType(jobType string) ([]*model.Job, *model.AppError)

func (SqlJobStore) GetAllByTypePage

func (jss SqlJobStore) GetAllByTypePage(jobType string, offset int, limit int) ([]*model.Job, *model.AppError)

func (SqlJobStore) GetAllPage

func (jss SqlJobStore) GetAllPage(offset int, limit int) ([]*model.Job, *model.AppError)

func (SqlJobStore) GetCountByStatusAndType

func (jss SqlJobStore) GetCountByStatusAndType(status string, jobType string) (int64, *model.AppError)

func (SqlJobStore) GetNewestJobByStatusAndType

func (jss SqlJobStore) GetNewestJobByStatusAndType(status string, jobType string) (*model.Job, *model.AppError)

func (SqlJobStore) Save

func (jss SqlJobStore) Save(job *model.Job) (*model.Job, *model.AppError)

func (SqlJobStore) UpdateOptimistically

func (jss SqlJobStore) UpdateOptimistically(job *model.Job, currentStatus string) (bool, *model.AppError)

func (SqlJobStore) UpdateStatus

func (jss SqlJobStore) UpdateStatus(id string, status string) (*model.Job, *model.AppError)

func (SqlJobStore) UpdateStatusOptimistically

func (jss SqlJobStore) UpdateStatusOptimistically(id string, currentStatus string, newStatus string) (bool, *model.AppError)

type SqlLicenseStore

type SqlLicenseStore struct {
	SqlStore
}

SqlLicenseStore encapsulates the database writes and reads for model.LicenseRecord objects.

func (SqlLicenseStore) Get

Get obtains the license with the provided id parameter from the database. If the license doesn't exist it returns a model.AppError with http.StatusNotFound in the StatusCode field.

func (SqlLicenseStore) Save

Save validates and stores the license instance in the database. The Id and Bytes fields are mandatory. The Bytes field is limited to a maximum of 10000 bytes. If the license ID matches an existing license in the database it returns the license stored in the database. If not, it saves the new database and returns the created license with the CreateAt field updated.

type SqlLinkMetadataStore

type SqlLinkMetadataStore struct {
	SqlStore
}

func (SqlLinkMetadataStore) Get

func (s SqlLinkMetadataStore) Get(url string, timestamp int64) (*model.LinkMetadata, *model.AppError)

func (SqlLinkMetadataStore) Save

type SqlOAuthStore

type SqlOAuthStore struct {
	SqlStore
}

func (SqlOAuthStore) DeleteApp

func (as SqlOAuthStore) DeleteApp(id string) *model.AppError

func (SqlOAuthStore) GetAccessData

func (as SqlOAuthStore) GetAccessData(token string) (*model.AccessData, *model.AppError)

func (SqlOAuthStore) GetAccessDataByRefreshToken

func (as SqlOAuthStore) GetAccessDataByRefreshToken(token string) (*model.AccessData, *model.AppError)

func (SqlOAuthStore) GetAccessDataByUserForApp

func (as SqlOAuthStore) GetAccessDataByUserForApp(userId, clientId string) ([]*model.AccessData, *model.AppError)

func (SqlOAuthStore) GetApp

func (as SqlOAuthStore) GetApp(id string) (*model.OAuthApp, *model.AppError)

func (SqlOAuthStore) GetAppByUser

func (as SqlOAuthStore) GetAppByUser(userId string, offset, limit int) ([]*model.OAuthApp, *model.AppError)

func (SqlOAuthStore) GetApps

func (as SqlOAuthStore) GetApps(offset, limit int) ([]*model.OAuthApp, *model.AppError)

func (SqlOAuthStore) GetAuthData

func (as SqlOAuthStore) GetAuthData(code string) (*model.AuthData, *model.AppError)

func (SqlOAuthStore) GetAuthorizedApps

func (as SqlOAuthStore) GetAuthorizedApps(userId string, offset, limit int) ([]*model.OAuthApp, *model.AppError)

func (SqlOAuthStore) GetPreviousAccessData

func (as SqlOAuthStore) GetPreviousAccessData(userId, clientId string) (*model.AccessData, *model.AppError)

func (SqlOAuthStore) PermanentDeleteAuthDataByUser

func (as SqlOAuthStore) PermanentDeleteAuthDataByUser(userId string) *model.AppError

func (SqlOAuthStore) RemoveAccessData

func (as SqlOAuthStore) RemoveAccessData(token string) *model.AppError

func (SqlOAuthStore) RemoveAllAccessData

func (as SqlOAuthStore) RemoveAllAccessData() *model.AppError

func (SqlOAuthStore) RemoveAuthData

func (as SqlOAuthStore) RemoveAuthData(code string) *model.AppError

func (SqlOAuthStore) SaveAccessData

func (as SqlOAuthStore) SaveAccessData(accessData *model.AccessData) (*model.AccessData, *model.AppError)

func (SqlOAuthStore) SaveApp

func (as SqlOAuthStore) SaveApp(app *model.OAuthApp) (*model.OAuthApp, *model.AppError)

func (SqlOAuthStore) SaveAuthData

func (as SqlOAuthStore) SaveAuthData(authData *model.AuthData) (*model.AuthData, *model.AppError)

func (SqlOAuthStore) UpdateAccessData

func (as SqlOAuthStore) UpdateAccessData(accessData *model.AccessData) (*model.AccessData, *model.AppError)

func (SqlOAuthStore) UpdateApp

func (as SqlOAuthStore) UpdateApp(app *model.OAuthApp) (*model.OAuthApp, *model.AppError)

type SqlPreferenceStore

type SqlPreferenceStore struct {
	SqlStore
}

func (SqlPreferenceStore) CleanupFlagsBatch

func (s SqlPreferenceStore) CleanupFlagsBatch(limit int64) (int64, *model.AppError)

func (SqlPreferenceStore) Delete

func (s SqlPreferenceStore) Delete(userId, category, name string) *model.AppError

func (SqlPreferenceStore) DeleteCategory

func (s SqlPreferenceStore) DeleteCategory(userId string, category string) *model.AppError

func (SqlPreferenceStore) DeleteCategoryAndName

func (s SqlPreferenceStore) DeleteCategoryAndName(category string, name string) *model.AppError

func (SqlPreferenceStore) Get

func (s SqlPreferenceStore) Get(userId string, category string, name string) (*model.Preference, *model.AppError)

func (SqlPreferenceStore) GetAll

func (SqlPreferenceStore) GetCategory

func (s SqlPreferenceStore) GetCategory(userId string, category string) (model.Preferences, *model.AppError)

func (SqlPreferenceStore) PermanentDeleteByUser

func (s SqlPreferenceStore) PermanentDeleteByUser(userId string) *model.AppError

func (SqlPreferenceStore) Save

func (s SqlPreferenceStore) Save(preferences *model.Preferences) *model.AppError

type SqlReactionStore

type SqlReactionStore struct {
	SqlStore
}

func (*SqlReactionStore) BulkGetForPosts

func (s *SqlReactionStore) BulkGetForPosts(postIds []string) ([]*model.Reaction, *model.AppError)

func (*SqlReactionStore) Delete

func (s *SqlReactionStore) Delete(reaction *model.Reaction) (*model.Reaction, *model.AppError)

func (*SqlReactionStore) DeleteAllWithEmojiName

func (s *SqlReactionStore) DeleteAllWithEmojiName(emojiName string) *model.AppError

func (*SqlReactionStore) GetForPost

func (s *SqlReactionStore) GetForPost(postId string, allowFromCache bool) ([]*model.Reaction, *model.AppError)

func (*SqlReactionStore) PermanentDeleteBatch

func (s *SqlReactionStore) PermanentDeleteBatch(endTime int64, limit int64) (int64, *model.AppError)

func (*SqlReactionStore) Save

func (s *SqlReactionStore) Save(reaction *model.Reaction) (*model.Reaction, *model.AppError)

type SqlRoleStore

type SqlRoleStore struct {
	SqlStore
}

func (*SqlRoleStore) AllClassSchemeRoles

func (s *SqlRoleStore) AllClassSchemeRoles() ([]*model.Role, *model.AppError)

func (*SqlRoleStore) ClassHigherScopedPermissions

func (s *SqlRoleStore) ClassHigherScopedPermissions(roleNames []string) (map[string]*model.RolePermissions, *model.AppError)

func (*SqlRoleStore) ClassRolesUnderBranchRole

func (s *SqlRoleStore) ClassRolesUnderBranchRole(roleName string) ([]*model.Role, *model.AppError)

ClassRolesUnderBranchRole finds all of the class-scheme roles under the branch of the given branch-scheme role.

func (*SqlRoleStore) Delete

func (s *SqlRoleStore) Delete(roleId string) (*model.Role, *model.AppError)

func (*SqlRoleStore) Get

func (s *SqlRoleStore) Get(roleId string) (*model.Role, *model.AppError)

func (*SqlRoleStore) GetAll

func (s *SqlRoleStore) GetAll() ([]*model.Role, *model.AppError)

func (*SqlRoleStore) GetByName

func (s *SqlRoleStore) GetByName(name string) (*model.Role, *model.AppError)

func (*SqlRoleStore) GetByNames

func (s *SqlRoleStore) GetByNames(names []string) ([]*model.Role, *model.AppError)

func (*SqlRoleStore) PermanentDeleteAll

func (s *SqlRoleStore) PermanentDeleteAll() *model.AppError

func (*SqlRoleStore) Save

func (s *SqlRoleStore) Save(role *model.Role) (*model.Role, *model.AppError)

type SqlSchemeStore

type SqlSchemeStore struct {
	SqlStore
}

func (*SqlSchemeStore) CountByScope

func (s *SqlSchemeStore) CountByScope(scope string) (int64, *model.AppError)

func (*SqlSchemeStore) CountWithoutPermission

func (s *SqlSchemeStore) CountWithoutPermission(schemeScope, permissionID string, roleScope model.RoleScope, roleType model.RoleType) (int64, *model.AppError)

func (*SqlSchemeStore) Delete

func (s *SqlSchemeStore) Delete(schemeId string) (*model.Scheme, *model.AppError)

func (*SqlSchemeStore) Get

func (s *SqlSchemeStore) Get(schemeId string) (*model.Scheme, *model.AppError)

func (*SqlSchemeStore) GetAllPage

func (s *SqlSchemeStore) GetAllPage(scope string, offset int, limit int) ([]*model.Scheme, *model.AppError)

func (*SqlSchemeStore) GetByName

func (s *SqlSchemeStore) GetByName(schemeName string) (*model.Scheme, *model.AppError)

func (*SqlSchemeStore) PermanentDeleteAll

func (s *SqlSchemeStore) PermanentDeleteAll() *model.AppError

func (*SqlSchemeStore) Save

func (s *SqlSchemeStore) Save(scheme *model.Scheme) (*model.Scheme, *model.AppError)

type SqlSessionStore

type SqlSessionStore struct {
	SqlStore
}

func (SqlSessionStore) AnalyticsSessionCount

func (me SqlSessionStore) AnalyticsSessionCount() (int64, *model.AppError)

func (SqlSessionStore) Cleanup

func (me SqlSessionStore) Cleanup(expiryTime int64, batchSize int64)

func (SqlSessionStore) Get

func (me SqlSessionStore) Get(sessionIdOrToken string) (*model.Session, *model.AppError)

func (SqlSessionStore) GetSessions

func (me SqlSessionStore) GetSessions(userId string) ([]*model.Session, *model.AppError)

func (SqlSessionStore) GetSessionsWithActiveDeviceIds

func (me SqlSessionStore) GetSessionsWithActiveDeviceIds(userId string) ([]*model.Session, *model.AppError)

func (SqlSessionStore) PermanentDeleteSessionsByUser

func (me SqlSessionStore) PermanentDeleteSessionsByUser(userId string) *model.AppError

func (SqlSessionStore) Remove

func (me SqlSessionStore) Remove(sessionIdOrToken string) *model.AppError

func (SqlSessionStore) RemoveAllSessions

func (me SqlSessionStore) RemoveAllSessions() *model.AppError

func (SqlSessionStore) Save

func (me SqlSessionStore) Save(session *model.Session) (*model.Session, *model.AppError)

func (SqlSessionStore) UpdateDeviceId

func (me SqlSessionStore) UpdateDeviceId(id string, deviceId string, expiresAt int64) (string, *model.AppError)

func (SqlSessionStore) UpdateLastActivityAt

func (me SqlSessionStore) UpdateLastActivityAt(sessionId string, time int64) *model.AppError

func (SqlSessionStore) UpdateProps

func (me SqlSessionStore) UpdateProps(session *model.Session) *model.AppError

func (SqlSessionStore) UpdateRoles

func (me SqlSessionStore) UpdateRoles(userId, roles string) (string, *model.AppError)

type SqlStatusStore

type SqlStatusStore struct {
	SqlStore
}

func (SqlStatusStore) Get

func (s SqlStatusStore) Get(userId string) (*model.Status, *model.AppError)

func (SqlStatusStore) GetByIds

func (s SqlStatusStore) GetByIds(userIds []string) ([]*model.Status, *model.AppError)

func (SqlStatusStore) GetTotalActiveUsersCount

func (s SqlStatusStore) GetTotalActiveUsersCount() (int64, *model.AppError)

func (SqlStatusStore) ResetAll

func (s SqlStatusStore) ResetAll() *model.AppError

func (SqlStatusStore) SaveOrUpdate

func (s SqlStatusStore) SaveOrUpdate(status *model.Status) *model.AppError

func (SqlStatusStore) UpdateLastActivityAt

func (s SqlStatusStore) UpdateLastActivityAt(userId string, lastActivityAt int64) *model.AppError

type SqlStore

type SqlStore interface {
	DriverName() string
	GetCurrentSchemaVersion() string
	GetMaster() *gorp.DbMap
	GetSearchReplica() *gorp.DbMap
	GetReplica() *gorp.DbMap
	TotalMasterDbConnections() int
	TotalReadDbConnections() int
	TotalSearchDbConnections() int
	MarkSystemRanUnitTests()
	DoesTableExist(tablename string) bool
	DoesColumnExist(tableName string, columName string) bool
	DoesTriggerExist(triggerName string) bool
	CreateColumnIfNotExists(tableName string, columnName string, mySqlColType string, postgresColType string, defaultValue string) bool
	CreateColumnIfNotExistsNoDefault(tableName string, columnName string, mySqlColType string, postgresColType string) bool
	RemoveColumnIfExists(tableName string, columnName string) bool
	RemoveTableIfExists(tableName string) bool
	RenameColumnIfExists(tableName string, oldColumnName string, newColumnName string, colType string) bool
	GetMaxLengthOfColumnIfExists(tableName string, columnName string) string
	AlterColumnTypeIfExists(tableName string, columnName string, mySqlColType string, postgresColType string) bool
	AlterColumnDefaultIfExists(tableName string, columnName string, mySqlColDefault *string, postgresColDefault *string) bool
	AlterPrimaryKey(tableName string, columnNames []string) bool
	CreateUniqueIndexIfNotExists(indexName string, tableName string, columnName string) bool
	CreateIndexIfNotExists(indexName string, tableName string, columnName string) bool
	CreateCompositeIndexIfNotExists(indexName string, tableName string, columnNames []string) bool
	CreateFullTextIndexIfNotExists(indexName string, tableName string, columnName string) bool
	RemoveIndexIfExists(indexName string, tableName string) bool
	GetAllConns() []*gorp.DbMap
	Close()
	LockToMaster()
	UnlockFromMaster()
	Branch() store.BranchStore
	Class() store.ClassStore
	User() store.UserStore
	Audit() store.AuditStore
	ClusterDiscovery() store.ClusterDiscoveryStore
	Compliance() store.ComplianceStore
	Session() store.SessionStore
	OAuth() store.OAuthStore
	System() store.SystemStore
	Webhook() store.WebhookStore
	Command() store.CommandStore
	CommandWebhook() store.CommandWebhookStore
	Preference() store.PreferenceStore
	License() store.LicenseStore
	Token() store.TokenStore
	Emoji() store.EmojiStore
	Status() store.StatusStore
	FileInfo() store.FileInfoStore
	Reaction() store.ReactionStore
	Job() store.JobStore
	UserAccessToken() store.UserAccessTokenStore
	Role() store.RoleStore
	Scheme() store.SchemeStore
	TermsOfService() store.TermsOfServiceStore
	UserTermsOfService() store.UserTermsOfServiceStore
	LinkMetadata() store.LinkMetadataStore
	// contains filtered or unexported methods
}

type SqlSupplier

type SqlSupplier struct {
	// contains filtered or unexported fields
}

func NewSqlSupplier

func NewSqlSupplier(settings model.SqlSettings, metrics einterfaces.MetricsInterface) *SqlSupplier

func (*SqlSupplier) AlterColumnDefaultIfExists

func (ss *SqlSupplier) AlterColumnDefaultIfExists(tableName string, columnName string, mySqlColDefault *string, postgresColDefault *string) bool

func (*SqlSupplier) AlterColumnTypeIfExists

func (ss *SqlSupplier) AlterColumnTypeIfExists(tableName string, columnName string, mySqlColType string, postgresColType string) bool

func (*SqlSupplier) AlterPrimaryKey

func (ss *SqlSupplier) AlterPrimaryKey(tableName string, columnNames []string) bool

func (*SqlSupplier) Audit

func (ss *SqlSupplier) Audit() store.AuditStore

func (*SqlSupplier) Branch

func (ss *SqlSupplier) Branch() store.BranchStore

func (*SqlSupplier) CheckIntegrity

func (ss *SqlSupplier) CheckIntegrity() <-chan store.IntegrityCheckResult

func (*SqlSupplier) Class

func (ss *SqlSupplier) Class() store.ClassStore

func (*SqlSupplier) Close

func (ss *SqlSupplier) Close()

func (*SqlSupplier) ClusterDiscovery

func (ss *SqlSupplier) ClusterDiscovery() store.ClusterDiscoveryStore

func (*SqlSupplier) Command

func (ss *SqlSupplier) Command() store.CommandStore

func (*SqlSupplier) CommandWebhook

func (ss *SqlSupplier) CommandWebhook() store.CommandWebhookStore

func (*SqlSupplier) Compliance

func (ss *SqlSupplier) Compliance() store.ComplianceStore

func (*SqlSupplier) Context

func (ss *SqlSupplier) Context() context.Context

func (*SqlSupplier) CreateColumnIfNotExists

func (ss *SqlSupplier) CreateColumnIfNotExists(tableName string, columnName string, mySqlColType string, postgresColType string, defaultValue string) bool

func (*SqlSupplier) CreateColumnIfNotExistsNoDefault

func (ss *SqlSupplier) CreateColumnIfNotExistsNoDefault(tableName string, columnName string, mySqlColType string, postgresColType string) bool

func (*SqlSupplier) CreateCompositeIndexIfNotExists

func (ss *SqlSupplier) CreateCompositeIndexIfNotExists(indexName string, tableName string, columnNames []string) bool

func (*SqlSupplier) CreateFullTextIndexIfNotExists

func (ss *SqlSupplier) CreateFullTextIndexIfNotExists(indexName string, tableName string, columnName string) bool

func (*SqlSupplier) CreateIndexIfNotExists

func (ss *SqlSupplier) CreateIndexIfNotExists(indexName string, tableName string, columnName string) bool

func (*SqlSupplier) CreateUniqueIndexIfNotExists

func (ss *SqlSupplier) CreateUniqueIndexIfNotExists(indexName string, tableName string, columnName string) bool

func (*SqlSupplier) DoesColumnExist

func (ss *SqlSupplier) DoesColumnExist(tableName string, columnName string) bool

func (*SqlSupplier) DoesTableExist

func (ss *SqlSupplier) DoesTableExist(tableName string) bool

func (*SqlSupplier) DoesTriggerExist

func (ss *SqlSupplier) DoesTriggerExist(triggerName string) bool

func (*SqlSupplier) DriverName

func (ss *SqlSupplier) DriverName() string

func (*SqlSupplier) DropAllTables

func (ss *SqlSupplier) DropAllTables()

func (*SqlSupplier) Emoji

func (ss *SqlSupplier) Emoji() store.EmojiStore

func (*SqlSupplier) FileInfo

func (ss *SqlSupplier) FileInfo() store.FileInfoStore

func (*SqlSupplier) GetAllConns

func (ss *SqlSupplier) GetAllConns() []*gorp.DbMap

func (*SqlSupplier) GetCurrentSchemaVersion

func (ss *SqlSupplier) GetCurrentSchemaVersion() string

func (*SqlSupplier) GetMaster

func (ss *SqlSupplier) GetMaster() *gorp.DbMap

func (*SqlSupplier) GetMaxLengthOfColumnIfExists

func (ss *SqlSupplier) GetMaxLengthOfColumnIfExists(tableName string, columnName string) string

func (*SqlSupplier) GetReplica

func (ss *SqlSupplier) GetReplica() *gorp.DbMap

func (*SqlSupplier) GetSearchReplica

func (ss *SqlSupplier) GetSearchReplica() *gorp.DbMap

func (*SqlSupplier) Job

func (ss *SqlSupplier) Job() store.JobStore

func (*SqlSupplier) License

func (ss *SqlSupplier) License() store.LicenseStore

func (*SqlSupplier) LinkMetadata

func (ss *SqlSupplier) LinkMetadata() store.LinkMetadataStore

func (*SqlSupplier) LockToMaster

func (ss *SqlSupplier) LockToMaster()

func (*SqlSupplier) MarkSystemRanUnitTests

func (ss *SqlSupplier) MarkSystemRanUnitTests()

func (*SqlSupplier) OAuth

func (ss *SqlSupplier) OAuth() store.OAuthStore

func (*SqlSupplier) Preference

func (ss *SqlSupplier) Preference() store.PreferenceStore

func (*SqlSupplier) Reaction

func (ss *SqlSupplier) Reaction() store.ReactionStore

func (*SqlSupplier) RemoveColumnIfExists

func (ss *SqlSupplier) RemoveColumnIfExists(tableName string, columnName string) bool

func (*SqlSupplier) RemoveIndexIfExists

func (ss *SqlSupplier) RemoveIndexIfExists(indexName string, tableName string) bool

func (*SqlSupplier) RemoveTableIfExists

func (ss *SqlSupplier) RemoveTableIfExists(tableName string) bool

func (*SqlSupplier) RenameColumnIfExists

func (ss *SqlSupplier) RenameColumnIfExists(tableName string, oldColumnName string, newColumnName string, colType string) bool

func (*SqlSupplier) Role

func (ss *SqlSupplier) Role() store.RoleStore

func (*SqlSupplier) Scheme

func (ss *SqlSupplier) Scheme() store.SchemeStore

func (*SqlSupplier) Session

func (ss *SqlSupplier) Session() store.SessionStore

func (*SqlSupplier) SetContext

func (ss *SqlSupplier) SetContext(context context.Context)

func (*SqlSupplier) Status

func (ss *SqlSupplier) Status() store.StatusStore

func (*SqlSupplier) System

func (ss *SqlSupplier) System() store.SystemStore

func (*SqlSupplier) TermsOfService

func (ss *SqlSupplier) TermsOfService() store.TermsOfServiceStore

func (*SqlSupplier) Token

func (ss *SqlSupplier) Token() store.TokenStore

func (*SqlSupplier) TotalMasterDbConnections

func (ss *SqlSupplier) TotalMasterDbConnections() int

func (*SqlSupplier) TotalReadDbConnections

func (ss *SqlSupplier) TotalReadDbConnections() int

func (*SqlSupplier) TotalSearchDbConnections

func (ss *SqlSupplier) TotalSearchDbConnections() int

func (*SqlSupplier) UnlockFromMaster

func (ss *SqlSupplier) UnlockFromMaster()

func (*SqlSupplier) User

func (ss *SqlSupplier) User() store.UserStore

func (*SqlSupplier) UserAccessToken

func (ss *SqlSupplier) UserAccessToken() store.UserAccessTokenStore

func (*SqlSupplier) UserTermsOfService

func (ss *SqlSupplier) UserTermsOfService() store.UserTermsOfServiceStore

func (*SqlSupplier) Webhook

func (ss *SqlSupplier) Webhook() store.WebhookStore

type SqlSupplierStores

type SqlSupplierStores struct {
	TermsOfService     store.TermsOfServiceStore
	UserTermsOfService store.UserTermsOfServiceStore
	// contains filtered or unexported fields
}

type SqlSystemStore

type SqlSystemStore struct {
	SqlStore
}

func (SqlSystemStore) Get

func (SqlSystemStore) GetByName

func (s SqlSystemStore) GetByName(name string) (*model.System, *model.AppError)

func (SqlSystemStore) PermanentDeleteByName

func (s SqlSystemStore) PermanentDeleteByName(name string) (*model.System, *model.AppError)

func (SqlSystemStore) Save

func (s SqlSystemStore) Save(system *model.System) *model.AppError

func (SqlSystemStore) SaveOrUpdate

func (s SqlSystemStore) SaveOrUpdate(system *model.System) *model.AppError

func (SqlSystemStore) Update

func (s SqlSystemStore) Update(system *model.System) *model.AppError

type SqlTermsOfServiceStore

type SqlTermsOfServiceStore struct {
	SqlStore
	// contains filtered or unexported fields
}

func (SqlTermsOfServiceStore) Get

func (s SqlTermsOfServiceStore) Get(id string, allowFromCache bool) (*model.TermsOfService, *model.AppError)

func (SqlTermsOfServiceStore) GetLatest

func (s SqlTermsOfServiceStore) GetLatest(allowFromCache bool) (*model.TermsOfService, *model.AppError)

func (SqlTermsOfServiceStore) Save

type SqlTokenStore

type SqlTokenStore struct {
	SqlStore
}

func (SqlTokenStore) Cleanup

func (s SqlTokenStore) Cleanup()

func (SqlTokenStore) Delete

func (s SqlTokenStore) Delete(token string) *model.AppError

func (SqlTokenStore) GetByToken

func (s SqlTokenStore) GetByToken(tokenString string) (*model.Token, *model.AppError)

func (SqlTokenStore) RemoveAllTokensByType

func (s SqlTokenStore) RemoveAllTokensByType(tokenType string) *model.AppError

func (SqlTokenStore) Save

func (s SqlTokenStore) Save(token *model.Token) *model.AppError

type SqlUserAccessTokenStore

type SqlUserAccessTokenStore struct {
	SqlStore
}

func (SqlUserAccessTokenStore) Delete

func (s SqlUserAccessTokenStore) Delete(tokenId string) *model.AppError

func (SqlUserAccessTokenStore) DeleteAllForUser

func (s SqlUserAccessTokenStore) DeleteAllForUser(userId string) *model.AppError

func (SqlUserAccessTokenStore) Get

func (SqlUserAccessTokenStore) GetAll

func (s SqlUserAccessTokenStore) GetAll(offset, limit int) ([]*model.UserAccessToken, *model.AppError)

func (SqlUserAccessTokenStore) GetByToken

func (s SqlUserAccessTokenStore) GetByToken(tokenString string) (*model.UserAccessToken, *model.AppError)

func (SqlUserAccessTokenStore) GetByUser

func (s SqlUserAccessTokenStore) GetByUser(userId string, offset, limit int) ([]*model.UserAccessToken, *model.AppError)

func (SqlUserAccessTokenStore) Save

func (SqlUserAccessTokenStore) Search

func (SqlUserAccessTokenStore) UpdateTokenDisable

func (s SqlUserAccessTokenStore) UpdateTokenDisable(tokenId string) *model.AppError

func (SqlUserAccessTokenStore) UpdateTokenEnable

func (s SqlUserAccessTokenStore) UpdateTokenEnable(tokenId string) *model.AppError

type SqlUserStore

type SqlUserStore struct {
	SqlStore
	// contains filtered or unexported fields
}

func (SqlUserStore) AnalyticsActiveCount

func (us SqlUserStore) AnalyticsActiveCount(timePeriod int64, options model.UserCountOptions) (int64, *model.AppError)

func (SqlUserStore) AnalyticsGetInactiveUsersCount

func (us SqlUserStore) AnalyticsGetInactiveUsersCount() (int64, *model.AppError)

func (SqlUserStore) AnalyticsGetSystemAdminCount

func (us SqlUserStore) AnalyticsGetSystemAdminCount() (int64, *model.AppError)

func (SqlUserStore) ClearAllCustomRoleAssignments

func (us SqlUserStore) ClearAllCustomRoleAssignments() *model.AppError

func (SqlUserStore) ClearCaches

func (us SqlUserStore) ClearCaches()

func (SqlUserStore) Count

func (us SqlUserStore) Count(options model.UserCountOptions) (int64, *model.AppError)

func (SqlUserStore) Get

func (us SqlUserStore) Get(id string) (*model.User, *model.AppError)

func (SqlUserStore) GetAll

func (us SqlUserStore) GetAll() ([]*model.User, *model.AppError)

func (SqlUserStore) GetAllAfter

func (us SqlUserStore) GetAllAfter(limit int, afterId string) ([]*model.User, *model.AppError)

func (SqlUserStore) GetAllProfiles

func (us SqlUserStore) GetAllProfiles(options *model.UserGetOptions) ([]*model.User, *model.AppError)

func (SqlUserStore) GetAllProfilesInClass

func (us SqlUserStore) GetAllProfilesInClass(classId string, allowFromCache bool) (map[string]*model.User, *model.AppError)

func (SqlUserStore) GetAllUsingAuthService

func (us SqlUserStore) GetAllUsingAuthService(authService string) ([]*model.User, *model.AppError)

func (SqlUserStore) GetByAuth

func (us SqlUserStore) GetByAuth(authData *string, authService string) (*model.User, *model.AppError)

func (SqlUserStore) GetByEmail

func (us SqlUserStore) GetByEmail(email string) (*model.User, *model.AppError)

func (SqlUserStore) GetByUsername

func (us SqlUserStore) GetByUsername(username string) (*model.User, *model.AppError)

func (SqlUserStore) GetEtagForAllProfiles

func (us SqlUserStore) GetEtagForAllProfiles() string

func (SqlUserStore) GetEtagForProfiles

func (us SqlUserStore) GetEtagForProfiles(teamId string) string

func (SqlUserStore) GetForLogin

func (us SqlUserStore) GetForLogin(loginId string, allowSignInWithUsername, allowSignInWithEmail bool) (*model.User, *model.AppError)

func (SqlUserStore) GetNewUsersForBranch

func (us SqlUserStore) GetNewUsersForBranch(teamId string, offset, limit int, viewRestrictions *model.ViewUsersRestrictions) ([]*model.User, *model.AppError)

func (SqlUserStore) GetProfileByIds

func (us SqlUserStore) GetProfileByIds(userIds []string, options *store.UserGetByIdsOpts, _ bool) ([]*model.User, *model.AppError)

func (SqlUserStore) GetProfiles

func (us SqlUserStore) GetProfiles(options *model.UserGetOptions) ([]*model.User, *model.AppError)

func (SqlUserStore) GetProfilesByUsernames

func (us SqlUserStore) GetProfilesByUsernames(usernames []string, viewRestrictions *model.ViewUsersRestrictions) ([]*model.User, *model.AppError)

func (SqlUserStore) GetProfilesInClass

func (us SqlUserStore) GetProfilesInClass(classId string, offset int, limit int) ([]*model.User, *model.AppError)

func (SqlUserStore) GetProfilesInClassByStatus

func (us SqlUserStore) GetProfilesInClassByStatus(classId string, offset int, limit int) ([]*model.User, *model.AppError)

func (SqlUserStore) GetProfilesNotInClass

func (us SqlUserStore) GetProfilesNotInClass(teamId string, classId string, groupConstrained bool, offset int, limit int, viewRestrictions *model.ViewUsersRestrictions) ([]*model.User, *model.AppError)

func (SqlUserStore) GetProfilesWithoutBranch

func (us SqlUserStore) GetProfilesWithoutBranch(options *model.UserGetOptions) ([]*model.User, *model.AppError)

func (SqlUserStore) GetRecentlyActiveUsersForBranch

func (us SqlUserStore) GetRecentlyActiveUsersForBranch(teamId string, offset, limit int, viewRestrictions *model.ViewUsersRestrictions) ([]*model.User, *model.AppError)

func (SqlUserStore) GetSystemAdminProfiles

func (us SqlUserStore) GetSystemAdminProfiles() (map[string]*model.User, *model.AppError)

func (SqlUserStore) GetUsersBatchForIndexing

func (us SqlUserStore) GetUsersBatchForIndexing(startTime, endTime int64, limit int) ([]*model.UserForIndexing, *model.AppError)

func (SqlUserStore) InferSystemInstallDate

func (us SqlUserStore) InferSystemInstallDate() (int64, *model.AppError)

func (SqlUserStore) InvalidateProfileCacheForUser

func (us SqlUserStore) InvalidateProfileCacheForUser(userId string)

func (SqlUserStore) InvalidateProfilesInClassCache

func (us SqlUserStore) InvalidateProfilesInClassCache(classId string)

func (SqlUserStore) InvalidateProfilesInClassCacheByUser

func (us SqlUserStore) InvalidateProfilesInClassCacheByUser(userId string)

func (SqlUserStore) PermanentDelete

func (us SqlUserStore) PermanentDelete(userId string) *model.AppError

func (SqlUserStore) ResetLastPictureUpdate

func (us SqlUserStore) ResetLastPictureUpdate(userId string) *model.AppError

func (SqlUserStore) Save

func (us SqlUserStore) Save(user *model.User) (*model.User, *model.AppError)

func (SqlUserStore) Update

func (us SqlUserStore) Update(user *model.User, trustedUpdateData bool) (*model.UserUpdate, *model.AppError)

func (SqlUserStore) UpdateAuthData

func (us SqlUserStore) UpdateAuthData(userId string, service string, authData *string, email string, resetMfa bool) (string, *model.AppError)

func (SqlUserStore) UpdateFailedPasswordAttempts

func (us SqlUserStore) UpdateFailedPasswordAttempts(userId string, attempts int) *model.AppError

func (SqlUserStore) UpdateLastPictureUpdate

func (us SqlUserStore) UpdateLastPictureUpdate(userId string) *model.AppError

func (SqlUserStore) UpdateMfaActive

func (us SqlUserStore) UpdateMfaActive(userId string, active bool) *model.AppError

func (SqlUserStore) UpdateMfaSecret

func (us SqlUserStore) UpdateMfaSecret(userId, secret string) *model.AppError

func (SqlUserStore) UpdatePassword

func (us SqlUserStore) UpdatePassword(userId, hashedPassword string) *model.AppError

func (SqlUserStore) UpdateUpdateAt

func (us SqlUserStore) UpdateUpdateAt(userId string) (int64, *model.AppError)

func (SqlUserStore) VerifyEmail

func (us SqlUserStore) VerifyEmail(userId, email string) (string, *model.AppError)

type SqlUserTermsOfServiceStore

type SqlUserTermsOfServiceStore struct {
	SqlStore
}

func (SqlUserTermsOfServiceStore) Delete

func (s SqlUserTermsOfServiceStore) Delete(userId, termsOfServiceId string) *model.AppError

func (SqlUserTermsOfServiceStore) GetByUser

func (SqlUserTermsOfServiceStore) Save

type SqlWebhookStore

type SqlWebhookStore struct {
	SqlStore
	// contains filtered or unexported fields
}

func (SqlWebhookStore) AnalyticsIncomingCount

func (s SqlWebhookStore) AnalyticsIncomingCount(teamId string) (int64, *model.AppError)

func (SqlWebhookStore) AnalyticsOutgoingCount

func (s SqlWebhookStore) AnalyticsOutgoingCount(teamId string) (int64, *model.AppError)

func (SqlWebhookStore) ClearCaches

func (s SqlWebhookStore) ClearCaches()

func (SqlWebhookStore) DeleteIncoming

func (s SqlWebhookStore) DeleteIncoming(webhookId string, time int64) *model.AppError

func (SqlWebhookStore) DeleteOutgoing

func (s SqlWebhookStore) DeleteOutgoing(webhookId string, time int64) *model.AppError

func (SqlWebhookStore) GetIncoming

func (s SqlWebhookStore) GetIncoming(id string, allowFromCache bool) (*model.IncomingWebhook, *model.AppError)

func (SqlWebhookStore) GetIncomingByChannel

func (s SqlWebhookStore) GetIncomingByChannel(channelId string) ([]*model.IncomingWebhook, *model.AppError)

func (SqlWebhookStore) GetIncomingByTeam

func (s SqlWebhookStore) GetIncomingByTeam(teamId string, offset, limit int) ([]*model.IncomingWebhook, *model.AppError)

func (SqlWebhookStore) GetIncomingByTeamByUser

func (s SqlWebhookStore) GetIncomingByTeamByUser(teamId string, userId string, offset, limit int) ([]*model.IncomingWebhook, *model.AppError)

func (SqlWebhookStore) GetIncomingList

func (s SqlWebhookStore) GetIncomingList(offset, limit int) ([]*model.IncomingWebhook, *model.AppError)

func (SqlWebhookStore) GetIncomingListByUser

func (s SqlWebhookStore) GetIncomingListByUser(userId string, offset, limit int) ([]*model.IncomingWebhook, *model.AppError)

func (SqlWebhookStore) GetOutgoing

func (s SqlWebhookStore) GetOutgoing(id string) (*model.OutgoingWebhook, *model.AppError)

func (SqlWebhookStore) GetOutgoingByChannel

func (s SqlWebhookStore) GetOutgoingByChannel(channelId string, offset, limit int) ([]*model.OutgoingWebhook, *model.AppError)

func (SqlWebhookStore) GetOutgoingByChannelByUser

func (s SqlWebhookStore) GetOutgoingByChannelByUser(channelId string, userId string, offset, limit int) ([]*model.OutgoingWebhook, *model.AppError)

func (SqlWebhookStore) GetOutgoingByTeam

func (s SqlWebhookStore) GetOutgoingByTeam(teamId string, offset, limit int) ([]*model.OutgoingWebhook, *model.AppError)

func (SqlWebhookStore) GetOutgoingByTeamByUser

func (s SqlWebhookStore) GetOutgoingByTeamByUser(teamId string, userId string, offset, limit int) ([]*model.OutgoingWebhook, *model.AppError)

func (SqlWebhookStore) GetOutgoingList

func (s SqlWebhookStore) GetOutgoingList(offset, limit int) ([]*model.OutgoingWebhook, *model.AppError)

func (SqlWebhookStore) GetOutgoingListByUser

func (s SqlWebhookStore) GetOutgoingListByUser(userId string, offset, limit int) ([]*model.OutgoingWebhook, *model.AppError)

func (SqlWebhookStore) InvalidateWebhookCache

func (s SqlWebhookStore) InvalidateWebhookCache(webhookId string)

func (SqlWebhookStore) PermanentDeleteIncomingByChannel

func (s SqlWebhookStore) PermanentDeleteIncomingByChannel(channelId string) *model.AppError

func (SqlWebhookStore) PermanentDeleteIncomingByUser

func (s SqlWebhookStore) PermanentDeleteIncomingByUser(userId string) *model.AppError

func (SqlWebhookStore) PermanentDeleteOutgoingByChannel

func (s SqlWebhookStore) PermanentDeleteOutgoingByChannel(channelId string) *model.AppError

func (SqlWebhookStore) PermanentDeleteOutgoingByUser

func (s SqlWebhookStore) PermanentDeleteOutgoingByUser(userId string) *model.AppError

func (SqlWebhookStore) SaveIncoming

func (SqlWebhookStore) SaveOutgoing

func (SqlWebhookStore) UpdateIncoming

func (SqlWebhookStore) UpdateOutgoing

type TraceOnAdapter

type TraceOnAdapter struct{}

func (*TraceOnAdapter) Printf

func (t *TraceOnAdapter) Printf(format string, v ...interface{})

type UserWithClass

type UserWithClass struct {
	model.User
	ClassId string
}

type UserWithLastActivityAt

type UserWithLastActivityAt struct {
	model.User
	LastActivityAt int64
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL