Documentation ¶
Index ¶
- Constants
- func NewTenantManager(storage TenantStorage, lmsClient TenantCreator, log logrus.FieldLogger) *manager
- type Client
- type ClusterType
- type Config
- type CreateTenantInput
- type CreateTenantOutput
- type FakeClient
- func (f *FakeClient) CreateTenant(input CreateTenantInput) (o CreateTenantOutput, err error)
- func (f *FakeClient) GetCACertificate(tenantID string) (cert string, found bool, err error)
- func (f *FakeClient) GetCertificateByURL(url string) (cert string, found bool, err error)
- func (f *FakeClient) GetTenantInfo(tenantID string) (status TenantInfo, err error)
- func (f *FakeClient) GetTenantStatus(tenantID string) (status TenantStatus, err error)
- func (f *FakeClient) IsCertRequestedForTenant(tenantID string) bool
- func (f *FakeClient) RequestCertificate(tenantID string, subj pkix.Name) (id string, privateKey []byte, err error)
- type TenantCreator
- type TenantInfo
- type TenantStatus
- type TenantStorage
Constants ¶
View Source
const ( FakeCaCertificate = "cert-ca-payload" FakeSignedCertificate = "signed-cert-payload" FakeLmsHost = "lms.localhost" FakePrivateKey = "private-key" )
Variables ¶
This section is empty.
Functions ¶
func NewTenantManager ¶
func NewTenantManager(storage TenantStorage, lmsClient TenantCreator, log logrus.FieldLogger) *manager
Types ¶
type Client ¶
type Client interface { CreateTenant(input CreateTenantInput) (o CreateTenantOutput, err error) GetTenantStatus(tenantID string) (status TenantStatus, err error) GetTenantInfo(tenantID string) (status TenantInfo, err error) GetCACertificate(tenantID string) (cert string, found bool, err error) GetCertificateByURL(url string) (cert string, found bool, err error) RequestCertificate(tenantID string, subject pkix.Name) (string, []byte, error) }
type ClusterType ¶
type ClusterType string
ClusterType can be ha or single-node
const ( ClusterTypeHA ClusterType = "ha" ClusterTypeSingleNode ClusterType = "single-node" )
type Config ¶
type CreateTenantInput ¶
type CreateTenantOutput ¶
type CreateTenantOutput struct {
ID string `json:"id"`
}
type FakeClient ¶
type FakeClient struct {
// contains filtered or unexported fields
}
FakeClient implements the lms client interface but does not call real external system
func NewFakeClient ¶
func NewFakeClient(timeToReady time.Duration) *FakeClient
NewFakeClient creates lms fake client which response tenant ready after timeToReady duration
func (*FakeClient) CreateTenant ¶
func (f *FakeClient) CreateTenant(input CreateTenantInput) (o CreateTenantOutput, err error)
func (*FakeClient) GetCACertificate ¶
func (f *FakeClient) GetCACertificate(tenantID string) (cert string, found bool, err error)
func (*FakeClient) GetCertificateByURL ¶
func (f *FakeClient) GetCertificateByURL(url string) (cert string, found bool, err error)
func (*FakeClient) GetTenantInfo ¶
func (f *FakeClient) GetTenantInfo(tenantID string) (status TenantInfo, err error)
func (*FakeClient) GetTenantStatus ¶
func (f *FakeClient) GetTenantStatus(tenantID string) (status TenantStatus, err error)
func (*FakeClient) IsCertRequestedForTenant ¶
func (f *FakeClient) IsCertRequestedForTenant(tenantID string) bool
assert methods
func (*FakeClient) RequestCertificate ¶
type TenantCreator ¶
type TenantCreator interface {
CreateTenant(input CreateTenantInput) (o CreateTenantOutput, err error)
}
type TenantInfo ¶
type TenantStatus ¶
Click to show internal directories.
Click to hide internal directories.