Documentation ¶
Index ¶
- type Client
- type GetUserFuture
- type GetUserRequest
- type GetUserResponse
- type ListUsersFuture
- type ListUsersRequest
- type ListUsersResponse
- type MockClient
- type User
- func (m *User) GetCreatedAt() (val time.Time, set bool)
- func (m *User) GetId() (val uint32, set bool)
- func (m *User) GetName() (val string, set bool)
- func (m *User) GetUpdatedAt() (val time.Time, set bool)
- func (m *User) SetCreatedAt(v time.Time) *User
- func (m *User) SetId(v uint32) *User
- func (m *User) SetName(v string) *User
- func (m *User) SetUpdatedAt(v time.Time) *User
- func (m *User) Validate() error
- type UserService
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client makes requests to this service
func (*Client) GetUser ¶
func (c *Client) GetUser(ctx context.Context, body *GetUserRequest) *GetUserFuture
GetUser dispatches an RPC to the service
func (*Client) ListUsers ¶
func (c *Client) ListUsers(ctx context.Context, body *ListUsersRequest) *ListUsersFuture
ListUsers dispatches an RPC to the service
type GetUserFuture ¶
type GetUserFuture struct {
// contains filtered or unexported fields
}
GetUserFuture represents an in-flight GetUser request
func (*GetUserFuture) Wait ¶
func (f *GetUserFuture) Wait() (*GetUserResponse, error)
Wait blocks until the response is ready
type GetUserRequest ¶
type GetUserRequest struct {
UserId *uint32 `json:"user_id,omitempty"`
}
GetUserRequest is defined in the .def file
func (*GetUserRequest) GetUserId ¶
func (m *GetUserRequest) GetUserId() (val uint32, set bool)
GetUserId returns the de-referenced value of UserId. The second return value states whether the field was set.
func (*GetUserRequest) SetUserId ¶
func (m *GetUserRequest) SetUserId(v uint32) *GetUserRequest
SetUserId sets the value of UserId
func (*GetUserRequest) Validate ¶
func (m *GetUserRequest) Validate() error
Validate returns an error if any of the fields have bad values
type GetUserResponse ¶
type GetUserResponse struct {
User *User `json:"user,omitempty"`
}
GetUserResponse is defined in the .def file
func (*GetUserResponse) GetUser ¶
func (m *GetUserResponse) GetUser() (val User, set bool)
GetUser returns the de-referenced value of User. The second return value states whether the field was set.
func (*GetUserResponse) SetUser ¶
func (m *GetUserResponse) SetUser(v User) *GetUserResponse
SetUser sets the value of User
func (*GetUserResponse) Validate ¶
func (m *GetUserResponse) Validate() error
Validate returns an error if any of the fields have bad values
type ListUsersFuture ¶
type ListUsersFuture struct {
// contains filtered or unexported fields
}
ListUsersFuture represents an in-flight ListUsers request
func (*ListUsersFuture) Wait ¶
func (f *ListUsersFuture) Wait() (*ListUsersResponse, error)
Wait blocks until the response is ready
type ListUsersRequest ¶
type ListUsersRequest struct { }
ListUsersRequest is defined in the .def file
func (*ListUsersRequest) Validate ¶
func (m *ListUsersRequest) Validate() error
Validate returns an error if any of the fields have bad values
type ListUsersResponse ¶
type ListUsersResponse struct {
Users []*User `json:"users,omitempty"`
}
ListUsersResponse is defined in the .def file
func (*ListUsersResponse) GetUsers ¶
func (m *ListUsersResponse) GetUsers() (val []*User, set bool)
GetUsers returns the de-referenced value of Users. The second return value states whether the field was set.
func (*ListUsersResponse) SetUsers ¶
func (m *ListUsersResponse) SetUsers(v []*User) *ListUsersResponse
SetUsers sets the value of Users
func (*ListUsersResponse) Validate ¶
func (m *ListUsersResponse) Validate() error
Validate returns an error if any of the fields have bad values
type MockClient ¶
type MockClient struct {
// contains filtered or unexported fields
}
MockClient can be used in tests
func NewMockClient ¶
func NewMockClient(ctx context.Context, t *testing.T) *MockClient
NewMockClient returns a new mock client
func (*MockClient) GetUser ¶
func (c *MockClient) GetUser(ctx context.Context, body *GetUserRequest) *GetUserFuture
GetUser dispatches an RPC to the mock client
func (*MockClient) ListUsers ¶
func (c *MockClient) ListUsers(ctx context.Context, body *ListUsersRequest) *ListUsersFuture
ListUsers dispatches an RPC to the mock client
type User ¶
type User struct { Id *uint32 `json:"id,omitempty"` Name *string `json:"name,omitempty"` CreatedAt *time.Time `json:"created_at,omitempty"` UpdatedAt *time.Time `json:"updated_at,omitempty"` }
User is defined in the .def file
func (*User) GetCreatedAt ¶
GetCreatedAt returns the de-referenced value of CreatedAt. The second return value states whether the field was set.
func (*User) GetId ¶
GetId returns the de-referenced value of Id. The second return value states whether the field was set.
func (*User) GetName ¶
GetName returns the de-referenced value of Name. The second return value states whether the field was set.
func (*User) GetUpdatedAt ¶
GetUpdatedAt returns the de-referenced value of UpdatedAt. The second return value states whether the field was set.
func (*User) SetCreatedAt ¶
SetCreatedAt sets the value of CreatedAt
func (*User) SetUpdatedAt ¶
SetUpdatedAt sets the value of UpdatedAt
type UserService ¶
type UserService interface { GetUser(ctx context.Context, body *GetUserRequest) *GetUserFuture ListUsers(ctx context.Context, body *ListUsersRequest) *ListUsersFuture }
UserService is the public interface of this service