api

package
v0.0.0-...-ba84551 Latest Latest
Warning

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

Go to latest
Published: Sep 16, 2014 License: MIT Imports: 0 Imported by: 9

Documentation

Index

Constants

This section is empty.

Variables

View Source
var RequestDummyAuthUrl = "auths/dummy.auth"
View Source
var RequestDummyCreateUrl = "auths/dummy.create"
View Source
var RequestDummyGetChallengeUrl = "auths/dummy.get_challenge"
View Source
var RequestGetInfoUrl = "config/get_info"
View Source
var RequestGetUsersUrl = "config/get_users"
View Source
var RequestListUrl = "auths/list"
View Source
var RequestLogoutUrl = "auths/logout"

Functions

This section is empty.

Types

type AccessType

type AccessType int
const (
	NONE       AccessType = 0
	READ       AccessType = 1
	READ_WRITE AccessType = 2
)

type Account

type Account struct {
	Login   string `json:"login"`
	IsAdmin bool   `json:"isAdmin"`
	Email   string `json:"email"`
	Id      string `json:"id"`
}

type BrowserCommand

type BrowserCommand struct {
	List         *CommandBrowserList         `json:"list,omitempty" bson:"list,omitempty"`
	CreateFolder *CommandBrowserCreateFolder `json:"create_folder,omitempty" bson:"create_folder,omitempty"`
	Delete       *CommandBrowserDelete       `json:"delete,omitempty" bson:"delete,omitempty"`
	DownloadLink *CommandBrowserDownloadLink `json:"download_link,omitempty" bson:"download_link,omitempty"`
	UploadFile   *CommandBrowserUploadFile   `json:"upload_file,omitempty" bson:"upload_file,omitempty"`
	Thumbnail    *CommandBrowserThumbnail    `json:"thumbnail,omitempty" bson:"thumbnail,omitempty"`
}

type Command

type Command struct {
	Name      EnumAction        `json:"name"`
	CommandId string            `json:"command_id"`
	Timeout   int64             `json:"timeout,omitempty"`
	AuthKey   *string           `json:"auth_key,omitempty"` //Used when calling commands on behalf of a sharedlink
	Password  *string           `json:"password"`           //Used when a share_link requires a password This should be the hash of AuthKey + Password
	State     CommandStatus     `json:"state"`
	Browser   *BrowserCommand   `json:"browser,omitempty"`
	ShareLink *ShareLinkCommand `json:"share_link,omitempty"`
}

type CommandBrowserCreateFolder

type CommandBrowserCreateFolder struct {
	Input  CommandBrowserCreateFolderInput  `json:"input" bson:"input"`
	Output CommandBrowserCreateFolderOutput `json:"output" bson:"output"`
}

type CommandBrowserCreateFolderInput

type CommandBrowserCreateFolderInput struct {
	Path string `json:"path"`
}

type CommandBrowserCreateFolderOutput

type CommandBrowserCreateFolderOutput struct {
	Result StorageItem `json:"result"`
}

type CommandBrowserDelete

type CommandBrowserDelete struct {
	Input CommandBrowserDeleteInput `json:"input" bson:"input"`
}

type CommandBrowserDeleteInput

type CommandBrowserDeleteInput struct {
	Path string `json:"path"`
}
type CommandBrowserDownloadLink struct {
	Input  CommandBrowserDownloadLinkInput  `json:"input" bson:"input"`
	Output CommandBrowserDownloadLinkOutput `json:"output" bson:"output"`
}

type CommandBrowserDownloadLinkInput

type CommandBrowserDownloadLinkInput struct {
	Path string `json:"path"`
}

type CommandBrowserDownloadLinkOutput

type CommandBrowserDownloadLinkOutput struct {
	DownloadLink string `json:"download_link"`
}

type CommandBrowserList

type CommandBrowserList struct {
	Input  CommandBrowserListInput  `json:"input" bson:"input"`
	Output CommandBrowserListOutput `json:"output" bson:"output"`
}

type CommandBrowserListInput

type CommandBrowserListInput struct {
	Path            string `json:"path"`
	ShowHiddenFiles *bool  `json:"show_hidden_files,omitempty"` // By default hidden files are hidden
}

type CommandBrowserListOutput

type CommandBrowserListOutput struct {
	CurrentItem StorageItem   `json:"current_item"`
	Children    []StorageItem `json:"children"`
}

