Documentation
¶
Index ¶
- func RegisterAutoRuntime(r Runtime)
- func WithCmd(in []string) func(*config)
- func WithEntrypoint(in string) func(*config)
- func WithEnv(in []string) func(*config)
- func WithLivenessCheck(lc LivenessCheck) func(*config)
- func WithLogger(in Logger) func(*config)
- func WithRuntime(in Runtime) func(*config)
- func WithUlimit(in []Ulimit) func(*config)
- type Container
- type ContainerConfig
- type LivenessCheck
- type Logger
- type Runtime
- type Ulimit
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RegisterAutoRuntime ¶
func RegisterAutoRuntime(r Runtime)
RegisterAutoRuntime allows a runtime to register itself for auto-selection of a runtime, when one isn't explicitly specified.
func WithCmd ¶
func WithCmd(in []string) func(*config)
WithCmd configures the command of the container.
func WithEntrypoint ¶
func WithEntrypoint(in string) func(*config)
WithEntrypoint configures the entrypoint of the container.
func WithEnv ¶
func WithEnv(in []string) func(*config)
WithEnv configures the environment of the container.
func WithLivenessCheck ¶ added in v0.2.0
func WithLivenessCheck(lc LivenessCheck) func(*config)
WithLivenessCheck defines a function to call repeatedly until it does not error, to ascertain the successful startup of the container. The function will be retried for 10 seconds, and if it does not return a non-nil error before that time, the last error will be returned.
func WithLogger ¶
func WithLogger(in Logger) func(*config)
WithLogger configures the logger of the container. The containers logs will be logged at Info level to this logger. Some errors during closing may also be logged at Error level.
func WithRuntime ¶
func WithRuntime(in Runtime) func(*config)
WithRuntime configures the Runtime to use to launch the container. By default, the auto runtime is used.
func WithUlimit ¶
func WithUlimit(in []Ulimit) func(*config)
WithUlimit configures the ulimits of the container.
Types ¶
type Container ¶
type Container interface { // Context releases resources associated with the container. Close(context.Context) error // Address contains the IP and port of the running container. Address() string // StreamLogs asynchronously streams logs from the // running container to the writer. The writer must // be safe for concurrent use. // If the context is cancelled after logging has been set up, // it has no effect. Use Close to stop logging. // This function is called automatically on the runtimes // configured logger, so there is no need to explicitly call this. StreamLogs(context.Context, io.Writer) error }
Container represents a running container.
type ContainerConfig ¶
type ContainerConfig struct { Repo string Tag string Port string // Optional Env []string Entrypoint *string Cmd []string Ulimits []Ulimit }
ContainerConfig is used by runtimes to start containers.
type LivenessCheck ¶ added in v0.2.0
LivenessCheck is a type used to check the successful startup of a container.
type Logger ¶
type Logger interface { Trace(msg string, fields ...map[string]interface{}) Debug(msg string, fields ...map[string]interface{}) Info(msg string, fields ...map[string]interface{}) Warn(msg string, fields ...map[string]interface{}) Error(msg string, fields ...map[string]interface{}) }
Logger must be implemented to log events. See https://logur.dev/logur for some adapters for popular logging libraries.
Directories
¶
Path | Synopsis |
---|---|
runtimes
|
|
podman/iopodman
Podman Service Interface and API description.
|
Podman Service Interface and API description. |