container

package
v0.0.0-...-fcfc175 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 27, 2022 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Container

type Container struct {
	Impl
}

func New

func New(id ID, name string, logPath string) (*Container, error)

func (*Container) CreatedAt

func (c *Container) CreatedAt() string

func (*Container) CreatedAtNano

func (c *Container) CreatedAtNano() int64

func (*Container) ExitCode

func (c *Container) ExitCode() int32

func (*Container) FinishedAt

func (c *Container) FinishedAt() string

func (*Container) FinishedAtNano

func (c *Container) FinishedAtNano() int64

func (*Container) ID

func (c *Container) ID() ID

func (*Container) LogPath

func (c *Container) LogPath() string

func (*Container) MarshalJSON

func (c *Container) MarshalJSON() ([]byte, error)

func (*Container) Name

func (c *Container) Name() string

func (*Container) SetCreatedAt

func (c *Container) SetCreatedAt(t time.Time) error

func (*Container) SetExitCode

func (c *Container) SetExitCode(code int32)

func (*Container) SetFinishedAt

func (c *Container) SetFinishedAt(t time.Time) error

func (*Container) SetStartedAt

func (c *Container) SetStartedAt(t time.Time) error

func (*Container) SetStatus

func (c *Container) SetStatus(s Status)

func (*Container) StartedAt

func (c *Container) StartedAt() string

func (*Container) StartedAtNano

func (c *Container) StartedAtNano() int64

func (*Container) Status

func (c *Container) Status() Status

func (*Container) UnmarshalJSON

func (c *Container) UnmarshalJSON(bytes []byte) error

type ID

type ID string

func ParseId

func ParseId(id string) (ID, error)

func RandID

func RandID() ID

type Impl

type Impl struct {
	ID_       ID     `json:"id"`
	Name_     string `json:"name"`
	Status_   Status `json:"status"`
	ExitCode_ int32  `json:"exitCode"`

	CreateAt_   string `json:"createdAt"`
	StartedAt_  string `json:"startedAt,omitempty"`
	FinishedAt_ string `json:"finishedAt,omitempty"`

	Command_ []string `json:"command"`
	Args_    []string `json:"args,omitempty"`

	Rootfs_ string `json:"rootfs"`

	LogPath_ string `json:"logPath,omitempty"`
}

type Map

type Map struct {
	// contains filtered or unexported fields
}

func NewMap

func NewMap() *Map

func (*Map) Add

func (m *Map) Add(c *Container, rb *rollback.Rollback) error

func (*Map) All

func (m *Map) All() (cs []*Container)

func (*Map) Del

func (m *Map) Del(id ID) bool

func (*Map) Get

func (m *Map) Get(id ID) *Container

func (*Map) GetByName

func (m *Map) GetByName(name string) *Container

type Status

type Status uint32
const (
	Initial Status = 0
	Created Status = 10
	Running Status = 20
	Stopped Status = 30
	Unknown Status = math.MaxUint32
)

func StatusFromString

func StatusFromString(s string) (Status, error)

func (Status) String

func (s Status) String() string

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL