api

package
v1.74.0 Latest Latest
Warning

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

Go to latest
Published: Feb 20, 2026 License: MIT Imports: 3 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package api has type definitions for drime

Converted from the API docs with help from https://mholt.github.io/json-to-go/

Index

Constants

View Source
const (
	ItemTypeFolder = "folder"
)

Types of things in Item

Variables

This section is empty.

Functions

This section is empty.

Types

type CompletedPart

type CompletedPart struct {
	ETag       string `json:"ETag"`
	PartNumber int32  `json:"PartNumber"`
}

CompletedPart Type for completed parts when making a multipart upload.

type CopyRequest

type CopyRequest struct {
	EntryIDs      []string `json:"entryIds"`
	DestinationID string   `json:"destinationId"`
}

CopyRequest is the input to /file-entries/duplicate

type CopyResponse

type CopyResponse struct {
	Status  string `json:"status"`
	Entries []Item `json:"entries"`
}

CopyResponse is returned by POST /file-entries/duplicate

type CreateFolderRequest

type CreateFolderRequest struct {
	Name     string      `json:"name"`
	ParentID json.Number `json:"parentId,omitempty"`
}

CreateFolderRequest for a folder

type CreateFolderResponse

type CreateFolderResponse struct {
	Status string `json:"status"`
	Folder Item   `json:"folder"`
}

CreateFolderResponse for a folder

type DeleteRequest

type DeleteRequest struct {
	EntryIDs      []string `json:"entryIds"`
	DeleteForever bool     `json:"deleteForever"`
}

DeleteRequest is the input to DELETE /file-entries

type DeleteResponse

type DeleteResponse struct {
	Status  string            `json:"status"`
	Message string            `json:"message"`
	Errors  map[string]string `json:"errors"`
}

DeleteResponse is the input to DELETE /file-entries

type Error

type Error struct {
	Message string `json:"message"`
}

Error is returned from drime when things go wrong

func (Error) Error

func (e Error) Error() string

Error returns a string for the error and satisfies the error interface

type Item

type Item struct {
	ID           json.Number `json:"id"`
	Name         string      `json:"name"`
	Description  any         `json:"description"`
	FileName     string      `json:"file_name"`
	Mime         string      `json:"mime"`
	Color        any         `json:"color"`
	Backup       bool        `json:"backup"`
	Tracked      int         `json:"tracked"`
	FileSize     int64       `json:"file_size"`
	UserID       json.Number `json:"user_id"`
	ParentID     json.Number `json:"parent_id"`
	CreatedAt    time.Time   `json:"created_at"`
	UpdatedAt    time.Time   `json:"updated_at"`
	DeletedAt    any         `json:"deleted_at"`
	IsDeleted    int         `json:"is_deleted"`
	Path         string      `json:"path"`
	DiskPrefix   any         `json:"disk_prefix"`
	Type         string      `json:"type"`
	Extension    any         `json:"extension"`
	FileHash     any         `json:"file_hash"`
	Public       bool        `json:"public"`
	Thumbnail    bool        `json:"thumbnail"`
	MuxStatus    any         `json:"mux_status"`
	ThumbnailURL any         `json:"thumbnail_url"`
	WorkspaceID  int         `json:"workspace_id"`
	IsEncrypted  int         `json:"is_encrypted"`
	Iv           any         `json:"iv"`
	VaultID      any         `json:"vault_id"`
	OwnerID      int         `json:"owner_id"`
	Hash         string      `json:"hash"`
	URL          string      `json:"url"`
	Users        []User      `json:"users"`
	Tags         []any       `json:"tags"`
	Permissions  Permissions `json:"permissions"`
}

Item describes a folder or a file as returned by /drive/file-entries

type Listing

type Listing struct {
	CurrentPage int    `json:"current_page"`
	Data        []Item `json:"data"`
	From        int    `json:"from"`
	LastPage    int    `json:"last_page"`
	NextPage    int    `json:"next_page"`
	PerPage     int    `json:"per_page"`
	PrevPage    int    `json:"prev_page"`
	To          int    `json:"to"`
	Total       int    `json:"total"`
}

Listing response

type MoveRequest

type MoveRequest struct {
	EntryIDs      []string `json:"entryIds"`
	DestinationID string   `json:"destinationId"`
}

MoveRequest is the input to /file-entries/move

type MoveResponse

