icecast

package
v0.0.0-...-fd00b2c Latest Latest
Warning

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

Go to latest
Published: Apr 4, 2024 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DefaultClient = http.DefaultClient
View Source
var Dialer net.Dialer

Functions

func Dial

func Dial(ctx context.Context, u string, opts ...Option) (net.Conn, error)

Dial calls url.Parse on `u` and calls DialURL

func DialURL

func DialURL(ctx context.Context, u *url.URL, opts ...Option) (net.Conn, error)

DialURL connects to the icecast server at `u` with the options given

The ctx given is used for the dialing and sending of the request

Types

type MetadataFunc

type MetadataFunc func(ctx context.Context, metadata string) error

func Metadata

func Metadata(u string, opts ...Option) (MetadataFunc, error)

Metadata is like MetadataURL but takes a string and parses it for you with url.Parse

func MetadataURL

func MetadataURL(u *url.URL, opts ...Option) MetadataFunc

MetadataURL takes an URL as passed to DialURL and creates a function that can be called to send metadata to icecast for that DialURL

type Option

type Option func(req *http.Request)

func Auth

func Auth(user, password string) Option

Auth sets the BasicAuth user and password

func ContentType

func ContentType(ct string) Option

ContentType sets the Content-Type header and is REQUIRED

func Description

func Description(desc string) Option

Description sets the ice-description header

func Genre

func Genre(genre string) Option

Genre sets the ice-genre header

func Name

func Name(name string) Option

Name sets the ice-name header

func Public

func Public(public bool) Option

Public sets the ice-public header

func URL

func URL(u string) Option

URL sets the ice-url header

func UserAgent

func UserAgent(ua string) Option

UserAgent sets the User-Agent header

func WithHeader

func WithHeader(header, value string) Option

WithHeader sets a header on the request to icecast

Jump to

Keyboard shortcuts

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