Documentation ¶
Index ¶
- Constants
- Variables
- type Client
- type Configuration
- type Device
- type DeviceConnectionMode
- type DeviceInfo
- type DeviceNetwork
- type File
- func (f *File) Create(name string) (*File, error)
- func (f *File) CreateDirectory(name string) (*File, error)
- func (f *File) Delete() error
- func (f *File) IsDirectory() bool
- func (f *File) ListDirectory() (map[string]File, error)
- func (f *File) LookupDirectory(name string) (*File, error)
- func (f *File) Read(dest []byte, offset int64) (int, error)
- func (f *File) Refresh() error
- func (f *File) Rename(newParent *File, newName string) error
- func (f *File) SetMeta(reqJSON map[string]interface{}) error
- func (f *File) Truncate(offset int64) error
- func (f *File) Write(data []byte, offset int64) error
- type FileList
- type ISOTime
- type MultipartBody
Constants ¶
View Source
const ConnectionRecheckTime = 30 * time.Second
View Source
const DirectoryMimeType = "application/x.wd.dir"
View Source
const FileFields = "id,eTag,parentID,childCount,mimeType,name,size,mTime,cTime"
Variables ¶
View Source
var ErrorInvalidOperation = errors.New("invalid operation")
View Source
var ErrorUnexpectedStatusCode = errors.New("unexpected status code")
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct { AccessToken string `json:"access_token"` RefreshToken string `json:"refresh_token"` IDToken string `json:"id_token"` Scope string `json:"scope"` TokenType string `json:"token_type"` ExpiresIn int `json:"expires_in"` UserID string `json:"user_id,omitempty"` Configuration *Configuration `json:"configuration,omitempty"` OSType string `json:"os_type,omitempty"` HTTPClient http.Client `json:"-"` }
func (*Client) DeviceInfo ¶
func (c *Client) DeviceInfo() (*DeviceInfo, error)
type Configuration ¶
type Configuration struct { ConfigurationID string `json:"configurationId"` ComponentMap map[string]map[string]interface{} `json:"componentMap"` }
func GetConfiguration ¶
func GetConfiguration() (*Configuration, error)
func (Configuration) GetString ¶
func (c Configuration) GetString(section, config string) string
type Device ¶
type Device struct { DeviceID string `json:"deviceId"` Name string `json:"name"` Mac string `json:"mac"` DeviceType string `json:"type"` CreatedOn ISOTime `json:"createdOn"` AttachedStatus string `json:"attachedStatus"` Lang string `json:"lang"` Network DeviceNetwork `json:"network"` LastHDStoragePercent int `json:"lastHDStoragePercent"` CloudConnected bool `json:"cloudConnected"` OwnerAccess bool `json:"ownerAccess"` SerialNumber string `json:"serialNumber"` APIVersion string `json:"apiVersion"` // contains filtered or unexported fields }
type DeviceConnectionMode ¶ added in v0.1.0
type DeviceConnectionMode int
DeviceConnectionMode represents the current connection status for a device.
const ( UnknownConnection DeviceConnectionMode = iota InternalConnection ExternalConnection )
func (DeviceConnectionMode) String ¶ added in v0.1.0
func (dm DeviceConnectionMode) String() string
type DeviceInfo ¶
type DeviceInfo struct { Data []Device `json:"data"` // contains filtered or unexported fields }
func (DeviceInfo) Find ¶
func (di DeviceInfo) Find(name string) *Device
type DeviceNetwork ¶
type DeviceNetwork struct { LocalIPAddress net.IP `json:"localIpAddress"` ExternalIPAddress net.IP `json:"externalIpAddress"` LocalHTTPPort int `json:"localHttpPort"` LocalHTTPSPort int `json:"localHttpsPort"` PortForwardPort int `json:"portForwardPort"` TunnelID string `json:"tunnelId"` InternalDNSName string `json:"internalDNSName"` InternalURL string `json:"internalURL"` PortForwardURL string `json:"portForwardURL"` PortForwardDomain string `json:"portForwardDomain"` ProxyURL string `json:"proxyURL"` ExternalURI string `json:"externalURI"` PortForwardInfoUpdateStatus string `json:"portForwardInfoUpdateStatus"` }
type File ¶
type File struct { ID string `json:"id"` ETag string `json:"eTag"` ParentID string `json:"parentID"` ChildCount int `json:"childCount,omitempty"` MimeType string `json:"mimeType"` Name string `json:"name"` Size uint64 `json:"size,omitempty"` MTime ISOTime `json:"mTime"` CTime ISOTime `json:"cTime"` // contains filtered or unexported fields }
func (*File) IsDirectory ¶
type MultipartBody ¶
type MultipartBody struct {
// contains filtered or unexported fields
}
func NewMultipartBody ¶
func NewMultipartBody(reqJSON interface{}) (*MultipartBody, error)
func (MultipartBody) AddContentType ¶
func (mb MultipartBody) AddContentType(req *http.Request)
func (MultipartBody) Buffer ¶
func (mb MultipartBody) Buffer() *bytes.Buffer
Click to show internal directories.
Click to hide internal directories.