Documentation
¶
Overview ¶
Package drive provides an omniskill Skill for Google Drive: reading the comments on a file, and (when explicitly enabled) uploading and updating files.
All Google access goes through gogoogle's driveutil package.
Index ¶
Constants ¶
const ( CodeNotFound = "not_found" CodePermissionDenied = "permission_denied" CodeUnsupportedConversion = "unsupported_conversion" CodePathOutsideRoot = "path_outside_root" CodeWriteDisabled = "write_disabled" CodeFileTooLarge = "file_too_large" CodeInvalidRequest = "invalid_request" CodeAPIError = "api_error" )
Error codes returned by the write tools.
const DefaultMaxUploadBytes int64 = 50 << 20
DefaultMaxUploadBytes is the largest file the write tools will send.
Variables ¶
This section is empty.
Functions ¶
func WriteDisabledError ¶
func WriteDisabledError() error
WriteDisabledError is the error for a write request when write mode is off.
Types ¶
type Option ¶
type Option func(*Skill)
Option configures a Drive skill.
func WithLogger ¶
WithLogger sets the logger that receives the audit record of each write call.
func WithMaxUploadBytes ¶
WithMaxUploadBytes sets the largest file the write tools will send.
type Skill ¶
type Skill struct {
// contains filtered or unexported fields
}
Skill provides Google Drive tools.
func New ¶
New creates a Drive skill with the given authenticated HTTP client. By default it is read-only: it registers no tool that can change Google data.
func NewWithService ¶
NewWithService creates a Drive skill that uses an existing gogoogle service, for callers that build the service themselves (tests use a fake endpoint).
func (*Skill) Description ¶
Description returns what this skill does.
func (*Skill) Init ¶
Init creates the gogoogle Drive service unless one was supplied, and in write mode resolves the upload root, which must be an existing directory.