Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type ClearUserInfo ¶
type ClearUserInfo struct {
// The user that was cleared
ClearedFrom []ClearFrom
// Whether the user was a bot or not
IsBot bool
}
ClearUserInfo contains information on a clear operation
func ClearUser ¶
func ClearUser(ctx context.Context, id string, platform Platform, req ClearUserReq) (*ClearUserInfo, error)
Clears a user of a platform
type ClearUserReq ¶
type ClearUserReq struct {
// Where to clear from
//
// iuc -> internal user cache (postgres)
//
// Redis -> redis cache
//
//
// If not specified, will clear from all
ClearFrom []ClearFrom
}
type Platform ¶
type Platform interface {
// initializes a platform, most of the time, needs no implementation
Init() error
// returns whether or not the platform is initialized, init() must set this to true if called
Initted() bool
// Returns the base state
GetState() *BaseState
// returns the name of the platform, used for cache table names
PlatformName() string
// validate the id, if feasible
ValidateId(id string) (string, error)
// try and find the user in the platform's cache, should only hit cache
//
// if user not found, return nil, nil (error should be nil and user obj should be nil)
//
// note that returning a error here will cause the user to not be fetched from the platform
PlatformSpecificCache(ctx context.Context, id string) (*dovetypes.PlatformUser, error)
// fetch a user from the platform, at this point, assume that cache has been checked
GetUser(ctx context.Context, id string) (*dovetypes.PlatformUser, error)
}
Click to show internal directories.
Click to hide internal directories.