Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func IsValidMppqResponse ¶
func IsValidMppqResponse(r MppqResponse) bool
Validate MppqResponse, based on header / mppqResponseHeader
Types ¶
type MppqQuery ¶
type MppqQuery struct {
Query string
}
MppqQuery defines the mppq query (cf NewStdMppqQuery)
func NewStdMppqQuery ¶
func NewStdMppqQuery() MppqQuery
Create a MppqQuery, with the query's correct values
type MppqResponse ¶
type MppqResponse struct { Header string // holds the expected mppqResponseHeader ServiceDefs []ServiceDef }
MppqResponse defines the mppq response
func NewMppqResponse ¶
func NewMppqResponse(serviceDefs []ServiceDef) MppqResponse
Create a MppqResponse, with header set to correct value
func QueryServiceDefs ¶
func QueryServiceDefs(nbTries int) (*MppqResponse, error)
QueryServiceDefs sends a MppqQuery to get service definitions from all mppq servers nbTries: number of tries (1 second timeout each)
type MppqServer ¶
type MppqServer struct {
// contains filtered or unexported fields
}
MppqServer implements a mppq server
func NewMppqServer ¶
func NewMppqServer(serviceDefs []ServiceDef) *MppqServer
Create a new MppqServer
func (*MppqServer) Serve ¶
func (s *MppqServer) Serve(ctx context.Context)
Listen on udp and process / respond to received MppqQuery
type ServiceDef ¶
type ServiceDef struct { ServiceName string // the name of the service provided ProviderName string // the name of the provider HostIP string // IP address on which the service is available HostPort int // port on which the service is available Protocol string // app arbitrary protocol name, ie "jsonrpcv1" }
ServiceDef describes a service the provider offers.
func NewLocalServiceDef ¶
func NewLocalServiceDef(serviceName string, hostPort int, protocol string) ServiceDef
Create a service definition using local hostname and local IP
func NewServiceDef ¶
func NewServiceDef(serviceName, providerName string, hostIP string, hostPort int, protocol string) ServiceDef
Create a service definition
Directories ¶
Path | Synopsis |
---|---|
examples
|
|
marcopolo.old
|
|
v0.1/go
main.go
|
main.go |
v0.2/go/src/google.code/p/marcoPoloGo/clientQryTest
clientQryTest, queries marcopolo for an app address
|
clientQryTest, queries marcopolo for an app address |
v0.2/go/src/google.code/p/marcoPoloGo/clientRegTest
marcoPoloClientTest
|
marcoPoloClientTest |
v0.2/go/src/google.code/p/marcoPoloGo/marcopolo
marcopolo contains ClientConn & ServerConn that lets apps register to marcoPolo server (UDP), other apps then send requests for registered apps addresses by name
|
marcopolo contains ClientConn & ServerConn that lets apps register to marcoPolo server (UDP), other apps then send requests for registered apps addresses by name |
v0.2/go/src/google.code/p/marcoPoloGo/marcopolo/notbuild
marcopolo lets apps register for msgs they are interested in, other apps then requests for the registered app's address for a msg
|
marcopolo lets apps register for msgs they are interested in, other apps then requests for the registered app's address for a msg |
v0.2/go/src/google.code/p/marcoPoloGo/marcopoloSrv
marcoPoloSrv.go
|
marcoPoloSrv.go |
v0.3/examples
MarcoPoloPQ project Copyright 2014 Philippe Quesnel Licensed under the Academic Free License version 3.0
|
MarcoPoloPQ project Copyright 2014 Philippe Quesnel Licensed under the Academic Free License version 3.0 |
v0.3/examples/libprovider/provider
Package provider
|
Package provider |
v0.3/examples/libprovider/provider/gen
Package go_provider is an autogenerated binder stub for package provider.
|
Package go_provider is an autogenerated binder stub for package provider. |
v0.3/examples/provider
MarcoPoloPQ project Copyright 2014 Philippe Quesnel Licensed under the Academic Free License version 3.0
|
MarcoPoloPQ project Copyright 2014 Philippe Quesnel Licensed under the Academic Free License version 3.0 |
v0.3/examples/query
MarcoPoloPQ project Copyright 2014 Philippe Quesnel Licensed under the Academic Free License version 3.0
|
MarcoPoloPQ project Copyright 2014 Philippe Quesnel Licensed under the Academic Free License version 3.0 |
v0.3/examples/queryAsynch
MarcoPoloPQ project Copyright 2014 Philippe Quesnel Licensed under the Academic Free License version 3.0
|
MarcoPoloPQ project Copyright 2014 Philippe Quesnel Licensed under the Academic Free License version 3.0 |
misctests
|
|
udp.go
main.go
|
main.go |