Documentation ¶
Overview ¶
* from github.com/natefinch/pie
Index ¶
- Constants
- func NewConsumer() *rpc.Client
- func NewConsumerCodec(f func(io.ReadWriteCloser) rpc.ClientCodec) *rpc.Client
- func StartProvider(output io.Writer, path string, args ...string) (*rpc.Client, error)
- func StartProviderCodec(f func(io.ReadWriteCloser) rpc.ClientCodec, output io.Writer, path string, ...) (*rpc.Client, error)
- type Album
- type Lyrics
- type Musician
- type SearchRet
- type Server
- type Song
Constants ¶
const ( AppName string = "IsrafilCore" AppVersion uint = 1 APILevel uint = 1 )
AppName Name of the App, just for future possible name change APILevel The version of the universal music API. Just in case. AppVersion The version of Israfil Core
const ( SrcNetease = 1 SrcQQMusic = 2 SrcXiami = 3 SrcKuwo = 4 )
Variables ¶
This section is empty.
Functions ¶
func NewConsumer ¶
NewConsumer returns an rpc.Client that will consume an API from the host process over this application's Stdin and Stdout using gob encoding.
func NewConsumerCodec ¶
func NewConsumerCodec(f func(io.ReadWriteCloser) rpc.ClientCodec) *rpc.Client
NewConsumerCodec returns an rpc.Client that will consume an API from the host process over this application's Stdin and Stdout using the ClientCodec returned by f.
func StartProvider ¶
StartProvider start a provider-style plugin application at the given path and args, and returns an RPC client that communicates with the plugin using gob encoding over the plugin's Stdin and Stdout. The writer passed to output will receive output from the plugin's stderr. Closing the RPC client returned from this function will shut down the plugin application.
func StartProviderCodec ¶
func StartProviderCodec( f func(io.ReadWriteCloser) rpc.ClientCodec, output io.Writer, path string, args ...string, ) (*rpc.Client, error)
StartProviderCodec starts a provider-style plugin application at the given path and args, and returns an RPC client that communicates with the plugin using the ClientCodec returned by f over the plugin's Stdin and Stdout. The writer passed to output will receive output from the plugin's stderr. Closing the RPC client returned from this function will shut down the plugin application.
Types ¶
type Musician ¶
type Musician struct { MName string MID string MURL string MSongnum uint MAlbumnum uint MPicURL string }
Musician defines universal Author struct
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
Server is a type that represents an RPC server that serves an API over stdin/stdout.
func NewProvider ¶
func NewProvider() Server
NewProvider returns a Server that will serve RPC over this application's Stdin and Stdout. This method is intended to be run by the plugin application.
func StartConsumer ¶
StartConsumer starts a consumer-style plugin application with the given path and args, writing its stderr to output. The plugin consumes an API this application provides. The function returns the Server for this host application, which should be used to register APIs for the plugin to consume.
func (Server) Close ¶
Close closes the connection with the client. If the client is a plugin process, the process will be stopped. Further communication using this Server will fail.
func (Server) Register ¶
Register publishes in the provider the set of methods of the receiver value that satisfy the following conditions:
- exported method
- two arguments, both of exported type
- the second argument is a pointer
- one return value, of type error
It returns an error if the receiver is not an exported type or has no suitable methods. It also logs the error using package log. The client accesses each method using a string of the form "Type.Method", where Type is the receiver's concrete type.
func (Server) RegisterName ¶
RegisterName is like Register but uses the provided name for the type instead of the receiver's concrete type.
func (Server) Serve ¶
func (s Server) Serve()
Serve starts the Server's RPC server, serving via gob encoding. This call will block until the client hangs up.
func (Server) ServeCodec ¶
func (s Server) ServeCodec(f func(io.ReadWriteCloser) rpc.ServerCodec)
ServeCodec starts the Server's RPC server, serving via the encoding returned by f. This call will block until the client hangs up.
type Song ¶
type Song struct { SName string SID string UID string SSingers []Musician SAlbum Album SSource uint SOnly bool SMp3URLs []string SLLURLs []string SPicURLs []string SLyricsURLs []string SURL string SDevString string SSlot1 string SSlot2 string SIsMp3Filled bool SIsLyricsFilled bool SIsPicFilled bool SIsAlbumFilled bool }
Song defines the main structure of universal song apis