model

package
v1.0.8 Latest Latest
Warning

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

Go to latest
Published: Mar 2, 2025 License: MIT Imports: 3 Imported by: 0

Documentation

Overview

package model defines data structures for the API requests and responses

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DeleteContentPayload

func DeleteContentPayload(IDs []string) deleteContent

DeleteContentPayload creates an instance of deleteContent

Returns delete content

func NewFolderPayload

func NewFolderPayload(p string, f string) newFolder

NewFolderPayload creates an instance of newFolder

Returns newFolder

func NewUpdateContentPayload

func NewUpdateContentPayload() *updateContent

Returns updateContent or an error

Types

type AccountIDResponse

type AccountIDResponse struct {
	Status string `json:"status"`
	Data   struct {
		ID string `json:"id"` //ID of user account
	} `json:"data"`
}

AccountIDResponse represents the response structure for the user's ID

Contains status and the user ID

type AccountInformationResponse

type AccountInformationResponse struct {
	Status string `json:"status"`
	Data   struct {
		IPTraffic30  int64        `json:"ipTraffic30"` //
		ID           string       `json:"id"`          // Id of user account
		CreateTime   int64        `json:"createTime"`  // date:time account was created
		Email        string       `json:"email"`       // email address of user
		Tier         string       `json:"tier"`        // tier of user account
		Token        string       `json:"token"`       // bearer token for Authorization header
		RootFolder   string       `json:"rootFolder"`  // ID of user's root folder
		StatsCurrent currentStats `json:"statsCurrent"`
	} `json:"data"`
}

AccountInformationResponse represent the response structure for a user account information

Contains status and data about the user account

type AvailableServerResponse

type AvailableServerResponse struct {
	Status string `json:"status"`
	Data   struct {
		Servers        []server `json:"servers"`        // servers in the specified zone
		ServersAllZone []server `json:"serversAllZone"` // servers across all zones
	} `json:"data"`
}

AvailableServerResponse represents the response structure for available servers.

Contains status and data about servers in all zones.

type ContentType

type ContentType string
const (
	FileType   ContentType = "file"
	FolderType ContentType = "folder"
)

type CreateFolderResponse

type CreateFolderResponse struct {
	Status string `json:"status"`
	Data   struct {
		ID           string `json:"id"`           // ID of the folder
		Owner        string `json:"owner"`        // ID of the creator of the folder
		Type         string `json:"type"`         // this is always folder
		Name         string `json:"name"`         // name of the folder
		ParentFolder string `json:"parentFolder"` // ID of the parent folder
		CreateTime   string `json:"createTime"`   // date:time the folder was created
		ModTime      string `json:"modTime"`      //
		Code         string `json:"code"`         // short code of the folder?
	} `json:"data"`
}

CreateFolderResponse represents the response structure for a successful folder creation

Contains status and data about the created folder

type DeleteContentResponse

type DeleteContentResponse struct {
	Status string `json:"status"`
	Data   map[string]struct {
		Status string `json:"status"`
	} `json:"data"`
}

type UpdateContentResponse

type UpdateContentResponse struct {
	Status string `json:"status"`
	Data   struct {
		ID           string      `json:"id"`
		Type         ContentType `json:"type"`
		Name         string      `json:"name"`
		CreateTime   int64       `json:"createTime"`
		ModTime      int64       `json:"modTime"`
		ParentFolder string      `json:"parentFolder"`

		// File-specific fields
		MimeType *string `json:"mimetype,omitempty"`
		MD5      *string `json:"md5,omitempty"`
		Size     *int64  `json:"size,omitempty"`
	} `json:"data"`
}

UpdateContentResponse represent the response structure for a successful attribute change of a file or folder

Contains status and data about specified file or folder

type UploadFileResponse

type UploadFileResponse struct {
	Status string `json:"status"`
	Data   struct {
		CreateTime       int64       `json:"createTime"`       // time the file was uploaded
		DownloadPage     string      `json:"downloadPage"`     // gofile.io download link page for the file
		ID               string      `json:"id"`               // ID of the file on the gofile server
		MD5              string      `json:"md5"`              // MD5 hash of the file
		Mimetype         string      `json:"mimetype"`         // type of the file (eg: "application/zip")
		ModTime          int64       `json:"modTime"`          //
		Name             string      `json:"name"`             // name of the file uploaded
		ParentFolder     string      `json:"parentFolder"`     // ID of parent folder
		ParentFolderCode string      `json:"parentFolderCode"` //code of parent folder
		Servers          []string    `json:"servers"`          // array of name of servers the uploaded file is on
		Size             int64       `json:"size"`             // size of the file in bytes
		Type             ContentType `json:"type"`             // type of file (eg: "file")
	} `json:"data"`
}

UploadFileResponse represent the response structure for a successful file upload

Contains status and data about uploaded file

Jump to

Keyboard shortcuts

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