Documentation ¶
Index ¶
- Variables
- func CreateErrUnmarshalLogLine(marshalized []byte, originalErr error) error
- func NewChildPart(profileReader *os.File, logsWriter *os.File, ...) (*childPart, error)
- func NewParentPart(childName string, logLineMarshalizer logger.Marshalizer) (*parentPart, error)
- type ChildMessenger
- type Messenger
- type ParentMessenger
- type PartLoopStateType
Constants ¶
This section is empty.
Variables ¶
var ErrInvalidOperationGivenPartLoopState = errors.New("invalid operation given state of loop")
ErrInvalidOperationGivenPartLoopState signals an error
Functions ¶
func CreateErrUnmarshalLogLine ¶
CreateErrUnmarshalLogLine creates an error
func NewChildPart ¶
func NewChildPart( profileReader *os.File, logsWriter *os.File, logLineMarshalizer logger.Marshalizer, ) (*childPart, error)
NewChildPart creates a new logs sender part (in the child process)
func NewParentPart ¶
func NewParentPart(childName string, logLineMarshalizer logger.Marshalizer) (*parentPart, error)
NewParentPart creates a new logs receiver part (in the parent process)
Types ¶
type ChildMessenger ¶
type ChildMessenger struct {
Messenger
}
ChildMessenger is the messenger on child's part of the pipe
func NewChildMessenger ¶
func NewChildMessenger(profileReader *os.File, logsWriter *os.File) *ChildMessenger
NewChildMessenger creates a new messenger
func (*ChildMessenger) ReadProfile ¶
func (messenger *ChildMessenger) ReadProfile() (logger.Profile, error)
ReadProfile reads an incoming profile
func (*ChildMessenger) SendLogLine ¶
func (messenger *ChildMessenger) SendLogLine(logLineMarshalized []byte) (int, error)
SendLogLine sends a log line
type Messenger ¶
type Messenger struct {
// contains filtered or unexported fields
}
Messenger intermediates communication (message exchange) via pipes
func NewMessenger ¶
NewMessenger creates a new messenger
func (*Messenger) ReadMessage ¶
ReadMessage reads a message from the pipe Reading messages is normally performed from a single go-routine, no mutex required
type ParentMessenger ¶
type ParentMessenger struct { Messenger // contains filtered or unexported fields }
ParentMessenger is the messenger on parent's part of the pipe
func NewParentMessenger ¶
func NewParentMessenger(logsReader *os.File, profileWriter *os.File, logLineMarshalizer logger.Marshalizer) *ParentMessenger
NewParentMessenger creates a new messenger
func (*ParentMessenger) ReadLogLine ¶
func (messenger *ParentMessenger) ReadLogLine() (*logger.LogLine, error)
ReadLogLine reads a log line
func (*ParentMessenger) SendProfile ¶
func (messenger *ParentMessenger) SendProfile(profile logger.Profile) error
SendProfile sends a profile
type PartLoopStateType ¶
type PartLoopStateType = uint32
PartLoopStateType represents the state of a part (parent, child) loop
const ( // PartLoopInit signals that loop hasn't been started yet PartLoopInit PartLoopStateType = iota // PartLoopRunning signals that a loop is running PartLoopRunning // PartLoopStopped signals that a loop is stopped PartLoopStopped )