Documentation ¶
Index ¶
- Variables
- func EnqueueJob(job Job)
- func GetJobQueue() chan Job
- func NewJobQueue()
- func Run(ctx context.Context, addr string, c Controller) error
- func RunTLS(ctx context.Context, addr string, cert string, key string, c Controller) error
- type Controller
- type Dispatcher
- type Job
- type JobPayload
- type Worker
Constants ¶
This section is empty.
Variables ¶
View Source
var ( WorkerMax = os.Getenv("MAX_WORKERS") WorkerQueueMax = os.Getenv("MAX_WORKER_QUEUE") WorkerMaxDefault = 10 WorkerQueueMaxDefault = 10 )
View Source
var ( JobQueueMax = os.Getenv("MAX_JOB_QUEUE") JobQueueMaxDefault = 10 )
Functions ¶
func EnqueueJob ¶
func EnqueueJob(job Job)
func GetJobQueue ¶
func GetJobQueue() chan Job
func NewJobQueue ¶
func NewJobQueue()
Types ¶
type Controller ¶
type Controller interface { GetCatalog() (*brokerapi.Catalog, error) GetServiceInstanceStatus(instanceId, serviceID, PlanID string, operation string) (string, error) CreateServiceInstance(instanceId, serviceID, PlanID string, Parameter map[string]interface{}) error DeleteServiceInstance(instanceId, serviceID, PlanID string, Parameter map[string]string) error GetServiceBindingStatus(instanceId, serviceID, planID, bindingId string, operation string) (string, error) CreateServiceBinding(instanceId, serviceID, planID, bindingId string, Parameter map[string]interface{}) (brokerapi.Credential, error) DeleteServiceBinding(instanceId, serviceID, planID, bindingId string, Parameter map[string]string) error }
Controller defines the APIs that the base function of Alibaba Cloud service broker is expected to support. Implementation should be concurrency-safe
type Dispatcher ¶
type Dispatcher struct { // A pool of each worker's job channel that are registered with the dispatcher WorkerPool chan chan Job }
Dispatcher dispatch incoming jobs to idle worker's job channel
func NewDispatcher ¶
func NewDispatcher() *Dispatcher
func (*Dispatcher) Run ¶
func (d *Dispatcher) Run()
type Job ¶
type Job struct {
Payload JobPayload
}
type JobPayload ¶
type JobPayload interface {
Deal() error
}
Click to show internal directories.
Click to hide internal directories.