gokapi

package
v0.24.0 Latest Latest
Warning

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

Go to latest
Published: Aug 26, 2024 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type GokapiClient

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

func New

func New(host string, token string) *GokapiClient

func (*GokapiClient) GetDownloadUrl

func (c *GokapiClient) GetDownloadUrl(f GokapiFile) string

func (*GokapiClient) ListFiles

func (c *GokapiClient) ListFiles() ([]GokapiFile, error)

func (*GokapiClient) UploadBytes added in v0.18.1

func (c *GokapiClient) UploadBytes(data []byte, opts *UploadOptions) (GokapiFile, error)

func (*GokapiClient) UploadFile

func (c *GokapiClient) UploadFile(filePath string, opts *UploadOptions) (GokapiFile, error)

type GokapiFile

type GokapiFile struct {
	ID                           string `json:"Id"`
	Name                         string `json:"Name"`
	Size                         string `json:"Size"`
	HotlinkId                    string `json:"HotlinkId"`
	ContentType                  string `json:"ContentType"`
	ExpireAt                     int64  `json:"ExpireAt"`
	SizeBytes                    int64  `json:"SizeBytes"`
	ExpireAtString               string `json:"ExpireAtString"`
	DownloadsRemaining           int    `json:"DownloadsRemaining"`
	DownloadCount                int    `json:"DownloadCount"`
	UnlimitedDownloads           bool   `json:"UnlimitedDownloads"`
	UnlimitedTime                bool   `json:"UnlimitedTime"`
	RequiresClientSideDecryption bool   `json:"RequiresClientSideDecryption"`
	IsEncrypted                  bool   `json:"IsEncrypted"`
	IsPasswordProtected          bool   `json:"IsPasswordProtected"`
	IsSavedOnLocalStorage        bool   `json:"IsSavedOnLocalStorage"`
}

type UploadOptions

type UploadOptions struct {
	AllowedDownloads int
	ExpiryDays       int
	Password         string
	FilenameOverride string
}

Jump to

Keyboard shortcuts

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