type MoveResponse struct {
	Status  string `json:"status"`
	Entries []Item `json:"entries"`
}

MoveResponse is returned by POST /file-entries/move

type MultiPartAbort

type MultiPartAbort struct {
	UploadID string `json:"uploadId"`
	Key      string `json:"key"`
}

MultiPartAbort is the input of POST /s3/multipart/abort

type MultiPartCompleteRequest

type MultiPartCompleteRequest struct {
	UploadID string          `json:"uploadId"`
	Key      string          `json:"key"`
	Parts    []CompletedPart `json:"parts"`
}

MultiPartCompleteRequest is the input to POST /s3/multipart/complete

type MultiPartCompleteResponse

type MultiPartCompleteResponse struct {
	Location string `json:"location"`
}

MultiPartCompleteResponse is the result of POST /s3/multipart/complete

type MultiPartCreateRequest

type MultiPartCreateRequest struct {
	Filename     string      `json:"filename"`
	Mime         string      `json:"mime"`
	Size         int64       `json:"size"`
	Extension    string      `json:"extension"`
	ParentID     json.Number `json:"parent_id"`
	RelativePath string      `json:"relativePath"`
}

MultiPartCreateRequest is the input of POST /s3/multipart/create

type MultiPartCreateResponse

type MultiPartCreateResponse struct {
	UploadID string `json:"uploadId"`
	Key      string `json:"key"`
}

MultiPartCreateResponse is returned by POST /s3/multipart/create

type MultiPartEntriesRequest

type MultiPartEntriesRequest struct {
	ClientMime      string      `json:"clientMime"`
	ClientName      string      `json:"clientName"`
	Filename        string      `json:"filename"`
	Size            int64       `json:"size"`
	ClientExtension string      `json:"clientExtension"`
	ParentID        json.Number `json:"parent_id"`
	RelativePath    string      `json:"relativePath"`
}

MultiPartEntriesRequest is the input to POST /s3/entries

type MultiPartEntriesResponse

type MultiPartEntriesResponse struct {
	FileEntry Item `json:"fileEntry"`
}

MultiPartEntriesResponse is the result of POST /s3/entries

type MultiPartGetURLsRequest

type MultiPartGetURLsRequest struct {
	UploadID    string `json:"uploadId"`
	Key         string `json:"key"`
	PartNumbers []int  `json:"partNumbers"`
}

MultiPartGetURLsRequest is the input of POST /s3/multipart/batch-sign-part-urls

type MultiPartGetURLsResponse

type MultiPartGetURLsResponse struct {
	URLs []struct {
		URL        string `json:"url"`
		PartNumber int32  `json:"partNumber"`
	} `json:"urls"`
}

MultiPartGetURLsResponse is the result of POST /s3/multipart/batch-sign-part-urls

type Permissions

type Permissions struct {
	FilesUpdate   bool `json:"files.update"`
	FilesCreate   bool `json:"files.create"`
	FilesDownload bool `json:"files.download"`
	FilesDelete   bool `json:"files.delete"`
}

Permissions for a file

type SpaceUsageResponse

type SpaceUsageResponse struct {
	Used      int64  `json:"used"`
	Available int64  `json:"available"`
	Status    string `json:"status"`
	SEO       any    `json:"seo"`
}

SpaceUsageResponse is returned by GET /user/space-usage

type UpdateItemRequest

type UpdateItemRequest struct {
	Name        string `json:"name,omitempty"`
	Description string `json:"description,omitempty"`
}

UpdateItemRequest describes the updates to be done to an item for PUT /file-entries/{id}/

type UpdateItemResponse

type UpdateItemResponse struct {
	Status    string `json:"status"`
	FileEntry Item   `json:"fileEntry"`
}

UpdateItemResponse is returned by PUT /file-entries/{id}/

type UploadResponse

type UploadResponse struct {
	Status    string `json:"status"`
	FileEntry Item   `json:"fileEntry"`
}

UploadResponse for a file

type User

type User struct {
	Email            string      `json:"email"`
	ID               json.Number `json:"id"`
	Avatar           string      `json:"avatar"`
	ModelType        string      `json:"model_type"`
	OwnsEntry        bool        `json:"owns_entry"`
	EntryPermissions []any       `json:"entry_permissions"`
	DisplayName      string      `json:"display_name"`
}

User information

Jump to

Keyboard shortcuts

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