clientcmd

package
v0.0.0-...-bcf6333 Latest Latest
Warning

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

Go to latest
Published: Jul 17, 2018 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CreateClientCommand

type CreateClientCommand struct {
	//Name is the name of the Client to create.
	Name string
}

CreateClientCommand is Command that should be used to create a new Client and add it to a repository.

type DeleteClientCommand

type DeleteClientCommand struct {
	//Id is the Id of the Client to delete.
	Id data.Id
}

DeleteClientCommand is a Command to delete (remove) a Client.

type Handler

type Handler struct {
	//Clients is the Client repository to use within Command handling.
	Clients client.Repo
}

Handler is a handler type that understands how to work with Client commands.

func (*Handler) CreateClient

func (h *Handler) CreateClient(ctx context.Context, cmd cbus.Command) (interface{}, error)

CreateClient attempts to create a new Client and add it to h.Clients. Cmd must be of type *CreateClientCommand. The result, if not nil and without error, will be a *client.Client.

func (*Handler) DeleteClient

func (h *Handler) DeleteClient(ctx context.Context, cmd cbus.Command) (interface{}, error)

DeleteClient attempts to remove a Client from h.Clients. Cmd must be of type *DeleteClientCommand. The result will always be nil. A non-nil error will be returned to indicate failure.

func (*Handler) UpdateClient

func (h *Handler) UpdateClient(ctx context.Context, cmd cbus.Command) (interface{}, error)

UpdateClient attempts to retrieve and set a Client using h.Clients. Cmd must be of type *UpdateClientCommand. The result, if not nil and without error, will be a *client.Client.

type UpdateClientCommand

type UpdateClientCommand struct {
	//Id is the Id of the Client to update.
	Id data.Id

	//Name, if not nil, is the name to set on the Client.
	Name *string
}

UpdateClientCommand is a Command to update a Client.

Jump to

Keyboard shortcuts

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