analytics

package
v0.6.41 Latest Latest
Warning

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

Go to latest
Published: Mar 31, 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 SSHAnalyticsStore

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

type SSHAnalyticsTask

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

func (SSHAnalyticsTask) Configure

func (s SSHAnalyticsTask) Configure() error

func (SSHAnalyticsTask) GetTaskSpec

func (s SSHAnalyticsTask) GetTaskSpec() tasks.TaskSpec

func (*SSHAnalyticsTask) Run

func (s *SSHAnalyticsTask) Run() 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