files

package
v1.1.1 Latest Latest
Warning

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

Go to latest
Published: Oct 18, 2023 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateFormFile

func CreateFormFile(w *multipart.Writer, fieldname string, filename string, contentType string) (io.Writer, error)

CreateFormFile -

func GetFileContentType

func GetFileContentType(out *os.File) (string, error)

GetFileContentType -

Types

type Client

type Client struct {
	API checkout.HTTPClient
}

Client ...

func NewClient

func NewClient(config checkout.Config) *Client

NewClient ...

func (*Client) GetFile

func (c *Client) GetFile(fileID string) (*Response, error)

GetFile -

func (*Client) UploadFile

func (c *Client) UploadFile(file *FileUpload) (*Response, error)

UploadFile -

type File

type File struct {
	ID         string                 `json:"id,omitempty"`
	Filename   string                 `json:"filename,omitempty"`
	Purpose    string                 `json:"purpose,omitempty"`
	Size       uint64                 `json:"size,omitempty"`
	UploadedOn time.Time              `json:"uploaded_on,omitempty"`
	Links      map[string]common.Link `json:"_links"`
}

File -

type FileUpload

type FileUpload struct {
	FileReader *os.File
	File       *string
	Purpose    *string
}

FileUpload -

func (*FileUpload) GetBody

func (f *FileUpload) GetBody() (*bytes.Buffer, string, error)

GetBody -

type QueryParameter

type QueryParameter struct {
}

QueryParameter -

type Request

type Request struct {
	*QueryParameter
	*FileUpload
}

Request -

type Response

type Response struct {
	StatusResponse *checkout.StatusResponse `json:"api_response,omitempty"`
	File           *File                    `json:"file,omitempty"`
}

Response -

Jump to

Keyboard shortcuts

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