Documentation ¶
Index ¶
- Variables
- type Config
- type EventHandler
- type Interface
- type MockEdgeRegister
- func (m *MockEdgeRegister) CanProxyToEdge(source apistructs.PipelineSource, clusterName string) bool
- func (m *MockEdgeRegister) CheckAccessToken(token string) error
- func (m *MockEdgeRegister) CheckAccessTokenFromCtx(ctx context.Context) error
- func (m *MockEdgeRegister) CheckAccessTokenFromHttpRequest(req *http.Request) error
- func (m *MockEdgeRegister) ClusterAccessKey() string
- func (m *MockEdgeRegister) ClusterIsEdge(clusterName string) (bool, error)
- func (m *MockEdgeRegister) CreateMessageEvent(event *apistructs.EventCreateRequest) error
- func (m *MockEdgeRegister) GetAccessToken(req apistructs.OAuth2TokenGetRequest) (*apistructs.OAuth2Token, error)
- func (m *MockEdgeRegister) GetEdgeBundleByClusterName(clusterName string) (*bundle.Bundle, error)
- func (m *MockEdgeRegister) GetEdgePipelineEnvs() apistructs.ClusterManagerClientDetail
- func (m *MockEdgeRegister) GetOAuth2Token(req apistructs.OAuth2TokenGetRequest) (*apistructs.OAuth2Token, error)
- func (m *MockEdgeRegister) IsCenter() bool
- func (m *MockEdgeRegister) IsEdge() bool
- func (m *MockEdgeRegister) ListAllClients() []apistructs.ClusterManagerClientDetail
- func (m *MockEdgeRegister) OnCenter(f func(context.Context))
- func (m *MockEdgeRegister) OnEdge(f func(context.Context))
- func (m *MockEdgeRegister) RegisterEventHandler(handler EventHandler)
- type MockKV
- func (o MockKV) Compact(ctx context.Context, rev int64, opts ...clientv3.CompactOption) (*clientv3.CompactResponse, error)
- func (o MockKV) Delete(ctx context.Context, key string, opts ...clientv3.OpOption) (*clientv3.DeleteResponse, error)
- func (o MockKV) Do(ctx context.Context, op clientv3.Op) (clientv3.OpResponse, error)
- func (o MockKV) Get(ctx context.Context, key string, opts ...clientv3.OpOption) (*clientv3.GetResponse, error)
- func (o MockKV) Put(ctx context.Context, key, val string, opts ...clientv3.OpOption) (*clientv3.PutResponse, error)
- func (o MockKV) Txn(ctx context.Context) clientv3.Txn
Constants ¶
This section is empty.
Variables ¶
View Source
var (
// center pipeline could receive edge event after edge side pipeline registered
EdgeHookApiPath = "/api/pipeline-edge/actions/hook"
)
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct { IsEdge bool `env:"DICE_IS_EDGE" default:"false"` ErdaNamespace string `env:"DICE_NAMESPACE"` ClusterName string `env:"DICE_CLUSTER_NAME"` AllowedSources []string `file:"allowed_sources" env:"EDGE_ALLOWED_SOURCES"` // env support comma-seperated string PipelineAddr string `env:"PIPELINE_ADDR"` PipelineHost string `env:"PIPELINE_HOST"` ClusterManagerEndpoint string `file:"cluster_manager_endpoint" desc:"cluster manager endpoint"` ClusterAccessKey string `file:"cluster_access_key" desc:"cluster access key, if specified will doesn't start watcher"` RetryConnectDialerInterval time.Duration `file:"retry_cluster_hook_interval" default:"1s"` EtcdPrefixOfClusterAccessKey string `file:"cluster_access_key_etcd_prefix" env:"EDGE_PIPELINE_CLUSTER_ACCESS_KEY_ETCD_PREFIX"` UpdateClientInterval time.Duration `file:"update_client_interval" env:"UPDATE_CLIENT_INTERVAL" default:"60s"` }
type EventHandler ¶
type EventHandler func(ctx context.Context, eventDetail apistructs.ClusterManagerClientDetail)
type Interface ¶
type Interface interface { ClusterAccessKey() string GetAccessToken(req apistructs.OAuth2TokenGetRequest) (*apistructs.OAuth2Token, error) GetOAuth2Token(req apistructs.OAuth2TokenGetRequest) (*apistructs.OAuth2Token, error) GetEdgePipelineEnvs() apistructs.ClusterManagerClientDetail CheckAccessToken(token string) error CheckAccessTokenFromHttpRequest(req *http.Request) error // CheckAccessTokenFromCtx is used for pb provider, get token from content and check access CheckAccessTokenFromCtx(ctx context.Context) error IsEdge() bool IsCenter() bool CanProxyToEdge(source apistructs.PipelineSource, clusterName string) bool GetEdgeBundleByClusterName(clusterName string) (*bundle.Bundle, error) ClusterIsEdge(clusterName string) (bool, error) // CreateMessageEvent edge-side pipeline send events by event-dispatcher CreateMessageEvent(event *apistructs.EventCreateRequest) error // OnEdge register hook that will be invoked if you are running on edge. // Could register multi hooks as you need. // All hooks executed asynchronously. OnEdge(func(context.Context)) // OnCenter register hook that will be invoked if you are running on center. // Could register multi hooks as you need. // All hooks executed asynchronously. OnCenter(func(context.Context)) // RegisterEventHandler register edge event handler. // Now only support update-operation event. // All handlers executed asynchronously. RegisterEventHandler(handler EventHandler) // ListAllClients list all edge pipelines that are registered in center. ListAllClients() []apistructs.ClusterManagerClientDetail }
type MockEdgeRegister ¶
type MockEdgeRegister struct{}
func (*MockEdgeRegister) CanProxyToEdge ¶
func (m *MockEdgeRegister) CanProxyToEdge(source apistructs.PipelineSource, clusterName string) bool
func (*MockEdgeRegister) CheckAccessToken ¶
func (m *MockEdgeRegister) CheckAccessToken(token string) error
func (*MockEdgeRegister) CheckAccessTokenFromCtx ¶
func (m *MockEdgeRegister) CheckAccessTokenFromCtx(ctx context.Context) error
func (*MockEdgeRegister) CheckAccessTokenFromHttpRequest ¶
func (m *MockEdgeRegister) CheckAccessTokenFromHttpRequest(req *http.Request) error
func (*MockEdgeRegister) ClusterAccessKey ¶
func (m *MockEdgeRegister) ClusterAccessKey() string
func (*MockEdgeRegister) ClusterIsEdge ¶
func (m *MockEdgeRegister) ClusterIsEdge(clusterName string) (bool, error)
func (*MockEdgeRegister) CreateMessageEvent ¶
func (m *MockEdgeRegister) CreateMessageEvent(event *apistructs.EventCreateRequest) error
func (*MockEdgeRegister) GetAccessToken ¶
func (m *MockEdgeRegister) GetAccessToken(req apistructs.OAuth2TokenGetRequest) (*apistructs.OAuth2Token, error)
func (*MockEdgeRegister) GetEdgeBundleByClusterName ¶
func (m *MockEdgeRegister) GetEdgeBundleByClusterName(clusterName string) (*bundle.Bundle, error)
func (*MockEdgeRegister) GetEdgePipelineEnvs ¶
func (m *MockEdgeRegister) GetEdgePipelineEnvs() apistructs.ClusterManagerClientDetail
func (*MockEdgeRegister) GetOAuth2Token ¶
func (m *MockEdgeRegister) GetOAuth2Token(req apistructs.OAuth2TokenGetRequest) (*apistructs.OAuth2Token, error)
func (*MockEdgeRegister) IsCenter ¶
func (m *MockEdgeRegister) IsCenter() bool
func (*MockEdgeRegister) IsEdge ¶
func (m *MockEdgeRegister) IsEdge() bool
func (*MockEdgeRegister) ListAllClients ¶
func (m *MockEdgeRegister) ListAllClients() []apistructs.ClusterManagerClientDetail
func (*MockEdgeRegister) OnCenter ¶
func (m *MockEdgeRegister) OnCenter(f func(context.Context))
func (*MockEdgeRegister) OnEdge ¶
func (m *MockEdgeRegister) OnEdge(f func(context.Context))
func (*MockEdgeRegister) RegisterEventHandler ¶
func (m *MockEdgeRegister) RegisterEventHandler(handler EventHandler)
Click to show internal directories.
Click to hide internal directories.