Documentation ¶
Index ¶
- Constants
- Variables
- func CanBeAugmented() managerOption
- func DisableDelete() managerOption
- func WithIDGen(fn func() id.ID) managerOption
- func WithOperations(ops ...Operation) managerOption
- func WithTracer(tracer trace.Tracer) managerOption
- type Create
- type Current
- type Delete
- type Encoder
- type Get
- type GetAugmented
- type IDSetter
- type List
- type ListAugmented
- type Manager
- type Operation
- type Provision
- type Provisioner
- type Resource
- type ResourceList
- type ResourceSpec
- type SortableHandler
- type Update
Constants ¶
View Source
const HeaderAugmented = "X-Tracetest-Augmented"
Variables ¶
View Source
var ErrTypeNotSupported = errors.New("type not supported")
Functions ¶
func CanBeAugmented ¶
func CanBeAugmented() managerOption
func DisableDelete ¶
func DisableDelete() managerOption
func WithOperations ¶
func WithOperations(ops ...Operation) managerOption
func WithTracer ¶
Types ¶
type Create ¶
type Create[T ResourceSpec] interface { Create(context.Context, T) (T, error) IDSetter[T] }
type Encoder ¶
type Encoder struct {
// contains filtered or unexported fields
}
func EncoderFromRequest ¶
func (Encoder) DecodeRequestBody ¶
func (Encoder) RequestContentType ¶
func (Encoder) ResponseContentType ¶
func (Encoder) WriteEncodedResponse ¶
type GetAugmented ¶
type IDSetter ¶
type IDSetter[T ResourceSpec] interface { SetID(T, id.ID) T }
type ListAugmented ¶
type Manager ¶
type Operation ¶
type Operation string
const ( OperationNoop Operation = "" OperationList Operation = "list" OperationCreate Operation = "create" OperationUpdate Operation = "update" OperationGet Operation = "get" OperationDelete Operation = "delete" OperationGetAugmented Operation = "getAugmented" OperationListAugmented Operation = "listAugmented" )
type Provision ¶
type Provision[T ResourceSpec] interface { Provision(context.Context, T) error IDSetter[T] }
type Provisioner ¶
type Resource ¶
type Resource[T ResourceSpec] struct { Type string `json:"type"` Spec T `json:"spec"` }
type ResourceList ¶
type ResourceList[T ResourceSpec] struct { Count int `json:"count" yamlstream:"count"` Items []Resource[T] `json:"items" yamlstream:"items"` }
type SortableHandler ¶
type SortableHandler interface {
SortingFields() []string
}
Click to show internal directories.
Click to hide internal directories.