Documentation ¶
Index ¶
- type Bindings
- type BoundMethod
- func (b *BoundMethod) Call(args []interface{}) (interface{}, error)
- func (b *BoundMethod) InputCount() int
- func (b *BoundMethod) IsWailsInit() bool
- func (b *BoundMethod) IsWailsShutdown() bool
- func (b *BoundMethod) OutputCount() int
- func (b *BoundMethod) ParseArgs(args []json.RawMessage) ([]interface{}, error)
- func (b *BoundMethod) VerifyWailsInit() error
- func (b *BoundMethod) VerifyWailsShutdown() error
- type DB
- func (d *DB) AddMethod(packageName string, structName string, methodName string, ...)
- func (d *DB) AddWailsInit(method *BoundMethod) error
- func (d *DB) AddWailsShutdown(method *BoundMethod) error
- func (d *DB) GetMethod(qualifiedMethodName string) *BoundMethod
- func (d *DB) GetMethodFromStore(packageName string, structName string, methodName string) *BoundMethod
- func (d *DB) ToJSON() (string, error)
- func (d *DB) WailsInitMethods() []*BoundMethod
- func (d *DB) WailsShutdownMethods() []*BoundMethod
- type Parameter
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 ¶
NewBindings returns a new Bindings object
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) IsWailsInit ¶
func (b *BoundMethod) IsWailsInit() bool
IsWailsInit returns true if the method name is "WailsInit"
func (*BoundMethod) IsWailsShutdown ¶
func (b *BoundMethod) IsWailsShutdown() bool
IsWailsShutdown returns true if the method name is "WailsShutdown"
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
func (*BoundMethod) VerifyWailsInit ¶
func (b *BoundMethod) VerifyWailsInit() error
VerifyWailsInit checks if the WailsInit signature is correct
func (*BoundMethod) VerifyWailsShutdown ¶
func (b *BoundMethod) VerifyWailsShutdown() error
VerifyWailsShutdown checks if the WailsShutdown signature is correct
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) AddWailsInit ¶
func (d *DB) AddWailsInit(method *BoundMethod) error
AddWailsInit checks the given method is a WailsInit method and if it is, adds it to the list of WailsInit methods
func (*DB) AddWailsShutdown ¶
func (d *DB) AddWailsShutdown(method *BoundMethod) error
AddWailsShutdown checks the given method is a WailsInit method and if it is, adds it to the list of WailsShutdown methods
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
func (*DB) WailsInitMethods ¶
func (d *DB) WailsInitMethods() []*BoundMethod
WailsInitMethods returns the list of registered WailsInit methods
func (*DB) WailsShutdownMethods ¶
func (d *DB) WailsShutdownMethods() []*BoundMethod
WailsShutdownMethods returns the list of registered WailsInit methods