Documentation ¶
Index ¶
- func Init(cliConfig micro.CliConfig, etcdConfing etcd.EasyConfig)
- func InitWithClient(cli *micro.Client)
- func V1_User_Add(arg *args.AddUserArgsV1, setting ...socket.PacketSetting) (*args.AddUserResultV1, *tp.Rerror)
- func V1_User_Get(arg *args.GetUserArgsV1, setting ...socket.PacketSetting) (*args.GetUserResultV1, *tp.Rerror)
- func V1_User_GetById(arg *args.GetUserByIdArgsV1, setting ...socket.PacketSetting) (*args.GetUserByIdResultV1, *tp.Rerror)
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Init ¶
func Init(cliConfig micro.CliConfig, etcdConfing etcd.EasyConfig)
Init initializes client with configs.
func InitWithClient ¶
InitWithClient initializes client with specified object.
func V1_User_Add ¶
func V1_User_Add(arg *args.AddUserArgsV1, setting ...socket.PacketSetting) (*args.AddUserResultV1, *tp.Rerror)
Add handler
Example ¶
package main import ( "encoding/json" "fmt" tp "github.com/henrylee2cn/teleport" "github.com/xiaoenai/tp-template/user/args" "github.com/xiaoenai/tp-template/user/sdk" ) func toJsonBytes(i interface{}) []byte { b, _ := json.MarshalIndent(i, "", " ") return b } func main() { result, rerr := sdk.V1_User_Add(&args.AddUserArgsV1{}) if rerr != nil { tp.Errorf("V1_User_Add: rerr: %s", toJsonBytes(rerr)) } else { tp.Infof("V1_User_Add: result: %s", toJsonBytes(result)) } fmt.Printf("") }
Output:
func V1_User_Get ¶
func V1_User_Get(arg *args.GetUserArgsV1, setting ...socket.PacketSetting) (*args.GetUserResultV1, *tp.Rerror)
Get handler
Example ¶
package main import ( "encoding/json" "fmt" tp "github.com/henrylee2cn/teleport" "github.com/xiaoenai/tp-template/user/args" "github.com/xiaoenai/tp-template/user/sdk" ) func toJsonBytes(i interface{}) []byte { b, _ := json.MarshalIndent(i, "", " ") return b } func main() { result, rerr := sdk.V1_User_Get(&args.GetUserArgsV1{}) if rerr != nil { tp.Errorf("V1_User_Get: rerr: %s", toJsonBytes(rerr)) } else { tp.Infof("V1_User_Get: result: %s", toJsonBytes(result)) } fmt.Printf("") }
Output:
func V1_User_GetById ¶
func V1_User_GetById(arg *args.GetUserByIdArgsV1, setting ...socket.PacketSetting) (*args.GetUserByIdResultV1, *tp.Rerror)
获取用户
Example ¶
package main import ( "encoding/json" "fmt" tp "github.com/henrylee2cn/teleport" "github.com/xiaoenai/tp-template/user/args" "github.com/xiaoenai/tp-template/user/sdk" ) func toJsonBytes(i interface{}) []byte { b, _ := json.MarshalIndent(i, "", " ") return b } func main() { result, rerr := sdk.V1_User_GetById(&args.GetUserByIdArgsV1{}) if rerr != nil { tp.Errorf("V1_User_GetById: rerr: %s", toJsonBytes(rerr)) } else { tp.Infof("V1_User_GetById: result: %s", toJsonBytes(result)) } fmt.Printf("") }
Output:
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.