Documentation
¶
Index ¶
- Constants
- Variables
- type Admin
- func (a *Admin) APIKeyValidation(c *gin.Context)
- func (a *Admin) ClusterStatus(c *gin.Context)
- func (a *Admin) CreateTenant(c *gin.Context)
- func (a *Admin) DeleteTenant(c *gin.Context)
- func (a *Admin) GetConfiguration(c *gin.Context)
- func (a *Admin) GetTenant(c *gin.Context)
- func (a *Admin) ListInstances(c *gin.Context)
- func (a *Admin) ListTenants(c *gin.Context)
- func (a *Admin) Routes() *[]api.EndpointGroup
- func (a *Admin) SetInstances(c *gin.Context)
- type InstanceList
- type InstanceManager
- type InstanceManagerMock
- func (m *InstanceManagerMock) Add(instance api.BigBlueButtonInstance) error
- func (m *InstanceManagerMock) Get(URL string) (api.BigBlueButtonInstance, error)
- func (m *InstanceManagerMock) List() ([]string, error)
- func (m *InstanceManagerMock) ListInstances() ([]api.BigBlueButtonInstance, error)
- func (m *InstanceManagerMock) SetInstances(instances map[string]string) error
- type RedisInstanceManager
- func (m *RedisInstanceManager) Add(instance api.BigBlueButtonInstance) error
- func (m *RedisInstanceManager) Get(URL string) (api.BigBlueButtonInstance, error)
- func (m *RedisInstanceManager) List() ([]string, error)
- func (m *RedisInstanceManager) ListInstances() ([]api.BigBlueButtonInstance, error)
- func (m *RedisInstanceManager) SetInstances(instances map[string]string) error
- type RedisTenantManager
- type Tenant
- type TenantList
- type TenantListObject
- type TenantManager
- type TenantManagerMock
Constants ¶
const B3LBInstances = "instances:list"
B3LBInstances is the key for the list of instances
Variables ¶
var ( // ListInstanceManagerMockFunc is the function that will be called when the mock instance manager is used. ListInstanceManagerMockFunc func() ([]string, error) // AddInstanceManagerMockFunc is the function that will be called when the mock instance manager is used. AddInstanceManagerMockFunc func(instance api.BigBlueButtonInstance) error // GetInstanceManagerMockFunc is the function that will be called when the mock instance manager is used. GetInstanceManagerMockFunc func(URL string) (api.BigBlueButtonInstance, error) // ListInstancesInstanceManagerMockFunc is the function that will be called when the mock instance manager is used. ListInstancesInstanceManagerMockFunc func() ([]api.BigBlueButtonInstance, error) // SetInstancesInstanceManagerMockFunc is the function that will be called when the mock instance manager is used. SetInstancesInstanceManagerMockFunc func(instances map[string]string) error )
var ( // AddTenantTenantManagerMockFunc is the function that will be called when the mock tenant manager is used. AddTenantTenantManagerMockFunc func(tenant *Tenant) error // ListTenantsTenantManagerMockFunc is the function that will be called when the mock tenant manager is used ListTenantsTenantManagerMockFunc func() ([]TenantListObject, error) // DeleteTenantTenantManagerMockFunc is the function that will be called when the mock tenant manager is used DeleteTenantTenantManagerMockFunc func(hostname string) error // GetTenantTenantManagerMockFunc is the function that will be called when the mock tenant manager is used GetTenantTenantManagerMockFunc func(hostname string) (*Tenant, error) )
Functions ¶
This section is empty.
Types ¶
type Admin ¶
type Admin struct {
InstanceManager InstanceManager
TenantManager TenantManager
Balancer balancer.Balancer
Config *config.Config
}
Admin struct manager b3lb administration
func CreateAdmin ¶
func CreateAdmin(manager InstanceManager, tenantManager TenantManager, balancer balancer.Balancer, config *config.Config) *Admin
CreateAdmin creates a new admin based on given configuration
func (*Admin) APIKeyValidation ¶
APIKeyValidation check that the request contains an api key provided by Authorization header
func (*Admin) ClusterStatus ¶
ClusterStatus send a status for the cluster. It contains all instances with their status
func (*Admin) CreateTenant ¶
CreateTenant create a tenant from a configuraion YAML body
func (*Admin) DeleteTenant ¶
DeleteTenant delete a given tenant
func (*Admin) GetConfiguration ¶
GetConfiguration render configuration
func (*Admin) ListInstances ¶
ListInstances returns Bigbluebutton instance list
func (*Admin) ListTenants ¶
ListTenants list all tenants in system
func (*Admin) SetInstances ¶
SetInstances set all instances. It takes InstanceList object in body
type InstanceList ¶
type InstanceList struct {
Kind string `yaml:"kind" json:"kind"`
Instances map[string]string `yaml:"instances" json:"instances"`
}
InstanceList represent the kind InstanceList configuration struct file
type InstanceManager ¶
type InstanceManager interface {
List() ([]string, error)
ListInstances() ([]api.BigBlueButtonInstance, error)
Add(instance api.BigBlueButtonInstance) error
Get(URL string) (api.BigBlueButtonInstance, error)
SetInstances(instances map[string]string) error
}
InstanceManager manager Bigbluebutton instances
func NewInstanceManager ¶
func NewInstanceManager(rdb redis.Client) InstanceManager
NewInstanceManager creates a new instance manager
type InstanceManagerMock ¶
type InstanceManagerMock struct{}
InstanceManagerMock is a mock implementation of the InstanceManager interface.
func (*InstanceManagerMock) Add ¶
func (m *InstanceManagerMock) Add(instance api.BigBlueButtonInstance) error
Add is a mock implementation that adds a new instance.
func (*InstanceManagerMock) Get ¶
func (m *InstanceManagerMock) Get(URL string) (api.BigBlueButtonInstance, error)
Get is a mock implementation that returns an instance.
func (*InstanceManagerMock) List ¶
func (m *InstanceManagerMock) List() ([]string, error)
List is a mock implementation that returns a list of all instances.
func (*InstanceManagerMock) ListInstances ¶
func (m *InstanceManagerMock) ListInstances() ([]api.BigBlueButtonInstance, error)
ListInstances is a mock implementation that returns all instances.
func (*InstanceManagerMock) SetInstances ¶
func (m *InstanceManagerMock) SetInstances(instances map[string]string) error
SetInstances is a mock implementation that set all instances.
type RedisInstanceManager ¶
RedisInstanceManager is the redis implementation of InstanceManager
func (*RedisInstanceManager) Add ¶
func (m *RedisInstanceManager) Add(instance api.BigBlueButtonInstance) error
Add adds an instance to the manager
func (*RedisInstanceManager) Get ¶
func (m *RedisInstanceManager) Get(URL string) (api.BigBlueButtonInstance, error)
Get retrieve a BigBlueButton instance based on its url
func (*RedisInstanceManager) List ¶
func (m *RedisInstanceManager) List() ([]string, error)
List returns the list of instances
func (*RedisInstanceManager) ListInstances ¶
func (m *RedisInstanceManager) ListInstances() ([]api.BigBlueButtonInstance, error)
ListInstances retrieve all instance as a BigBlueButtonInstance array
func (*RedisInstanceManager) SetInstances ¶
func (m *RedisInstanceManager) SetInstances(instances map[string]string) error
SetInstances set instances map
type RedisTenantManager ¶
RedisTenantManager is the redis implementation of TenantManager
func (*RedisTenantManager) AddTenant ¶
func (r *RedisTenantManager) AddTenant(tenant *Tenant) error
AddTenant store tenant in redis
func (*RedisTenantManager) DeleteTenant ¶
func (r *RedisTenantManager) DeleteTenant(hostname string) error
DeleteTenant delete a specific tenant based on tenant hostname
func (*RedisTenantManager) GetTenant ¶
func (r *RedisTenantManager) GetTenant(hostname string) (*Tenant, error)
GetTenant retrieve a tenant from a hostname
func (*RedisTenantManager) ListTenants ¶
func (r *RedisTenantManager) ListTenants() ([]TenantListObject, error)
ListTenants list all tenants in the system
type Tenant ¶
type Tenant struct {
Kind string `yaml:"kind" json:"kind"`
Spec map[string]string `yaml:"spec" json:"spec"`
Instances []string `yaml:"instances" json:"instances"`
}
Tenant represents the kind Tenant configuration struct file
type TenantList ¶
type TenantList struct {
Kind string `yaml:"kind" json:"kind"`
Tenants []TenantListObject `yaml:"tenants" json:"tenants"`
}
TenantList represents the system tenant list
type TenantListObject ¶
type TenantListObject struct {
Hostname string `json:"hostname"`
InstanceCount int `json:"instance_count"`
}
TenantListObject represents a Tenant in a TenantList
type TenantManager ¶
type TenantManager interface {
// AddTenant add a tenant in the manager
AddTenant(tenant *Tenant) error
// ListTenants list all tenants in the system
ListTenants() ([]TenantListObject, error)
// DeleteTenant delete a specific tenant based on tenant hostname
DeleteTenant(hostname string) error
// GetTenant retrieve a tenant from a hostname
GetTenant(hostname string) (*Tenant, error)
}
TenantManager is a struct manager b3lb tenants
func NewTenantManager ¶
func NewTenantManager(redis redis.Client) TenantManager
NewTenantManager initialize a new tenant manager
type TenantManagerMock ¶
type TenantManagerMock struct{}
TenantManagerMock is a mock implementation of the TenantManager interface.
func (*TenantManagerMock) AddTenant ¶
func (t *TenantManagerMock) AddTenant(tenant *Tenant) error
AddTenant is a mock implementation that add a tenant
func (*TenantManagerMock) DeleteTenant ¶
func (t *TenantManagerMock) DeleteTenant(hostname string) error
DeleteTenant is a mock implementation that will delete a given tenant
func (*TenantManagerMock) GetTenant ¶
func (t *TenantManagerMock) GetTenant(hostname string) (*Tenant, error)
GetTenant is a mock implementation that retrieve a tenant from a hostname
func (*TenantManagerMock) ListTenants ¶
func (t *TenantManagerMock) ListTenants() ([]TenantListObject, error)
ListTenants is a mock implementation that list all tenants