Documentation
¶
Overview ¶
Package endpoints 定义所有的 route handle.
Package endpoints cmdb api 逻辑处理层
Index ¶
- Variables
- type Endpoints
- func (e *Endpoints) CreateCluster(ctx context.Context, r *http.Request, vars map[string]string) (httpserver.Responser, error)
- func (e *Endpoints) DBClient() *dao.DBClient
- func (e *Endpoints) DealTaskEvent(ctx context.Context, r *http.Request, vars map[string]string) (httpserver.Responser, error)
- func (e *Endpoints) DeleteCluster(ctx context.Context, r *http.Request, vars map[string]string) (httpserver.Responser, error)
- func (e *Endpoints) GetCluster(ctx context.Context, r *http.Request, vars map[string]string) (httpserver.Responser, error)
- func (e *Endpoints) GetHost(ctx context.Context, r *http.Request, vars map[string]string) (httpserver.Responser, error)
- func (e *Endpoints) GetLocale(request *http.Request) *i18n.LocaleResource
- func (e *Endpoints) Health(ctx context.Context, r *http.Request, vars map[string]string) (httpserver.Responser, error)
- func (e *Endpoints) Info(ctx context.Context, r *http.Request, vars map[string]string) (httpserver.Responser, error)
- func (e *Endpoints) ListCluster(ctx context.Context, r *http.Request, vars map[string]string) (httpserver.Responser, error)
- func (e *Endpoints) ListEdasContainers(ctx context.Context, r *http.Request, vars map[string]string) (httpserver.Responser, error)
- func (e *Endpoints) ListOrgRunningTasks(ctx context.Context, r *http.Request, vars map[string]string) (httpserver.Responser, error)
- func (e *Endpoints) Routes() []httpserver.Endpoint
- func (e *Endpoints) SyncHostResource(interval time.Duration)
- func (e *Endpoints) SyncTaskStatus(interval time.Duration)
- func (e *Endpoints) TaskClean(interval time.Duration)
- func (e *Endpoints) UCClient() *ucauth.UCClient
- func (e *Endpoints) UpdateCluster(ctx context.Context, r *http.Request, vars map[string]string) (httpserver.Responser, error)
- func (e *Endpoints) UpdateInstanceBySchedulerEvent(ctx context.Context, r *http.Request, vars map[string]string) (httpserver.Responser, error)
- type Option
- func WithBundle(bdl *bundle.Bundle) Option
- func WithCluster(cluster *cluster.Cluster) Option
- func WithContainer(container *container.Container) Option
- func WithDBClient(db *dao.DBClient) Option
- func WithErrorBox(errorbox *errorbox.ErrorBox) Option
- func WithEtcdStore(etcdStore *etcd.Store) Option
- func WithHost(host *host.Host) Option
- func WithJSONStore(store jsonstore.JsonStore) Option
- func WithLicense(license *license.License) Option
- func WithOSSClient(client *oss.Client) Option
- func WithOrg(org *org.Org) Option
- func WithQueryStringDecoder(decoder *schema.Decoder) Option
- func WithUCClient(uc *ucauth.UCClient) Option
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // job/deployment列表的任务存在时间,默认7天 TaskCleanDurationTimestamp int64 = 7 * 24 * 60 * 60 )
Functions ¶
This section is empty.
Types ¶
type Endpoints ¶
type Endpoints struct {
// contains filtered or unexported fields
}
Endpoints 定义 endpoint 方法
func (*Endpoints) CreateCluster ¶
func (e *Endpoints) CreateCluster(ctx context.Context, r *http.Request, vars map[string]string) (httpserver.Responser, error)
CreateCluster 创建集群
func (*Endpoints) DealTaskEvent ¶
func (e *Endpoints) DealTaskEvent(ctx context.Context, r *http.Request, vars map[string]string) (httpserver.Responser, error)
DealTaskEvent 接收任务的事件
func (*Endpoints) DeleteCluster ¶
func (e *Endpoints) DeleteCluster(ctx context.Context, r *http.Request, vars map[string]string) (httpserver.Responser, error)
DeleteCluster 删除集群
func (*Endpoints) GetCluster ¶
func (e *Endpoints) GetCluster(ctx context.Context, r *http.Request, vars map[string]string) (httpserver.Responser, error)
GetCluster 获取集群详情
func (*Endpoints) GetHost ¶
func (e *Endpoints) GetHost(ctx context.Context, r *http.Request, vars map[string]string) (httpserver.Responser, error)
GetHost 获取指定集群下某个host的信息
func (*Endpoints) GetLocale ¶
func (e *Endpoints) GetLocale(request *http.Request) *i18n.LocaleResource
GetLocale 获取本地化资源
func (*Endpoints) Health ¶
func (e *Endpoints) Health(ctx context.Context, r *http.Request, vars map[string]string) (httpserver.Responser, error)
Component health check interface
func (*Endpoints) Info ¶
func (e *Endpoints) Info(ctx context.Context, r *http.Request, vars map[string]string) (httpserver.Responser, error)
Info 用于健康检查
func (*Endpoints) ListCluster ¶
func (e *Endpoints) ListCluster(ctx context.Context, r *http.Request, vars map[string]string) (httpserver.Responser, error)
ListCluster 获取集群列表(可按orgID过滤)
func (*Endpoints) ListEdasContainers ¶
func (e *Endpoints) ListEdasContainers(ctx context.Context, r *http.Request, vars map[string]string) (httpserver.Responser, error)
ListEdasContainers 获取 edas 实例列表 (内部调用)
func (*Endpoints) ListOrgRunningTasks ¶
func (e *Endpoints) ListOrgRunningTasks(ctx context.Context, r *http.Request, vars map[string]string) (httpserver.Responser, error)
ListOrgRunningTasks 指定企业获取服务或者job列表
func (*Endpoints) Routes ¶
func (e *Endpoints) Routes() []httpserver.Endpoint
Routes 返回 endpoints 的所有 endpoint 方法,也就是 route.
func (*Endpoints) SyncHostResource ¶
SyncHostResource 定时同步主机实际使用资源
func (*Endpoints) SyncTaskStatus ¶
SyncTaskStatus 定时同步主机实际使用资源
type Option ¶
type Option func(*Endpoints)
func WithContainer ¶
WithContainer 配置 container service
func WithErrorBox ¶
func WithJSONStore ¶
WithJSONStore 配置 jsonstore
func WithQueryStringDecoder ¶
WithQueryStringDecoder 配置 queryStringDecoder
Click to show internal directories.
Click to hide internal directories.