syncthing

package
v0.0.0-...-d9d3431 Latest Latest
Warning

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

Go to latest
Published: Jul 8, 2023 License: AGPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type SyncthingAPI

type SyncthingAPI struct {
	URL string
	Key string
}

func New

func New(url string, key string) (*SyncthingAPI, error)

func (*SyncthingAPI) Connections

func (api *SyncthingAPI) Connections() (map[string]SyncthingConnection, error)

func (*SyncthingAPI) CreateDevice

func (api *SyncthingAPI) CreateDevice(device SyncthingDevice) error

func (*SyncthingAPI) CreateFolder

func (api *SyncthingAPI) CreateFolder(folder SyncthingFolder) error

func (*SyncthingAPI) Devices

func (api *SyncthingAPI) Devices() ([]SyncthingDevice, error)

func (*SyncthingAPI) File

func (api *SyncthingAPI) File(folderID, path string) (*SyncthingFileResponse, error)

func (*SyncthingAPI) Folders

func (api *SyncthingAPI) Folders() ([]SyncthingFolder, error)

func (*SyncthingAPI) Get

func (api *SyncthingAPI) Get(endpoint string, out any) error

func (*SyncthingAPI) Ignore

func (api *SyncthingAPI) Ignore(folderID, glob string) error

func (*SyncthingAPI) MyGUID

func (api *SyncthingAPI) MyGUID() (string, error)

func (*SyncthingAPI) Post

func (api *SyncthingAPI) Post(endpoint string, data io.Reader, out any) error

func (*SyncthingAPI) Request

func (api *SyncthingAPI) Request(method string, endpoint string, data io.Reader, out any) error

func (*SyncthingAPI) Unignore

func (api *SyncthingAPI) Unignore(folderID, glob string) error

TODO: Break out duplicate code here and in Ignore into a third function which both may use.

type SyncthingConnection

type SyncthingConnection struct {
	LastSeen  time.Time `json:"at"` // Only set if "connected" is true.
	Connected bool      `json:"connected"`
}

type SyncthingConnections

type SyncthingConnections struct {
	Connections map[string]SyncthingConnection
}

type SyncthingDevice

type SyncthingDevice struct {
	DeviceID string `json:"deviceID"`
	Name     string `json:"name"`
}

type SyncthingFile

type SyncthingFile struct {
	Ignored bool `json:"ignored"`
}

type SyncthingFileResponse

type SyncthingFileResponse struct {
	Local SyncthingFile `json:"local"`
}

type SyncthingFolder

type SyncthingFolder struct {
	ID         string            `json:"id"`
	Label      string            `json:"label"`
	Path       string            `json:"path"`
	Type       string            `json:"type"`
	SyncXattrs bool              `json:"syncXattrs"`
	Devices    []SyncthingDevice `json:"devices"`
}

Jump to

Keyboard shortcuts

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