Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AccountRepository ¶
type AccountRepository interface {
// GetCurrent is a method that returns the current account.
GetCurrent(ctx context.Context, account *models.Account) error
// Get is a method that returns an account by ID.
Get(ctx context.Context, account *models.Account) error
// Create is a method that creates a new account.
Create(ctx context.Context, account *models.Account) error
// Delete is a method that deletes an account.
Delete(ctx context.Context, account *models.Account) error
// Update is a method that updates an account.
Update(ctx context.Context, account *models.Account) error
// List is a method that returns a list of accounts.
List(ctx context.Context, accounts *[]models.Account) error
}
AccountRepository is an interface that defines the methods for account operations.
type AccountService ¶ added in v0.3.28
type AccountService interface {
// GetAccount returns the account associated with the session.
GetAccount(ctx context.Context, account *models.Account) error
// UpdateAccount updates the account associated with the session.
UpdateAccount(ctx context.Context, account *models.Account) error
// DeleteAccount deletes the account associated with the session.
DeleteAccount(ctx context.Context, account *models.Account) error
// CreateAccount creates a new account.
CreateAccount(ctx context.Context, account *models.Account) error
// ListAccounts returns the list of accounts.
ListAccounts(ctx context.Context, accounts *[]*models.Account) error
}
AccountService is the service for managing accounts.
type DeviceAuthRepository ¶
type DeviceAuthRepository interface {
// Begin is a method that begins the device authentication process.
Begin(ctx context.Context) (*models.DeviceAuth, error)
// Finish is a method that finishes the device authentication process.
// TODO: could be returned in a token structure
Finish(ctx context.Context, deviceAuth *models.DeviceAuth) (*models.Account, error)
// Refresh is a method that refreshes the device authentication token.
Refresh(ctx context.Context, model *models.Account) error
}
DeviceAuthRepository is an interface that defines the methods for device authentication operations.
type FilesRepository ¶ added in v0.3.0
type FilesRepository interface {
// UploadFile uploads a file to the repository.
UploadFile(ctx context.Context, name, cwd, file string) error
}
FilesRepository is an interface for the files repository.
type ReadTx ¶ added in v0.3.2
type ReadTx interface {
// GetCurrentAccount retrieves the current account from the database.
GetCurrentAccount(ctx context.Context, account *models.Account) error
// GetSession retrieves the session from the database.
GetSession(ctx context.Context, session *models.Session) error
// ListSessions retrieves the list of sessions from the database.
ListSessions(ctx context.Context, sessions *[]*models.Session) error
// GetAccount retrieves the account from the database.
GetAccount(ctx context.Context, account *models.Account) error
// ListAccounts retrieves the list of accounts from the database.
ListAccounts(ctx context.Context, accounts *[]*models.Account) error
// GetSite retrieves the site from the database.
GetSite(ctx context.Context, site *models.Site) error
}
ReadTx is a read-only transaction interface.
type ReadWriteTx ¶ added in v0.3.2
type ReadWriteTx interface {
// CreateSession creates a new session in the database.
CreateSession(ctx context.Context, session *models.Session) error
// UpdateSession updates an existing session in the database.
UpdateSession(ctx context.Context, session *models.Session) error
// DeleteSession deletes a session in the database.
DeleteSession(ctx context.Context, session *models.Session) error
// CreateAccount creates a new account in the database.
CreateAccount(ctx context.Context, account *models.Account) error
// UpdateAccount updates an existing account in the database.
UpdateAccount(ctx context.Context, account *models.Account) error
// DeleteAccount deletes an account in the database.
DeleteAccount(ctx context.Context, account *models.Account) error
// CreateSite creates a new site in the database.
CreateSite(ctx context.Context, site *models.Site) error
// UpdateSite updates an existing site in the database.
UpdateSite(ctx context.Context, site *models.Site) error
// DeleteSite deletes a site in the database.
DeleteSite(ctx context.Context, site *models.Site) error
ReadTx
}
ReadWriteTx is a read-write transaction interface.
type SessionService ¶ added in v0.3.28
type SessionService interface {
// GetSession returns the session associated with the request.
GetSession(ctx context.Context, models *models.Session) error
// CreateSession creates a new session.
CreateSession(ctx context.Context) (*models.Session, error)
// UpdateSession updates an existing session.
UpdateSession(ctx context.Context, session *models.Session) error
// DeleteSession deletes a session.
DeleteSession(ctx context.Context, session *models.Session) error
// ListSessions returns the list of sessions.
ListSessions(ctx context.Context, sessions *[]*models.Session) error
}
SessionService is the service for managing sessions.
type SitesRepository ¶
type SitesRepository interface {
// Create is a method that creates a new site.
Create(ctx context.Context, site *models.Site) error
// GetSite is a method that gets a site by name.
GetSite(ctx context.Context, name string) (models.Site, error)
// ClaimSite is a method that claims a site.
ClaimSite(ctx context.Context, name string) error
}
SitesRepository contains the methods for sites operations.
type SitesService ¶ added in v0.3.28
type SitesService interface {
// GetSite returns the site associated with the session.
GetSite(ctx context.Context, site *models.Site) error
// CreateSite creates a new site.
CreateSite(ctx context.Context, site *models.Site) error
// UpdateSite updates an existing site.
UpdateSite(ctx context.Context, site *models.Site) error
// DeleteSite deletes a site.
DeleteSite(ctx context.Context, site *models.Site) error
// UpdateSiteOwnedBy updates the owner of a site.
UpdateSiteOwnedBy(ctx context.Context, name, owner string) error
}
SitesService contains the methods for sites operations.
Click to show internal directories.
Click to hide internal directories.