Documentation ¶
Index ¶
- Constants
- Variables
- func BasicMsg(typ string, uid string, stale time.Duration) *cotproto.TakMessage
- func GetMsgType(t string) string
- func MakeDpMsg(uid string, typ string, name string, lat float64, lon float64) *cotproto.TakMessage
- func MakeOfflineMsg(uid string, typ string) *cotproto.TakMessage
- func MakePing(uid string) *cotproto.TakMessage
- func MakePong() *cotproto.TakMessage
- func MakeProtoPacket(msg *cotproto.TakMessage) ([]byte, error)
- func MatchAnyPattern(a string, patterns ...string) bool
- func MatchPattern(a, pattern string) bool
- func ReadProto(r *bufio.Reader) (*cotproto.TakMessage, error)
- func TimeFromMillis(ms uint64) time.Time
- func TimeToMillis(t time.Time) uint64
- type CotMessage
- func (m *CotMessage) GetCallsign() string
- func (m *CotMessage) GetColor() string
- func (m *CotMessage) GetDetail() *Node
- func (m *CotMessage) GetEndpoint() string
- func (m *CotMessage) GetFirstLink(relation string) *Node
- func (m *CotMessage) GetIconsetPath() string
- func (m *CotMessage) GetLat() float64
- func (m *CotMessage) GetLatLon() (float64, float64)
- func (m *CotMessage) GetLon() float64
- func (m *CotMessage) GetParent() (string, string)
- func (m *CotMessage) GetRole() string
- func (m *CotMessage) GetSendTime() time.Time
- func (m *CotMessage) GetStale() time.Time
- func (m *CotMessage) GetStaleTime() time.Time
- func (m *CotMessage) GetStartTime() time.Time
- func (m *CotMessage) GetTakMessage() *cotproto.TakMessage
- func (m *CotMessage) GetTakv() *cotproto.Takv
- func (m *CotMessage) GetTeam() string
- func (m *CotMessage) GetType() string
- func (m *CotMessage) GetUID() string
- func (m *CotMessage) GetUpdatedTakMessage() *cotproto.TakMessage
- func (m *CotMessage) IsChat() bool
- func (m *CotMessage) IsChatReceipt() bool
- func (m *CotMessage) IsContact() bool
- func (m *CotMessage) IsControl() bool
- func (m *CotMessage) IsLocal() bool
- func (m *CotMessage) IsMapItem() bool
- func (m *CotMessage) IsPing() bool
- type CotType
- type Event
- type Node
- func (n *Node) AddChild(name string, params map[string]string, text string) *Node
- func (n *Node) AddOrChangeChild(name string, params map[string]string) *Node
- func (n *Node) AddPpLink(uid, typ, callsign string)
- func (n *Node) AsXMLString() string
- func (n *Node) GetAll(name string) []*Node
- func (n *Node) GetAttr(name string) string
- func (n *Node) GetAttrs() map[string]string
- func (n *Node) GetDestCallsign() []string
- func (n *Node) GetDestMission() []string
- func (n *Node) GetFirst(name string) *Node
- func (n *Node) GetText() string
- func (n *Node) Has(name string) bool
- func (n *Node) RemoveTags(tags ...string)
- func (n *Node) String() string
- type Point
- type ProtoReader
- type TagReader
Constants ¶
View Source
const ( LocalFrom = "local" LocalScope = "local" BroadcastScope = "broadcast" )
View Source
const NotNum = 999999
Variables ¶
View Source
var (
Root = new(CotType)
)
Functions ¶
func GetMsgType ¶ added in v0.12.5
func MakeOfflineMsg ¶
func MakeOfflineMsg(uid string, typ string) *cotproto.TakMessage
func MakePing ¶
func MakePing(uid string) *cotproto.TakMessage
func MakePong ¶
func MakePong() *cotproto.TakMessage
func MakeProtoPacket ¶
func MakeProtoPacket(msg *cotproto.TakMessage) ([]byte, error)
func MatchAnyPattern ¶ added in v0.13.0
func MatchPattern ¶ added in v0.12.4
func TimeFromMillis ¶
func TimeToMillis ¶
Types ¶
type CotMessage ¶
type CotMessage struct { From string `json:"from,omitempty"` Scope string `json:"scope"` TakMessage *cotproto.TakMessage `json:"tak_message"` Detail *Node `json:"-"` }
func CotFromProto ¶ added in v0.14.4
func CotFromProto(msg *cotproto.TakMessage, from, scope string) (*CotMessage, error)
func EventToProto ¶
func EventToProto(ev *Event) (*CotMessage, error)
func EventToProtoExt ¶ added in v0.14.6
func EventToProtoExt(ev *Event, from, scope string) (*CotMessage, error)
func LocalCotMessage ¶ added in v0.16.4
func LocalCotMessage(msg *cotproto.TakMessage) *CotMessage
func (*CotMessage) GetCallsign ¶
func (m *CotMessage) GetCallsign() string
func (*CotMessage) GetColor ¶ added in v0.14.7
func (m *CotMessage) GetColor() string
func (*CotMessage) GetDetail ¶ added in v0.15.0
func (m *CotMessage) GetDetail() *Node
func (*CotMessage) GetEndpoint ¶
func (m *CotMessage) GetEndpoint() string
func (*CotMessage) GetFirstLink ¶ added in v0.14.0
func (m *CotMessage) GetFirstLink(relation string) *Node
func (*CotMessage) GetIconsetPath ¶ added in v0.15.0
func (m *CotMessage) GetIconsetPath() string
func (*CotMessage) GetLat ¶
func (m *CotMessage) GetLat() float64
func (*CotMessage) GetLatLon ¶
func (m *CotMessage) GetLatLon() (float64, float64)
func (*CotMessage) GetLon ¶
func (m *CotMessage) GetLon() float64
func (*CotMessage) GetParent ¶
func (m *CotMessage) GetParent() (string, string)
func (*CotMessage) GetRole ¶
func (m *CotMessage) GetRole() string
func (*CotMessage) GetSendTime ¶ added in v0.13.0
func (m *CotMessage) GetSendTime() time.Time
func (*CotMessage) GetStale ¶
func (m *CotMessage) GetStale() time.Time
func (*CotMessage) GetStaleTime ¶ added in v0.13.0
func (m *CotMessage) GetStaleTime() time.Time
func (*CotMessage) GetStartTime ¶ added in v0.13.0
func (m *CotMessage) GetStartTime() time.Time
func (*CotMessage) GetTakMessage ¶ added in v0.15.0
func (m *CotMessage) GetTakMessage() *cotproto.TakMessage
func (*CotMessage) GetTakv ¶ added in v0.19.0
func (m *CotMessage) GetTakv() *cotproto.Takv
func (*CotMessage) GetTeam ¶
func (m *CotMessage) GetTeam() string
func (*CotMessage) GetType ¶
func (m *CotMessage) GetType() string
func (*CotMessage) GetUID ¶ added in v0.14.7
func (m *CotMessage) GetUID() string
func (*CotMessage) GetUpdatedTakMessage ¶ added in v0.15.1
func (m *CotMessage) GetUpdatedTakMessage() *cotproto.TakMessage
func (*CotMessage) IsChat ¶
func (m *CotMessage) IsChat() bool
func (*CotMessage) IsChatReceipt ¶
func (m *CotMessage) IsChatReceipt() bool
func (*CotMessage) IsContact ¶
func (m *CotMessage) IsContact() bool
func (*CotMessage) IsControl ¶ added in v0.16.4
func (m *CotMessage) IsControl() bool
func (*CotMessage) IsLocal ¶ added in v0.16.4
func (m *CotMessage) IsLocal() bool
func (*CotMessage) IsMapItem ¶ added in v0.16.1
func (m *CotMessage) IsMapItem() bool
func (*CotMessage) IsPing ¶ added in v0.16.1
func (m *CotMessage) IsPing() bool
type CotType ¶
type Event ¶
type Event struct { XMLName xml.Name `xml:"event"` Version string `xml:"version,attr"` Type string `xml:"type,attr"` Access string `xml:"access,attr,omitempty"` Qos string `xml:"qos,attr,omitempty"` Opex string `xml:"opex,attr,omitempty"` UID string `xml:"uid,attr"` Time time.Time `xml:"time,attr"` Start time.Time `xml:"start,attr"` Stale time.Time `xml:"stale,attr"` How string `xml:"how,attr"` Detail *Node `xml:"detail"` Point Point `xml:"point"` }
func CotToEvent ¶ added in v0.15.0
func ProtoChangeOkMsg ¶
func ProtoChangeOkMsg() *Event
func ProtoToEvent ¶
func ProtoToEvent(msg *cotproto.TakMessage) *Event
func VersionReqMsg ¶
func VersionSupportMsg ¶
func XMLBasicMsg ¶ added in v0.14.7
func (*Event) AddCallsign ¶
func (*Event) AddVersion ¶
type Node ¶
type Node struct { XMLName xml.Name Attrs []xml.Attr `xml:",any,attr"` Content string `xml:",chardata"` Nodes []*Node `xml:",any"` }
func DetailsFromString ¶
func NewXMLDetails ¶ added in v0.14.7
func NewXMLDetails() *Node
func (*Node) AddOrChangeChild ¶ added in v0.14.6
func (*Node) AsXMLString ¶
func (*Node) GetDestCallsign ¶ added in v0.14.7
func (*Node) GetDestMission ¶ added in v0.14.7
func (*Node) RemoveTags ¶
type ProtoReader ¶
type ProtoReader struct {
// contains filtered or unexported fields
}
func NewProtoReader ¶
func NewProtoReader(r io.Reader) *ProtoReader
func (*ProtoReader) ReadProtoBuf ¶
func (er *ProtoReader) ReadProtoBuf() (*cotproto.TakMessage, error)
Click to show internal directories.
Click to hide internal directories.