Package state
Package state gives access to the state of the odo process stored in a local file
The state of an instance is stored in a file .odo/devstate.${PID}.json.
For compatibility with previous versions of odo, the `devstate.json` file contains
the state of the first instance of odo.
type Client interface {
Init(ctx context.Context) error
SetForwardedPorts(ctx context.Context, fwPorts []api.ForwardedPort) error
GetForwardedPorts(ctx context.Context) ([]api.ForwardedPort, error)
SaveExit(ctx context.Context) error
SetAPIServerPort(ctx context.Context, port int) error
GetAPIServerPorts(ctx context.Context) ([]api.DevControlPlane, error)
GetOrphanFiles(ctx context.Context) ([]string, error)
}
type Content struct {
PID int `json:"pid"`
Platform string `json:"platform"`
ForwardedPorts []api.ForwardedPort `json:"forwardedPorts"`
APIServerPort int `json:"apiServerPort,omitempty"`
}
type ErrAlreadyRunningOnPlatform struct {
}
func NewErrAlreadyRunningOnPlatform(platform string, pid int) ErrAlreadyRunningOnPlatform
func (e ErrAlreadyRunningOnPlatform) Error() string
type State struct {
}
func NewStateClient(fs filesystem.Filesystem, system system.System) *State
func (o *State) GetAPIServerPorts(ctx context.Context) ([]api.DevControlPlane, error)
func (o *State) GetForwardedPorts(ctx context.Context) ([]api.ForwardedPort, error)
func (o *State) GetOrphanFiles(ctx context.Context) ([]string, error)
func (*State) Init
¶
func (o *State) Init(ctx context.Context) error
func (o *State) SaveExit(ctx context.Context) error
func (o *State) SetAPIServerPort(ctx context.Context, port int) error
func (o *State) SetForwardedPorts(ctx context.Context, fwPorts []api.ForwardedPort) error