user

package
v0.3.3 Latest Latest
Warning

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

Go to latest
Published: Jan 29, 2022 License: MIT Imports: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrUserNotFound = errors.New("user does not exist")

Functions

This section is empty.

Types

type API

type API interface {
	Login(ctx context.Context, code, state string) (*skillz.User, error)
	LoadUserAll(ctx context.Context, id uuid.UUID) (*skillz.User, error)

	UserFromToken(ctx context.Context, token jwt.Token) (*skillz.User, error)
	ValidateCurrentToken(ctx context.Context, user *skillz.User) error

	User(ctx context.Context, id uuid.UUID, rels ...UserRel) (*skillz.User, error)
	RefreshUser(ctx context.Context, user *skillz.User) error
	UserByCharacterID(ctx context.Context, characterID uint64) (*skillz.User, error)
	SearchUsers(ctx context.Context, q string) ([]*skillz.UserSearchResult, error)
	UpdateUser(ctx context.Context, user *skillz.User) error

	Recent(ctx context.Context) ([]*skillz.User, []*skillz.User, error)
	// NewUsersBySP(ctx context.Context) ([]*skillz.UserWithSkillMeta, error)
	ResetUserCache(ctx context.Context, user *skillz.User) error
	ProcessUpdatableUsers(ctx context.Context) error

	UserSettings(ctx context.Context, id uuid.UUID) (*skillz.UserSettings, error)
	CreateUserSettings(ctx context.Context, userID uuid.UUID, settings *skillz.UserSettings) error
}

type Permission

type Permission uint
const (
	PermissionHideQueue Permission = iota
	PermissionHideClones
	PermissionHideStandings
	PermissionHideShips
)

type Service

type Service struct {
	skillz.UserRepository
	// contains filtered or unexported fields
}

func New

func New(
	redis *redis.Client,
	logger *logrus.Logger,
	cache cache.UserAPI,
	auth auth.API,
	alliance alliance.API,
	character character.API,
	corporation corporation.API,
	skills skill.API,
	user skillz.UserRepository,
) *Service

func (*Service) CreateUserSettings

func (s *Service) CreateUserSettings(ctx context.Context, id uuid.UUID, settings *skillz.UserSettings) error

func (*Service) LoadAttributes

func (s *Service) LoadAttributes(ctx context.Context, user *skillz.User, entry *logrus.Entry, mx *sync.Mutex, wg *sync.WaitGroup)

func (*Service) LoadCharacter

func (s *Service) LoadCharacter(ctx context.Context, user *skillz.User, entry *logrus.Entry, mx *sync.Mutex, wg *sync.WaitGroup)

func (*Service) LoadFlyable

func (s *Service) LoadFlyable(ctx context.Context, user *skillz.User, entry *logrus.Entry, mx *sync.Mutex, wg *sync.WaitGroup)

func (*Service) LoadSkillGrouped

func (s *Service) LoadSkillGrouped(ctx context.Context, user *skillz.User, entry *logrus.Entry, mx *sync.Mutex, wg *sync.WaitGroup)

func (*Service) LoadSkillMeta

func (s *Service) LoadSkillMeta(ctx context.Context, user *skillz.User, entry *logrus.Entry, mx *sync.Mutex, wg *sync.WaitGroup)

func (*Service) LoadSkillQueue

func (s *Service) LoadSkillQueue(ctx context.Context, user *skillz.User, entry *logrus.Entry, mx *sync.Mutex, wg *sync.WaitGroup)

func (*Service) LoadSkills

func (s *Service) LoadSkills(ctx context.Context, user *skillz.User, entry *logrus.Entry, mx *sync.Mutex, wg *sync.WaitGroup)

func (*Service) LoadUserAll

func (s *Service) LoadUserAll(ctx context.Context, id uuid.UUID) (*skillz.User, error)

func (*Service) Login

func (s *Service) Login(ctx context.Context, code, state string) (*skillz.User, error)

func (*Service) ProcessUpdatableUsers

func (s *Service) ProcessUpdatableUsers(ctx context.Context) error

func (*Service) Recent

func (s *Service) Recent(ctx context.Context) ([]*skillz.User, []*skillz.User, error)

func (*Service) RefreshUser

func (s *Service) RefreshUser(ctx context.Context, user *skillz.User) error

func (*Service) ResetUserCache added in v0.3.3

func (s *Service) ResetUserCache(ctx context.Context, user *skillz.User) error

func (*Service) SearchUsers

func (s *Service) SearchUsers(ctx context.Context, q string) ([]*skillz.UserSearchResult, error)

func (*Service) User

func (s *Service) User(ctx context.Context, id uuid.UUID, rels ...UserRel) (*skillz.User, error)

func (*Service) UserFromToken

func (s *Service) UserFromToken(ctx context.Context, token jwt.Token) (*skillz.User, error)

func (*Service) UserSettings

func (s *Service) UserSettings(ctx context.Context, id uuid.UUID) (*skillz.UserSettings, error)

func (*Service) ValidateCurrentToken

func (s *Service) ValidateCurrentToken(ctx context.Context, user *skillz.User) error

type UserRel

type UserRel uint
const (
	UserCharacterRel UserRel = iota
	UserAttributesRel
	UserSkillsRel
	UserFlyableRel
	UserSkillQueueRel
	UserSkillMetaRel
)

func (UserRel) Valid

func (r UserRel) Valid() bool

Jump to

Keyboard shortcuts

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