music

package
v0.0.0-...-6436a23 Latest Latest
Warning

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

Go to latest
Published: Sep 5, 2017 License: GPL-3.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ChinaMobileSDC

type ChinaMobileSDC struct {
	Song []byte
}

ChinaMobileSDC is the xxx music

func NewChinaMobileSDC

func NewChinaMobileSDC() *ChinaMobileSDC

NewChinaMobileSDC returns a new ChinaMobileSDC

func (*ChinaMobileSDC) GetResponse

func (c *ChinaMobileSDC) GetResponse(request []byte) []byte

GetResponse returns response when the request does not equal with the song

func (*ChinaMobileSDC) GetSong

func (c *ChinaMobileSDC) GetSong() []byte

GetSong returns song of music

func (*ChinaMobileSDC) Length

func (c *ChinaMobileSDC) Length() int

Length returns length of song

type ChinaUnicomIRead

type ChinaUnicomIRead struct {
	Song []byte
}

ChinaUnicomIRead is the xxx music

func NewChinaUnicomIRead

func NewChinaUnicomIRead() *ChinaUnicomIRead

NewChinaUnicomIRead returns a new ChinaUnicomIRead

func (*ChinaUnicomIRead) GetResponse

func (c *ChinaUnicomIRead) GetResponse(request []byte) []byte

GetResponse returns response when the request does not equal with the song

func (*ChinaUnicomIRead) GetSong

func (c *ChinaUnicomIRead) GetSong() []byte

GetSong returns song of music

func (*ChinaUnicomIRead) Length

func (c *ChinaUnicomIRead) Length() int

Length returns length of song

type ChinaUnicomSales

type ChinaUnicomSales struct {
	Song []byte
}

ChinaUnicomSales is the xxx music

func NewChinaUnicomSales

func NewChinaUnicomSales() *ChinaUnicomSales

NewChinaUnicomSales returns a new ChinaUnicomSales

func (*ChinaUnicomSales) GetResponse

func (c *ChinaUnicomSales) GetResponse(request []byte) []byte

GetResponse returns response when the request does not equal with the song

func (*ChinaUnicomSales) GetSong

func (c *ChinaUnicomSales) GetSong() []byte

GetSong returns song of music

func (*ChinaUnicomSales) Length

func (c *ChinaUnicomSales) Length() int

Length returns length of song

type Custom

type Custom struct {
	Song []byte
}

Custom is music for customize URL

func NewCustom

func NewCustom(u *url.URL) (*Custom, error)

NewCustom returns a Custom by URL

func (*Custom) GetResponse

func (c *Custom) GetResponse(request []byte) []byte

GetResponse returns response when the request does not equal with the song

func (*Custom) GetSong

func (c *Custom) GetSong() []byte

GetSong returns song of music

func (*Custom) Length

func (c *Custom) Length() int

Length returns length of song

type Music

type Music interface {
	// The length of the song
	Length() int
	// The data send first
	GetSong() []byte
	// Length of request is equal with song, but it may be any data and may be not complete data as some protocol, like a part of HTTP request
	GetResponse(request []byte) []byte
}

Music is a supplement to the brook protocol, you can create your own music

func GetMusic

func GetMusic(k string) (Music, error)

GetMusic return a music by the given key/url, or nil if not found

Jump to

Keyboard shortcuts

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