analytics

package
v0.0.0-...-5383ad1 Latest Latest
Warning

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

Go to latest
Published: May 9, 2022 License: Unlicense Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func StringIncludes

func StringIncludes(check string, shouldInclude []string) bool

returns true if empty list provided

func StructToMap

func StructToMap(obj interface{}) (map[string]interface{}, error)

func WriteSSHEvents

func WriteSSHEvents(sshMonitor *SSHMonitor, analytics Analytics, userID string, workspace *entity.Workspace) error

Types

type Analytics

type Analytics interface {
	TrackUserEvent(eventName EventName, userID string, properties Properties) error
}

type EventName

type EventName string
const (
	SSHConnections  EventName = "SSH Connections"
	StopSSHSession  EventName = "All SSH Session Stop"
	StartSSHSession EventName = "All SSH Session Start"
)

type Properties

type Properties map[string]interface{}

type SSData

type SSData struct {
	NetID            string `json:"netId"`
	State            string `json:"state"`
	RecvQ            string `json:"recvQ"`
	SendQ            string `json:"sendvQ"`
	LocalAddressPort string `json:"localAddressPort"`
	PeerAddressPort  string `json:"peerAddressPort"`
}

func RowStrToSSRow

func RowStrToSSRow(row string) SSData

type SSHAnalytics

type SSHAnalytics struct {
	SSHMonitor *SSHMonitor
	Analytics  Analytics
	Store      SSHAnalyticsStore
	// contains filtered or unexported fields
}

func (SSHAnalytics) Configure

func (s SSHAnalytics) Configure() error

func (*SSHAnalytics) DoOnSSHChange

func (s *SSHAnalytics) DoOnSSHChange(action func() error) error

func (*SSHAnalytics) WriteSSHEvents

func (s *SSHAnalytics) WriteSSHEvents() error

type SSHAnalyticsOnChangeTask

type SSHAnalyticsOnChangeTask struct {
	SSHAnalytics
}

func (SSHAnalyticsOnChangeTask) GetTaskInterval

func (s SSHAnalyticsOnChangeTask) GetTaskInterval() string

func (*SSHAnalyticsOnChangeTask) Run

type SSHAnalyticsSSHPing

type SSHAnalyticsSSHPing struct {
	SSHAnalytics
}

func (SSHAnalyticsSSHPing) GetTaskInterval

func (s SSHAnalyticsSSHPing) GetTaskInterval() string

func (*SSHAnalyticsSSHPing) Run

func (s *SSHAnalyticsSSHPing) Run() error

type SSHAnalyticsStore

type SSHAnalyticsStore interface {
	GetCurrentUserID() (string, error)
	GetCurrentWorkspaceID() (string, error)
	GetWorkspace(workspaceID string) (*entity.Workspace, error)
}

type SSHMonitor

type SSHMonitor struct {
	// contains filtered or unexported fields
}

func NewSSHMonitor

func NewSSHMonitor() *SSHMonitor

func (SSHMonitor) GetAllConnections

func (c SSHMonitor) GetAllConnections(include ...string) ([]string, error)

func (SSHMonitor) GetSSHConnections

func (c SSHMonitor) GetSSHConnections() ([]SSData, error)

func (*SSHMonitor) GetSSHSessionEvents

func (c *SSHMonitor) GetSSHSessionEvents() (EventName, error)

type SegmentClient

type SegmentClient struct {
	Client analytics.Client
}

func NewSegmentClient

func NewSegmentClient(writeAPIKey string) SegmentClient

func (SegmentClient) TrackUserEvent

func (s SegmentClient) TrackUserEvent(eventName EventName, userID string, properties Properties) error

func (SegmentClient) TrackUserWorkspaceEvent

func (s SegmentClient) TrackUserWorkspaceEvent(eventName EventName, userID string, workspace *entity.Workspace, extraProps Properties) error

Jump to

Keyboard shortcuts

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