file

package
v0.3.4 Latest Latest
Warning

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

Go to latest
Published: May 4, 2026 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateFileSchema

func CreateFileSchema() *jsonschema.Schema

func GetFile

func GetFile(ctx context.Context, req *mcp.CallToolRequest, params *GetFileParams, authKeeper auth.AuthKeeper) (*mcp.CallToolResult, any, error)

reads a file with the privileges of the systemd service

Types

type FileMetadata

type FileMetadata struct {
	Name    string `json:"name"`
	Size    int64  `json:"size"`
	Mode    string `json:"mode"`
	Owner   string `json:"owner"`
	Group   string `json:"group"`
	ModTime string `json:"mod_time"`
	ACLs    string `json:"acls,omitempty"`
	IsDir   bool   `json:"is_dir"`
}

type GetFileParams

type GetFileParams struct {
	Path        string `json:"path" jsonschema:"Absolute path to the file"`
	ShowContent bool   `json:"show_content,omitempty" jsonschema:"Whether to show file content. Defaults to false."`
	Offset      int    `json:"offset,omitempty" jsonschema:"Line offset for pagination. Defaults to 0."`
	Limit       int    `json:"limit,omitempty" jsonschema:"Line limit for pagination. Defaults to 1000."`
}

type GetFileResult

type GetFileResult struct {
	Metadata   *FileMetadata  `json:"metadata"`
	Entries    []FileMetadata `json:"entries,omitempty"`
	Content    string         `json:"content,omitempty"`
	TotalLines int            `json:"total_lines,omitempty"`
	Offset     int            `json:"offset,omitempty"`
	Limit      int            `json:"limit,omitempty"`
}

Jump to

Keyboard shortcuts

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