services

package
v0.3.34 Latest Latest
Warning

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

Go to latest
Published: Nov 4, 2026 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Service

type Service interface {
	// Sessions is the session service.
	ports.SessionService
	// Accounts is the account service.
	ports.AccountService
}

Service is the main service struct.

func NewService

func NewService(store dbx.Database[ports.ReadTx, ports.ReadWriteTx]) Service

NewService creates a new service.

func SetupServices

func SetupServices(ctx context.Context, path string) (Service, error)

SetupServices sets up the services for the application.

type ServiceImpl

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

ServiceImpl is the implementation of the Service interface.

func (*ServiceImpl) CreateAccount

func (s *ServiceImpl) CreateAccount(ctx context.Context, account *models.Account) error

CreateAccount creates a new account in the database.

func (*ServiceImpl) CreateSession

func (s *ServiceImpl) CreateSession(ctx context.Context) (*models.Session, error)

CreateSession creates a new session.

func (*ServiceImpl) CreateSite

func (s *ServiceImpl) CreateSite(ctx context.Context, site *models.Site) error

CreateSite creates a new site in the database.

func (*ServiceImpl) DeleteAccount

func (s *ServiceImpl) DeleteAccount(ctx context.Context, account *models.Account) error

DeleteAccount deletes an account from the database.

func (*ServiceImpl) DeleteSession

func (s *ServiceImpl) DeleteSession(ctx context.Context, session *models.Session) error

DeleteSession deletes the session associated with the request.

func (*ServiceImpl) DeleteSite

func (s *ServiceImpl) DeleteSite(ctx context.Context, site *models.Site) error

DeleteSite deletes a site from the database.

func (*ServiceImpl) GetAccount

func (s *ServiceImpl) GetAccount(ctx context.Context, account *models.Account) error

GetAccount returns the account with the given ID.

func (*ServiceImpl) GetSession

func (s *ServiceImpl) GetSession(ctx context.Context, session *models.Session) error

GetSession returns the session associated with the request.

func (*ServiceImpl) GetSite

func (s *ServiceImpl) GetSite(ctx context.Context, site *models.Site) error

GetSite returns a site from the database.

func (*ServiceImpl) ListAccounts

func (s *ServiceImpl) ListAccounts(ctx context.Context, accounts *[]*models.Account) error

ListAccounts returns the list of accounts.

func (*ServiceImpl) ListSessions

func (s *ServiceImpl) ListSessions(ctx context.Context, sessions *[]*models.Session) error

ListSessions returns the list of sessions.

func (*ServiceImpl) UpdateAccount

func (s *ServiceImpl) UpdateAccount(ctx context.Context, account *models.Account) error

UpdateAccount updates an existing account in the database.

func (*ServiceImpl) UpdateSession

func (s *ServiceImpl) UpdateSession(ctx context.Context, session *models.Session) error

UpdateSession updates the session associated with the request.

func (*ServiceImpl) UpdateSite

func (s *ServiceImpl) UpdateSite(ctx context.Context, site *models.Site) error

UpdateSite updates a site in the database.

Jump to

Keyboard shortcuts

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