file

package
v0.0.0-...-795d1ad Latest Latest
Warning

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

Go to latest
Published: Sep 14, 2021 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BatchSaveRequest

type BatchSaveRequest struct {
	Files []Record `json:"files"`
}

type BatchSaveResponse

type BatchSaveResponse struct {
}

type DeleteRequest

type DeleteRequest struct {
	// Path to the file
	Path string `json:"path"`
	// The project name
	Project string `json:"project"`
}

type DeleteResponse

type DeleteResponse struct {
}

type FileService

type FileService struct {
	// contains filtered or unexported fields
}

func NewFileService

func NewFileService(token string) *FileService

func (*FileService) Delete

func (t *FileService) Delete(request *DeleteRequest) (*DeleteResponse, error)

Delete a file by project name/path

func (*FileService) List

func (t *FileService) List(request *ListRequest) (*ListResponse, error)

List files by their project and optionally a path.

func (*FileService) Read

func (t *FileService) Read(request *ReadRequest) (*ReadResponse, error)

Read a file by path

func (*FileService) Save

func (t *FileService) Save(request *SaveRequest) (*SaveResponse, error)

Save a file

type ListRequest

type ListRequest struct {
	// Defaults to '/', ie. lists all files in a project.
	// Supply path to a folder if you want to list
	// files inside that folder
	// eg. '/docs'
	Path string `json:"path"`
	// Project, required for listing.
	Project string `json:"project"`
}

type ListResponse

type ListResponse struct {
	Files []Record `json:"files"`
}

type ReadRequest

type ReadRequest struct {
	// Path to the file
	Path string `json:"path"`
	// Project name
	Project string `json:"project"`
}

type ReadResponse

type ReadResponse struct {
	// Returns the file
	File *Record `json:"file"`
}

type Record

type Record struct {
	// File contents
	Content string `json:"content"`
	// Time the file was created e.g 2021-05-20T13:37:21Z
	Created string `json:"created"`
	// Any other associated metadata as a map of key-value pairs
	Metadata map[string]string `json:"metadata"`
	// Path to file or folder eg. '/documents/text-files/file.txt'.
	Path string `json:"path"`
	// A custom project to group files
	// eg. file-of-mywebsite.com
	Project string `json:"project"`
	// Time the file was updated e.g 2021-05-20T13:37:21Z
	Updated string `json:"updated"`
}

type SaveRequest

type SaveRequest struct {
	File *Record `json:"file"`
}

type SaveResponse

type SaveResponse struct {
}

Directories

Path Synopsis
examples

Jump to

Keyboard shortcuts

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