backends

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Nov 24, 2023 License: GPL-3.0 Imports: 19 Imported by: 0

Documentation

Overview

Copyright © 2023 Philipp Wolfer <phw@uploadedlobster.com>

This file is part of Scotty.

Scotty is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

Scotty 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 General Public License for more details.

You should have received a copy of the GNU General Public License along with Scotty. If not, see <https://www.gnu.org/licenses/>.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Authenticate

func Authenticate(service string, backend models.Backend, db storage.Database, config *viper.Viper) (bool, error)

func BuildRedirectURL

func BuildRedirectURL(config *viper.Viper, backend string) (*url.URL, error)

func ImplementsInterface

func ImplementsInterface[T interface{}](backend *models.Backend) (bool, string)

func NewDatabaseTokenSource

func NewDatabaseTokenSource(db storage.Database, service string, config *oauth2.Config, tok *oauth2.Token) oauth2.TokenSource

func ProcessListensImports

func ProcessListensImports(importer models.ListensImport, results chan models.ListensResult, out chan models.ImportResult, progress chan models.Progress)

func ProcessLovesImports

func ProcessLovesImports(importer models.LovesImport, results chan models.LovesResult, out chan models.ImportResult, progress chan models.Progress)

func ResolveBackend

func ResolveBackend[T interface{}](config *viper.Viper) (T, error)

Types

type BackendInfo

type BackendInfo struct {
	Name               string
	ExportCapabilities []Capability
	ImportCapabilities []Capability
}

func GetBackends

func GetBackends() []BackendInfo

type Capability

type Capability = string

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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