mount

package
v0.5.3 Latest Latest
Warning

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

Go to latest
Published: Nov 9, 2026 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Overview

Package mount is how a host names a cloud folder for a session to mount: the binding, its credential, and the parameter names providers read.

Index

Constants

View Source
const (
	ProviderGoogleDrive = "gdrive"
	ProviderMicrosoft   = "msgraph"
	ParamFolderID       = "folderId"
	ParamName           = "name"
	ParamDriveID        = "driveId"
	ParamItemID         = "itemId"
	ParamSiteID         = "siteId"
	// ParamAccount selects a Microsoft account kind on a bind ("organization" or "personal").
	ParamAccount = "account"
)

ProviderGoogleDrive is the bind kind for Drive. ProviderMicrosoft is the bind kind for OneDrive and SharePoint libraries.

View Source
const WorkspacePoint = "/workspace"

WorkspacePoint is the only top-level mount. Backends live at /workspace/<name> via Tree(At(...)).

Variables

View Source
var ErrInvalidBinding = errors.New("mount: invalid binding")

ErrInvalidBinding is a binding or alias that Validate or ValidAlias rejects.

Functions

func ValidAlias

func ValidAlias(alias string) error

ValidAlias checks that alias is one path segment and not a name the workspace keeps for itself (work, skills, workspace).

Types

type Binding

type Binding struct {
	Provider string            `json:"provider"`
	Point    string            `json:"point,omitempty"`
	Auth     Credential        `json:"auth,omitempty"`
	Params   map[string]string `json:"params,omitempty"`
	Writable bool              `json:"writable,omitempty"`
}

Binding is one user-owned cloud folder under /workspace/<alias>. Alias is params["name"] or a leftover single-segment Point (not /workspace). Provider is the bind kind (gdrive, msgraph). Writable is opt-in; the Go zero value stays read-only.

func (Binding) Alias

func (b Binding) Alias() string

Alias is the binding's folder name under /workspace: its name parameter, else its absolute point without the leading "/" ("/contracts" is contracts). It is "" when the binding has neither.

func (Binding) Validate

func (b Binding) Validate() error

Validate checks that the binding has a provider, an access token and a valid alias. The provider checks its own parameters (folderId, siteId) when it opens.

type Credential

type Credential struct {
	Token     string    `json:"token,omitempty"`
	ExpiresAt time.Time `json:"expiresAt,omitempty"`
}

Credential is a session-scoped access token. Never store this on MountSpec or in a checkpoint / session.Store. Work-item payloads (Prompt/Resume) may carry it; backends must not persist it with recipes. Workflow history must not contain Token; the runtime keeps it in SecretStorage.

Jump to

Keyboard shortcuts

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