init
This commit is contained in:
commit
ee2718a1d0
17 files changed
+5264
No files matched your search
@@ -0,0 +1,23 @@
|
||||
package client
|
||||
|
||||
import (
|
||||
"example.com/layout/proto/discovery"
|
||||
"example.com/layout/proto/micro_layout/proto/user"
|
||||
)
|
||||
|
||||
const ServiceName = "micro.micro_layout"
|
||||
|
||||
type MicroLayoutClient struct {
|
||||
User user.UserClient
|
||||
connection *discovery.Connection
|
||||
}
|
||||
|
||||
func NewMicroLayoutClient(cfg discovery.Config, service string) (*MicroLayoutClient, error) {
|
||||
connection, err := discovery.Dial(cfg, service)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return &MicroLayoutClient{User: user.NewUserClient(connection.Conn), connection: connection}, nil
|
||||
}
|
||||
|
||||
func (client *MicroLayoutClient) Close() error { return client.connection.Close() }
|
||||
Reference in new issue
Block a user