rest

package
v0.0.0-...-74c685c Latest Latest
Warning

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

Go to latest
Published: Oct 1, 2023 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Authenticator

type Authenticator interface {
	ValidateSession(ctx context.Context, key, ip, agent string) (userId string, err error)
	EndAllSessions(ctx context.Context, userId string) error
}

type ErrUserDeleted

type ErrUserDeleted interface {
	Error() string
	ImplementsUserDeletedError()
}

type ErrUserIdAlreadyExists

type ErrUserIdAlreadyExists interface {
	Error() string
	ImplementsUserIdAlreadyExistsError()
}

type ErrUserNotFound

type ErrUserNotFound interface {
	Error() string
	ImplementsUserNotFoundError()
}

type FileStats

type FileStats interface {
	SendUsage(ctx context.Context, fileId string, inUse bool) error
}

type Service

type Service struct {
	Shutdown chan struct{}
	// contains filtered or unexported fields
}

func (*Service) Start

func (s *Service) Start(auth Authenticator, storage Storage, fileStats FileStats)

func (*Service) Stop

func (s *Service) Stop(ctx context.Context) (err error)

type Storage

type Storage interface {
	CreateUser(ctx context.Context, id, name, password string) error
	UserInfoV1(ctx context.Context, id string) (*models.UserInfoV1, error)
	UpdateCommonProfileInfoV1(ctx context.Context, userId string, info *models.UserProfileCommonV1) (oldPic string, err error)
	ChangePassword(ctx context.Context, userId, newPassword string) error
	GenerateUserDeletionCode(ctx context.Context, userId string) (code string, err error)
	ValidateUserDeletionCode(ctx context.Context, userId string, code string) (valid bool, err error)
	DeleteUser(ctx context.Context, userId string) error

	ValidateCredentials(ctx context.Context, userId, password string) (valid bool, err error)
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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