mirror of
https://github.com/go-micro/go-micro.git
synced 2024-11-24 08:02:32 +02:00
Add package comments
This commit is contained in:
parent
9d50d51c40
commit
1254a87286
4
broker/doc.go
Normal file
4
broker/doc.go
Normal file
@ -0,0 +1,4 @@
|
||||
/*
|
||||
Package broker is an interface used for asynchronous messaging.
|
||||
*/
|
||||
package broker
|
@ -1,24 +1,3 @@
|
||||
/*
|
||||
Package client provides a method to make synchronous, asynchronous and
|
||||
streaming requests to services. By default json and protobuf codecs are
|
||||
supported.
|
||||
|
||||
import "github.com/micro/go-micro/client"
|
||||
|
||||
c := client.NewClient()
|
||||
|
||||
req := c.NewRequest("go.micro.srv.greeter", "Greeter.Hello", &greeter.Request{
|
||||
Name: "John",
|
||||
})
|
||||
|
||||
rsp := &greeter.Response{}
|
||||
|
||||
if err := c.Call(context.Background(), req, rsp); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
fmt.Println(rsp.Msg)
|
||||
*/
|
||||
package client
|
||||
|
||||
import (
|
||||
|
23
client/doc.go
Normal file
23
client/doc.go
Normal file
@ -0,0 +1,23 @@
|
||||
/*
|
||||
Package client is an interface for making requests.
|
||||
|
||||
It provides a method to make synchronous, asynchronous and streaming requests to services.
|
||||
By default json and protobuf codecs are supported.
|
||||
|
||||
import "github.com/micro/go-micro/client"
|
||||
|
||||
c := client.NewClient()
|
||||
|
||||
req := c.NewRequest("go.micro.srv.greeter", "Greeter.Hello", &greeter.Request{
|
||||
Name: "John",
|
||||
})
|
||||
|
||||
rsp := &greeter.Response{}
|
||||
|
||||
if err := c.Call(context.Background(), req, rsp); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
fmt.Println(rsp.Msg)
|
||||
*/
|
||||
package client
|
4
cmd/doc.go
Normal file
4
cmd/doc.go
Normal file
@ -0,0 +1,4 @@
|
||||
/*
|
||||
Package cmd is an interface for parsing the command line.
|
||||
*/
|
||||
package cmd
|
4
codec/doc.go
Normal file
4
codec/doc.go
Normal file
@ -0,0 +1,4 @@
|
||||
/*
|
||||
Package codec is an interface for encoding messages.
|
||||
*/
|
||||
package codec
|
4
errors/doc.go
Normal file
4
errors/doc.go
Normal file
@ -0,0 +1,4 @@
|
||||
/*
|
||||
Package errors is an interface for defining detailed errors.
|
||||
*/
|
||||
package errors
|
4
metadata/doc.go
Normal file
4
metadata/doc.go
Normal file
@ -0,0 +1,4 @@
|
||||
/*
|
||||
Package metadata is a way of defining message headers.
|
||||
*/
|
||||
package metadata
|
4
registry/doc.go
Normal file
4
registry/doc.go
Normal file
@ -0,0 +1,4 @@
|
||||
/*
|
||||
Package registry is an interface for service discovery.
|
||||
*/
|
||||
package registry
|
8
selector/doc.go
Normal file
8
selector/doc.go
Normal file
@ -0,0 +1,8 @@
|
||||
/*
|
||||
Package selector is a way to load balance service nodes.
|
||||
|
||||
It algorithmically filter and return nodes required by the client or any other system.
|
||||
Selector's implemented by Micro build on the registry but it's of optional use. One could
|
||||
provide a static Selector that has a fixed pool.
|
||||
*/
|
||||
package selector
|
@ -1,9 +1,3 @@
|
||||
/*
|
||||
The Selector package provides a way to algorithmically filter and return
|
||||
nodes required by the client or any other system. Selector's implemented
|
||||
by Micro build on the registry but it's of optional use. One could
|
||||
provide a static Selector that has a fixed pool.
|
||||
*/
|
||||
package selector
|
||||
|
||||
import (
|
||||
|
31
server/doc.go
Normal file
31
server/doc.go
Normal file
@ -0,0 +1,31 @@
|
||||
/*
|
||||
Package server is an interface for a micro server.
|
||||
|
||||
It represents a server instance in go-micro which handles synchronous
|
||||
requests via handlers and asynchronous requests via subscribers that
|
||||
register with a broker.
|
||||
|
||||
The server combines the all the packages in go-micro to create a whole unit
|
||||
used for building applications including discovery, client/server communication
|
||||
and pub/sub.
|
||||
|
||||
import "github.com/micro/go-micro/server"
|
||||
|
||||
type Greeter struct {}
|
||||
|
||||
func (g *Greeter) Hello(ctx context.Context, req *greeter.Request, rsp *greeter.Response) error {
|
||||
rsp.Msg = "Hello " + req.Name
|
||||
return nil
|
||||
}
|
||||
|
||||
s := server.NewServer()
|
||||
|
||||
|
||||
s.Handle(
|
||||
s.NewHandler(&Greeter{}),
|
||||
)
|
||||
|
||||
s.Start()
|
||||
|
||||
*/
|
||||
package server
|
@ -1,31 +1,3 @@
|
||||
/*
|
||||
Server represents a server instance in go-micro which handles synchronous
|
||||
requests via handlers and asynchronous requests via subscribers that
|
||||
register with a broker.
|
||||
|
||||
The server combines the all the packages in go-micro to create a whole unit
|
||||
used for building applications including discovery, client/server communication
|
||||
and pub/sub.
|
||||
|
||||
import "github.com/micro/go-micro/server"
|
||||
|
||||
type Greeter struct {}
|
||||
|
||||
func (g *Greeter) Hello(ctx context.Context, req *greeter.Request, rsp *greeter.Response) error {
|
||||
rsp.Msg = "Hello " + req.Name
|
||||
return nil
|
||||
}
|
||||
|
||||
s := server.NewServer()
|
||||
|
||||
|
||||
s.Handle(
|
||||
s.NewHandler(&Greeter{}),
|
||||
)
|
||||
|
||||
s.Start()
|
||||
|
||||
*/
|
||||
package server
|
||||
|
||||
import (
|
||||
|
4
transport/doc.go
Normal file
4
transport/doc.go
Normal file
@ -0,0 +1,4 @@
|
||||
/*
|
||||
Package is an interface for synchronous communication.
|
||||
*/
|
||||
package transport
|
Loading…
Reference in New Issue
Block a user