application

package
v0.0.0-...-3ee0b18 Latest Latest
Warning

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

Go to latest
Published: Apr 20, 2026 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 Consensus

type Consensus interface {
	Apply(cmd []byte, timeout time.Duration) (err error)
	GetServers(ctx context.Context) ([]*api.Server, error)
}

type Distributed

type Distributed struct {
	// contains filtered or unexported fields
}

func New

func New(consensus Consensus, usersRepo UsersRepository, log *logger.Logger) *Distributed

func (*Distributed) CreateUser

func (m *Distributed) CreateUser(ctx context.Context, id int64, login, password string, metadata []byte) (user *model.User, err error)

func (*Distributed) DeleteUser

func (m *Distributed) DeleteUser(ctx context.Context, id int64) (err error)

func (*Distributed) FindUser

func (m *Distributed) FindUser(ctx context.Context, login string) (user *model.User, err error)

func (*Distributed) GetServers

func (m *Distributed) GetServers(ctx context.Context) ([]*api.Server, error)

func (*Distributed) GetUser

func (m *Distributed) GetUser(ctx context.Context, id int64) (user *model.User, err error)

func (*Distributed) MakePremium

func (m *Distributed) MakePremium(ctx context.Context, id int64, invoiceID, createdAt, expiresAt string) (err error)

func (*Distributed) UpdateUser

func (m *Distributed) UpdateUser(ctx context.Context, id int64, login *string, metadata []byte) (err error)

type UsersRepository

type UsersRepository interface {
	FindByID(ctx context.Context, id int64) (user *model.User, err error)
	FindByLogin(ctx context.Context, login string) (user *model.User, err error)
}

Jump to

Keyboard shortcuts

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