type CommandBrowserThumbnail

type CommandBrowserThumbnail struct {
	Input  CommandBrowserThumbnailInput  `json:"input" bson:"input"`
	Output CommandBrowserThumbnailOutput `json:"output" bson:"output"`
}

type CommandBrowserThumbnailInput

type CommandBrowserThumbnailInput struct {
	Path string `json:"path"`
	Size *int   `json:"size,omitempty"` // size of desired picture
}

type CommandBrowserThumbnailOutput

type CommandBrowserThumbnailOutput struct {
	Content string `json:"content"` // base64 of the image
}

type CommandBrowserUploadFile

type CommandBrowserUploadFile struct {
	Input CommandBrowserUploadFileInput `json:"input" bson:"input"`
}

type CommandBrowserUploadFileInput

type CommandBrowserUploadFileInput struct {
	Path string `json:"path"`
	Size int64  `json:"size"`
}

type CommandShareLinkCreate

type CommandShareLinkCreate struct {
	Input  CommandShareLinkCreateInput  `json:"input" bson:"input"`
	Output CommandShareLinkCreateOutput `json:"output" bson:"output"`
}

type CommandShareLinkCreateInput

type CommandShareLinkCreateInput struct {
	ShareLink ShareLink `json:"share_link"`
}

type CommandShareLinkCreateOutput

type CommandShareLinkCreateOutput struct {
	ShareLink ShareLink `json:"share_link"`
}

type CommandShareLinkDelete

type CommandShareLinkDelete struct {
	Input CommandShareLinkDeleteInput `json:"input" bson:"input"`
}

type CommandShareLinkDeleteInput

type CommandShareLinkDeleteInput struct {
	Key string `json:"key"`
}
type CommandShareLinkList struct {
	Input  CommandShareLinkListInput  `json:"input" bson:"input"`
	Output CommandShareLinkListOutput `json:"output" bson:"output"`
}

type CommandShareLinkListInput

type CommandShareLinkListInput struct {
	Path string `json:"path"`
}

type CommandShareLinkListOutput

type CommandShareLinkListOutput struct {
	ShareLinks []ShareLink `json:"share_links"`
}

type CommandShareLinkUpdate

type CommandShareLinkUpdate struct {
	Input  CommandShareLinkUpdateInput  `json:"input" bson:"input"`
	Output CommandShareLinkUpdateOutput `json:"output" bson:"output"`
}

type CommandShareLinkUpdateInput

type CommandShareLinkUpdateInput struct {
	ShareLink ShareLink `json:"share_link"`
}

type CommandShareLinkUpdateOutput

type CommandShareLinkUpdateOutput struct {
	ShareLink ShareLink `json:"share_link"`
}

type CommandStatus

type CommandStatus struct {
	Status    EnumStatus           `json:"status"`
	Progress  int                  `json:"progress"`
	ErrorCode EnumCommandErrorCode `json:"error_code"`
}

type CommandsSearchParameters

type CommandsSearchParameters struct {
	Status *EnumStatus `json:"status,omitempty"`
}

type EnumAction

type EnumAction string
const (
	EnumBrowserList         EnumAction = "browser.list"
	EnumBrowserCreateFolder EnumAction = "browser.create_folder"
	EnumBrowserDelete       EnumAction = "browser.delete"
	EnumBrowserDownloadLink EnumAction = "browser.download_link"
	EnumBrowserUploadFile   EnumAction = "browser.upload_file"
	EnumBrowserThumbnail    EnumAction = "browser.thumbnail"
	EnumShareLinkList       EnumAction = "share_link.list"
	EnumShareLinkCreate     EnumAction = "share_link.create"
	EnumShareLinkUpdate     EnumAction = "share_link.update"
	EnumShareLinkDelete     EnumAction = "share_link.delete"
)

type EnumCommandErrorCode

type EnumCommandErrorCode int
const (
	ERROR_NO_ERROR             EnumCommandErrorCode = 0
	ERROR_MISSING_COMMAND_BODY EnumCommandErrorCode = 1
	ERROR_MISSING_PARAMETERS   EnumCommandErrorCode = 2
	ERROR_INVALID_PARAMETERS   EnumCommandErrorCode = 3
	ERROR_NOT_ALLOWED          EnumCommandErrorCode = 4
	ERROR_INVALID_PATH         EnumCommandErrorCode = 5
	ERROR_FILE_SYSTEM          EnumCommandErrorCode = 6
	ERROR_SAVING               EnumCommandErrorCode = 7
	ERROR_UNKNOWN              EnumCommandErrorCode = 8
)

