remote

package
v0.0.0-...-c4eee4d Latest Latest
Warning

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

Go to latest
Published: Apr 19, 2024 License: AGPL-3.0 Imports: 6 Imported by: 0

Documentation

Overview

Package remote provides detection of remote services for file sharing and synchronization.

Copyright (c) 2018 - 2024 PhotoPrism UG. All rights reserved.

This program is free software: you can redistribute it and/or modify
it under Version 3 of the GNU Affero General Public License (the "AGPL"):
<https://docs.photoprism.app/license/agpl>

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU Affero General Public License for more details.

The AGPL is supplemented by our Trademark and Brand Guidelines,
which describe how our Brand Assets may be used:
<https://www.photoprism.app/trademark>

Feel free to send an email to hello@photoprism.app if you have questions, want to support our work, or just want to say hello.

Additional information can be found in our Developer Guide: <https://docs.photoprism.app/developer-guide/>

Index

Constants

View Source
const (
	ServiceWebDAV    = "webdav"
	ServiceFacebook  = "facebook"
	ServiceTwitter   = "twitter"
	ServiceFlickr    = "flickr"
	ServiceInstagram = "instagram"
	ServiceEyeEm     = "eyeem"
	ServiceTelegram  = "telegram"
	ServiceWhatsApp  = "whatsapp"
	ServiceGPhotos   = "gphotos"
	ServiceGDrive    = "gdrive"
	ServiceOneDrive  = "onedrive"
)

Variables

View Source
var Heuristics = []Heuristic{
	{ServiceFacebook, []string{"facebook.com", "www.facebook.com"}, []string{}, "GET"},
	{ServiceTwitter, []string{"twitter.com"}, []string{}, "GET"},
	{ServiceFlickr, []string{"flickr.com", "www.flickr.com"}, []string{}, "GET"},
	{ServiceInstagram, []string{"instagram.com", "www.instagram.com"}, []string{}, "GET"},
	{ServiceEyeEm, []string{"eyeem.com", "www.eyeem.com"}, []string{}, "GET"},
	{ServiceTelegram, []string{"web.telegram.org", "www.telegram.org", "telegram.org"}, []string{}, "GET"},
	{ServiceWhatsApp, []string{"web.whatsapp.com", "www.whatsapp.com", "whatsapp.com"}, []string{}, "GET"},
	{ServiceOneDrive, []string{"onedrive.live.com"}, []string{}, "GET"},
	{ServiceGDrive, []string{"drive.google.com"}, []string{}, "GET"},
	{ServiceGPhotos, []string{"photos.google.com"}, []string{}, "GET"},
	{ServiceWebDAV, []string{}, []string{"/", "/webdav/", "/originals/", "/remote.php/dav/files/{user}/", "/remote.php/webdav/", "/dav/files/{user}/", "/servlet/webdav.infostore/"}, "PROPFIND"},
}

Functions

func HttpOk

func HttpOk(method, rawUrl string) bool

Types

type Account

type Account struct {
	AccName string
	AccURL  string
	AccType string
	AccKey  string
	AccUser string
	AccPass string
}

Account represents remote service details.

func Discover

func Discover(rawUrl, user, pass string) (result Account, err error)

Discover performs a service lookup based on the URL and credentials provided and returns an Account if successful.

type Heuristic

type Heuristic struct {
	ServiceType string
	Domains     []string
	Paths       []string
	Method      string
}

func (Heuristic) Discover

func (h Heuristic) Discover(rawUrl, user string) *url.URL

func (Heuristic) MatchDomain

func (h Heuristic) MatchDomain(match string) bool

Directories

Path Synopsis
Package webdav provides WebDAV file sharing and synchronization.
Package webdav provides WebDAV file sharing and synchronization.

Jump to

Keyboard shortcuts

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