Documentation ¶
Index ¶
Constants ¶
const ( LogFilePrefix = "vic-machine" // logFilePrefix is the prefix for file names of all vic-machine log files LogFileSuffix = ".log" // logFileSuffix is the suffix for file names of all vic-machine log files )
Reminder: When changing these, consider the impact to backwards compatibility.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BufferedPipe ¶
type BufferedPipe struct {
// contains filtered or unexported fields
}
BufferedPipe struct implements a pipe readwriter with buffer
func NewBufferedPipe ¶
func NewBufferedPipe() *BufferedPipe
NewBufferedPipe returns a new buffered pipe instance the internal buffer is initialized to default size. Since internal memory is used, need to make sure that buffered data is bounded.
type DatastoreReadySignal ¶
type DatastoreReadySignal struct { // Datastore: the govmomi datastore object Datastore *object.Datastore // Name: vic-machine process name (e.g. "create", "inspect") Name string // Operation: the operation from which the signal is sent Operation trace.Operation // VMPathName: the datastore path VMPathName string // Timestamp: timestamp at which the signal is sent Timestamp time.Time }
DatastoreReadySignal serves as a signal struct indicating datastore folder path is available
type Receiver ¶
type Receiver interface {
Signal(sig DatastoreReadySignal)
}
type VCHLogger ¶
type VCHLogger struct {
// contains filtered or unexported fields
}
func New ¶
func New() *VCHLogger
New creates the logger, with the streaming pipe and singaling channel.
func (*VCHLogger) GetPipe ¶
func (l *VCHLogger) GetPipe() *BufferedPipe
GetPipe returns the streaming pipe of the vch logger
func (*VCHLogger) Run ¶
func (l *VCHLogger) Run()
Run waits until the signal arrives and uploads the streaming pipe to datastore
func (*VCHLogger) Signal ¶
func (l *VCHLogger) Signal(sig DatastoreReadySignal)
Signal signals the logger that the datastore folder is ready