Documentation ¶
Index ¶
- Variables
- func CheckExpiration(token string) (expired bool, err error)
- func Whoami(token string) (email string, expirationTime time.Time, err error)
- type APIError
- type Box
- type ClientEphemeralfiles
- func (c *ClientEphemeralfiles) Download(uuidFile string, outputfile string) error
- func (c *ClientEphemeralfiles) DownloadEndpoint(uuidFile string) string
- func (c *ClientEphemeralfiles) Fetch() (FileList, error)
- func (c *ClientEphemeralfiles) FilesEndpoint() string
- func (c *ClientEphemeralfiles) GetBoxInfos() (*Box, error)
- func (c *ClientEphemeralfiles) Remove(uuidFileToRemove string) error
- func (c *ClientEphemeralfiles) Upload(fileToUpload string) error
- func (c *ClientEphemeralfiles) UploadEndpoint() string
- type File
- type FileList
Constants ¶
This section is empty.
Variables ¶
var (
ErrFileNotFound = errors.New("file not found")
)
Functions ¶
func CheckExpiration ¶
Types ¶
type ClientEphemeralfiles ¶
type ClientEphemeralfiles struct { HttpClient *http.Client // contains filtered or unexported fields }
ClientEphemeralfiles is the client to interact with the API
func NewClient ¶
func NewClient(endpoint string, token string) *ClientEphemeralfiles
NewClient creates a new client
func (*ClientEphemeralfiles) Download ¶
func (c *ClientEphemeralfiles) Download(uuidFile string, outputfile string) error
Download downloads a file from the server and saves it to the outputfile If the outputfile is empty, the file will be saved to the current directory with the same name as the file on the server (retrieving the name from the Content-Disposition header)
func (*ClientEphemeralfiles) DownloadEndpoint ¶
func (c *ClientEphemeralfiles) DownloadEndpoint(uuidFile string) string
func (*ClientEphemeralfiles) Fetch ¶
func (c *ClientEphemeralfiles) Fetch() (FileList, error)
func (*ClientEphemeralfiles) FilesEndpoint ¶
func (c *ClientEphemeralfiles) FilesEndpoint() string
FilesEndpoint returns the endpoint for the files
func (*ClientEphemeralfiles) GetBoxInfos ¶
func (c *ClientEphemeralfiles) GetBoxInfos() (*Box, error)
func (*ClientEphemeralfiles) Remove ¶
func (c *ClientEphemeralfiles) Remove(uuidFileToRemove string) error
Download downloads a file from the server and saves it to the outputfile If the outputfile is empty, the file will be saved to the current directory with the same name as the file on the server (retrieving the name from the Content-Disposition header)
func (*ClientEphemeralfiles) Upload ¶
func (c *ClientEphemeralfiles) Upload(fileToUpload string) error
func (*ClientEphemeralfiles) UploadEndpoint ¶
func (c *ClientEphemeralfiles) UploadEndpoint() string
type File ¶
type File struct { Idfile string `json:"idfile"` FileName string `json:"filename"` Size int64 `json:"size"` UpdateDateBegin time.Time `json:"update_date_egin"` UpdateDateEnd time.Time `json:"update_date_end"` ExpirationDate time.Time `json:"expiration_date"` }
File is the struct that represents a file in the API