README
Runtime
A runtime for self governing services.
Overview
In recent years we've started to develop complex architectures for the pipeline between writing code and running it. This philosophy of build, run, manage or however many variations, has created a number of layers of abstraction that make it all the more difficult to run code.
Runtime manages the lifecycle of a service from source to running process. If the source is the source of truth then everything in between running is wasted breath. Applications should be self governing and self sustaining. To enable that we need libraries which make it possible.
Runtime will fetch source code, build a binary and execute it. Any Go program that uses this library should be able to run dependencies or itself with ease, with the ability to update itself as the source is updated.
Features
- Source - Fetches source whether it be git, go, docker, etc
- Package - Compiles the source into a binary which can be executed
- Process - Executes a binary and creates a running process
Usage
TODO
Documentation
Overview ¶
Package runtime is a service runtime manager
Index ¶
Constants ¶
Variables ¶
Functions ¶
Types ¶
type CreateOption ¶
type CreateOption func(o *CreateOptions)
func WithCommand ¶
func WithCommand(args ...string) CreateOption
WithCommand specifies the command to execute
type CreateOptions ¶
type CreateOptions struct { // command to execute including args Command []string // Environment to configure Env []string // Log output Output io.Writer // Type of service to create Type string }
CreateOptions configure runtime services
type Event ¶
type Event struct { // Type is event type Type EventType // Timestamp is event timestamp Timestamp time.Time // Service is the name of the service Service string // Version of the build Version string }
Event is notification event
type Notifier ¶
type Notifier interface { // Notify publishes notification events Notify() (<-chan Event, error) // Close stops the notifier Close() error }
Notifier is an update notifier
type Option ¶
type Option func(o *Options)
func WithNotifier ¶
WithNotifier specifies a notifier for updates
type Options ¶
type Options struct { // Notifier for updates Notifier Notifier // Service type to manage Type string }
Options configure runtime
type ReadOption ¶
type ReadOption func(o *ReadOptions)
func ReadService ¶
func ReadService(service string) ReadOption
ReadService returns services with the given name
func ReadVersion ¶
func ReadVersion(version string) ReadOption
WithVersion 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 }
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) error // Remove a service Delete(*Service) error // List the managed services List() ([]*Service, error) // Start starts the runtime Start() error // Stop shuts down the runtime Stop() error }
Runtime is a service runtime manager
var ( // DefaultRuntime is default micro runtime DefaultRuntime Runtime = NewRuntime() // DefaultName is default runtime service name DefaultName = "go.micro.runtime" )
func NewRuntime ¶
NewRuntime creates new local runtime and returns it
Directories
Path | Synopsis |
---|---|
Package build builds a micro runtime package
|
Package build builds a micro runtime package |
docker
Package docker builds docker images
|
Package docker builds docker images |
go
Package golang is a go package manager
|
Package golang is a go package manager |
Package kubernetes implements kubernetes micro runtime
|
Package kubernetes implements kubernetes micro runtime |
client
Package client provides an implementation of a restricted subset of kubernetes API client
|
Package client provides an implementation of a restricted subset of kubernetes API client |
Package process executes a binary
|
Package process executes a binary |
os
Package os runs processes locally Package os runs processes locally
|
Package os runs processes locally Package os runs processes locally |
Package source retrieves source code
|
Package source retrieves source code |
git
Package git provides a git source
|
Package git provides a git source |
go
Package golang is a source for Go
|
Package golang is a source for Go |