Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct { //Id is the Client's id. Id data.Id //Name is the Client's name. // //Name must be unique across all Clients in the application. Name string //CreatedAt is the time at which this Client was created. CreatedAt time.Time //UpdatedAt is the time at which this Client was most recently updated. UpdatedAt time.Time }
Client is a domain type that represents a client inside the application.
This could be thought of as a business project or business unit. In out line of work, they are called clients.
Different Users are allowed to access different Clients. Furthermore, there would normally be "lower level" domain types that belong to a Client.
type QueryRepo ¶
type QueryRepo interface { //Get should return the Client whose Id equals id. Get(ctx context.Context, id data.Id) (*Client, error) //List should return all Clients in the repository. List(ctx context.Context) ([]*Client, error) //ListById should return all Clients whose Id is in ids. ListByIds(ctx context.Context, ids []data.Id) ([]*Client, error) }
QueryRepo provides the methods for retrieving Clients.
type Repo ¶
type Repo interface { //QueryRepo is promoted to include the retrival methods. QueryRepo //Add should add c to the underlying repo's storage. Add(ctx context.Context, c Client) error //Set should udpate all stored fields of c in the underlying storage repository. //The update should use c.Id to determine with entity to update. Set(ctx context.Context, c Client) error //Remove should remove the Client with id from the underlying storage. Remove(ctx context.Context, id data.Id) error }
Repo provides methods for retrieving and manipulating Clients.
Click to show internal directories.
Click to hide internal directories.