bindings

package module
v0.4.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 5, 2021 License: BSL-1.0 Imports: 2 Imported by: 0

README

Bindings

GoDoc Go Report Card

About

This package provides bindings for values, similar to Java's property bindings. It is published on https://github.com/vbsw/bindings.

Copyright 2019, Vitali Baumtrok (vbsw@mailbox.org).

Bindings is distributed under the Boost Software License, version 1.0. (See accompanying file LICENSE or copy at http://www.boost.org/LICENSE_1_0.txt)

Bindings is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the Boost Software License for more details.

Using Go

Get this project:

$ go get github.com/vbsw/bindings

Update a local copy:

$ go get -u github.com/vbsw/bindings

Compile:

$ go install github.com/vbsw/bindings

Run tests:

$ go test github.com/vbsw/bindings

Using Git

Get the master branch and all refs of this project:

$ git clone https://github.com/vbsw/bindings.git

See all tags:

$ git tag -l

See local and remote branches:

$ git branch -a

Checkout other branches than master, for example the development branch:

$ git branch development origin/development
$ git checkout development

See tracked remote branches:

$ git branch -vv

Update all tracked branches and all refs:

$ git fetch

References

Documentation

Overview

Package bindings provides bindings for values.

Version 0.4.0.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Boolean

type Boolean interface {
	AddListener(BooleanListener)
	And(Boolean) Boolean
	EqualTo(Boolean) Boolean
	Int() Int
	Not() Boolean
	NotEqualTo(Boolean) Boolean
	Or(Boolean) Boolean
	RemoveListener(BooleanListener)
	Set(bool)
	SetFilter(BooleanFilter)
	String() String
	Value() bool
}

Boolean is an observable value.

func NewBoolean

func NewBoolean(params ...interface{}) Boolean

NewBoolean creates the observable Boolean and returns it.

type BooleanFilter added in v0.3.0

type BooleanFilter interface {
	FilterBoolean(Boolean, bool, bool) bool
}

BooleanFilter provides a function that is called before setting the value of Boolean.

type BooleanListener

type BooleanListener interface {
	BooleanChanged(Boolean, bool, bool)
}

BooleanListener is a listener for the observable Boolean. Function BooleanChanged is called only when observable value has changed, i.e. new value is not equal to old value.

type Float32 added in v0.3.0

type Float32 interface {
	AddListener(Float32Listener)
	Divide(Float32) Float32
	EqualTo(Float32) Boolean
	Float64() Float64
	GreaterThan(Float32) Boolean
	GreaterThanOrEqualTo(Float32) Boolean
	Int() Int
	LessThan(Float32) Boolean
	LessThanOrEqualTo(Float32) Boolean
	Minus(Float32) Float32
	Multiply(Float32) Float32
	NotEqualTo(Float32) Boolean
	Plus(Float32) Float32
	RemoveListener(Float32Listener)
	Set(float32)
	SetFilter(Float32Filter)
	String() String
	Value() float32
}

Float32 is an observable value.

func NewFloat32 added in v0.3.0

func NewFloat32(params ...interface{}) Float32

NewFloat32 creates the observable Float32 and returns it.

type Float32Filter added in v0.3.0

type Float32Filter interface {
	FilterFloat32(Float32, float32, float32) float32
}

Float32Filter provides a function that is called before setting the value of Float32.

type Float32Listener added in v0.3.0

type Float32Listener interface {
	Float32Changed(Float32, float32, float32)
}

Float32Listener is a listener for the observable Float32. Function Float32Changed is called only when observable value has changed, i.e. new value is not equal to old value.

type Float64 added in v0.2.0

type Float64 interface {
	AddListener(Float64Listener)
	Divide(Float64) Float64
	EqualTo(Float64) Boolean
	Float32() Float32
	GreaterThan(Float64) Boolean
	GreaterThanOrEqualTo(Float64) Boolean
	Int() Int
	LessThan(Float64) Boolean
	LessThanOrEqualTo(Float64) Boolean
	Minus(Float64) Float64
	Multiply(Float64) Float64
	NotEqualTo(Float64) Boolean
	Plus(Float64) Float64
	RemoveListener(Float64Listener)
	Set(float64)
	SetFilter(Float64Filter)
	String() String
	Value() float64
}

Float64 is an observable value.

func NewFloat64 added in v0.3.0

func NewFloat64(params ...interface{}) Float64

NewFloat64 creates the observable Float64 and returns it.

type Float64Filter added in v0.3.0

type Float64Filter interface {
	FilterFloat64(Float64, float64, float64) float64
}

Float64Filter provides a function that is called before setting the value of Float64.

type Float64Listener added in v0.2.0

type Float64Listener interface {
	Float64Changed(Float64, float64, float64)
}

Float64Listener is a listener for the observable Float64. Function Float64Changed is called only when observable value has changed, i.e. new value is not equal to old value.

type Int added in v0.3.0

type Int interface {
	AddListener(IntListener)
	Divide(Int) Int
	EqualTo(Int) Boolean
	Float64() Float64
	Float32() Float32
	GreaterThan(Int) Boolean
	GreaterThanOrEqualTo(Int) Boolean
	LessThan(Int) Boolean
	LessThanOrEqualTo(Int) Boolean
	Minus(Int) Int
	Multiply(Int) Int
	NotEqualTo(Int) Boolean
	Plus(Int) Int
	RemoveListener(IntListener)
	Set(int)
	SetFilter(IntFilter)
	String() String
	Value() int
}

Int is an observable value.

func NewInt added in v0.3.0

func NewInt(params ...interface{}) Int

NewInt creates the observable Int and returns it.

type IntFilter added in v0.3.0

type IntFilter interface {
	FilterInt(Int, int, int) int
}

IntFilter provides a function that is called before setting the value of Int.

type IntListener added in v0.3.0

type IntListener interface {
	IntChanged(Int, int, int)
}

IntListener is a listener for the observable Int. Function IntChanged is called only when observable value has changed, i.e. new value is not equal to old value.

type String added in v0.3.0

type String interface {
	AddListener(StringListener)
	Append(String) String
	Boolean() Boolean
	EqualTo(String) Boolean
	Float64() Float64
	Float32() Float32
	GreaterThan(String) Boolean
	GreaterThanOrEqualTo(String) Boolean
	Int() Int
	LessThan(String) Boolean
	LessThanOrEqualTo(String) Boolean
	LowerCase() String
	NotEqualTo(String) Boolean
	RemoveListener(StringListener)
	Set(string)
	SetFilter(StringFilter)
	Value() string
}

String is an observable value.

func NewString added in v0.3.0

func NewString(params ...interface{}) String

NewString creates the observable String and returns it.

type StringFilter added in v0.3.0

type StringFilter interface {
	FilterString(String, string, string) string
}

StringFilter provides a function that is called before setting the value of String.

type StringListener added in v0.3.0

type StringListener interface {
	StringChanged(String, string, string)
}

StringListener is a listener for the observable String. Function StringChanged is called only when observable value has changed, i.e. new value is not equal to old value.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL