Documentation ¶
Overview ¶
Package sarif implements the sarif protocol, including client and broker.
Package sarif implements the sarif protocol, including client and broker.
Index ¶
- Constants
- func GenerateId() string
- type Client
- type ClientFactory
- type ClientInfo
- type Connection
- type Message
- type Partial
- func (p *Partial) Decode(v interface{}) error
- func (p *Partial) Encode(v interface{}) (err error)
- func (p *Partial) Map() (m map[string]interface{}, err error)
- func (p Partial) MarshalJSON() ([]byte, error)
- func (p *Partial) MustDecode(v interface{})
- func (p Partial) String() string
- func (p *Partial) UnmarshalJSON(data []byte) error
Constants ¶
View Source
const VERSION = "0.5"
Variables ¶
This section is empty.
Functions ¶
func GenerateId ¶
func GenerateId() string
Types ¶
type Client ¶
type Client interface { DeviceId() string Connect(conn Connection) error Disconnect() error Publish(msg Message) error Subscribe(action, device string, h func(Message)) error SetRequestTimeout(timeout time.Duration) Request(msg Message) <-chan Message Reply(orig, reply Message) error ReplyBadRequest(orig Message, err error) error ReplyInternalError(orig Message, err error) error Discover(action string) <-chan Message Log(typ, text string, args ...interface{}) error }
func NewClient ¶
func NewClient(ci ClientInfo) Client
type ClientFactory ¶
type ClientFactory interface {
NewClient(ci ClientInfo) (Client, error)
}
type ClientInfo ¶
type Connection ¶
type Message ¶
type Message struct { Version string `json:"sarif,omitempty"` Id string `json:"id,omitempty"` Action string `json:"action,omitempty"` Source string `json:"src,omitempty"` Destination string `json:"dst,omitempty"` Payload Partial `json:"p,omitempty"` CorrId string `json:"corr,omitempty"` Text string `json:"text,omitempty"` }
func BadRequest ¶
func ConvertURL ¶
func CreateMessage ¶
func InternalError ¶
func (Message) ActionSuffix ¶
func (Message) DecodePayload ¶
func (*Message) EncodePayload ¶
type Partial ¶
type Partial struct {
Raw []byte
}
func (Partial) MarshalJSON ¶
func (*Partial) MustDecode ¶
func (p *Partial) MustDecode(v interface{})
func (*Partial) UnmarshalJSON ¶
Click to show internal directories.
Click to hide internal directories.