mirror of
https://github.com/go-micro/go-micro.git
synced 2025-08-10 21:52:01 +02:00
[WIP] Micro Runtime (#947)
* Add Get() and GetOptions. * Removed watcher. Outline of client. YAML templates * Added default service and deployment templates and types * Added API tests and cleaned up errors. * Small refactoring. Template package is no more. * Ripped out existing code in preparation to small rework * Reshuffled the source code to make it organized better * Create service and deployment in kubernetes runtime * Major cleanup and refactoring of Kubernetes runtime * Service now handles low level K8s API calls across both K8s deployment an service API objects * Runtime has a task queue that serves for queueing runtime action requests * General refactoring * No need for Lock in k8s service * Added kubernetes runtime env var to default deployment * Enable running different versions of the same service * Can't delete services through labels * Proto cruft. Added runtime.CreateOptions implementation in proto * Removed proxy service from default env variables * Make service name mandatory param to Get method * Get Delete changes from https://github.com/micro/go-micro/pull/945 * Replaced template files with global variables * Validate service names before sending K8s API request * Refactored Kubernetes API client. Fixed typos. * Added client.Resource to make API resources more explicit in code
This commit is contained in:
@@ -12,17 +12,19 @@ var (
|
||||
type Runtime interface {
|
||||
// Init initializes runtime
|
||||
Init(...Option) error
|
||||
// Registers a service
|
||||
// Create registers a service
|
||||
Create(*Service, ...CreateOption) error
|
||||
// Remove a service
|
||||
Delete(*Service) error
|
||||
// Get returns service or fails with error
|
||||
Get(string, ...GetOption) ([]*Service, error)
|
||||
// Update the service in place
|
||||
Update(*Service) error
|
||||
// Remove a service
|
||||
Delete(*Service) error
|
||||
// List the managed services
|
||||
List() ([]*Service, error)
|
||||
// starts the runtime
|
||||
// Start starts the runtime
|
||||
Start() error
|
||||
// Shutdown the runtime
|
||||
// Stop shuts down the runtime
|
||||
Stop() error
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user