store

package
v0.3.4 Latest Latest
Warning

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

Go to latest
Published: Mar 6, 2023 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Account

type Account struct {
	Model
	Email     string
	Salt      string
	Password  string
	Token     string
	Limitless bool
}

type AccountRequest

type AccountRequest struct {
	Model
	Token         string
	Email         string
	SourceAddress string
}

type Config

type Config struct {
	Path string `cf:"+secret"`
	Type string
}

type Environment

type Environment struct {
	Model
	AccountId   *int
	Description string
	Host        string
	Address     string
	ZId         string
}

type Frontend

type Frontend struct {
	Model
	EnvironmentId *int
	Token         string
	ZId           string
	PublicName    *string
	UrlTemplate   *string
	Reserved      bool
}

type InviteToken

type InviteToken struct {
	Model
	Token string
}

type Model

type Model struct {
	Id        int
	CreatedAt time.Time
	UpdatedAt time.Time
}

type PasswordResetRequest

type PasswordResetRequest struct {
	Model
	Token     string
	AccountId int
}

type Share

type Share struct {
	Model
	EnvironmentId        int
	ZId                  string
	Token                string
	ShareMode            string
	BackendMode          string
	FrontendSelection    *string
	FrontendEndpoint     *string
	BackendProxyEndpoint *string
	Reserved             bool
}

type Store

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

func Open

func Open(cfg *Config) (*Store, error)

func (*Store) Begin

func (self *Store) Begin() (*sqlx.Tx, error)

func (*Store) Close

func (self *Store) Close() error

func (*Store) CreateAccount

func (self *Store) CreateAccount(a *Account, tx *sqlx.Tx) (int, error)

func (*Store) CreateAccountRequest

func (self *Store) CreateAccountRequest(ar *AccountRequest, tx *sqlx.Tx) (int, error)

func (*Store) CreateEnvironment

func (self *Store) CreateEnvironment(accountId int, i *Environment, tx *sqlx.Tx) (int, error)

func (*Store) CreateEphemeralEnvironment

func (self *Store) CreateEphemeralEnvironment(i *Environment, tx *sqlx.Tx) (int, error)

func (*Store) CreateFrontend

func (str *Store) CreateFrontend(envId int, f *Frontend, tx *sqlx.Tx) (int, error)

func (*Store) CreateGlobalFrontend

func (str *Store) CreateGlobalFrontend(f *Frontend, tx *sqlx.Tx) (int, error)

func (*Store) CreateInviteTokens

func (str *Store) CreateInviteTokens(inviteTokens []*InviteToken, tx *sqlx.Tx) error

func (*Store) CreatePasswordResetRequest

func (self *Store) CreatePasswordResetRequest(prr *PasswordResetRequest, tx *sqlx.Tx) (int, error)

func (*Store) CreateShare

func (self *Store) CreateShare(envId int, shr *Share, tx *sqlx.Tx) (int, error)

func (*Store) DeleteAccountRequest

func (self *Store) DeleteAccountRequest(id int, tx *sqlx.Tx) error

func (*Store) DeleteEnvironment

func (self *Store) DeleteEnvironment(id int, tx *sqlx.Tx) error

func (*Store) DeleteFrontend

func (str *Store) DeleteFrontend(id int, tx *sqlx.Tx) error

func (*Store) DeleteInviteToken

func (str *Store) DeleteInviteToken(id int, tx *sqlx.Tx) error

func (*Store) DeleteMultipleAccountRequests

func (self *Store) DeleteMultipleAccountRequests(ids []int, tx *sqlx.Tx) error

func (*Store) DeleteMultiplePasswordResetRequests

func (self *Store) DeleteMultiplePasswordResetRequests(ids []int, tx *sqlx.Tx) error

func (*Store) DeletePasswordResetRequest

func (self *Store) DeletePasswordResetRequest(id int, tx *sqlx.Tx) error

func (*Store) DeleteShare

func (self *Store) DeleteShare(id int, tx *sqlx.Tx) error

func (*Store) FindAccountRequestWithEmail

