state package

import "go.sbk.wtf/runj/state"

Index

func Dir

Dir returns the state directory for a container

func Remove

Remove removes the state for a container

func SetDir

SetDir overrides the state directory and returns a function that restores the previous value. It is intended for tests that need an isolated, writable state directory.

type Output

Output is the expected output format for the state command

{
    "ociVersion": "0.2.0",
    "id": "oci-container1",
    "status": "running",
    "pid": 4422,
    "bundle": "/containers/redis",
    "annotations": {
        "myKey": "myValue"
    }
}

type State

State represents the state of a container

func Create

Create creates a state file for runj

func Load

Load reads the state from disk and parses it

func (*State) Output

Output converts the state to the "Output" format expected by hooks

func (*State) Save

Save saves the state to disk

type Status

Status is the type for representing container status

Source Files

dir.go state.go