user

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Jan 4, 2022 License: MIT Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type API

type API interface {
	Login(ctx context.Context, code, state string) (*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) (*skillz.User, error)
	RefreshUser(ctx context.Context, user *skillz.User) error
	UserByCharacterID(ctx context.Context, characterID uint64) (*skillz.User, error)
	UserByCookie(ctx context.Context, cookie *http.Cookie) (*skillz.User, error)
	SearchUsers(ctx context.Context, q string) ([]*skillz.UserSearchResult, error)
	UpdateUser(ctx context.Context, user *skillz.User) error

	NewUsersBySP(ctx context.Context, days int) ([]*skillz.UserWithSkillMeta, error)

	ProcessUpdatableUsers(ctx context.Context) error
}

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) Login

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

func (*Service) NewUsersBySP

func (s *Service) NewUsersBySP(ctx context.Context, days int) ([]*skillz.UserWithSkillMeta, error)

func (*Service) ProcessUpdatableUsers

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

func (*Service) RefreshUser

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

func (*Service) SearchUsers

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

func (*Service) UserByCookie

func (s *Service) UserByCookie(ctx context.Context, cookie *http.Cookie) (*skillz.User, error)

func (*Service) UserFromToken

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

func (*Service) ValidateCurrentToken

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

Jump to

Keyboard shortcuts

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