Documentation ¶
Overview ¶
Package testcmd provides fake commands used for testing.
Index ¶
- Variables
- type A
- func (a *A) API() api.API
- func (a *A) Caller() api.CmdID
- func (a *A) CmdFlags(context.Context, api.CmdID, *api.GlobalState) api.CmdFlags
- func (a *A) CmdName() string
- func (a *A) Extras() *api.CmdExtras
- func (a *A) Mutate(context.Context, api.CmdID, *api.GlobalState, *builder.Builder) error
- func (a *A) SetCaller(api.CmdID)
- func (a *A) SetThread(uint64)
- func (a *A) Thread() uint64
- type API
- func (API) ConstantSets() *constset.Pack
- func (API) Context(*api.GlobalState, uint64) api.Context
- func (API) CreateCmd(name string) api.Cmd
- func (API) GetFramebufferAttachmentInfo(ctx context.Context, after []uint64, state *api.GlobalState, thread uint64, ...) (api.FramebufferAttachmentInfo, error)
- func (API) ID() api.ID
- func (API) Index() uint8
- func (API) Name() string
- type B
- func (*B) API() api.API
- func (*B) Caller() api.CmdID
- func (*B) CmdFlags(context.Context, api.CmdID, *api.GlobalState) api.CmdFlags
- func (*B) CmdName() string
- func (*B) Extras() *api.CmdExtras
- func (*B) Mutate(context.Context, api.CmdID, *api.GlobalState, *builder.Builder) error
- func (*B) SetCaller(api.CmdID)
- func (*B) SetThread(uint64)
- func (*B) Thread() uint64
- type CmdAndID
- type CmdAndIDList
- type IntːStructPtr
- func (m IntːStructPtr) Add(k int, v *Struct)
- func (m *IntːStructPtr) Assign(v interface{}) bool
- func (m IntːStructPtr) Contains(k int) bool
- func (m IntːStructPtr) Get(k int) *Struct
- func (m IntːStructPtr) Keys() []int
- func (m IntːStructPtr) Len() int
- func (m IntːStructPtr) Lookup(k int) (val *Struct, ok bool)
- func (m IntːStructPtr) Remove(k int)
- type Pointer
- func (p Pointer) APointer()
- func (p Pointer) Address() uint64
- func (p *Pointer) Assign(o interface{}) bool
- func (p Pointer) ElementSize(m *device.MemoryLayout) uint64
- func (p Pointer) ElementType() reflect.Type
- func (p Pointer) ISlice(start, end uint64, m *device.MemoryLayout) memory.Slice
- func (p Pointer) IsNullptr() bool
- func (p Pointer) Offset(n uint64) memory.Pointer
- func (p Pointer) String() string
- type RawIntːStructPtr
- type StringːString
- func (m StringːString) Add(k, v string)
- func (m *StringːString) Assign(v interface{}) bool
- func (m StringːString) Contains(k string) bool
- func (m StringːString) Get(k string) string
- func (m StringːString) Keys() []string
- func (m StringːString) Len() int
- func (m StringːString) Lookup(k string) (val string, ok bool)
- func (m StringːString) Remove(k string)
- type Struct
- type Writer
- type X
- func (X) API() api.API
- func (X) Caller() api.CmdID
- func (X) CmdFlags(context.Context, api.CmdID, *api.GlobalState) api.CmdFlags
- func (X) CmdName() string
- func (X) Extras() *api.CmdExtras
- func (X) Mutate(context.Context, api.CmdID, *api.GlobalState, *builder.Builder) error
- func (X) SetCaller(api.CmdID)
- func (X) SetThread(uint64)
- func (X) Thread() uint64
Constants ¶
This section is empty.
Variables ¶
var ( APIID = api.ID{1, 2, 3} P = &X{ Str: "aaa", Sli: []bool{true, false, true}, Ref: &Struct{Str: "ccc", Ref: &Struct{Str: "ddd"}}, Ptr: Pointer(0x123), Map: StringːString{map[string]string{"cat": "meow", "dog": "woof"}}, PMap: IntːStructPtr{map[int]*Struct{}}, RMap: map[string]string{"eyes": "see", "nose": "smells"}, } Q = &X{ Str: "xyz", Sli: []bool{false, true, false}, Ptr: Pointer(0x321), Map: StringːString{map[string]string{"bird": "tweet", "fox": "?"}}, PMap: IntːStructPtr{map[int]*Struct{ 100: &Struct{Str: "baldrick"}, }}, RMap: map[string]string{"ears": "hear", "tongue": "taste"}, } )
Functions ¶
This section is empty.
Types ¶
type API ¶
type API struct{}
func (API) ConstantSets ¶
func (API) GetFramebufferAttachmentInfo ¶
func (API) GetFramebufferAttachmentInfo( ctx context.Context, after []uint64, state *api.GlobalState, thread uint64, attachment api.FramebufferAttachment) (api.FramebufferAttachmentInfo, error)
type CmdAndIDList ¶
type CmdAndIDList []CmdAndID
func List ¶
func List(cmds ...interface{}) CmdAndIDList
List takes a mix of Cmds and CmdIDsAndCmd and returns a CmdIDListAndCmd. Cmds are transformed into CmdIDsAndCmd by using the ID field as the command id.
type IntːStructPtr ¶
func (IntːStructPtr) Add ¶ added in v1.1.0
func (m IntːStructPtr) Add(k int, v *Struct)
Add inserts the key-value pair, replacing any existing entry with the same key.
func (*IntːStructPtr) Assign ¶ added in v0.9.0
func (m *IntːStructPtr) Assign(v interface{}) bool
func (IntːStructPtr) Contains ¶ added in v1.1.0
func (m IntːStructPtr) Contains(k int) bool
Contains returns true if the dictionary contains an entry with the given key.
func (IntːStructPtr) Get ¶ added in v1.1.0
func (m IntːStructPtr) Get(k int) *Struct
Get returns the value of the entry with the given key.
func (IntːStructPtr) Keys ¶ added in v1.1.0
func (m IntːStructPtr) Keys() []int
Keys returns all the entry keys in the map.
func (IntːStructPtr) Len ¶ added in v1.1.0
func (m IntːStructPtr) Len() int
Len returns the number of entries in the dictionary.
func (IntːStructPtr) Lookup ¶ added in v1.1.0
func (m IntːStructPtr) Lookup(k int) (val *Struct, ok bool)
Lookup searches for the value of the entry with the given key.
func (IntːStructPtr) Remove ¶ added in v1.1.0
func (m IntːStructPtr) Remove(k int)
Remove removes the entry with the given key. If no entry with the given key exists then this call is a no-op.
type Pointer ¶
type Pointer uint64
func (Pointer) ElementSize ¶
func (p Pointer) ElementSize(m *device.MemoryLayout) uint64
func (Pointer) ElementType ¶
type RawIntːStructPtr ¶ added in v0.9.0
type StringːString ¶
func (StringːString) Add ¶ added in v1.1.0
func (m StringːString) Add(k, v string)
Add inserts the key-value pair, replacing any existing entry with the same key.
func (*StringːString) Assign ¶ added in v0.9.0
func (m *StringːString) Assign(v interface{}) bool
func (StringːString) Contains ¶ added in v1.1.0
func (m StringːString) Contains(k string) bool
Contains returns true if the dictionary contains an entry with the given key.
func (StringːString) Get ¶ added in v1.1.0
func (m StringːString) Get(k string) string
Get returns the value of the entry with the given key.
func (StringːString) Keys ¶ added in v1.1.0
func (m StringːString) Keys() []string
Keys returns all the entry keys in the map.
func (StringːString) Len ¶ added in v1.1.0
func (m StringːString) Len() int
Len returns the number of entries in the dictionary.
func (StringːString) Lookup ¶ added in v1.1.0
func (m StringːString) Lookup(k string) (val string, ok bool)
Lookup searches for the value of the entry with the given key.
func (StringːString) Remove ¶ added in v1.1.0
func (m StringːString) Remove(k string)
Remove removes the entry with the given key. If no entry with the given key exists then this call is a no-op.
type Writer ¶
type Writer struct { S *api.GlobalState Cmds []api.Cmd CmdsAndIDs []CmdAndID }
Writer is a transform.Writer that record all commands that pass through it.
func (*Writer) MutateAndWrite ¶
func (*Writer) State ¶
func (w *Writer) State() *api.GlobalState
type X ¶
type X struct { Str string `param:"Str"` Sli []bool `param:"Sli"` Ref *Struct `param:"Ref"` Ptr Pointer `param:"Ptr"` Map StringːString `param:"Map"` PMap IntːStructPtr `param:"PMap"` RMap RawIntːStructPtr `param:"RMap"` }