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

api

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Feb 7, 2025 License: MIT Imports: 2 Imported by: 0

Documentation

Overview

Package api provides types used by the Quatrix API.

Index

Constants

View Source
const OverwriteMode = "overwrite"

OverwriteMode is a conflict resolve mode during copy or move. Files with conflicting names will be overwritten

Variables

This section is empty.

Functions

This section is empty.

Types

type CreateDirParams

type CreateDirParams struct {
	Target  string `json:"target,omitempty"`
	Name    string `json:"name"`
	Resolve bool   `json:"resolve"`
}

CreateDirParams is the request to create a directory

type DeleteParams

type DeleteParams struct {
	IDs               []string `json:"ids"`
	DeletePermanently bool     `json:"delete_permanently"`
}

DeleteParams is the request to delete object

type DownloadLinkResponse

type DownloadLinkResponse struct {
	ID string `json:"id"`
}

DownloadLinkResponse is the response to download-link request

type File

type File struct {
	ID         string   `json:"id"`
	Created    JSONTime `json:"created"`
	Modified   JSONTime `json:"modified"`
	Name       string   `json:"name"`
	ParentID   string   `json:"parent_id"`
	Size       int64    `json:"size"`
	ModifiedMS JSONTime `json:"modified_ms"`
	Type       string   `json:"type"`
	Operations int      `json:"operations"`
	SubType    string   `json:"sub_type"`
	Content    []File   `json:"content"`
}

File represent metadata about object in Quatrix (file or directory)

func (*File) IsDir

func (f *File) IsDir() bool

IsDir returns true if object is a directory false otherwise

func (*File) IsFile

func (f *File) IsFile() bool

IsFile returns true if object is a file false otherwise

func (*File) IsProjectFolder

func (f *File) IsProjectFolder() bool

IsProjectFolder returns true if object is a project folder false otherwise

type FileCopyMoveOneParams

type FileCopyMoveOneParams struct {
	ID          string   `json:"file_id"`
	Target      string   `json:"target_id"`
	Name        string   `json:"name"`
	MTime       JSONTime `json:"mtime"`
	Resolve     bool     `json:"resolve"`
	ResolveMode string   `json:"resolve_mode"`
}

FileCopyMoveOneParams is the request to do server-side copy and move can be used for file or directory

type FileInfo

type FileInfo struct {
	FileID   string `json:"file_id"`
	ParentID string `json:"parent_id"`
	Src      string `json:"src"`
	Type     string `json:"type"`
}

FileInfo is the response to get object's (file or directory) info

func (*FileInfo) IsDir

func (fi *FileInfo) IsDir() bool

IsDir returns true if object is a directory false otherwise

func (*FileInfo) IsFile

func (fi *FileInfo) IsFile() bool

IsFile returns true if object is a file false otherwise

type FileInfoParams

type FileInfoParams struct {
	ParentID string `json:"parent_id,omitempty"`
	Path     string `json:"path"`
}

FileInfoParams is the request to get object's (file or directory) info

type FileModifyParams

type FileModifyParams struct {
	ID       string `json:"id"`
	Truncate int64  `json:"truncate"`
}

FileModifyParams is the request to get modify file link

type IDList

type IDList struct {
	IDs []string `json:"ids"`
}

IDList is a general object that contains list of ids

type JSONTime

type JSONTime time.Time

JSONTime provides methods to marshal/unmarshal time.Time as Unix time

func (JSONTime) MarshalJSON

func (u JSONTime) MarshalJSON() ([]byte, error)

MarshalJSON returns time representation in Unix time

func (JSONTime) String

func (u JSONTime) String() string

String returns Unix time representation of time as string

func (*JSONTime) UnmarshalJSON

func (u *JSONTime) UnmarshalJSON(data []byte) error

UnmarshalJSON sets time from Unix time representation

type ProfileInfo

type ProfileInfo struct {
	UserUsed  int64 `json:"user_used"`
	UserLimit int64 `json:"user_limit"`
	AccUsed   int64 `json:"acc_used"`
	AccLimit  int64 `json:"acc_limit"`
}

ProfileInfo is a profile info about quota

type SetMTimeParams

type SetMTimeParams struct {
	ID    string   `json:"id,omitempty"`
	MTime JSONTime `json:"mtime"`
}

SetMTimeParams is the request to set modification time for object

type UploadFinalizeResponse

type UploadFinalizeResponse struct {
	FileID   string `json:"id"`
	ParentID string `json:"parent_id"`
	Modified int64  `json:"modified"`
	FileSize int64  `json:"size"`
}

UploadFinalizeResponse is the response to finalize file method

type UploadLinkParams

type UploadLinkParams struct {
	Name     string `json:"name"`
	ParentID string `json:"parent_id"`
	Resolve  bool   `json:"resolve"`
}

UploadLinkParams is the request to get upload-link

type UploadLinkResponse

type UploadLinkResponse struct {
	Name      string `json:"name"`
	FileID    string `json:"file_id"`
	ParentID  string `json:"parent_id"`
	UploadKey string `json:"upload_key"`
}

UploadLinkResponse is the response to upload-link request

Jump to

Keyboard shortcuts

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