add goa examples
This commit is contained in:
48
go/goa_example/gen/service1/client.go
Normal file
48
go/goa_example/gen/service1/client.go
Normal file
@@ -0,0 +1,48 @@
|
||||
// Code generated by goa v3.6.0, DO NOT EDIT.
|
||||
//
|
||||
// Service1 client
|
||||
//
|
||||
// Command:
|
||||
// $ goa gen goa_example/design
|
||||
|
||||
package service1
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
goa "goa.design/goa/v3/pkg"
|
||||
)
|
||||
|
||||
// Client is the "Service1" service client.
|
||||
type Client struct {
|
||||
SigninEndpoint goa.Endpoint
|
||||
SecureEndpoint goa.Endpoint
|
||||
}
|
||||
|
||||
// NewClient initializes a "Service1" service client given the endpoints.
|
||||
func NewClient(signin, secure goa.Endpoint) *Client {
|
||||
return &Client{
|
||||
SigninEndpoint: signin,
|
||||
SecureEndpoint: secure,
|
||||
}
|
||||
}
|
||||
|
||||
// Signin calls the "signin" endpoint of the "Service1" service.
|
||||
func (c *Client) Signin(ctx context.Context, p *SigninPayload) (res *Creds, err error) {
|
||||
var ires interface{}
|
||||
ires, err = c.SigninEndpoint(ctx, p)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
return ires.(*Creds), nil
|
||||
}
|
||||
|
||||
// Secure calls the "secure" endpoint of the "Service1" service.
|
||||
func (c *Client) Secure(ctx context.Context, p *SecurePayload) (res string, err error) {
|
||||
var ires interface{}
|
||||
ires, err = c.SecureEndpoint(ctx, p)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
return ires.(string), nil
|
||||
}
|
||||
Reference in New Issue
Block a user