platformcontracts

package module
v1.0.10 Latest Latest
Warning

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

Go to latest
Published: May 5, 2023 License: MIT Imports: 2 Imported by: 3

README

platform-contracts

Documentation

Index

Constants

View Source
const Album = "album"
View Source
const AmazonMusic = "amazon"
View Source
const AppleMusic = "apple"
View Source
const Compilation = "compilation"
View Source
const Deezer = "deezer"
View Source
const Gaana = "gaana"
View Source
const PLATFORM_URL_REQUESTS_CONSUMER_NAME_TEMPLATE = "-platform-request-consumer"
View Source
const PLATFORM_URL_REQUESTS_STREAM_NAME = "PLATFORM-URL-REQUESTS"
View Source
const PLATFORM_URL_REQUESTS_STREAM_SUBJECTS = "PLATFORM-URL-REQUESTS.*"
View Source
const PLATFORM_URL_REQUESTS_STREAM_SUBJECT_TEMPLATE = "PLATFORM-URL-REQUESTS."
View Source
const PLATFORM_URL_RESPONSE_CONSUMER_NAME = "platform-response-consumer"
View Source
const PLATFORM_URL_RESPONSE_STREAM_NAME = "PLATFORM-URL-RESPONSES"
View Source
const PLATFORM_URL_RESPONSE_STREAM_SUBJECT = "PLATFORM-URL-RESPONSES.reducer"
View Source
const Single = "single"
View Source
const Spotify = "spotify"
View Source
const Tidal = "tidal"
View Source
const Uma = "uma"
View Source
const YandexMusic = "yandex"
View Source
const YouTubeMusic = "youtube"

Variables

View Source
var AvailablePlatforms = []string{
	Deezer,
	Spotify,
}
View Source
var DefaultPlatformServiceConfig = &nats.StreamConfig{
	Name:      PLATFORM_URL_REQUESTS_STREAM_NAME,
	MaxAge:    time.Hour,
	Retention: nats.WorkQueuePolicy,
	Storage:   nats.MemoryStorage,
	Subjects:  []string{PLATFORM_URL_REQUESTS_STREAM_SUBJECTS},
}
View Source
var DefaultReducerConfig = &nats.StreamConfig{
	Name:      PLATFORM_URL_RESPONSE_STREAM_NAME,
	MaxAge:    time.Hour * 24,
	Retention: nats.WorkQueuePolicy,
	Storage:   nats.FileStorage,
	Subjects:  []string{PLATFORM_URL_RESPONSE_STREAM_SUBJECT},
}

Functions

func GetRequestConsumerName added in v1.0.1

func GetRequestConsumerName(platformName string) string

func GetRequestStreamSubject added in v1.0.1

func GetRequestStreamSubject(platformName string) string

Types

type Platformer added in v1.0.1

type Platformer interface {
	GetBatchSize() int
	GetPlatformName() string
	GetReleaseUrlsByUpc(upcContainers []UpcContainer) []UrlResultContainer
}

type UpcContainer

type UpcContainer struct {
	Id  int
	Upc string
}

type UrlResultContainer

type UrlResultContainer struct {
	Id           int
	PlatformName string
	Upc          string
	Url          string
}

Jump to

Keyboard shortcuts

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