Documentation ¶
Index ¶
- func ConstructNamespaceName(envType environment.Type, nsBaseName string) string
- func ConstructNsBaseName(repo Service, username string) (string, error)
- type DBService
- func (s *DBService) CreateTenant(tenant *Tenant) error
- func (s *DBService) ExistsWithNsBaseName(nsBaseName string) (bool, error)
- func (s *DBService) GetClustersToUpdate(typeWithVersion map[environment.Type]string, commit string) ([]string, error)
- func (s *DBService) GetNumberOfOutdatedTenants(typeWithVersion map[environment.Type]string, commit string, masterURL string) (int, error)
- func (s *DBService) GetTenantsToUpdate(typeWithVersion map[environment.Type]string, count int, commit string, ...) ([]*Tenant, error)
- func (s *DBService) LookupTenantByClusterAndNamespace(masterURL, namespace string) (*Tenant, error)
- func (s *DBService) NamespaceExists(nsName string) (bool, error)
- func (s *DBService) NewTenantRepository(tenantID uuid.UUID) Repository
- func (s *DBService) SaveTenant(tenant *Tenant) error
- type DBTenantRepository
- func (r *DBTenantRepository) CreateNamespace(namespace *Namespace) (*Namespace, error)
- func (r *DBTenantRepository) DeleteNamespace(namespace *Namespace) error
- func (r *DBTenantRepository) DeleteNamespaces() error
- func (r *DBTenantRepository) DeleteTenant() error
- func (r *DBTenantRepository) Exists() bool
- func (r *DBTenantRepository) GetNamespaces() ([]*Namespace, error)
- func (r *DBTenantRepository) GetTenant() (*Tenant, error)
- func (r *DBTenantRepository) NewNamespace(envType environment.Type, nsName, masterURL string, state NamespaceState) *Namespace
- func (r *DBTenantRepository) SaveNamespace(namespace *Namespace) error
- type Namespace
- type NamespaceState
- type Repository
- type Resolve
- type Service
- type Tenant
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ConstructNamespaceName ¶
func ConstructNamespaceName(envType environment.Type, nsBaseName string) string
Types ¶
type DBService ¶
type DBService struct {
// contains filtered or unexported fields
}
func (*DBService) CreateTenant ¶
func (*DBService) ExistsWithNsBaseName ¶
func (*DBService) GetClustersToUpdate ¶
func (*DBService) GetNumberOfOutdatedTenants ¶
func (*DBService) GetTenantsToUpdate ¶
func (*DBService) LookupTenantByClusterAndNamespace ¶
func (*DBService) NamespaceExists ¶
func (*DBService) NewTenantRepository ¶
func (s *DBService) NewTenantRepository(tenantID uuid.UUID) Repository
func (*DBService) SaveTenant ¶
type DBTenantRepository ¶
type DBTenantRepository struct { *DBService // contains filtered or unexported fields }
func (*DBTenantRepository) CreateNamespace ¶
func (r *DBTenantRepository) CreateNamespace(namespace *Namespace) (*Namespace, error)
func (*DBTenantRepository) DeleteNamespace ¶
func (r *DBTenantRepository) DeleteNamespace(namespace *Namespace) error
func (*DBTenantRepository) DeleteNamespaces ¶
func (r *DBTenantRepository) DeleteNamespaces() error
func (*DBTenantRepository) DeleteTenant ¶
func (r *DBTenantRepository) DeleteTenant() error
func (*DBTenantRepository) Exists ¶
func (r *DBTenantRepository) Exists() bool
func (*DBTenantRepository) GetNamespaces ¶
func (r *DBTenantRepository) GetNamespaces() ([]*Namespace, error)
func (*DBTenantRepository) GetTenant ¶
func (r *DBTenantRepository) GetTenant() (*Tenant, error)
func (*DBTenantRepository) NewNamespace ¶
func (r *DBTenantRepository) NewNamespace(envType environment.Type, nsName, masterURL string, state NamespaceState) *Namespace
func (*DBTenantRepository) SaveNamespace ¶
func (r *DBTenantRepository) SaveNamespace(namespace *Namespace) error
type Namespace ¶
type Namespace struct { ID uuid.UUID `sql:"type:uuid default uuid_generate_v4()" gorm:"primary_key"` TenantID uuid.UUID `sql:"type:uuid"` CreatedAt time.Time UpdatedAt time.Time DeletedAt *time.Time Name string MasterURL string Type environment.Type Version string State NamespaceState UpdatedBy string }
Namespace represent a single namespace owned by an Tenant
func (Namespace) TableName ¶
TableName overrides the table name settings in Gorm to force a specific table name in the database.
func (*Namespace) UpdateData ¶
func (n *Namespace) UpdateData(env *environment.EnvData, cluster *cluster.Cluster, state NamespaceState)
type NamespaceState ¶
type NamespaceState string
const ( Provisioning NamespaceState = "provisioning" Updating NamespaceState = "updating" Ready NamespaceState = "ready" Failed NamespaceState = "failed" )
func (*NamespaceState) Scan ¶
func (ns *NamespaceState) Scan(value interface{}) error
Scan - Implement the database/sql scanner interface
func (NamespaceState) String ¶
func (s NamespaceState) String() string
type Repository ¶
type Repository interface { Service Exists() bool GetTenant() (*Tenant, error) NewNamespace(envType environment.Type, nsName, masterURL string, state NamespaceState) *Namespace GetNamespaces() ([]*Namespace, error) SaveNamespace(namespace *Namespace) error CreateNamespace(namespace *Namespace) (*Namespace, error) DeleteNamespace(namespace *Namespace) error DeleteNamespaces() error DeleteTenant() error }
func NewTenantRepository ¶
func NewTenantRepository(db *gorm.DB, tenantID uuid.UUID) Repository
type Resolve ¶
type Resolve func(ctx context.Context, target, token string) (username, accessToken string, err error)
Resolve a func to resolve tenant tokens based on tenants auth
type Service ¶
type Service interface { CreateTenant(tenant *Tenant) error SaveTenant(tenant *Tenant) error LookupTenantByClusterAndNamespace(masterURL, namespace string) (*Tenant, error) NewTenantRepository(tenantID uuid.UUID) Repository NamespaceExists(nsName string) (bool, error) ExistsWithNsBaseName(nsBaseName string) (bool, error) GetTenantsToUpdate(typeWithVersion map[environment.Type]string, count int, commit string, masterURL string) ([]*Tenant, error) GetClustersToUpdate(typeWithVersion map[environment.Type]string, commit string) ([]string, error) GetNumberOfOutdatedTenants(typeWithVersion map[environment.Type]string, commit string, masterURL string) (int, error) }
func NewDBService ¶
Click to show internal directories.
Click to hide internal directories.