Documentation ¶
Index ¶
- Constants
- type ApplicationService
- type AuthService
- type CallbackService
- type ConfigService
- type FunctionService
- type IndexService
- type InitializeService
- type LicenseService
- type NamespaceService
- type NodeService
- type ObjectService
- type PKIService
- type RegisterService
- type SecretService
- type SyncService
- type SysConfigService
Constants ¶
const ( Certificate = "certificate" CertRoot = "baetyl.ca" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ApplicationService ¶
type ApplicationService interface { Get(namespace, name, version string) (*specV1.Application, error) Create(namespace string, app *specV1.Application) (*specV1.Application, error) Update(namespace string, app *specV1.Application) (*specV1.Application, error) Delete(namespace, name, version string) error List(namespace string, listOptions *models.ListOptions) (*models.ApplicationList, error) CreateWithBase(namespace string, app, base *specV1.Application) (*specV1.Application, error) }
ApplicationService ApplicationService
func NewApplicationService ¶
func NewApplicationService(config *config.CloudConfig) (ApplicationService, error)
NewApplicationService NewApplicationService
type AuthService ¶
type AuthService interface { Authenticate(c *common.Context) error SignToken(meta []byte) ([]byte, error) VerifyToken(meta, sign []byte) bool GenToken(map[string]interface{}) (string, error) }
func NewAuthService ¶
func NewAuthService(config *config.CloudConfig) (AuthService, error)
type CallbackService ¶
type CallbackService interface { Create(callback *models.Callback) (*models.Callback, error) Delete(name, ns string) error Update(callback *models.Callback) (*models.Callback, error) Get(name, ns string) (*models.Callback, error) Callback(name, ns string, data map[string]string) ([]byte, error) }
func NewCallbackService ¶
func NewCallbackService(config *config.CloudConfig) (CallbackService, error)
NewCallbackService New Callback Service
type ConfigService ¶
type ConfigService interface { Get(namespace, name, version string) (*specV1.Configuration, error) List(namespace string, listOptions *models.ListOptions) (*models.ConfigurationList, error) Create(namespace string, config *specV1.Configuration) (*specV1.Configuration, error) Update(namespace string, config *specV1.Configuration) (*specV1.Configuration, error) Upsert(namespace string, config *specV1.Configuration) (*specV1.Configuration, error) Delete(namespace, name string) error }
ConfigService ConfigService
func NewConfigService ¶
func NewConfigService(config *config.CloudConfig) (ConfigService, error)
NewConfigService NewConfigService
type FunctionService ¶
type FunctionService interface { List(userID, source string) ([]models.Function, error) ListFunctionVersions(userID, name, source string) ([]models.Function, error) ListSources() []models.FunctionSource GetFunction(userID, name, version, source string) (*models.Function, error) }
func NewFunctionService ¶
func NewFunctionService(config *config.CloudConfig) (FunctionService, error)
NewFunctionService NewFunctionService
type IndexService ¶
type IndexService interface { // comment RefreshIndex(namespace string, keyA, keyB common.Resource, valueA string, valueBs []string) error ListIndex(namespace string, keyA, byKeyB common.Resource, valueB string) ([]string, error) // app and config RefreshAppIndexByConfig(namespace, config string, apps []string) error RefreshConfigIndexByApp(namespace, app string, configs []string) error ListAppIndexByConfig(namespace, config string) ([]string, error) ListConfigIndexByApp(namespace, app string) ([]string, error) ListNodesByApp(namespace, app string) ([]string, error) ListAppsByNode(namespace, node string) ([]string, error) ListAppIndexBySecret(namespace, secret string) ([]string, error) // app and secret RefreshSecretIndexByApp(namespace, app string, secrets []string) error RefreshNodesIndexByApp(namespace, appName string, nodes []string) error RefreshAppsIndexByNode(namespace, node string, apps []string) error }
func NewIndexService ¶
func NewIndexService(config *config.CloudConfig) (IndexService, error)
NewIndexService New Index Service
type InitializeService ¶
type InitializeService interface { InitWithNode(ns, nodeName, edgeKubeNodeName string) ([]byte, error) InitWithBitch(batch *models.Batch, edgeKubeNodeName string) ([]byte, error) GetResource(key string) (string, error) GetSyncCert(ns, nodeName string) (*specV1.Secret, error) }
func NewInitializeService ¶
func NewInitializeService(config *config.CloudConfig) (InitializeService, error)
NewInitializeService New Initialize Service
type LicenseService ¶
type LicenseService interface { ProtectCode() error CheckLicense() error CheckQuota(namespace string, collector plugin.QuotaCollector) error }
func NewLicenseService ¶
func NewLicenseService(config *config.CloudConfig) (LicenseService, error)
type NamespaceService ¶
type NamespaceService interface { Get(namespace string) (*models.Namespace, error) Create(namespace *models.Namespace) (*models.Namespace, error) Delete(namespace *models.Namespace) error }
NamespaceService NamespaceService
func NewNamespaceService ¶
func NewNamespaceService(config *config.CloudConfig) (NamespaceService, error)
NewNamespaceService NewNamespaceService
type NodeService ¶
type NodeService interface { Get(namespace, name string) (*specV1.Node, error) List(namespace string, listOptions *models.ListOptions) (*models.NodeList, error) Create(namespace string, node *specV1.Node) (*specV1.Node, error) Update(namespace string, node *specV1.Node) (*specV1.Node, error) Delete(namespace, name string) error UpdateReport(namespace, name string, report specV1.Report) (*models.Shadow, error) UpdateDesire(namespace, name string, desire specV1.Desire) (*models.Shadow, error) UpdateNodeAppVersion(namespace string, app *specV1.Application) ([]string, error) DeleteNodeAppVersion(namespace string, app *specV1.Application) ([]string, error) }
NodeService NodeService
func NewNodeService ¶
func NewNodeService(config *config.CloudConfig) (NodeService, error)
NewNodeService NewNodeService
type ObjectService ¶
type ObjectService interface { ListSources() []models.ObjectStorageSource ListBuckets(userID, source string) ([]models.Bucket, error) ListBucketObjects(userID, bucket, source string) (*models.ListObjectsResult, error) CreateBucketIfNotExist(userID, bucket, permission, source string) (*models.Bucket, error) PutObjectFromURLIfNotExist(userID, bucket, name, url, source string) error GenObjectURL(userID string, param models.ConfigObjectItem) (*models.ObjectURL, error) }
func NewObjectService ¶
func NewObjectService(config *config.CloudConfig) (ObjectService, error)
NewObjectService NewObjectService
type PKIService ¶
type PKIService interface { // GetCA get ca GetCA() ([]byte, error) // SignServerCertificate sign a certificate which can be used to connect to cloud SignServerCertificate(cn string, altNames models.AltNames) (*models.PEMCredential, error) // SignNodeCertificate sign a certificate which can be used to connect to cloud SignClientCertificate(cn string, altNames models.AltNames) (*models.PEMCredential, error) // DeleteServerCertificate delete a server certificate by certId DeleteServerCertificate(certId string) error // DeleteClientCertificate delete a server certificate by certId DeleteClientCertificate(certId string) error }
func NewPKIService ¶
func NewPKIService(config *config.CloudConfig) (PKIService, error)
NewPKIService create a certificate service
type RegisterService ¶
type RegisterService interface { GetBatch(name, ns string) (*models.Batch, error) CreateBatch(batch *models.Batch) (*models.Batch, error) UpdateBatch(batch *models.Batch) (*models.Batch, error) DeleteBatch(name, ns string) error GetRecord(batchName, recordName, ns string) (*models.Record, error) GetRecordByFingerprint(batchName, ns, value string) (*models.Record, error) CreateRecord(record *models.Record) (*models.Record, error) UpdateRecord(record *models.Record) (*models.Record, error) DeleteRecord(batchName, recordName, ns string) error DownloadRecords(batchName, ns string) ([]byte, error) GenRecordRandom(ns, batchName string, num int) ([]string, error) ListBatch(ns string, page *models.Filter) (*models.ListView, error) ListRecord(batchName, ns string, page *models.Filter) (*models.ListView, error) }
func NewRegisterService ¶
func NewRegisterService(config *config.CloudConfig) (RegisterService, error)
NewRegisterService New Register Service
type SecretService ¶
type SecretService interface { Get(namespace, name, version string) (*specV1.Secret, error) List(namespace string, listOptions *models.ListOptions) (*models.SecretList, error) Create(namespace string, secret *specV1.Secret) (*specV1.Secret, error) Update(namespace string, secret *specV1.Secret) (*specV1.Secret, error) Delete(namespace, name string) error }
SecretService SecretService
func NewSecretService ¶
func NewSecretService(config *config.CloudConfig) (SecretService, error)
NewSecretService NewSecretService
type SyncService ¶
type SyncService interface { Report(namespace, name string, report specV1.Report) (specV1.Desire, error) Desire(namespace string, infos []specV1.ResourceInfo) ([]specV1.ResourceValue, error) }
SyncService sync service
func NewSyncService ¶
func NewSyncService(config *config.CloudConfig) (SyncService, error)
NewSyncService new SyncService
type SysConfigService ¶
type SysConfigService interface { GetSysConfig(tp, key string) (*models.SysConfig, error) ListSysConfigAll(tp string) ([]models.SysConfig, error) }
func NewSysConfigService ¶
func NewSysConfigService(config *config.CloudConfig) (SysConfigService, error)
NewSysConfigService