cmd

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: May 10, 2026 License: MPL-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CatURL

func CatURL(u ...string) string

CatURL takes arbitrary number of strings and concatenates them together

func InitOTelGRF

func InitOTelGRF() (*sdktrace.TracerProvider, error)

InitOTelGRF uses the Grafana recommended configuration including Baggage for propagation

Types

type Artist

type Artist struct {
	ID             string `json:"id"`
	Name           string `json:"name"`
	Type           string `json:"type"`
	Country        string `json:"country,omitempty"`
	Disambiguation string `json:"disambiguation,omitempty"`
	Score          int    `json:"score"`
}

Artist is a sub-target for unmarshalling the specific Artist keys we care about.

type MBAnswerArtist

type MBAnswerArtist struct {
	Count   int      `json:"count"`
	Offset  int      `json:"offset"`
	Artists []Artist `json:"artists"`
}

MBAnswerArtist is the primary target for unmarshalling the results JSON.

type MBQuestion

type MBQuestion struct {
	QString  string
	QType    string
	QFullURL string
	RespBody string
	// contains filtered or unexported fields
}

MBQuestion is the heart of operations, where data and client configs are kept

func NewMBQuestion

func NewMBQuestion(qSearch, qType string) *MBQuestion

NewMBQuestion creates the object for asking and storing the answer.

func (*MBQuestion) ArtistSearch

func (mbq *MBQuestion) ArtistSearch(ctx context.Context) (bool, string, error)

ArtistSearch uses context for the request and includes retry logic for backoff

func (*MBQuestion) FetchBody

func (mbq *MBQuestion) FetchBody(ctx context.Context) (int, error)

FetchBody reads a url and returns the status code and any errors, the actual contents of the fetch are put in the struct.

Jump to

Keyboard shortcuts

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