Documentation
¶
Overview ¶
Package widgets is the module of the spectest test app: its request types, the functions that answer them and the models they return.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AdminRequest ¶
type AdminRequest struct {
ID int64 `json:"id"`
}
func (*AdminRequest) Validate ¶
func (r *AdminRequest) Validate() error
type AdminWidget ¶
AdminWidget is a widget with the fields only an administrator sees.
func GetAdmin ¶
func GetAdmin(ctx context.Context, request *AdminRequest) (*AdminWidget, error)
type CreateRequest ¶
type CreateRequest struct {
Name string `json:"name"`
}
func (*CreateRequest) Validate ¶
func (r *CreateRequest) Validate() error
type FileRequest ¶
type FileRequest struct {
Path string `json:"path"`
}
func (*FileRequest) Validate ¶
func (r *FileRequest) Validate() error
type GetRequest ¶
type GetRequest struct {
ID int64 `json:"id"`
}
func (*GetRequest) Validate ¶
func (r *GetRequest) Validate() error
type ListRequest ¶
type ListRequest struct {
Search string `json:"search"`
}
func (*ListRequest) Validate ¶
func (r *ListRequest) Validate() error
type ListResponse ¶
type ListResponse struct {
Widgets []Widget `json:"widgets"`
}
func List ¶
func List(ctx context.Context, request *ListRequest) (*ListResponse, error)