file_box

package
v0.0.0-...-6b858f3 Latest Latest
Warning

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

Go to latest
Published: Aug 24, 2020 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

View Source
const (
	FileBoxTypeUnknown FileBoxType = 0

	FileBoxTypeBase64 = 1
	FileBoxTypeUrl    = 2
	FileBoxTypeQRCode = 3
	FileBoxTypeBuffer = 4
	FileBoxTypeFile   = 5
	FileBoxTypeStream = 6
)

Variables

This section is empty.

Functions

This section is empty.

Types

type FileBox

type FileBox struct {
	Name string
	// contains filtered or unexported fields
}

FileBox struct

func FromBase64

func FromBase64(base64 string, name string) *FileBox

func FromFile

func FromFile(path, name string) *FileBox

func FromJSON

func FromJSON(s string) (*FileBox, error)

func FromQRCode

func FromQRCode(qrCode string) *FileBox

func FromUrl

func FromUrl(urlString string, name string, headers http.Header) (*FileBox, error)

func (*FileBox) String

func (fb *FileBox) String() string

String ...

func (*FileBox) ToBase64

func (fb *FileBox) ToBase64() (string, error)

func (*FileBox) ToBytes

func (fb *FileBox) ToBytes() ([]byte, error)

func (*FileBox) ToDataURL

func (fb *FileBox) ToDataURL() (string, error)

func (*FileBox) ToFile

func (fb *FileBox) ToFile(filePath string, overwrite bool) error

func (*FileBox) ToJSON

func (fb *FileBox) ToJSON() (string, error)

func (*FileBox) ToQRCode

func (fb *FileBox) ToQRCode() (string, error)

type FileBoxOptionsBase64

type FileBoxOptionsBase64 struct {
	Base64 string `json:"base64"`
}

type FileBoxOptionsCommon

type FileBoxOptionsCommon struct {
	Name     string                 `json:"Name"`
	Metadata map[string]interface{} `json:"metadata"`
	BoxType  FileBoxType            `json:"boxType"`
}

type FileBoxOptionsQRCode

type FileBoxOptionsQRCode struct {
	QrCode string `json:"qrCode"`
}

type FileBoxOptionsUrl

type FileBoxOptionsUrl struct {
	RemoteUrl string      `json:"remoteUrl"`
	Headers   http.Header `json:"headers"`
}

type FileBoxType

type FileBoxType uint8

func (FileBoxType) String

func (i FileBoxType) String() string

Jump to

Keyboard shortcuts

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