model

package
v0.23.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 6, 2025 License: AGPL-3.0 Imports: 17 Imported by: 0

Documentation

Index

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 DistBea

func DistBea(lat1, lon1, lat2, lon2 float64) (float64, float64)

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 Answer added in v0.20.0

type Answer[T any] struct {
	Version string `json:"version"`
	Type    string `json:"type"`
	NodeID  string `json:"nodeId"`
	Data    T      `json:"data"`
}

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 CertificateDTO struct {
	UID         string     `json:"uid"`
	CreatedAt   time.Time  `json:"created_at"`
	UpdatedAt   time.Time  `json:"updated_at"`
	Login       string     `json:"login"`
	Serial      string     `json:"serial"`
	LastConnect *time.Time `json:"last_connect"`
}

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"`
}

func (*Change) String added in v0.20.0

func (c *Change) String() string

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 Contact added in v0.12.5

type Contact struct {
	UID          string `json:"uid"`
	Callsign     string `json:"callsign"`
	Team         string `json:"team"`
	Role         string `json:"role"`
	Takv         string `json:"takv"`
	Notes        string `json:"notes"`
	FilterGroups string `json:"filterGroups"`
}

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

type CotTime time.Time

func (CotTime) MarshalText added in v0.20.0

func (x CotTime) MarshalText() ([]byte, error)

func (*CotTime) UnmarshalText added in v0.20.0

func (x *CotTime) UnmarshalText(text []byte) error

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) CanLogIn added in v0.21.0

func (u *Device) CanLogIn() bool

func (*Device) CanSeeScope added in v0.20.0

func (u *Device) CanSeeScope(scope string) bool

func (*Device) CheckPassword added in v0.20.0

func (u *Device) CheckPassword(password string) bool

func (*Device) DTO added in v0.20.0

func (u *Device) DTO() *DeviceDTO

func (*Device) GetLogin added in v0.20.0

func (u *Device) GetLogin() string

func (*Device) GetReadScope added in v0.21.0

func (u *Device) GetReadScope() []string

func (*Device) GetScope added in v0.20.0

func (u *Device) GetScope() string

func (*Device) IsGood added in v0.22.0

func (u *Device) IsGood() bool

func (*Device) SetPassword added in v0.20.0

func (u *Device) SetPassword(password string) error

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 DevicePutDTO struct {
	Admin     bool     `json:"admin,omitempty"`
	Disabled  bool     `json:"disabled"`
	Password  string   `json:"password,omitempty"`
	Scope     string   `json:"scope,omitempty"`
	ReadScope []string `json:"read_scope,omitempty"`
}

type DigitalPointer

type DigitalPointer struct {
	Lat  float64 `json:"lat"`
	Lon  float64 `json:"lon"`
	Name string  `json:"name"`
}

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"`
}

func (*Feed2) DTO added in v0.23.0

func (f *Feed2) DTO(admin bool) *Feed2DTO

func (*Feed2) DTOOld added in v0.23.0

func (f *Feed2) DTOOld() *FeedDTO

func (*Feed2) TableName added in v0.23.0

func (f *Feed2) TableName() string

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"`
}

func (*FeedDTO) ToFeed2 added in v0.23.0

func (f *FeedDTO) ToFeed2() *Feed2

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 (i *Item) GetCallsign() string

func (*Item) GetClass

func (i *Item) GetClass() string

func (*Item) GetLanLon

func (i *Item) GetLanLon() (float64, float64)

func (*Item) GetLastSeen

func (i *Item) GetLastSeen() time.Time

func (*Item) GetMsg

func (i *Item) GetMsg() *cot.CotMessage

func (*Item) GetScope added in v0.16.3

func (i *Item) GetScope() string

func (*Item) GetTrack added in v0.14.0

func (i *Item) GetTrack() []*Pos

func (*Item) GetType added in v0.14.7

func (i *Item) GetType() string

func (*Item) GetUID

func (i *Item) GetUID() string

func (*Item) HasMission added in v0.15.0

func (i *Item) HasMission(name string) bool

func (*Item) IsOld

func (i *Item) IsOld() bool

func (*Item) IsOnline

