container

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Jun 12, 2020 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Session

type Session struct {
	Name   string
	Status Status
	// contains filtered or unexported fields
}

Session holds the information for a live container, a socket will be opened through a session to fetch the logs.

func NewContainerSession

func NewContainerSession(dockerClient docker.APIClient, ctx context.Context, name string, follow bool) *Session

NewContainerSession creates a new session for a given container name.

func (*Session) ReadLogs

func (c *Session) ReadLogs(wg *sync.WaitGroup, w io.Writer) error

ReadLogs fetches the logs and writes it into provided writer w, it follows the logs if the follow option is enabled by the user.

type Status

type Status int

Status indicates the instantaneous condition of a Session.

const (
	Idle Status = iota
	Live
	Terminated
	Errored
)

func (Status) String

func (s Status) String() string

String returns string representation of the receiver Status.

Jump to

Keyboard shortcuts

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