api

package
v0.0.0-...-f4d0149 Latest Latest
Warning

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

Go to latest
Published: Sep 24, 2022 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

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

func New

func New(debug bool, endpoint string) *Client

func (*Client) CryptoGetRoot

func (c *Client) CryptoGetRoot(ctx context.Context, auth string) (*CryptoGetRootResponse, error)

func (*Client) CryptoGetUserKeys

func (c *Client) CryptoGetUserKeys(ctx context.Context, auth string) (*CryptoGetUserKeysResponse, error)

func (*Client) GetDigest

func (c *Client) GetDigest(ctx context.Context) (*GetDigestResponse, error)
func (c *Client) GetFileLink(ctx context.Context, auth string, fileID int) (*GetFileLinkResponse, error)

func (*Client) ListFolder

func (c *Client) ListFolder(ctx context.Context, auth string, folderID int) (*ListFolderResponse, error)

func (*Client) UploadCreate

func (c *Client) UploadCreate(ctx context.Context, auth string) (*UploadCreateResponse, error)

func (*Client) UploadSave

func (c *Client) UploadSave(ctx context.Context, auth string, req *UploadSaveRequest) (*UploadSaveResponse, error)

func (*Client) UploadWrite

func (c *Client) UploadWrite(ctx context.Context, auth string, req *UploadWriteRequest) error

func (*Client) UserInfo

func (c *Client) UserInfo(ctx context.Context, req *UserInfoRequest) (*UserInfoResponse, error)

type CryptoGetRootResponse

type CryptoGetRootResponse struct {
	Metadata *RootMetadata `json:"metadata"`
}

type CryptoGetUserKeysResponse

type CryptoGetUserKeysResponse struct {
	PrivateKey string `json:"privatekey"`
	PublicKey  string `json:"publickey"`
}

type GetDigestResponse

type GetDigestResponse struct {
	Digest  string `json:"digest"`
	Expires string `json:"expires"`
}

type GetFileLinkResponse

type GetFileLinkResponse struct {
	Path    string          `json:"path"`
	DWLTag  string          `json:"dwltag"`
	Size    int             `json:"size"`
	Expires string          `json:"expires"`
	Key     string          `json:"key"`
	Hosts   []string        `json:"hosts"`
	Hash    json.RawMessage `json:"hash"`
}

type ListFolderResponse

type ListFolderResponse struct {
	Key      string    `json:"key"`
	Metadata *Metadata `json:"metadata"`
}

type Metadata

type Metadata struct {
	Name           string          `json:"name"`
	Created        string          `json:"created"`
	IsMine         bool            `json:"ismine"`
	Thumb          bool            `json:"thumb"`
	Modified       string          `json:"modified"`
	Comments       int             `json:"comments"`
	Encrypted      bool            `json:"encrypted"`
	ID             string          `json:"id"`
	IsShared       bool            `json:"isshared"`
	Icon           string          `json:"icon"`
	ParentFolderID int             `json:"parentfolderid"`
	FolderID       int             `json:"folderid"`
	Contents       []*Metadata     `json:"contents"`
	IsFolder       bool            `json:"isfolder"`
	FileID         int             `json:"fileid"`
	Category       int             `json:"category"`
	Size           int             `json:"size"`
	ContentType    string          `json:"contenttype"`
	Hash           json.RawMessage `json:"hash"`
}

type RootMetadata

type RootMetadata struct {
	Name           string `json:"name"`
	Created        string `json:"created"`
	IsMine         bool   `json:"ismine"`
	Thumb          bool   `json:"thumb"`
	Modified       string `json:"modified"`
	Comments       int    `json:"comments"`
	Encrypted      bool   `json:"encrypted"`
	ID             string `json:"id"`
	IsShared       bool   `json:"isshared"`
	Icon           string `json:"icon"`
	IsFolder       bool   `json:"isfolder"`
	ParentFolderID int    `json:"parentfolderid"`
	FolderID       int    `json:"folderid"`
}

type UploadCreateResponse

type UploadCreateResponse struct {
	UploadID int `json:"uploadid"`
}

type UploadSaveRequest

type UploadSaveRequest struct {
	UploadID  int    `url:"uploadid"`
	FolderID  int    `url:"folderid"`
	Name      string `url:"name"`
	Encrypted int    `url:"encrypted"`
	Key       string `url:"key"`
	MTime     int64  `url:"mtime"`
}

type UploadSaveResponse

type UploadSaveResponse struct {
	Metadata Metadata `json:"metadata"`
}

type UploadWriteRequest

type UploadWriteRequest struct {
	UploadID     int    `url:"uploadid"`
	UploadOffset int    `url:"uploadoffset"`
	UploadSize   int    `url:"uploadsize"`
	Data         []byte `url:"-"`
}

type UserInfoRequest

type UserInfoRequest struct {
	GetAuth        string `url:"getauth"`
	Username       string `url:"username"`
	Digest         string `url:"digest"`
	PasswordDigest string `url:"passworddigest"`
}

type UserInfoResponse

type UserInfoResponse struct {
	Auth           string `json:"auth"`
	Email          string `json:"email"`          // address of the user
	EmailVerified  bool   `json:"emailverified"`  // true if the user had verified it's email
	Premium        bool   `json:"premium"`        // true if the user is premium
	PremiumExpires string `json:"premiumexpires"` // date when the premium expires
	Quota          int    `json:"quota"`          // quota in bytes
	UsedQuota      int    `json:"usedquota"`      // used quota in bytes
	Language       string `json:"language"`       // 2-3 characters lowercase languageid
}

Jump to

Keyboard shortcuts

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