func (i *Item) IsOnline() bool

func (*Item) IsSend

func (i *Item) IsSend() bool

func (*Item) SetLocal

func (i *Item) SetLocal(local bool)

func (*Item) SetOffline

func (i *Item) SetOffline()

func (*Item) SetOnline

func (i *Item) SetOnline()

func (*Item) SetSend added in v0.14.7

func (i *Item) SetSend(send bool)

func (*Item) String

func (i *Item) String() string

func (*Item) ToWeb

func (i *Item) ToWeb() *WebUnit

func (*Item) Update

func (i *Item) Update(msg *cot.CotMessage)

type LocationDTO added in v0.20.0

type LocationDTO struct {
	Lat float64 `json:"lat"`
	Lon float64 `json:"lon"`
}

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 MissionDetailsDTO struct {
	Type        string       `json:"type"`
	Callsign    string       `json:"callsign"`
	Title       string       `json:"title,omitempty"`
	IconsetPath string       `json:"iconsetPath"`
	Color       string       `json:"color"`
	Location    *LocationDTO `json:"location,omitempty"`
}

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

type MissionRoleDTO struct {
	Type        string   `json:"type"`
	Permissions []string `json:"permissions"`
}

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) BeforeSave added in v0.20.0

func (p *Point) BeforeSave(_ *gorm.DB) error

func (*Point) GetEvent added in v0.20.0

func (p *Point) GetEvent() *cotproto.CotEvent

func (*Point) String added in v0.20.0

func (p *Point) String() string

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 NewPos added in v0.12.5

func NewPos(lat, lon float64) *Pos

func NewPosFull added in v0.17.0

func NewPosFull(lat, lon, alt, speed, track float64) *Pos

func (*Pos) GetAlt added in v0.17.0

func (p *Pos) GetAlt() float64

func (*Pos) GetCe added in v0.17.0

func (p *Pos) GetCe() float64

func (*Pos) GetCoord added in v0.17.0

func (p *Pos) GetCoord() (float64, float64)

func (*Pos) GetLat added in v0.17.0

func (p *Pos) GetLat() float64

func (*Pos) GetLon added in v0.17.0

func (p *Pos) GetLon() float64

func (*Pos) GetSpeed added in v0.17.0

func (p *Pos) GetSpeed() float64

func (*Pos) GetTrack added in v0.17.0

func (p *Pos) GetTrack() float64

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 ProfileDTO struct {
	Login    string            `json:"login"`
	UID      string            `json:"uid"`
	Callsign string            `json:"callsign,omitempty"`
	Team     string            `json:"team,omitempty"`
	Role     string            `json:"role,omitempty"`
	CotType  string            `json:"cot_type,omitempty"`
	Options  map[string]string `json:"options,omitempty"`
}

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 ProfilePutDTO struct {
	Callsign string            `json:"callsign,omitempty"`
	Team     string            `json:"team,omitempty"`
	Role     string            `json:"role,omitempty"`
	CotType  string            `json:"cot_type,omitempty"`
	Options  map[string]string `json:"options,omitempty"`
}

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:"-"`
}

func (*Resource) AfterFind added in v0.20.0

func (c *Resource) AfterFind(_ *gorm.DB) error

func (*Resource) BeforeSave added in v0.20.0

func (c *Resource) BeforeSave(_ *gorm.DB) error

func (*Resource) String added in v0.20.0

func (c *Resource) String() string

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 Subscription struct {
	ID        uint      `gorm:"primaryKey"`
	CreatedAt time.Time `gorm:"type:timestamp"`
	MissionID uint      `gorm:"index;not null"`
	ClientUID string    `gorm:"index;not null;size:255"`
	Username  string    `gorm:"size:255"`
	Role      string    `gorm:"size:255"`
}

type VideoConnections added in v0.12.3

type VideoConnections struct {
	XMLName xml.Name   `xml:"videoConnections"`
	Feeds   []*FeedDTO `xml:"feed"`
}

type VideoConnections2 added in v0.14.0

type VideoConnections2 struct {
	XMLName xml.Name    `json:"-"`
	Feeds   []*Feed2DTO `json:"feeds" xml:"feed"`
}

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

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL