Documentation ¶
Index ¶
- func AddTenantZones(ctx context.Context, tx pgx.Tx, tenantID string, zones []string) error
- func CreateTenant(ctx context.Context, tx pgx.Tx, title string) (*gen.Tenant, error)
- func CreateTenantSecret(ctx context.Context, tx pgx.Tx, secret *gen.Secret) (*gen.Secret, error)
- func DeleteTenant(ctx context.Context, tx pgx.Tx, id string) error
- func DeleteTenantSecret(ctx context.Context, tx pgx.Tx, secretID string) error
- func GetTenant(ctx context.Context, tx pgx.Tx, id string) (*gen.Tenant, error)
- func GetTenantSecret(ctx context.Context, tx pgx.Tx, id string) (*gen.Secret, error)
- func ListTenantSecrets(ctx context.Context, tx pgx.Tx, tenantID string) ([]*gen.Secret, error)
- func ListTenants(ctx context.Context, tx pgx.Tx) ([]*gen.Tenant, error)
- func RemoveTenantZones(ctx context.Context, tx pgx.Tx, tenantID string, zones []string) error
- func ReplaceTenantZones(ctx context.Context, tx pgx.Tx, tenantID string, zones []string) error
- func SetupDB(ctx context.Context, pool *pgxpool.Pool) error
- func UpdateTenantTitle(ctx context.Context, tx pgx.Tx, id string, title string) error
- type Option
- type Server
- func (s *Server) AddTenantZones(ctx context.Context, request *gen.AddTenantZonesRequest) (*gen.Tenant, error)
- func (s *Server) CreateSecret(ctx context.Context, request *gen.CreateSecretRequest) (*gen.Secret, error)
- func (s *Server) CreateTenant(ctx context.Context, request *gen.CreateTenantRequest) (*gen.Tenant, error)
- func (s *Server) DeleteSecret(ctx context.Context, request *gen.DeleteSecretRequest) (*gen.DeleteSecretResponse, error)
- func (s *Server) DeleteTenant(ctx context.Context, request *gen.DeleteTenantRequest) (*gen.DeleteTenantResponse, error)
- func (s *Server) GetSecret(ctx context.Context, request *gen.GetSecretRequest) (*gen.Secret, error)
- func (s *Server) GetTenant(ctx context.Context, request *gen.GetTenantRequest) (*gen.Tenant, error)
- func (s *Server) ListSecrets(ctx context.Context, request *gen.ListSecretsRequest) (*gen.ListSecretsResponse, error)
- func (s *Server) ListTenants(ctx context.Context, request *gen.ListTenantsRequest) (*gen.ListTenantsResponse, error)
- func (s *Server) PullSecret(request *gen.PullSecretRequest, server gen.TenantApi_PullSecretServer) error
- func (s *Server) PullSecrets(request *gen.PullSecretsRequest, server gen.TenantApi_PullSecretsServer) error
- func (s *Server) PullTenant(request *gen.PullTenantRequest, server gen.TenantApi_PullTenantServer) error
- func (s *Server) PullTenants(request *gen.PullTenantsRequest, server gen.TenantApi_PullTenantsServer) error
- func (s *Server) RegenerateSecret(ctx context.Context, request *gen.RegenerateSecretRequest) (*gen.Secret, error)
- func (s *Server) RemoveTenantZones(ctx context.Context, request *gen.RemoveTenantZonesRequest) (*gen.Tenant, error)
- func (s *Server) UpdateSecret(ctx context.Context, request *gen.UpdateSecretRequest) (*gen.Secret, error)
- func (s *Server) UpdateTenant(ctx context.Context, request *gen.UpdateTenantRequest) (*gen.Tenant, error)
- func (s *Server) VerifySecret(ctx context.Context, request *gen.VerifySecretRequest) (*gen.Secret, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddTenantZones ¶
AddTenantZones will store an association between the given tenant and a set of zones. Will fail if the tenant doesn't exist.
func CreateTenant ¶
CreateTenant registers a new tenant in the database. The tenant has an autogenerated ID. The new tenant has no zones assigned.
func CreateTenantSecret ¶
CreateTenantSecret adds a tenant secret to the database. Only the fields TenantID, Name, SecretHash and Expires will be used from secret. Returns the newly created tenant secret row.
func DeleteTenantSecret ¶
func GetTenantSecret ¶
GetTenantSecret returns a gen.Secret by secret id.
func ListTenantSecrets ¶
ListTenantSecrets returns all tenant secrets stored in the database. If tenantID is non-empty, then only secrets associated with that tenant will be returned. If tenantID is empty then secrets from all tenants are returned.
func RemoveTenantZones ¶
func ReplaceTenantZones ¶
Types ¶
type Server ¶
type Server struct { gen.UnimplementedTenantApiServer // contains filtered or unexported fields }
func NewServerFromPool ¶
func (*Server) AddTenantZones ¶
func (*Server) CreateSecret ¶
func (*Server) CreateTenant ¶
func (*Server) DeleteSecret ¶
func (s *Server) DeleteSecret(ctx context.Context, request *gen.DeleteSecretRequest) (*gen.DeleteSecretResponse, error)
func (*Server) DeleteTenant ¶
func (s *Server) DeleteTenant(ctx context.Context, request *gen.DeleteTenantRequest) (*gen.DeleteTenantResponse, error)
func (*Server) ListSecrets ¶
func (s *Server) ListSecrets(ctx context.Context, request *gen.ListSecretsRequest) (*gen.ListSecretsResponse, error)
func (*Server) ListTenants ¶
func (s *Server) ListTenants(ctx context.Context, request *gen.ListTenantsRequest) (*gen.ListTenantsResponse, error)
func (*Server) PullSecret ¶
func (s *Server) PullSecret(request *gen.PullSecretRequest, server gen.TenantApi_PullSecretServer) error
func (*Server) PullSecrets ¶
func (s *Server) PullSecrets(request *gen.PullSecretsRequest, server gen.TenantApi_PullSecretsServer) error
func (*Server) PullTenant ¶
func (s *Server) PullTenant(request *gen.PullTenantRequest, server gen.TenantApi_PullTenantServer) error
func (*Server) PullTenants ¶
func (s *Server) PullTenants(request *gen.PullTenantsRequest, server gen.TenantApi_PullTenantsServer) error