database

package
v0.0.0-testrgm3 Latest Latest
Warning

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

Go to latest
Published: Jul 21, 2023 License: AGPL-3.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var GetTime = time.Now

Functions

func InitDuplicateUserMetrics

func InitDuplicateUserMetrics()

Should be in use in ProvideAuthInfoStore due to query performance for big user tables we have disabled these metrics from Grafana for now

func ProvideAuthInfoStore

func ProvideAuthInfoStore(sqlStore db.DB, secretsService secrets.Service, userService user.Service) login.Store

Types

type AuthInfoStore

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

func (*AuthInfoStore) CollectLoginStats

func (s *AuthInfoStore) CollectLoginStats(ctx context.Context) (map[string]interface{}, error)

func (*AuthInfoStore) DeleteAuthInfo

func (s *AuthInfoStore) DeleteAuthInfo(ctx context.Context, cmd *login.DeleteAuthInfoCommand) error

func (*AuthInfoStore) DeleteUserAuthInfo

func (s *AuthInfoStore) DeleteUserAuthInfo(ctx context.Context, userID int64) error

func (*AuthInfoStore) GetAuthInfo

func (s *AuthInfoStore) GetAuthInfo(ctx context.Context, query *login.GetAuthInfoQuery) (*login.UserAuth, error)

GetAuthInfo returns the auth info for a user It will return the latest auth info for a user

func (*AuthInfoStore) GetExternalUserInfoByLogin

func (s *AuthInfoStore) GetExternalUserInfoByLogin(ctx context.Context, query *login.GetExternalUserInfoByLoginQuery) (*login.ExternalUserInfo, error)

func (*AuthInfoStore) GetLoginStats

func (s *AuthInfoStore) GetLoginStats(ctx context.Context) (login.LoginStats, error)

func (*AuthInfoStore) GetUserByEmail

func (s *AuthInfoStore) GetUserByEmail(ctx context.Context, email string) (*user.User, error)

func (*AuthInfoStore) GetUserById

func (s *AuthInfoStore) GetUserById(ctx context.Context, id int64) (*user.User, error)

func (*AuthInfoStore) GetUserByLogin

func (s *AuthInfoStore) GetUserByLogin(ctx context.Context, login string) (*user.User, error)

func (*AuthInfoStore) GetUserLabels

func (s *AuthInfoStore) GetUserLabels(ctx context.Context, query login.GetUserLabelsQuery) (map[int64]string, error)

func (*AuthInfoStore) RunMetricsCollection

func (s *AuthInfoStore) RunMetricsCollection(ctx context.Context) error

func (*AuthInfoStore) SetAuthInfo

func (s *AuthInfoStore) SetAuthInfo(ctx context.Context, cmd *login.SetAuthInfoCommand) error

func (*AuthInfoStore) UpdateAuthInfo

func (s *AuthInfoStore) UpdateAuthInfo(ctx context.Context, cmd *login.UpdateAuthInfoCommand) error

func (*AuthInfoStore) UpdateAuthInfoDate

func (s *AuthInfoStore) UpdateAuthInfoDate(ctx context.Context, authInfo *login.UserAuth) error

UpdateAuthInfoDate updates the auth info for the user with the latest date. Avoids overlapping entries hiding the last used one (ex: LDAP->SAML->LDAP).

Jump to

Keyboard shortcuts

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