synology

package
v0.0.0-...-124a127 Latest Latest
Warning

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

Go to latest
Published: Jan 20, 2024 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const PAGE_LIMIT = 100

Variables

This section is empty.

Functions

This section is empty.

Types

type Connection

type Connection struct {
	// contains filtered or unexported fields
}

func NewConnection

func NewConnection(url string, username string, password string, insecureSkipVerify bool) Connection

func (*Connection) DownloadPhoto

func (c *Connection) DownloadPhoto(photoId int) (*string, error)

func (*Connection) ListFolder

func (c *Connection) ListFolder() ([]Folder, error)

func (*Connection) ListPhotosInFolder

func (c *Connection) ListPhotosInFolder(folderId int) ([]Photo, error)

func (*Connection) Login

func (c *Connection) Login() error

func (*Connection) TagPhoto

func (c *Connection) TagPhoto(photoId int, tagId int) error

type Folder

type Folder struct {
	Id   int    `json:"id"`
	Name string `json:"name"`
}

type ListFolderResponse

type ListFolderResponse struct {
	Data struct {
		List []Folder `json:"list"`
	} `json:"data"`
	Success bool `json:"success"`
}

type ListPhotosResponse

type ListPhotosResponse struct {
	Data struct {
		List []Photo `json:"list"`
	} `json:"data"`
	Success bool `json:"success"`
}

type LoginResponse

type LoginResponse struct {
	Data struct {
		Did string `json:"did"`
		Sid string `json:"sid"`
	} `json:"data"`
	Success bool `json:"success"`
}

type Photo

type Photo struct {
	Id         int    `json:"id"`
	FolderId   int    `json:"folder_id"`
	FileName   string `json:"filename"`
	Time       int    `json:"time"`
	Additional struct {
		Tag []struct {
			Id   int    `json:"id"`
			Name string `json:"name"`
		} `json:"tag"`
		Thumbnail struct {
			XL       string `json:"xl"`
			CacheKey string `json:"cache_key"`
		} `json:"thumbnail"`
	} `json:"additional"`
}

func (Photo) GetTime

func (p Photo) GetTime() time.Time

func (Photo) HasTag

func (p Photo) HasTag(tagId int) bool

type TagActionResponse

type TagActionResponse struct {
	Success bool `json:"success"`
}

Jump to

Keyboard shortcuts

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