Documentation ¶
Index ¶
- Constants
- type Attributes
- type Capabilities
- type IPAddresses
- type Job
- type JobClientTags
- type JobResult
- type Measurement
- type MultiJob
- type MultiJobResult
- type MultiJobSummary
- type NetBytes
- type NetworkCard
- type Remote
- func (r *Remote) EqualACL(acl *string) bool
- func (r *Remote) Equals(other *Remote) bool
- func (r *Remote) GetTunnelDomains() (subdomain string, basedomain string, err error)
- func (r *Remote) HasSubdomainTunnel() bool
- func (r *Remote) IsLocalSpecified() bool
- func (r *Remote) IsProtocol(other string) bool
- func (r *Remote) Local() string
- func (r *Remote) NewDownstreamProxyURL(subdomain string, basedomain string, port string) (proxyURL string)
- func (r *Remote) Remote() string
- func (r Remote) String() string
- type UpdateSummary
- type UpdatesStatus
- type UploadResponse
- type UploadResponseShort
- type UploadedFile
- func (uf *UploadedFile) FromBytes(rawData []byte) error
- func (uf *UploadedFile) FromMultipartRequest(req *http.Request) error
- func (uf *UploadedFile) ToBytes() (data []byte, err error)
- func (uf UploadedFile) Validate() error
- func (uf UploadedFile) ValidateDestinationPath(globPatters []string, log *logger.Logger) error
Constants ¶
View Source
const ( JobStatusSuccessful = "successful" JobStatusRunning = "running" JobStatusFailed = "failed" JobStatusUnknown = "unknown" ChannelStdout = "stdout" ChannelStderr = "stderr" )
View Source
const ( ZeroHost = "0.0.0.0" LocalHost = "127.0.0.1" ProtocolTCP = "tcp" ProtocolUDP = "udp" ProtocolTCPUDP = "tcp+udp" )
View Source
const (
IDKey = "id"
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Attributes ¶
type Capabilities ¶
type IPAddresses ¶
type Job ¶
type Job struct { JID string `json:"jid"` Status string `json:"status"` FinishedAt *time.Time `json:"finished_at"` ClientID string `json:"client_id"` ClientName string `json:"client_name"` Command string `json:"command"` Cwd string `json:"cwd"` Interpreter string `json:"interpreter"` PID *int `json:"pid"` StartedAt time.Time `json:"started_at"` CreatedBy string `json:"created_by"` TimeoutSec int `json:"timeout_sec"` MultiJobID *string `json:"multi_job_id"` ScheduleID *string `json:"schedule_id"` Error string `json:"error"` Result *JobResult `json:"result"` IsSudo bool `json:"is_sudo"` IsScript bool `json:"is_script"` StreamResult bool `json:"stream_result"` }
type JobClientTags ¶
func (*JobClientTags) String ¶
func (jct *JobClientTags) String() string
TODO: add some unit tests. not high priority but good to get done.
type Measurement ¶
type Measurement struct { ClientID string `json:"client_id" db:"client_id"` Timestamp time.Time `json:"timestamp" db:"timestamp"` CPUUsagePercent float64 `json:"cpu_usage_percent" db:"cpu_usage_percent"` MemoryUsagePercent float64 `json:"memory_usage_percent" db:"memory_usage_percent"` IoUsagePercent float64 `json:"io_usage_percent" db:"io_usage_percent"` Processes string `json:"processes" db:"processes"` Mountpoints string `json:"mountpoints" db:"mountpoints"` NetLan *NetBytes `json:"net_lan" db:"net_lan"` NetWan *NetBytes `json:"net_wan" db:"net_wan"` }
type MultiJob ¶
type MultiJob struct { MultiJobSummary ClientIDs []string `json:"client_ids"` GroupIDs []string `json:"group_ids"` ClientTags *JobClientTags `json:"tags"` Command string `json:"command"` Cwd string `json:"cwd"` Interpreter string `json:"interpreter"` TimeoutSec int `json:"timeout_sec"` Concurrent bool `json:"concurrent"` AbortOnErr bool `json:"abort_on_err"` Jobs []*Job `json:"jobs"` IsSudo bool `json:"is_sudo"` IsScript bool `json:"is_script"` }
TODO: check that ClientTags is populated where required
type MultiJobResult ¶
type MultiJobSummary ¶
type NetworkCard ¶
func DecodeCard ¶
func DecodeCard(sCard []string) (*NetworkCard, error)
type Remote ¶
type Remote struct { Name string `json:"name"` Protocol string `json:"protocol"` LocalHost string `json:"lhost"` LocalPort string `json:"lport"` LocalPortRandom bool `json:"lport_random"` Owner string `json:"owner"` RemoteHost string `json:"rhost"` RemotePort string `json:"rport"` Scheme *string `json:"scheme"` ACL *string `json:"acl"` // string representation of Tunnel.TunnelACL field IdleTimeoutMinutes int `json:"idle_timeout_minutes"` AutoClose time.Duration `json:"auto_close"` HTTPProxy bool `json:"http_proxy"` HostHeader string `json:"host_header"` AuthUser string `json:"auth_user"` AuthPassword string `json:"auth_password"` TunnelURL string `json:"tunnel_url"` }
TODO(m-terel): Remote should be only used for parsing command args and URL query params. Current Remote is kind of a Tunnel model. Refactor to use separate models for representation and business logic.
func (*Remote) GetTunnelDomains ¶
func (*Remote) HasSubdomainTunnel ¶
func (*Remote) IsLocalSpecified ¶
func (*Remote) IsProtocol ¶
IsProtocol compares remote's protocol with other, it returns true when tcp+udp is compared against either tcp or udp
func (*Remote) NewDownstreamProxyURL ¶
type UpdateSummary ¶
type UpdatesStatus ¶
type UpdatesStatus struct { Refreshed time.Time `json:"refreshed"` UpdatesAvailable int `json:"updates_available"` SecurityUpdatesAvailable int `json:"security_updates_available"` UpdateSummaries []UpdateSummary `json:"update_summaries"` RebootPending bool `json:"reboot_pending"` Error string `json:"error,omitempty"` Hint string `json:"hint,omitempty"` }
type UploadResponse ¶
type UploadResponse struct { UploadResponseShort Message string `json:"message"` Status string `json:"status"` }
type UploadResponseShort ¶
type UploadedFile ¶
type UploadedFile struct { ID string SourceFilePath string DestinationPath string DestinationFileMode os.FileMode DestinationFileOwner string DestinationFileGroup string ForceWrite bool Sync bool Md5Checksum []byte }
func (*UploadedFile) FromBytes ¶
func (uf *UploadedFile) FromBytes(rawData []byte) error
func (*UploadedFile) FromMultipartRequest ¶
func (uf *UploadedFile) FromMultipartRequest(req *http.Request) error
func (*UploadedFile) ToBytes ¶
func (uf *UploadedFile) ToBytes() (data []byte, err error)
func (UploadedFile) Validate ¶
func (uf UploadedFile) Validate() error
func (UploadedFile) ValidateDestinationPath ¶
func (uf UploadedFile) ValidateDestinationPath(globPatters []string, log *logger.Logger) error
Click to show internal directories.
Click to hide internal directories.