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, sessionsRepo SessionsRepository, log *logger.Logger) *Distributed

func (*Distributed) CreateSession

func (m *Distributed) CreateSession(ctx context.Context, userID int64) (session *model.Session, err error)

func (*Distributed) GetServers

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

func (*Distributed) GetSession

func (m *Distributed) GetSession(ctx context.Context, token string) (*model.Session, error)

func (*Distributed) ListUserSessions

func (m *Distributed) ListUserSessions(ctx context.Context, userID int64) ([]*model.Session, error)

func (*Distributed) RemoveSession

func (m *Distributed) RemoveSession(ctx context.Context, token string) error

func (*Distributed) RemoveUserSessions

func (m *Distributed) RemoveUserSessions(ctx context.Context, userID int64) error

type SessionsRepository

type SessionsRepository interface {
	Get(ctx context.Context, token string) (session *model.Session, err error)
	List(ctx context.Context, userID int64) (sessions []*model.Session, err error)
}

Jump to

Keyboard shortcuts

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