analytics

package
v0.6.43 Latest Latest
Warning

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

Go to latest
Published: Apr 5, 2022 License: MIT Imports: 10 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
	TrackUserWorkspaceEvent(eventName EventName, userID string, workspace *entity.Workspace, extraProps 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 added in v0.6.43

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

func (SSHAnalytics) Configure added in v0.6.43

func (s SSHAnalytics) Configure() error

func (*SSHAnalytics) DoOnSSHChange added in v0.6.43

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

func (*SSHAnalytics) WriteSSHEvents added in v0.6.43

func (s *SSHAnalytics) WriteSSHEvents() error

type SSHAnalyticsOnChangeTask added in v0.6.43

type SSHAnalyticsOnChangeTask struct {
	SSHAnalytics
}

func (SSHAnalyticsOnChangeTask) GetTaskSpec added in v0.6.43

func (s SSHAnalyticsOnChangeTask) GetTaskSpec() tasks.TaskSpec

func (*SSHAnalyticsOnChangeTask) Run added in v0.6.43

type SSHAnalyticsSSHPing added in v0.6.43

type SSHAnalyticsSSHPing struct {
	SSHAnalytics
}

func (SSHAnalyticsSSHPing) GetTaskSpec added in v0.6.43

func (s SSHAnalyticsSSHPing) GetTaskSpec() tasks.TaskSpec

func (*SSHAnalyticsSSHPing) Run added in v0.6.43

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

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