userdef

package
v0.0.0-...-34c5bf1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 7, 2020 License: MIT Imports: 4 Imported by: 0

Documentation

Index

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 NewClient

func NewClient(dispatcher taxi.Dispatcher) *Client

NewClient returns a new client

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

func (m *User) GetCreatedAt() (val time.Time, set bool)

GetCreatedAt returns the de-referenced value of CreatedAt. The second return value states whether the field was set.

func (*User) GetId

func (m *User) GetId() (val uint32, set bool)

GetId returns the de-referenced value of Id. The second return value states whether the field was set.

func (*User) GetName

func (m *User) GetName() (val string, set bool)

GetName returns the de-referenced value of Name. The second return value states whether the field was set.

func (*User) GetUpdatedAt

func (m *User) GetUpdatedAt() (val time.Time, set bool)

GetUpdatedAt returns the de-referenced value of UpdatedAt. The second return value states whether the field was set.

func (*User) SetCreatedAt

func (m *User) SetCreatedAt(v time.Time) *User

SetCreatedAt sets the value of CreatedAt

func (*User) SetId

func (m *User) SetId(v uint32) *User

SetId sets the value of Id

func (*User) SetName

func (m *User) SetName(v string) *User

SetName sets the value of Name

func (*User) SetUpdatedAt

func (m *User) SetUpdatedAt(v time.Time) *User

SetUpdatedAt sets the value of UpdatedAt

func (*User) Validate

func (m *User) Validate() error

Validate returns an error if any of the fields have bad values

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

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL