Documentation
¶
Index ¶
- Constants
- func DistBea(lat1, lon1, lat2, lon2 float64) (float64, float64)
- func GetClass(msg *cot.CotMessage) string
- func MakeChatMessage(c *ChatMessage) *cotproto.TakMessage
- func MissionChangeNotificationMsg(missionName string, scope string, c *Change) *cot.CotMessage
- func MissionCreateNotificationMsg(m *Mission) *cot.CotMessage
- type Answer
- type Certificate
- type CertificateDTO
- type Change
- type Chat
- type ChatMessage
- type ChatMessages
- type Contact
- type ContentItemDTO
- type CotTime
- type DataDTO
- type Device
- func (u *Device) CanLogIn() bool
- func (u *Device) CanSeeScope(scope string) bool
- func (u *Device) CheckPassword(password string) bool
- func (u *Device) DTO() *DeviceDTO
- func (u *Device) GetLogin() string
- func (u *Device) GetReadScope() []string
- func (u *Device) GetScope() string
- func (u *Device) IsGood() bool
- func (u *Device) SetPassword(password string) error
- type DeviceDTO
- type DevicePostDTO
- type DevicePutDTO
- type DigitalPointer
- type Feed2
- type Feed2DTO
- type FeedDTO
- type FeedPostDTO
- type FeedPutDTO
- type Invitation
- type Item
- func (i *Item) GetCallsign() string
- func (i *Item) GetClass() string
- func (i *Item) GetLanLon() (float64, float64)
- func (i *Item) GetLastSeen() time.Time
- func (i *Item) GetMsg() *cot.CotMessage
- func (i *Item) GetScope() string
- func (i *Item) GetTrack() []*Pos
- func (i *Item) GetType() string
- func (i *Item) GetUID() string
- func (i *Item) HasMission(name string) bool
- func (i *Item) IsOld() bool
- func (i *Item) IsOnline() bool
- func (i *Item) IsSend() bool
- func (i *Item) SetLocal(local bool)
- func (i *Item) SetOffline()
- func (i *Item) SetOnline()
- func (i *Item) SetSend(send bool)
- func (i *Item) String() string
- func (i *Item) ToWeb() *WebUnit
- func (i *Item) Update(msg *cot.CotMessage)
- type LocationDTO
- type Mission
- type MissionChangeDTO
- type MissionDTO
- type MissionDetailsDTO
- type MissionInvitationDTO
- type MissionLogEntryDTO
- type MissionPointDTO
- type MissionRoleDTO
- type MissionSubscriptionDTO
- type Point
- type Pos
- type Profile
- type ProfileDTO
- type ProfilePostDTO
- type ProfilePutDTO
- type Resource
- type ResourceDTO
- type Subscription
- type VideoConnections
- type VideoConnections2
- type WebUnit
Constants ¶
View Source
const ( CHANGE_TYPE_ADD = "ADD_CONTENT" CHANGE_TYPE_REMOVE = "REMOVE_CONTENT" )
View Source
const ( StaleContactDelete = time.Hour * 12 POINT = "point" UNIT = "unit" CONTACT = "contact" MaxTrackPoints = 5000 )
Variables ¶
This section is empty.
Functions ¶
func GetClass ¶
func GetClass(msg *cot.CotMessage) string
func MakeChatMessage ¶
func MakeChatMessage(c *ChatMessage) *cotproto.TakMessage
func MissionChangeNotificationMsg ¶ added in v0.20.0
func MissionChangeNotificationMsg(missionName string, scope string, c *Change) *cot.CotMessage
func MissionCreateNotificationMsg ¶ added in v0.20.0
func MissionCreateNotificationMsg(m *Mission) *cot.CotMessage
Types ¶
type Certificate ¶ added in v0.21.0
type Certificate struct { Serial string `gorm:"primaryKey;size:255"` CreatedAt time.Time `gorm:"index;type:timestamp"` UpdatedAt time.Time `gorm:"type:timestamp"` Login string `gorm:"not null;index;size:255"` UID string `gorm:"index;size:255"` LastConnect *time.Time `gorm:"type:timestamp"` ValidTill *time.Time `gorm:"type:timestamp"` }
func (*Certificate) DTO ¶ added in v0.21.0
func (c *Certificate) DTO() *CertificateDTO
type CertificateDTO ¶ added in v0.21.0
type Change ¶ added in v0.20.0
type Change struct { ID uint `gorm:"primaryKey"` CreatedAt time.Time `gorm:"index;type:timestamp"` Type string `gorm:"size:255"` MissionID uint `gorm:"index;not null"` CreatorUID string `gorm:"size:255"` ContentUID string `gorm:"size:255"` MissionPointID *uint MissionPoint *Point `gorm:"foreignKey:MissionPointID"` ContentHash string `gorm:"size:255"` ResourceID *uint Resource *Resource `gorm:"foreignKey:ResourceID"` }
type Chat ¶
type Chat struct { From string `json:"from"` UID string `json:"uid"` Messages []*ChatMessage `json:"messages"` }
type ChatMessage ¶
type ChatMessage struct { ID string `json:"message_id"` Time time.Time `json:"time"` Parent string `json:"parent"` Chatroom string `json:"chatroom"` From string `json:"from"` FromUID string `json:"from_uid"` ToUID string `json:"to_uid"` Direct bool `json:"direct"` Text string `json:"text"` }
func MsgToChat ¶
func MsgToChat(m *cot.CotMessage) *ChatMessage
func (*ChatMessage) String ¶
func (m *ChatMessage) String() string
type ChatMessages ¶ added in v0.18.0
type ChatMessages struct { Chats map[string]*Chat Contacts sync.Map // contains filtered or unexported fields }
func NewChatMessages ¶ added in v0.18.0
func NewChatMessages(myUID string) *ChatMessages
func (*ChatMessages) Add ¶ added in v0.18.0
func (m *ChatMessages) Add(msg *ChatMessage)
type ContentItemDTO ¶ added in v0.20.0
type ContentItemDTO struct { CreatorUID string `json:"creatorUid"` Timestamp CotTime `json:"timestamp"` Data DataDTO `json:"data"` }
func ToContentItemDTO ¶ added in v0.20.0
func ToContentItemDTO(r *Resource) *ContentItemDTO
type CotTime ¶ added in v0.20.0
func (CotTime) MarshalText ¶ added in v0.20.0
func (*CotTime) UnmarshalText ¶ added in v0.20.0
UnmarshalText implements the text unmarshaller method.
type DataDTO ¶ added in v0.20.0
type DataDTO struct { UID string `json:"uid"` Keywords []string `json:"keywords"` MimeType string `json:"mimeType"` Name string `json:"name"` SubmissionTime CotTime `json:"submissionTime"` Submitter string `json:"submitter"` CreatorUID string `json:"creatorUid"` Hash string `json:"hash"` Size int `json:"size"` }
type Device ¶ added in v0.20.0
type Device struct { Login string `gorm:"primaryKey;size:255" yaml:"user"` Password string `gorm:"not null;size:255" yaml:"password"` Scope string `gorm:"not null;size:255" yaml:"scope"` Disabled bool `gorm:"not null;default:false"` Admin bool `gorm:"not null;default:false"` ReadScope []string `gorm:"serializer:json" yaml:"read_scope"` LastConnect *time.Time `gorm:"type:timestamp"` Certs []*Certificate `gorm:"foreignKey:Login"` CreatedAt time.Time `gorm:"type:timestamp"` UpdatedAt time.Time `gorm:"type:timestamp"` }
func (*Device) CanSeeScope ¶ added in v0.20.0
func (*Device) CheckPassword ¶ added in v0.20.0
func (*Device) GetReadScope ¶ added in v0.21.0
func (*Device) SetPassword ¶ added in v0.20.0
type DeviceDTO ¶ added in v0.20.0
type DeviceDTO struct { Login string `json:"login"` Scope string `json:"scope"` Disabled bool `json:"disabled"` Admin bool `json:"admin,omitempty"` ReadScope []string `json:"read_scope,omitempty"` LastConnect *time.Time `json:"last_connect,omitempty"` Certs []*CertificateDTO `json:"certs,omitempty"` }
type DevicePostDTO ¶ added in v0.21.0
type DevicePostDTO struct { Login string `json:"login,omitempty"` DevicePutDTO }
type DevicePutDTO ¶ added in v0.21.0
type DigitalPointer ¶
type Feed2 ¶ added in v0.12.3
type Feed2 struct { UID string `gorm:"primaryKey;size:255"` Active bool Alias string `gorm:"size:255"` URL string `gorm:"size:512"` Latitude float64 Longitude float64 Fov string `gorm:"size:100"` Heading string `gorm:"size:100"` Range string `gorm:"size:100"` User string `gorm:"size:255;index"` Scope string `gorm:"size:255;index"` }
type Feed2DTO ¶ added in v0.23.0
type Feed2DTO struct { UID string `json:"uid,omitempty"` Active bool `json:"active"` Alias string `json:"alias,omitempty"` URL string `json:"url,omitempty"` Latitude float64 `json:"lat,omitempty"` Longitude float64 `json:"lon,omitempty"` Fov string `json:"fov,omitempty"` Heading string `json:"heading,omitempty"` Range string `json:"range,omitempty"` User string `json:"user,omitempty"` Scope string `json:"scope,omitempty"` }
type FeedDTO ¶ added in v0.23.0
type FeedDTO struct { UID string `xml:"uid"` Active bool `xml:"active"` Alias string `xml:"alias"` Typ string `xml:"type"` Address string `xml:"address"` Path string `xml:"path"` PreferredMacAddress string `xml:"preferredMacAddress"` Port int `xml:"port"` RoverPort int `xml:"roverPort"` IgnoreEmbeddedKLV bool `xml:"ignoreEmbeddedKLV"` Protocol string `xml:"protocol"` Source string `xml:"source"` Timeout int `xml:"timeout"` Buffer int `xml:"buffer"` RtspReliable string `xml:"rtspReliable"` Thumbnail string `xml:"thumbnail"` Classification string `xml:"classification"` Latitude float64 `xml:"latitude"` Longitude float64 `xml:"longitude"` Fov string `xml:"fov"` Heading string `xml:"heading"` Range string `xml:"range"` }
type FeedPostDTO ¶ added in v0.23.0
type FeedPostDTO struct { UID string `json:"uid,omitempty"` FeedPutDTO }
type FeedPutDTO ¶ added in v0.23.0
type FeedPutDTO struct { Active bool `json:"active"` Alias string `json:"alias,omitempty"` URL string `json:"url,omitempty"` Latitude float64 `json:"lat,omitempty"` Longitude float64 `json:"lon,omitempty"` Fov string `json:"fov,omitempty"` Heading string `json:"heading,omitempty"` Range string `json:"range,omitempty"` Scope string `json:"scope,omitempty"` }
type Invitation ¶ added in v0.20.0
type Invitation struct { ID uint `gorm:"primaryKey"` CreatedAt time.Time `gorm:"type:timestamp"` MissionID uint `gorm:"index;not null"` Mission *Mission Typ string `gorm:"index;not null;size:255"` Invitee string `gorm:"index;not null;size:255"` CreatorUID string `gorm:"size:255"` Role string `gorm:"size:255"` }
type Item ¶
type Item struct {
// contains filtered or unexported fields
}
func FromMsg ¶
func FromMsg(msg *cot.CotMessage) *Item
func (*Item) GetCallsign ¶
func (*Item) GetLastSeen ¶
func (*Item) GetMsg ¶
func (i *Item) GetMsg() *cot.CotMessage
func (*Item) HasMission ¶ added in v0.15.0
func (*Item) SetOffline ¶
func (i *Item) SetOffline()
func (*Item) Update ¶
func (i *Item) Update(msg *cot.CotMessage)
type LocationDTO ¶ added in v0.20.0
type Mission ¶ added in v0.20.0
type Mission struct { ID uint `gorm:"primaryKey"` CreatedAt time.Time `gorm:"type:timestamp"` UpdatedAt time.Time `gorm:"type:timestamp"` Scope string `gorm:"index;not null;size:255"` Name string `gorm:"index;not null;size:255"` Creator string `gorm:"size:255"` CreatorUID string `gorm:"size:255"` BaseLayer string `gorm:"size:255"` Bbox string `gorm:"size:255"` ChatRoom string `gorm:"size:255"` Classification string `gorm:"size:255"` Description string `gorm:"size:255"` InviteOnly bool Password string `gorm:"size:255"` Path string `gorm:"size:255"` Tool string `gorm:"size:255"` Groups string `gorm:"size:255"` Keywords string `gorm:"size:255"` Resources []*Resource `gorm:"many2many:mission_resources;"` Points []*Point `gorm:"many2many:mission_points;"` Token string `gorm:"size:255"` }
type MissionChangeDTO ¶ added in v0.20.0
type MissionChangeDTO struct { Type string `json:"type"` MissionName string `json:"missionName"` Timestamp CotTime `json:"timestamp"` CreatorUID string `json:"creatorUid"` ServerTime CotTime `json:"serverTime"` ContentUID string `json:"contentUid,omitempty"` ContentHash string `json:"contentHash,omitempty"` Details *MissionDetailsDTO `json:"details,omitempty"` ContentResource *ResourceDTO `json:"contentResource,omitempty"` }
func ToChangeDTO ¶ added in v0.20.0
func ToChangeDTO(c *Change, name string) *MissionChangeDTO
type MissionDTO ¶ added in v0.20.0
type MissionDTO struct { Name string `json:"name"` Scope string `json:"scope,omitempty"` CreatorUID string `json:"creatorUid"` CreateTime CotTime `json:"createTime"` LastEdit CotTime `json:"lastEdited"` BaseLayer string `json:"baseLayer"` Bbox string `json:"bbox"` ChatRoom string `json:"chatRoom"` Classification string `json:"classification"` DefaultRole *MissionRoleDTO `json:"defaultRole,omitempty"` OwnerRole *MissionRoleDTO `json:"ownerRole,omitempty"` Description string `json:"description"` Expiration int `json:"expiration"` ExternalData []any `json:"externalData"` Feeds []string `json:"feeds"` Groups []string `json:"groups,omitempty"` InviteOnly bool `json:"inviteOnly"` Keywords []string `json:"keywords"` MapLayers []string `json:"mapLayers"` PasswordProtected bool `json:"passwordProtected"` Path string `json:"path"` Tool string `json:"tool"` Uids []*MissionPointDTO `json:"uids"` Contents []*ContentItemDTO `json:"contents"` Token string `json:"token"` }
func ToMissionDTO ¶ added in v0.20.0
func ToMissionDTO(m *Mission, withToken bool) *MissionDTO
func ToMissionDTOAdm ¶ added in v0.20.0
func ToMissionDTOAdm(m *Mission) *MissionDTO
func ToMissionDTOFull ¶ added in v0.20.0
func ToMissionDTOFull(m *Mission, withToken bool, withScope bool) *MissionDTO
type MissionDetailsDTO ¶ added in v0.20.0
type MissionInvitationDTO ¶ added in v0.20.0
type MissionInvitationDTO struct { MissionName string `json:"mission_name"` Invitee string `json:"invitee"` Type string `json:"type"` CreatorUID string `json:"creator_uid"` CreateTime CotTime `json:"create_time"` Role *MissionRoleDTO `json:"role"` }
func ToMissionInvitationDTO ¶ added in v0.20.0
func ToMissionInvitationDTO(m *Invitation, name string) *MissionInvitationDTO
type MissionLogEntryDTO ¶ added in v0.20.0
type MissionLogEntryDTO struct { Content string `json:"content"` ContentHashes []string `json:"contentHashes"` Created time.Time `json:"created"` CreatorUID string `json:"creatorUid"` Dtg time.Time `json:"dtg"` ID string `json:"id"` Keywords []string `json:"keywords"` MissionNames []string `json:"missionNames"` Servertime time.Time `json:"servertime"` EntryUID string `json:"entryUid"` }
type MissionPointDTO ¶ added in v0.20.0
type MissionPointDTO struct { CreatorUID string `json:"creatorUid"` Timestamp CotTime `json:"timestamp"` Data string `json:"data"` Details *MissionDetailsDTO `json:"details"` }
func ToMissionPointDTO ¶ added in v0.20.0
func ToMissionPointDTO(i *Point) *MissionPointDTO
type MissionRoleDTO ¶ added in v0.20.0
func GetRole ¶ added in v0.20.0
func GetRole(name string) *MissionRoleDTO
func NewRole ¶ added in v0.20.0
func NewRole(typ string, perms ...string) *MissionRoleDTO
type MissionSubscriptionDTO ¶ added in v0.20.0
type MissionSubscriptionDTO struct { ClientUID string `json:"clientUid"` Username string `json:"username"` CreateTime CotTime `json:"createTime"` Role *MissionRoleDTO `json:"role"` Token string `json:"token,omitempty"` }
func ToMissionSubscriptionDTO ¶ added in v0.20.0
func ToMissionSubscriptionDTO(s *Subscription, token string) *MissionSubscriptionDTO
func ToMissionSubscriptionsDTO ¶ added in v0.20.0
func ToMissionSubscriptionsDTO(subscriptions []*Subscription) []*MissionSubscriptionDTO
type Point ¶ added in v0.20.0
type Point struct { ID uint `gorm:"primaryKey"` UID string `gorm:"uniqueIndex;size:255"` Type string `gorm:"index;size:255"` Callsign string `gorm:"size:255"` Scope string `gorm:"index;size:255"` CreatedAt time.Time `gorm:"type:timestamp"` UpdatedAt time.Time `gorm:"type:timestamp"` StaleTime time.Time `gorm:"type:timestamp"` CreatorUID string `gorm:"size:255"` Title string `gorm:"size:255"` IconsetPath string `gorm:"size:255"` Color string `gorm:"size:255"` Lat float64 Lon float64 EventData []byte // contains filtered or unexported fields }
func (*Point) UpdateFromMsg ¶ added in v0.20.0
func (p *Point) UpdateFromMsg(msg *cot.CotMessage)
type Pos ¶
type Pos struct { Time time.Time Lat float64 Lon float64 Alt float64 Speed float64 Track float64 Ce float64 }
func NewPosFull ¶ added in v0.17.0
type Profile ¶ added in v0.22.0
type Profile struct { Login string `gorm:"primaryKey;size:255"` UID string `gorm:"primaryKey;size:255"` CreatedAt time.Time `gorm:"type:timestamp"` UpdatedAt time.Time `gorm:"type:timestamp"` Callsign string `gorm:"size:255"` Team string `gorm:"size:255"` Role string `gorm:"size:255"` CotType string `gorm:"size:255"` Options map[string]string `gorm:"serializer:json"` }
func (*Profile) DTO ¶ added in v0.22.0
func (p *Profile) DTO() *ProfileDTO
type ProfileDTO ¶ added in v0.22.0
type ProfilePostDTO ¶ added in v0.22.0
type ProfilePostDTO struct { Login string `json:"login,omitempty"` UID string `json:"uid,omitempty"` ProfilePutDTO }
type ProfilePutDTO ¶ added in v0.22.0
type Resource ¶ added in v0.20.0
type Resource struct { ID uint `gorm:"primaryKey"` CreatedAt time.Time `gorm:"type:timestamp"` Scope string `gorm:"index;not null;size:255"` Hash string `gorm:"index;size:255"` UID string `gorm:"uniqueIndex;size:255"` Name string `gorm:"size:255"` FileName string `gorm:"size:255"` MIMEType string `gorm:"size:255"` Size int SubmissionUser string `gorm:"size:255"` CreatorUID string `gorm:"size:255"` Tool string `gorm:"index"` Keywords string `gorm:"size:255"` Groups string `gorm:"size:255"` Expiration int64 KwSet util.StringSet `gorm:"-"` }
type ResourceDTO ¶ added in v0.20.0
type ResourceDTO struct { ID string `json:"PrimaryKey"` UID string `json:"UID"` SubmissionDateTime time.Time `json:"SubmissionDateTime"` Keywords []string `json:"Keywords"` MIMEType string `json:"MIMEType"` Size int `json:"Size"` SubmissionUser string `json:"SubmissionUser"` Hash string `json:"Hash"` CreatorUID string `json:"CreatorUid"` FileName string `json:"FileName"` Name string `json:"Name"` Tool string `json:"Tool"` Expiration int64 `json:"Expiration"` }
func ToResourceDTO ¶ added in v0.20.0
func ToResourceDTO(r *Resource) *ResourceDTO
type Subscription ¶ added in v0.20.0
type VideoConnections ¶ added in v0.12.3
type VideoConnections2 ¶ added in v0.14.0
type WebUnit ¶
type WebUnit struct { UID string `json:"uid"` Callsign string `json:"callsign"` Category string `json:"category"` Scope string `json:"scope"` Team string `json:"team"` Role string `json:"role"` ExRole string `json:"exrole"` Time time.Time `json:"time"` LastSeen time.Time `json:"last_seen"` StaleTime time.Time `json:"stale_time"` StartTime time.Time `json:"start_time"` SendTime time.Time `json:"send_time"` Type string `json:"type"` Lat float64 `json:"lat"` Lon float64 `json:"lon"` Hae float64 `json:"hae"` Speed float64 `json:"speed"` Course float64 `json:"course"` Sidc string `json:"sidc"` TakVersion string `json:"tak_version"` Device string `json:"device"` Status string `json:"status"` Battery uint32 `json:"battery"` Text string `json:"text"` Color string `json:"color"` Icon string `json:"icon"` ParentCallsign string `json:"parent_callsign"` ParentUID string `json:"parent_uid"` Local bool `json:"local"` Send bool `json:"send"` Missions []string `json:"missions"` }
func (*WebUnit) ToMsg ¶
func (w *WebUnit) ToMsg() *cot.CotMessage
Click to show internal directories.
Click to hide internal directories.