Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Bindings ¶
type Bindings struct {
// contains filtered or unexported fields
}
func NewBindings ¶
func NewBindings(logger *logger.Logger, structPointersToBind []interface{}, exemptions []interface{}) *Bindings
NewBindings returns a new Bindings object
func (*Bindings) GenerateBackendJS ¶
func (b *Bindings) GenerateBackendJS()
type BoundMethod ¶
type BoundMethod struct { Name string `json:"name"` Inputs []*Parameter `json:"inputs,omitempty"` Outputs []*Parameter `json:"outputs,omitempty"` Comments string `json:"comments,omitempty"` Method reflect.Value `json:"-"` }
BoundMethod defines all the data related to a Go method that is bound to the Wails application
func (*BoundMethod) Call ¶
func (b *BoundMethod) Call(args []interface{}) (interface{}, error)
Call will attempt to call this bound method with the given args
func (*BoundMethod) InputCount ¶
func (b *BoundMethod) InputCount() int
InputCount returns the number of inputs this bound method has
func (*BoundMethod) OutputCount ¶
func (b *BoundMethod) OutputCount() int
OutputCount returns the number of outputs this bound method has
func (*BoundMethod) ParseArgs ¶
func (b *BoundMethod) ParseArgs(args []json.RawMessage) ([]interface{}, error)
ParseArgs method converts the input json into the types expected by the method
type DB ¶
type DB struct {
// contains filtered or unexported fields
}
DB is our database of method bindings
func (*DB) AddMethod ¶
func (d *DB) AddMethod(packageName string, structName string, methodName string, methodDefinition *BoundMethod)
AddMethod adds the given method definition to the db using the given qualified path: packageName.structName.methodName
func (*DB) GetMethod ¶
func (d *DB) GetMethod(qualifiedMethodName string) *BoundMethod
GetMethod returns the method for the given qualified method name qualifiedMethodName is "packagename.structname.methodname"
func (*DB) GetMethodFromStore ¶
func (d *DB) GetMethodFromStore(packageName string, structName string, methodName string) *BoundMethod
GetMethodFromStore returns the method for the given package/struct/method names nil is returned if any one of those does not exist