type EnumShareLinkType

type EnumShareLinkType int
const (
	EnumShareByKey            EnumShareLinkType = 0
	EnumRestricted            EnumShareLinkType = 1
	EnumAuthenticated         EnumShareLinkType = 2
	EnumShareByKeyAndPassword EnumShareLinkType = 3
)

type EnumStatus

type EnumStatus int
const (
	COMMAND_STATUS_DONE        EnumStatus = 0
	COMMAND_STATUS_QUEUED      EnumStatus = 1
	COMMAND_STATUS_IN_PROGRESS EnumStatus = 2
	COMMAND_STATUS_ERROR       EnumStatus = 3
	COMMAND_STATUS_CANCELLED   EnumStatus = 4
)

type RequestDummyAuthInput

type RequestDummyAuthInput struct {
	Login         string `json:"login"`
	ChallengeHash string `json:"challenge_hash"`
	Ref           string `json:"ref"`
}

type RequestDummyAuthOutput

type RequestDummyAuthOutput struct {
	MySelf               Account `json:"my_self"`
	AuthenticationHeader string  `json:"authentication_header"`
}

type RequestDummyCreateInput

type RequestDummyCreateInput struct {
	Login    string `json:"login"`
	Password string `json:"password"`
	Email    string `json:"email"`
	IsAdmin  *bool  `json:"is_admin,omitempty"`
}

type RequestDummyGetChallengeOutput

type RequestDummyGetChallengeOutput struct {
	Challenge string `json:"challenge"`
	Ref       string `json:"ref"`
}

type RequestGetInfoOutput

type RequestGetInfoOutput struct {
	ShareLink         bool              `json:"share_link"`
	PasswordProtected bool              `json:"password_protected"`
	NbDownloads       *int              `json:"nb_downloads,omitempty"` // Number of downloads left for this particular sharing
	Access            AccessType        `json:"access"`                 // Kind of access user has on this repository
	ShareAccess       AccessType        `json:"share_access"`           // Kind of share access user has on this repository
	Type              EnumShareLinkType `json:"type"`                   // AcessType: authenfied, resticted, password...
}

type RequestGetUsersOutput

type RequestGetUsersOutput struct {
	Users []Account `json:"users"`
}

type RequestListOutput

type RequestListOutput struct {
	Auths []string `json:"auths"`
}
type ShareLink struct {
	Name        *string           `json:"name,omitempty"`      // Name used for displaying the share link if multiple share links available
	Path        *string           `json:"path,omitempty"`      // Can be empty only if ShareLinkKey is provided
	Key         *string           `json:"key,omitempty"`       // Can be empty only for a creation or on a Get
	UserList    *[]string         `json:"user_list,omitempty"` // This is only available for EnumRestricted mode
	Type        EnumShareLinkType `json:"type"`
	Access      *AccessType       `json:"access,omitempty"` // What access would people coming with this link have
	Password    *string           `json:"password,omitempty"`
	NbDownloads *int              `json:"nb_downloads,omitempty"` // Number of downloads for a file. This is only valid for file shared, not directories
}

type ShareLinkCommand

type ShareLinkCommand struct {
	List   *CommandShareLinkList   `json:"list,omitempty" bson:"list,omitempty"`
	Create *CommandShareLinkCreate `json:"create,omitempty" bson:"create,omitempty"`
	Update *CommandShareLinkUpdate `json:"update,omitempty" bson:"update,omitempty"`
	Delete *CommandShareLinkDelete `json:"delete,omitempty" bson:"delete,omitempty"`
}

type StorageItem

type StorageItem struct {
	Name        string     `json:"name"`
	IsDir       bool       `json:"isDir"`
	MDate       int64      `json:"mDate"`
	Size        int64      `json:"size"`
	Kind        string     `json:"kind"`     // this is the extension of the file. value will be folder for a folder
	Mimetype    string     `json:"mimetype"` // this is the mimetype of the file
	Access      AccessType `json:"access"`
	ShareAccess AccessType `json:"share_access"`
}

Jump to

Keyboard shortcuts

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