Documentation ¶
Index ¶
- Constants
- Variables
- type CtxType
- type Listener
- type OpenContext
- func (*OpenContext) Descriptor() ([]byte, []int)
- func (m *OpenContext) GetCtxtype() CtxType
- func (m *OpenContext) GetKey() []string
- func (m *OpenContext) GetParentCtxId() uint64
- func (*OpenContext) ProtoMessage()
- func (m *OpenContext) Reset()
- func (m *OpenContext) String() string
- func (m *OpenContext) XXX_DiscardUnknown()
- func (m *OpenContext) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (dst *OpenContext) XXX_Merge(src proto.Message)
- func (m *OpenContext) XXX_Size() int
- func (m *OpenContext) XXX_Unmarshal(b []byte) error
- type Plog
- func (*Plog) Descriptor() ([]byte, []int)
- func (m *Plog) GetClose() bool
- func (m *Plog) GetCtxId() uint64
- func (m *Plog) GetMsg() []*PlogMessage
- func (m *Plog) GetOpen() *OpenContext
- func (*Plog) ProtoMessage()
- func (m *Plog) Reset()
- func (m *Plog) String() string
- func (m *Plog) XXX_DiscardUnknown()
- func (m *Plog) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (dst *Plog) XXX_Merge(src proto.Message)
- func (m *Plog) XXX_Size() int
- func (m *Plog) XXX_Unmarshal(b []byte) error
- type PlogMessage
- func (*PlogMessage) Descriptor() ([]byte, []int)
- func (m *PlogMessage) GetKey() string
- func (m *PlogMessage) GetValue() []byte
- func (*PlogMessage) ProtoMessage()
- func (m *PlogMessage) Reset()
- func (m *PlogMessage) String() string
- func (m *PlogMessage) XXX_DiscardUnknown()
- func (m *PlogMessage) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (dst *PlogMessage) XXX_Merge(src proto.Message)
- func (m *PlogMessage) XXX_Size() int
- func (m *PlogMessage) XXX_Unmarshal(b []byte) error
- type Reader
- type Writer
Constants ¶
View Source
const (
// Default path to listen on / connect to.
DefaultSock = "/run/plog/plog-packet.sock"
)
Variables ¶
View Source
var CtxType_name = map[int32]string{
0: "log",
1: "state",
2: "count",
3: "dict",
4: "list",
}
View Source
var CtxType_value = map[string]int32{
"log": 0,
"state": 1,
"count": 2,
"dict": 3,
"list": 4,
}
Functions ¶
This section is empty.
Types ¶
type Listener ¶
A convenience listener type. Set seqpacket to true in case that's the socket type used.
type OpenContext ¶
type OpenContext struct { Ctxtype *CtxType `protobuf:"varint,1,opt,name=ctxtype,enum=plogproto.CtxType" json:"ctxtype,omitempty"` Key []string `protobuf:"bytes,2,rep,name=key" json:"key,omitempty"` ParentCtxId *uint64 `protobuf:"varint,3,opt,name=parent_ctx_id,json=parentCtxId" json:"parent_ctx_id,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
func (*OpenContext) Descriptor ¶
func (*OpenContext) Descriptor() ([]byte, []int)
func (*OpenContext) GetCtxtype ¶
func (m *OpenContext) GetCtxtype() CtxType
func (*OpenContext) GetKey ¶
func (m *OpenContext) GetKey() []string
func (*OpenContext) GetParentCtxId ¶
func (m *OpenContext) GetParentCtxId() uint64
func (*OpenContext) ProtoMessage ¶
func (*OpenContext) ProtoMessage()
func (*OpenContext) Reset ¶
func (m *OpenContext) Reset()
func (*OpenContext) String ¶
func (m *OpenContext) String() string
func (*OpenContext) XXX_DiscardUnknown ¶
func (m *OpenContext) XXX_DiscardUnknown()
func (*OpenContext) XXX_Marshal ¶
func (m *OpenContext) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*OpenContext) XXX_Merge ¶
func (dst *OpenContext) XXX_Merge(src proto.Message)
func (*OpenContext) XXX_Size ¶
func (m *OpenContext) XXX_Size() int
func (*OpenContext) XXX_Unmarshal ¶
func (m *OpenContext) XXX_Unmarshal(b []byte) error
type Plog ¶
type Plog struct { CtxId *uint64 `protobuf:"varint,1,opt,name=ctx_id,json=ctxId" json:"ctx_id,omitempty"` // All these are optional, more than one can be set. // E.g. all three can be used together to send a whole context in a single message. Open *OpenContext `protobuf:"bytes,2,opt,name=open" json:"open,omitempty"` Msg []*PlogMessage `protobuf:"bytes,3,rep,name=msg" json:"msg,omitempty"` Close *bool `protobuf:"varint,4,opt,name=close" json:"close,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
func (*Plog) Descriptor ¶
func (*Plog) GetMsg ¶
func (m *Plog) GetMsg() []*PlogMessage
func (*Plog) GetOpen ¶
func (m *Plog) GetOpen() *OpenContext
func (*Plog) ProtoMessage ¶
func (*Plog) ProtoMessage()
func (*Plog) XXX_DiscardUnknown ¶
func (m *Plog) XXX_DiscardUnknown()
func (*Plog) XXX_Unmarshal ¶
type PlogMessage ¶
type PlogMessage struct { Key *string `protobuf:"bytes,2,opt,name=key" json:"key,omitempty"` Value []byte `protobuf:"bytes,3,opt,name=value" json:"value,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
func (*PlogMessage) Descriptor ¶
func (*PlogMessage) Descriptor() ([]byte, []int)
func (*PlogMessage) GetKey ¶
func (m *PlogMessage) GetKey() string
func (*PlogMessage) GetValue ¶
func (m *PlogMessage) GetValue() []byte
func (*PlogMessage) ProtoMessage ¶
func (*PlogMessage) ProtoMessage()
func (*PlogMessage) Reset ¶
func (m *PlogMessage) Reset()
func (*PlogMessage) String ¶
func (m *PlogMessage) String() string
func (*PlogMessage) XXX_DiscardUnknown ¶
func (m *PlogMessage) XXX_DiscardUnknown()
func (*PlogMessage) XXX_Marshal ¶
func (m *PlogMessage) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*PlogMessage) XXX_Merge ¶
func (dst *PlogMessage) XXX_Merge(src proto.Message)
func (*PlogMessage) XXX_Size ¶
func (m *PlogMessage) XXX_Size() int
func (*PlogMessage) XXX_Unmarshal ¶
func (m *PlogMessage) XXX_Unmarshal(b []byte) error
type Reader ¶
type Reader struct { io.ReadCloser Seqpacket bool }
Type for receiving plog messages. Has Closer for easier use.
type Writer ¶
type Writer struct { io.WriteCloser Seqpacket bool sync.Mutex }
Type for sending plog messages. Has closer for easier use.
func NewClientConn ¶
Parses sock either as a URL or a path and opens a connection there. If sock is empty string the DefaultSock value is used. The underlying WriteCloser can be cast to net.Conn if necessary.
func NewWriter ¶
func NewWriter(wc io.WriteCloser, seqpacket bool) *Writer
Creates a new writer for plog messages.
func (*Writer) SendKeyValue ¶
Convenience wrapper for sending a single message.
func (*Writer) SendMessage ¶
func (w *Writer) SendMessage(ctxId uint64, msg ...*PlogMessage) error
Convenience wrapper for sending only message messages.
Click to show internal directories.
Click to hide internal directories.