func (self *Store) FindAccountRequestWithEmail(email string, tx *sqlx.Tx) (*AccountRequest, error)

func (*Store) FindAccountRequestWithToken

func (self *Store) FindAccountRequestWithToken(token string, tx *sqlx.Tx) (*AccountRequest, error)

func (*Store) FindAccountWithEmail

func (self *Store) FindAccountWithEmail(email string, tx *sqlx.Tx) (*Account, error)

func (*Store) FindAccountWithToken

func (self *Store) FindAccountWithToken(token string, tx *sqlx.Tx) (*Account, error)

func (*Store) FindEnvironmentForAccount

func (self *Store) FindEnvironmentForAccount(envZId string, accountId int, tx *sqlx.Tx) (*Environment, error)

func (*Store) FindEnvironmentsForAccount

func (self *Store) FindEnvironmentsForAccount(accountId int, tx *sqlx.Tx) ([]*Environment, error)

func (*Store) FindExpiredAccountRequests

func (self *Store) FindExpiredAccountRequests(before time.Time, limit int, tx *sqlx.Tx) ([]*AccountRequest, error)

func (*Store) FindExpiredPasswordResetRequests

func (self *Store) FindExpiredPasswordResetRequests(before time.Time, limit int, tx *sqlx.Tx) ([]*PasswordResetRequest, error)

func (*Store) FindFrontendPubliclyNamed

func (str *Store) FindFrontendPubliclyNamed(publicName string, tx *sqlx.Tx) (*Frontend, error)

func (*Store) FindFrontendWithToken

func (str *Store) FindFrontendWithToken(token string, tx *sqlx.Tx) (*Frontend, error)

func (*Store) FindFrontendWithZId

func (str *Store) FindFrontendWithZId(zId string, tx *sqlx.Tx) (*Frontend, error)

func (*Store) FindFrontendsForEnvironment

func (str *Store) FindFrontendsForEnvironment(envId int, tx *sqlx.Tx) ([]*Frontend, error)

func (*Store) FindPasswordResetRequestWithToken

func (self *Store) FindPasswordResetRequestWithToken(token string, tx *sqlx.Tx) (*PasswordResetRequest, error)

func (*Store) FindPublicFrontends

func (str *Store) FindPublicFrontends(tx *sqlx.Tx) ([]*Frontend, error)

func (*Store) FindShareWithToken

func (self *Store) FindShareWithToken(shrToken string, tx *sqlx.Tx) (*Share, error)

func (*Store) FindSharesForEnvironment

func (self *Store) FindSharesForEnvironment(envId int, tx *sqlx.Tx) ([]*Share, error)

func (*Store) GetAccount

func (self *Store) GetAccount(id int, tx *sqlx.Tx) (*Account, error)

func (*Store) GetAccountRequest

func (self *Store) GetAccountRequest(id int, tx *sqlx.Tx) (*AccountRequest, error)

func (*Store) GetAllShares

func (self *Store) GetAllShares(tx *sqlx.Tx) ([]*Share, error)

func (*Store) GetEnvironment

func (self *Store) GetEnvironment(id int, tx *sqlx.Tx) (*Environment, error)

func (*Store) GetFrontend

func (str *Store) GetFrontend(id int, tx *sqlx.Tx) (*Frontend, error)

func (*Store) GetInviteTokenByToken

func (str *Store) GetInviteTokenByToken(token string, tx *sqlx.Tx) (*InviteToken, error)

func (*Store) GetShare

func (self *Store) GetShare(id int, tx *sqlx.Tx) (*Share, error)

func (*Store) UpdateAccount

func (self *Store) UpdateAccount(a *Account, tx *sqlx.Tx) (int, error)

func (*Store) UpdateFrontend

func (str *Store) UpdateFrontend(fe *Frontend, tx *sqlx.Tx) error

func (*Store) UpdateShare

func (self *Store) UpdateShare(shr *Share, tx *sqlx.Tx) error

Directories

Path Synopsis
sql

Jump to

Keyboard shortcuts

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