backends

package
v0.4.1 Latest Latest
Warning

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

Go to latest
Published: Sep 16, 2024 License: GPL-3.0 Imports: 23 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 BackendByName added in v0.3.0

func BackendByName(backendName string) (models.Backend, 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 ResolveBackend

func ResolveBackend[T interface{}](config config.ServiceConfig) (T, error)

Types

type BackendInfo

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

func (BackendInfo) String added in v0.3.0

func (b BackendInfo) String() string

type BackendList added in v0.3.0

type BackendList []BackendInfo

func GetBackends

func GetBackends() BackendList

func (BackendList) Len added in v0.3.0

func (l BackendList) Len() int

func (BackendList) Less added in v0.3.0

func (l BackendList) Less(i, j int) bool

func (BackendList) Swap added in v0.3.0

func (l BackendList) Swap(i, j int)

type Capability

type Capability = string

type ExportProcessor added in v0.3.0

type ExportProcessor[T models.ListensResult | models.LovesResult] interface {
	ExportBackend() models.Backend
	Process(oldestTimestamp time.Time, results chan T, progress chan models.Progress)
}

type ImportProcessor added in v0.3.0

type ImportProcessor[T models.ListensResult | models.LovesResult] interface {
	ImportBackend() models.ImportBackend
	Process(results chan T, out chan models.ImportResult, progress chan models.Progress)
	Import(export T, result models.ImportResult, out chan models.ImportResult, progress chan models.Progress) (models.ImportResult, error)
}

type ListensExportProcessor added in v0.3.0

type ListensExportProcessor struct {
	Backend models.ListensExport
}

func (ListensExportProcessor) ExportBackend added in v0.3.0

func (p ListensExportProcessor) ExportBackend() models.Backend

func (ListensExportProcessor) Process added in v0.3.0

func (p ListensExportProcessor) Process(oldestTimestamp time.Time, results chan models.ListensResult, progress chan models.Progress)

type ListensImportProcessor added in v0.3.0

type ListensImportProcessor struct {
	Backend models.ListensImport
}

func (ListensImportProcessor) Import added in v0.3.0

func (ListensImportProcessor) ImportBackend added in v0.3.0

func (p ListensImportProcessor) ImportBackend() models.ImportBackend

func (ListensImportProcessor) Process added in v0.3.0

func (p ListensImportProcessor) Process(results chan models.ListensResult, out chan models.ImportResult, progress chan models.Progress)

type LovesExportProcessor added in v0.3.0

type LovesExportProcessor struct {
	Backend models.LovesExport
}

func (LovesExportProcessor) ExportBackend added in v0.3.0

func (p LovesExportProcessor) ExportBackend() models.Backend

func (LovesExportProcessor) Process added in v0.3.0

func (p LovesExportProcessor) Process(oldestTimestamp time.Time, results chan models.LovesResult, progress chan models.Progress)

type LovesImportProcessor added in v0.3.0

type LovesImportProcessor struct {
	Backend models.LovesImport
}

func (LovesImportProcessor) Import added in v0.3.0

func (LovesImportProcessor) ImportBackend added in v0.3.0

func (p LovesImportProcessor) ImportBackend() models.ImportBackend

func (LovesImportProcessor) Process added in v0.3.0

func (p LovesImportProcessor) Process(results chan models.LovesResult, out chan models.ImportResult, progress chan models.Progress)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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