Help us shape the future of Go! Take the 2026 Go Developer Survey

fileexplorer

package
v0.5.5 Latest Latest
Warning

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

Go to latest
Published: Aug 5, 2026 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ActionList = "list"
	ActionStat = "stat"

	StatusQueued    = "queued"
	StatusCompleted = "completed"
	StatusError     = "error"
	StatusExpired   = "expired"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Entry

type Entry struct {
	Path      string `json:"path"`
	Filename  string `json:"filename"`
	Directory string `json:"directory"`
	Type      string `json:"type"`
	Size      int64  `json:"size,omitempty"`
	Mode      string `json:"mode,omitempty"`
	UID       string `json:"uid,omitempty"`
	GID       string `json:"gid,omitempty"`
	MTime     int64  `json:"mtime,omitempty"`
	ATime     int64  `json:"atime,omitempty"`
	CTime     int64  `json:"ctime,omitempty"`
}

type Manager

type Manager struct {
	DB      *gorm.DB
	Queries *queries.Queries
}

func NewManager

func NewManager(db *gorm.DB, queryManager *queries.Queries) *Manager

func (*Manager) CloseSession

func (m *Manager) CloseSession(sessionID uint) error

func (*Manager) CreateSession

func (m *Manager) CreateSession(env environments.TLSEnvironment, node nodes.OsqueryNode, creator string) (Session, error)

func (*Manager) GetRequest

func (m *Manager) GetRequest(sessionID, requestID uint) (Request, error)

func (*Manager) GetSession

func (m *Manager) GetSession(sessionID uint) (Session, error)

func (*Manager) ListDirectory

func (m *Manager) ListDirectory(sessionID uint, target string, timeout time.Duration) (Request, error)

func (*Manager) RefreshRequestStatus

func (m *Manager) RefreshRequestStatus(requestID uint) (Request, error)

func (*Manager) RequestResults

func (m *Manager) RequestResults(requestID uint) ([]Entry, error)

func (*Manager) StatPath

func (m *Manager) StatPath(sessionID uint, target string, timeout time.Duration) (Request, error)

func (*Manager) TouchSession

func (m *Manager) TouchSession(sessionID uint) (Session, error)

type Request

type Request struct {
	ID                   uint           `gorm:"primarykey" json:"id"`
	CreatedAt            time.Time      `json:"created_at"`
	UpdatedAt            time.Time      `json:"updated_at"`
	DeletedAt            gorm.DeletedAt `gorm:"index" json:"-"`
	SessionID            uint           `gorm:"not null;index" json:"session_id"`
	Action               string         `gorm:"not null;index" json:"action"`
	Path                 string         `gorm:"not null" json:"path"`
	TranslatedSQL        string         `json:"translated_sql"`
	DistributedQueryName string         `gorm:"index" json:"distributed_query_name,omitempty"`
	Status               string         `gorm:"not null;index" json:"status"`
	Error                string         `json:"error,omitempty"`
	CompletedAt          *time.Time     `json:"completed_at,omitempty"`
	ExpiredAt            *time.Time     `json:"expired_at,omitempty"`
}

func (Request) TableName

func (Request) TableName() string

type Session

type Session struct {
	ID            uint           `gorm:"primarykey" json:"id"`
	CreatedAt     time.Time      `json:"created_at"`
	UpdatedAt     time.Time      `json:"updated_at"`
	DeletedAt     gorm.DeletedAt `gorm:"index" json:"-"`
	EnvironmentID uint           `gorm:"not null;index" json:"environment_id"`
	NodeID        uint           `gorm:"not null;index" json:"node_id"`
	NodeUUID      string         `gorm:"not null;index" json:"node_uuid"`
	Creator       string         `gorm:"not null;index" json:"creator"`
	Platform      string         `json:"platform"`
	Root          string         `gorm:"not null" json:"root"`
	Active        bool           `gorm:"not null;default:true" json:"active"`
	ClosedAt      *time.Time     `json:"closed_at,omitempty"`
}

func (Session) TableName

func (Session) TableName() string

Jump to

Keyboard shortcuts

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