Documentation ¶
Overview ¶
Package clients provides the client related business logic.
Index ¶
- Variables
- func Activate(ctx context.Context, be *backend.Backend, project *types.Project, ...) (*database.ClientInfo, error)
- func Deactivate(ctx context.Context, be *backend.Backend, project *types.Project, ...) (*database.ClientInfo, error)
- func DeactivateInactives(ctx context.Context, be *backend.Backend, candidatesLimitPerProject int, ...) (types.ID, error)
- func FindActiveClientInfo(ctx context.Context, be *backend.Backend, refKey types.ClientRefKey) (*database.ClientInfo, error)
- type CandidatePair
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // ErrInvalidClientKey is returned when the given Key is not valid ClientKey. ErrInvalidClientKey = errors.New("invalid client key") // ErrInvalidClientID is returned when the given Key is not valid ClientID. ErrInvalidClientID = errors.New("invalid client id") )
Functions ¶
func Activate ¶
func Activate( ctx context.Context, be *backend.Backend, project *types.Project, clientKey string, ) (*database.ClientInfo, error)
Activate activates the given client.
func Deactivate ¶
func Deactivate( ctx context.Context, be *backend.Backend, project *types.Project, refKey types.ClientRefKey, ) (*database.ClientInfo, error)
Deactivate deactivates the given client.
func DeactivateInactives ¶ added in v0.4.28
func DeactivateInactives( ctx context.Context, be *backend.Backend, candidatesLimitPerProject int, projectFetchSize int, housekeepingLastProjectID types.ID, ) (types.ID, error)
DeactivateInactives deactivates clients that have not been active for a long time.
func FindActiveClientInfo ¶ added in v0.4.21
func FindActiveClientInfo( ctx context.Context, be *backend.Backend, refKey types.ClientRefKey, ) (*database.ClientInfo, error)
FindActiveClientInfo find the active client info by the given ref key.
Types ¶
type CandidatePair ¶ added in v0.5.2
type CandidatePair struct { Project *database.ProjectInfo Client *database.ClientInfo }
CandidatePair represents a pair of Project and Client.
func FindDeactivateCandidates ¶ added in v0.4.28
func FindDeactivateCandidates( ctx context.Context, be *backend.Backend, candidatesLimitPerProject int, projectFetchSize int, lastProjectID types.ID, ) (types.ID, []CandidatePair, error)
FindDeactivateCandidates finds candidates to deactivate from the database.
Click to show internal directories.
Click to hide internal directories.