Documentation ¶
Index ¶
- func Home(arg *args.EmptyStruct, setting ...tp.MessageSetting) (*args.HomeResult, *tp.Status)
- func Init(cliConfig micro.CliConfig, etcdConfing etcd.EasyConfig)
- func InitWithClient(cli *micro.Client)
- func Math_Divide(arg *args.DivideArg, setting ...tp.MessageSetting) (*args.DivideResult, *tp.Status)
- func Stat(arg *args.StatArg, setting ...tp.MessageSetting) *tp.Status
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Home ¶
func Home(arg *args.EmptyStruct, setting ...tp.MessageSetting) (*args.HomeResult, *tp.Status)
Home handler
Example ¶
package main import ( "encoding/json" "fmt" tp "github.com/henrylee2cn/teleport" "github.com/xiaoenai/tp-micro/examples/project/args" "github.com/xiaoenai/tp-micro/examples/project/sdk" ) func toJsonBytes(i interface{}) []byte { b, _ := json.MarshalIndent(i, "", " ") return b } func main() { result, status := sdk.Home(&args.EmptyStruct{}) if status != nil { tp.Errorf("Home: status: %s", toJsonBytes(status)) } else { tp.Infof("Home: result: %s", toJsonBytes(result)) } fmt.Printf("") }
Output:
func Init ¶
func Init(cliConfig micro.CliConfig, etcdConfing etcd.EasyConfig)
Init initializes client with configs.
func InitWithClient ¶
InitWithClient initializes client with specified object.
func Math_Divide ¶
func Math_Divide(arg *args.DivideArg, setting ...tp.MessageSetting) (*args.DivideResult, *tp.Status)
Divide handler
Example ¶
package main import ( "encoding/json" "fmt" tp "github.com/henrylee2cn/teleport" "github.com/xiaoenai/tp-micro/examples/project/args" "github.com/xiaoenai/tp-micro/examples/project/sdk" ) func toJsonBytes(i interface{}) []byte { b, _ := json.MarshalIndent(i, "", " ") return b } func main() { result, status := sdk.Math_Divide(&args.DivideArg{}) if status != nil { tp.Errorf("Math_Divide: status: %s", toJsonBytes(status)) } else { tp.Infof("Math_Divide: result: %s", toJsonBytes(result)) } fmt.Printf("") }
Output:
func Stat ¶
Stat handler
Example ¶
package main import ( "encoding/json" "fmt" tp "github.com/henrylee2cn/teleport" "github.com/xiaoenai/tp-micro/examples/project/args" "github.com/xiaoenai/tp-micro/examples/project/sdk" ) func toJsonBytes(i interface{}) []byte { b, _ := json.MarshalIndent(i, "", " ") return b } func main() { status := sdk.Stat(&args.StatArg{}) if status != nil { tp.Errorf("Stat: status: %s", toJsonBytes(status)) } fmt.Printf("") }
Output:
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.