user

package
v0.2.4 Latest Latest
Warning

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

Go to latest
Published: Jan 25, 2022 License: MIT Imports: 19 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)
	SearchUsers(ctx context.Context, q string) ([]*skillz.UserSearchResult, error)
	UpdateUser(ctx context.Context, user *skillz.User) error

	NewUsersBySP(ctx context.Context) ([]*skillz.UserWithSkillMeta, 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 added in v0.0.14

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 added in v0.0.14

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

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) ([]*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) UserFromToken

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

func (*Service) UserSettings added in v0.0.14

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

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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