api

package
v0.0.0-...-8b5c602 Latest Latest
Warning

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

Go to latest
Published: Oct 4, 2019 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ApiV1 string = "/containerstation/api/v1/"

	LoginPath  = "login"
	LogoutPath = "logout"

	SystemPath                  = "system"
	SystemResourcePath          = "system/resource"
	SystemReportPath            = "system/report"
	SystemBridgePath            = "system/bridge"
	TlsPath                     = "tls"
	TlsExportPath               = "tls/export"
	TlsDomainNamesPath          = "tls/domain_names"
	TlsExportRegistryPath       = "tls/export/registry"
	SharefolderPath             = "sharefolder/"
	ContainerPath               = "container"
	ImportConfigPath            = "import/config"
	BackgroundPath              = "background/"
	AppsPath                    = "apps"
	ResourceDevicePath          = "resource/device"
	ImagePath                   = "image"
	RegistryPath                = "registry"
	RegistryPushPath            = "registry/push"
	RegistryPingPath            = "registry/ping"
	NetworksPath                = "networks"
	VolumesPath                 = "volumes"
	LogPath                     = "log"
	LogExportPath               = "log/export"
	EventPath                   = "event"
	PreferencePath              = "preference/"
	WizardWorkspacePath         = "wizard/workspace"
	WizardWorkspaceStatusPath   = "wizard/workspace/status"
	PreferenceRepoPath          = "preference/repo"
	PreferenceNetworkPath       = "preference/network"
	PreferenceNetworkDockerPath = "preference/network_docker"
)

Functions

func Dump

func Dump(value interface{}) error

func Get

func Get(qnapUrl string, cookies []*http.Cookie) ([]byte, error)

Types

type BaseResult

type BaseResult struct {
	Error *ErrorDef `json:"error"` // nil on success
}

type ErrorDef

type ErrorDef struct {
	Code    int    `json:"code"`
	Message string `json:"message"`
}

type LoginResult

type LoginResult struct {
	Error     *ErrorDef `json:"error"` // nil on success
	Anonymous bool      `json:"anonymouse"`
	IsAdmin   bool      `json:"isAdmin"`
	LoginTime string    `json:"logintime"` // localtime like "2019-10-03 15:43:15"
	Username  string    `json:"username"`
}

func Login

func Login(qnapUrl string, username string, password string) (*LoginResult, []*http.Cookie, error)

type LogoutResult

type LogoutResult struct {
	Error    *ErrorDef `json:"error"` // nil on success
	Username string    `json:"username"`
}

func Logout

func Logout(qnapUrl string, cookies []*http.Cookie) (*LogoutResult, error)

Jump to

Keyboard shortcuts

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