Documentation ¶
Overview ¶
Package runtime is a service runtime manager
Index ¶
- Variables
- type CreateOption
- func CreateContext(ctx context.Context) CreateOption
- func CreateImage(img string) CreateOption
- func CreateNamespace(ns string) CreateOption
- func CreateType(t string) CreateOption
- func WithArgs(args ...string) CreateOption
- func WithCommand(cmd ...string) CreateOption
- func WithEnv(env []string) CreateOption
- func WithOutput(out io.Writer) CreateOption
- func WithRetries(retries int) CreateOption
- type CreateOptions
- type DeleteOption
- type DeleteOptions
- type Event
- type EventType
- type LogRecord
- type LogStream
- type LogsOption
- type LogsOptions
- type Option
- type Options
- type ReadOption
- type ReadOptions
- type Runtime
- type Scheduler
- type Service
- type UpdateOption
- type UpdateOptions
Constants ¶
This section is empty.
Variables ¶
var ( // DefaultRuntime is default micro runtime DefaultRuntime Runtime = NewRuntime() // DefaultName is default runtime service name DefaultName = "go.micro.runtime" ErrAlreadyExists = errors.New("already exists") )
Functions ¶
This section is empty.
Types ¶
type CreateOption ¶
type CreateOption func(o *CreateOptions)
func CreateContext ¶ added in v2.6.0
func CreateContext(ctx context.Context) CreateOption
CreateContext sets the context
func CreateImage ¶ added in v2.3.0
func CreateImage(img string) CreateOption
CreateImage sets the image to use
func CreateNamespace ¶ added in v2.6.0
func CreateNamespace(ns string) CreateOption
CreateNamespace sets the namespace
func CreateType ¶
func CreateType(t string) CreateOption
CreateType sets the type of service to create
func WithArgs ¶ added in v2.3.0
func WithArgs(args ...string) CreateOption
WithArgs specifies the command to execute
func WithCommand ¶
func WithCommand(cmd ...string) CreateOption
WithCommand specifies the command to execute
func WithRetries ¶ added in v2.1.0
func WithRetries(retries int) CreateOption
WithRetries sets the max retries attemps
type CreateOptions ¶
type CreateOptions struct { // Command to execut Command []string // Args to pass into command Args []string // Environment to configure Env []string // Log output Output io.Writer // Type of service to create Type string // Retries before failing deploy Retries int // Specify the image to use Image string // Namespace to create the service in Namespace string // Specify the context to use Context context.Context }
CreateOptions configure runtime services
type DeleteOption ¶ added in v2.6.0
type DeleteOption func(o *DeleteOptions)
func DeleteContext ¶ added in v2.6.0
func DeleteContext(ctx context.Context) DeleteOption
DeleteContext sets the context
func DeleteNamespace ¶ added in v2.6.0
func DeleteNamespace(ns string) DeleteOption
DeleteNamespace sets the namespace
type DeleteOptions ¶ added in v2.6.0
type Event ¶
type Event struct { // ID of the event ID string // Type is event type Type EventType // Timestamp is event timestamp Timestamp time.Time // Service the event relates to Service *Service // Options to use when processing the event Options *CreateOptions }
Event is notification event
type LogsOption ¶ added in v2.5.0
type LogsOption func(o *LogsOptions)
LogsOption configures runtime logging
func LogsContext ¶ added in v2.6.0
func LogsContext(ctx context.Context) LogsOption
LogsContext sets the context
func LogsCount ¶ added in v2.5.0
func LogsCount(count int64) LogsOption
LogsExistingCount confiures how many existing lines to show
func LogsNamespace ¶ added in v2.6.0
func LogsNamespace(ns string) LogsOption
LogsNamespace sets the namespace
func LogsStream ¶ added in v2.5.0
func LogsStream(stream bool) LogsOption
LogsStream configures whether to stream new lines
type LogsOptions ¶ added in v2.5.0
type LogsOptions struct { // How many existing lines to show Count int64 // Stream new lines? Stream bool // Namespace the service is running in Namespace string // Specify the context to use Context context.Context }
LogsOptions configure runtime logging
type Option ¶
type Option func(o *Options)
func WithClient ¶ added in v2.7.0
WithClient sets the client to use
func WithScheduler ¶
WithScheduler specifies a scheduler for updates
func WithSource ¶ added in v2.1.0
WithSource sets the base image / repository
type Options ¶
type Options struct { // Scheduler for updates Scheduler Scheduler // Service type to manage Type string // Source of the services repository Source string // Base image to use Image string // Client to use when making requests Client client.Client }
Options configure runtime
type ReadOption ¶
type ReadOption func(o *ReadOptions)
func ReadContext ¶ added in v2.6.0
func ReadContext(ctx context.Context) ReadOption
ReadContext sets the context
func ReadNamespace ¶ added in v2.6.0
func ReadNamespace(ns string) ReadOption
ReadNamespace sets the namespace
func ReadService ¶
func ReadService(service string) ReadOption
ReadService returns services with the given name
func ReadVersion ¶
func ReadVersion(version string) ReadOption
ReadVersion confifgures service version
type ReadOptions ¶
type ReadOptions struct { // Service name Service string // Version queries services with given version Version string // Type of service Type string // Namespace the service is running in Namespace string // Specify the context to use Context context.Context }
ReadOptions queries runtime services
type Runtime ¶
type Runtime interface { // Init initializes runtime Init(...Option) error // Create registers a service Create(*Service, ...CreateOption) error // Read returns the service Read(...ReadOption) ([]*Service, error) // Update the service in place Update(*Service, ...UpdateOption) error // Remove a service Delete(*Service, ...DeleteOption) error // Logs returns the logs for a service Logs(*Service, ...LogsOption) (LogStream, error) // Start starts the runtime Start() error // Stop shuts down the runtime Stop() error // String describes runtime String() string }
Runtime is a service runtime manager
func NewRuntime ¶
NewRuntime creates new local runtime and returns it
type Scheduler ¶
type Scheduler interface { // Notify publishes schedule events Notify() (<-chan Event, error) // Close stops the scheduler Close() error }
Scheduler is a runtime service scheduler
type Service ¶
type Service struct { // Name of the service Name string // Version of the service Version string // url location of source Source string // Metadata stores metadata Metadata map[string]string }
Service is runtime service
type UpdateOption ¶ added in v2.6.0
type UpdateOption func(o *UpdateOptions)
func UpdateContext ¶ added in v2.6.0
func UpdateContext(ctx context.Context) UpdateOption
UpdateContext sets the context
func UpdateNamespace ¶ added in v2.6.0
func UpdateNamespace(ns string) UpdateOption
UpdateNamespace sets the namespace
type UpdateOptions ¶ added in v2.6.0
Directories ¶
Path | Synopsis |
---|---|
Package kubernetes implements kubernetes micro runtime Package kubernetes taken from https://github.com/micro/go-micro/blob/master/debug/log/kubernetes/kubernetes.go There are some modifications compared to the other files as this package doesn't provide write functionality.
|
Package kubernetes implements kubernetes micro runtime Package kubernetes taken from https://github.com/micro/go-micro/blob/master/debug/log/kubernetes/kubernetes.go There are some modifications compared to the other files as this package doesn't provide write functionality. |
Package local provides a local runtime
|
Package local provides a local runtime |
build
Package build builds a micro runtime package
|
Package build builds a micro runtime package |
build/docker
Package docker builds docker images
|
Package docker builds docker images |
build/go
Package golang is a go package manager
|
Package golang is a go package manager |
process
Package process executes a binary
|
Package process executes a binary |
process/os
Package os runs processes locally Package os runs processes locally
|
Package os runs processes locally Package os runs processes locally |
source
Package source retrieves source code
|
Package source retrieves source code |
source/git
Package git provides a git source
|
Package git provides a git source |
source/go
Package golang is a source for Go
|
Package golang is a source for Go |