Documentation
¶
Overview ¶
Package postgres provides a Postgres-backed CMS store.
Index ¶
- type Store
- func (s *Store) Close()
- func (s *Store) Create(ctx context.Context, tenantID int64, p *store.Page) error
- func (s *Store) CreateDomain(ctx context.Context, d *store.Domain) error
- func (s *Store) CreateTenant(ctx context.Context, t *store.Tenant) error
- func (s *Store) Delete(ctx context.Context, tenantID int64, id int64) error
- func (s *Store) DeleteDomain(ctx context.Context, tenantID, id int64) error
- func (s *Store) DeleteTenant(ctx context.Context, id int64) error
- func (s *Store) Get(ctx context.Context, tenantID int64, id int64) (*store.Page, error)
- func (s *Store) GetByPath(ctx context.Context, tenantID int64, subsite, path string) (*store.Page, error)
- func (s *Store) GetTenant(ctx context.Context, id int64) (*store.Tenant, error)
- func (s *Store) List(ctx context.Context, tenantID int64, subsite string) ([]*store.Page, error)
- func (s *Store) ListDomains(ctx context.Context, tenantID int64) ([]*store.Domain, error)
- func (s *Store) ListTenants(ctx context.Context) ([]*store.Tenant, error)
- func (s *Store) Ping(ctx context.Context) error
- func (s *Store) Update(ctx context.Context, tenantID int64, p *store.Page) error
- func (s *Store) UpdateTenant(ctx context.Context, t *store.Tenant) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Store ¶
type Store struct {
// contains filtered or unexported fields
}
Store implements store.TenantAdminStore and store.PageStore using Postgres.
func NewWithPool ¶
NewWithPool wraps an existing pgx pool.
func (*Store) CreateDomain ¶
CreateDomain inserts a tenant domain.
func (*Store) CreateTenant ¶
CreateTenant inserts a tenant.
func (*Store) DeleteDomain ¶
DeleteDomain deletes a tenant-owned domain.
func (*Store) DeleteTenant ¶
DeleteTenant deletes a tenant.
func (*Store) GetByPath ¶
func (s *Store) GetByPath(ctx context.Context, tenantID int64, subsite, path string) (*store.Page, error)
GetByPath returns a tenant-scoped page by subsite and path.
func (*Store) ListDomains ¶
ListDomains returns domains for a tenant.
func (*Store) ListTenants ¶
ListTenants returns all tenants.
Click to show internal directories.
Click to hide internal directories.