crud

package
v0.0.0-...-7c0078d Latest Latest
Warning

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

Go to latest
Published: Sep 21, 2020 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const CrudABI = "" /* 1658-byte string literal not displayed */

CrudABI is the input ABI used to generate the binding from.

View Source
const TableFactoryABI = "" /* 315-byte string literal not displayed */

TableFactoryABI is the input ABI used to generate the binding from.

View Source
const (
	TableKeyMaxLength int = 255
)

Variables

View Source
var CRUDPrecompileAddress = common.HexToAddress("0x0000000000000000000000000000000000001002")

CRUDPrecompileAddress is the contract address of CRUD

View Source
var TableFactoryPrecompileAddress = common.HexToAddress("0x0000000000000000000000000000000000001001")

TableFactoryPrecompileAddress is the contract address of TableFactory

Functions

This section is empty.

Types

type Condition

type Condition struct {
	// contains filtered or unexported fields
}

func NewCondition

func NewCondition() *Condition

func (*Condition) EQ

func (c *Condition) EQ(key string, value string)

func (*Condition) GE

func (c *Condition) GE(key string, value string)

func (*Condition) GT

func (c *Condition) GT(key string, value string)

func (*Condition) GetConditions

func (c *Condition) GetConditions() map[string]map[EnumOP]string

func (*Condition) LE

func (c *Condition) LE(key string, value string)

func (*Condition) LT

func (c *Condition) LT(key string, value string)

func (*Condition) Limit

func (c *Condition) Limit(count int)

func (*Condition) NE

func (c *Condition) NE(key string, value string)

func (*Condition) SetConditions

func (c *Condition) SetConditions(newMap map[string]map[EnumOP]string)

type Crud

type Crud struct {
	CrudCaller     // Read-only binding to the contract
	CrudTransactor // Write-only binding to the contract
	CrudFilterer   // Log filterer for contract events
}

Crud is an auto generated Go binding around a Solidity contract.

func NewCrud

func NewCrud(address common.Address, backend bind.ContractBackend) (*Crud, error)

NewCrud creates a new instance of Crud, bound to a specific deployed contract.

type CrudCaller

type CrudCaller struct {
	// contains filtered or unexported fields
}

CrudCaller is an auto generated read-only Go binding around a Solidity contract.

func NewCrudCaller

func NewCrudCaller(address common.Address, caller bind.ContractCaller) (*CrudCaller, error)

NewCrudCaller creates a new read-only instance of Crud, bound to a specific deployed contract.

func (*CrudCaller) Desc

func (_Crud *CrudCaller) Desc(opts *bind.CallOpts, tableName string) (string, string, error)

Desc is a free data retrieval call binding the contract method 0x5d0d6d54.

Solidity: function desc(string tableName) constant returns(string, string)

func (*CrudCaller) Select

func (_Crud *CrudCaller) Select(opts *bind.CallOpts, tableName string, key string, condition string, arg3 string) (string, error)

Select is a free data retrieval call binding the contract method 0x983c6c4f.

Solidity: function select(string tableName, string key, string condition, string ) constant returns(string)

type CrudCallerRaw

type CrudCallerRaw struct {
	Contract *CrudCaller // Generic read-only contract binding to access the raw methods on
}

CrudCallerRaw is an auto generated low-level read-only Go binding around a Solidity contract.

func (*CrudCallerRaw) Call

func (_Crud *CrudCallerRaw) Call(opts *bind.CallOpts, result interface{}, method string, params ...interface{}) error

Call invokes the (constant) contract method with params as input values and sets the output to result. The result type might be a single field for simple returns, a slice of interfaces for anonymous returns and a struct for named returns.

type CrudCallerSession

type CrudCallerSession struct {
	Contract *CrudCaller   // Generic contract caller binding to set the session for
	CallOpts bind.CallOpts // Call options to use throughout this session
}

CrudCallerSession is an auto generated read-only Go binding around a Solidity contract, with pre-set call options.

func (*CrudCallerSession) Desc

func (_Crud *CrudCallerSession) Desc(tableName string) (string, string, error)

Desc is a free data retrieval call binding the contract method 0x5d0d6d54.

Solidity: function desc(string tableName) constant returns(string, string)

func (*CrudCallerSession) Select

func (_Crud *CrudCallerSession) Select(tableName string, key string, condition string, arg3 string) (string, error)

Select is a free data retrieval call binding the contract method 0x983c6c4f.

Solidity: function select(string tableName, string key, string condition, string ) constant returns(string)

type CrudFilterer

type CrudFilterer struct {
	// contains filtered or unexported fields
}

CrudFilterer is an auto generated log filtering Go binding around a Solidity contract events.

func NewCrudFilterer

func NewCrudFilterer(address common.Address, filterer bind.ContractFilterer) (*CrudFilterer, error)

NewCrudFilterer creates a new log filterer instance of Crud, bound to a specific deployed contract.

type CrudRaw

type CrudRaw struct {
	Contract *Crud // Generic contract binding to access the raw methods on
}

CrudRaw is an auto generated low-level Go binding around a Solidity contract.

func (*CrudRaw) Call

func (_Crud *CrudRaw) Call(opts *bind.CallOpts, result interface{}, method string, params ...interface{}) error

Call invokes the (constant) contract method with params as input values and sets the output to result. The result type might be a single field for simple returns, a slice of interfaces for anonymous returns and a struct for named returns.

func (*CrudRaw) Transact

func (_Crud *CrudRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, *types.Receipt, error)

Transact invokes the (paid) contract method with params as input values.

func (*CrudRaw) Transfer

func (_Crud *CrudRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, *types.Receipt, error)

Transfer initiates a plain transaction to move funds to the contract, calling its default method if one is available.

type CrudSession

type CrudSession struct {
	Contract     *Crud             // Generic contract binding to set the session for
	CallOpts     bind.CallOpts     // Call options to use throughout this session
	TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session
}

CrudSession is an auto generated Go binding around a Solidity contract, with pre-set call and transact options.

func (*CrudSession) AsyncInsert

func (_Crud *CrudSession) AsyncInsert(handler func(*types.Receipt, error), tableName string, key string, entry string, arg3 string) (*types.Transaction, error)

func (*CrudSession) AsyncRemove

func (_Crud *CrudSession) AsyncRemove(handler func(*types.Receipt, error), tableName string, key string, condition string, arg3 string) (*types.Transaction, error)

func (*CrudSession) AsyncUpdate

func (_Crud *CrudSession) AsyncUpdate(handler func(*types.Receipt, error), tableName string, key string, entry string, condition string, arg4 string) (*types.Transaction, error)

func (*CrudSession) Desc

func (_Crud *CrudSession) Desc(tableName string) (string, string, error)

Desc is a free data retrieval call binding the contract method 0x5d0d6d54.

Solidity: function desc(string tableName) constant returns(string, string)

func (*CrudSession) Insert

func (_Crud *CrudSession) Insert(tableName string, key string, entry string, arg3 string) (*types.Transaction, *types.Receipt, error)

Insert is a paid mutator transaction binding the contract method 0xa216464b.

Solidity: function insert(string tableName, string key, string entry, string ) returns(int256)

func (*CrudSession) Remove

func (_Crud *CrudSession) Remove(tableName string, key string, condition string, arg3 string) (*types.Transaction, *types.Receipt, error)

Remove is a paid mutator transaction binding the contract method 0xa72a1e65.

Solidity: function remove(string tableName, string key, string condition, string ) returns(int256)

func (*CrudSession) Select

func (_Crud *CrudSession) Select(tableName string, key string, condition string, arg3 string) (string, error)

Select is a free data retrieval call binding the contract method 0x983c6c4f.

Solidity: function select(string tableName, string key, string condition, string ) constant returns(string)

func (*CrudSession) Update

func (_Crud *CrudSession) Update(tableName string, key string, entry string, condition string, arg4 string) (*types.Transaction, *types.Receipt, error)

Update is a paid mutator transaction binding the contract method 0x2dca76c1.

Solidity: function update(string tableName, string key, string entry, string condition, string ) returns(int256)

type CrudTransactor

type CrudTransactor struct {
	// contains filtered or unexported fields
}

CrudTransactor is an auto generated write-only Go binding around a Solidity contract.

func NewCrudTransactor

func NewCrudTransactor(address common.Address, transactor bind.ContractTransactor) (*CrudTransactor, error)

NewCrudTransactor creates a new write-only instance of Crud, bound to a specific deployed contract.

func (*CrudTransactor) AsyncInsert

func (_Crud *CrudTransactor) AsyncInsert(handler func(*types.Receipt, error), opts *bind.TransactOpts, tableName string, key string, entry string, arg3 string) (*types.Transaction, error)

func (*CrudTransactor) AsyncRemove

func (_Crud *CrudTransactor) AsyncRemove(handler func(*types.Receipt, error), opts *bind.TransactOpts, tableName string, key string, condition string, arg3 string) (*types.Transaction, error)

func (*CrudTransactor) AsyncUpdate

func (_Crud *CrudTransactor) AsyncUpdate(handler func(*types.Receipt, error), opts *bind.TransactOpts, tableName string, key string, entry string, condition string, arg4 string) (*types.Transaction, error)

func (*CrudTransactor) Insert

func (_Crud *CrudTransactor) Insert(opts *bind.TransactOpts, tableName string, key string, entry string, arg3 string) (*types.Transaction, *types.Receipt, error)

Insert is a paid mutator transaction binding the contract method 0xa216464b.

Solidity: function insert(string tableName, string key, string entry, string ) returns(int256)

func (*CrudTransactor) Remove

func (_Crud *CrudTransactor) Remove(opts *bind.TransactOpts, tableName string, key string, condition string, arg3 string) (*types.Transaction, *types.Receipt, error)

Remove is a paid mutator transaction binding the contract method 0xa72a1e65.

Solidity: function remove(string tableName, string key, string condition, string ) returns(int256)

func (*CrudTransactor) Update

func (_Crud *CrudTransactor) Update(opts *bind.TransactOpts, tableName string, key string, entry string, condition string, arg4 string) (*types.Transaction, *types.Receipt, error)

Update is a paid mutator transaction binding the contract method 0x2dca76c1.

Solidity: function update(string tableName, string key, string entry, string condition, string ) returns(int256)

type CrudTransactorRaw

type CrudTransactorRaw struct {
	Contract *CrudTransactor // Generic write-only contract binding to access the raw methods on
}

CrudTransactorRaw is an auto generated low-level write-only Go binding around a Solidity contract.

func (*CrudTransactorRaw) Transact

func (_Crud *CrudTransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, *types.Receipt, error)

Transact invokes the (paid) contract method with params as input values.

func (*CrudTransactorRaw) Transfer

func (_Crud *CrudTransactorRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, *types.Receipt, error)

Transfer initiates a plain transaction to move funds to the contract, calling its default method if one is available.

type CrudTransactorSession

type CrudTransactorSession struct {
	Contract     *CrudTransactor   // Generic contract transactor binding to set the session for
	TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session
}

CrudTransactorSession is an auto generated write-only Go binding around a Solidity contract, with pre-set transact options.

func (*CrudTransactorSession) AsyncInsert

func (_Crud *CrudTransactorSession) AsyncInsert(handler func(*types.Receipt, error), tableName string, key string, entry string, arg3 string) (*types.Transaction, error)

func (*CrudTransactorSession) AsyncRemove

func (_Crud *CrudTransactorSession) AsyncRemove(handler func(*types.Receipt, error), tableName string, key string, condition string, arg3 string) (*types.Transaction, error)

func (*CrudTransactorSession) AsyncUpdate

func (_Crud *CrudTransactorSession) AsyncUpdate(handler func(*types.Receipt, error), tableName string, key string, entry string, condition string, arg4 string) (*types.Transaction, error)

func (*CrudTransactorSession) Insert

func (_Crud *CrudTransactorSession) Insert(tableName string, key string, entry string, arg3 string) (*types.Transaction, *types.Receipt, error)

Insert is a paid mutator transaction binding the contract method 0xa216464b.

Solidity: function insert(string tableName, string key, string entry, string ) returns(int256)

func (*CrudTransactorSession) Remove

func (_Crud *CrudTransactorSession) Remove(tableName string, key string, condition string, arg3 string) (*types.Transaction, *types.Receipt, error)

Remove is a paid mutator transaction binding the contract method 0xa72a1e65.

Solidity: function remove(string tableName, string key, string condition, string ) returns(int256)

func (*CrudTransactorSession) Update

func (_Crud *CrudTransactorSession) Update(tableName string, key string, entry string, condition string, arg4 string) (*types.Transaction, *types.Receipt, error)

Update is a paid mutator transaction binding the contract method 0x2dca76c1.

Solidity: function update(string tableName, string key, string entry, string condition, string ) returns(int256)

type Entry

type Entry struct {
	// contains filtered or unexported fields
}

func NewEntry

func NewEntry() *Entry

func (*Entry) Get

func (e *Entry) Get(key string) string

func (*Entry) GetFields

func (e *Entry) GetFields() map[string]string

func (*Entry) Put

func (e *Entry) Put(key string, value string)

func (*Entry) SetFields

func (e *Entry) SetFields(newFields map[string]string)

type EnumOP

type EnumOP string
const (
	EQ    EnumOP = "eq"
	NE    EnumOP = "ne"
	GT    EnumOP = "gt"
	GE    EnumOP = "ge"
	LT    EnumOP = "lt"
	LE    EnumOP = "le"
	Limit EnumOP = "limit"
)

type Service

type Service struct {
	// contains filtered or unexported fields
}

CRUDService is a precompile contract service.

func NewCRUDService

func NewCRUDService(client *client.Client) (*Service, error)

NewCRUDService returns ptr of CRUDService

func (*Service) AsyncCreateTable

func (service *Service) AsyncCreateTable(handler func(*types.Receipt, error), tableName string, key string, valueFields string) (*types.Transaction, error)

func (*Service) AsyncInsert

func (service *Service) AsyncInsert(handler func(*types.Receipt, error), tableName string, key string, entry *Entry) (*types.Transaction, error)

func (*Service) AsyncRemove

func (service *Service) AsyncRemove(handler func(*types.Receipt, error), tableName string, key string, condition *Condition) (*types.Transaction, error)

func (*Service) AsyncUpdate

func (service *Service) AsyncUpdate(handler func(*types.Receipt, error), tableName string, key string, entry *Entry, condition *Condition) (*types.Transaction, error)

func (*Service) CreateTable

func (service *Service) CreateTable(tableName string, key string, valueFields string) (int64, error)

func (*Service) Desc

func (service *Service) Desc(userTableName string) (string, string, error)

Desc is used for Table

func (*Service) Insert

func (service *Service) Insert(tableName string, key string, entry *Entry) (int64, error)

Insert entry

func (*Service) Remove

func (service *Service) Remove(tableName string, key string, condition *Condition) (int64, error)

func (*Service) Select

func (service *Service) Select(tableName string, key string, condition *Condition) ([]map[string]string, error)

Select entry

func (*Service) Update

func (service *Service) Update(tableName string, key string, entry *Entry, condition *Condition) (int64, error)

Update entry

type TableFactory

type TableFactory struct {
	TableFactoryCaller     // Read-only binding to the contract
	TableFactoryTransactor // Write-only binding to the contract
	TableFactoryFilterer   // Log filterer for contract events
}

TableFactory is an auto generated Go binding around a Solidity contract.

func NewTableFactory

func NewTableFactory(address common.Address, backend bind.ContractBackend) (*TableFactory, error)

NewTableFactory creates a new instance of TableFactory, bound to a specific deployed contract.

type TableFactoryCaller

type TableFactoryCaller struct {
	// contains filtered or unexported fields
}

TableFactoryCaller is an auto generated read-only Go binding around a Solidity contract.

func NewTableFactoryCaller

func NewTableFactoryCaller(address common.Address, caller bind.ContractCaller) (*TableFactoryCaller, error)

NewTableFactoryCaller creates a new read-only instance of TableFactory, bound to a specific deployed contract.

type TableFactoryCallerRaw

type TableFactoryCallerRaw struct {
	Contract *TableFactoryCaller // Generic read-only contract binding to access the raw methods on
}

TableFactoryCallerRaw is an auto generated low-level read-only Go binding around a Solidity contract.

func (*TableFactoryCallerRaw) Call

func (_TableFactory *TableFactoryCallerRaw) Call(opts *bind.CallOpts, result interface{}, method string, params ...interface{}) error

Call invokes the (constant) contract method with params as input values and sets the output to result. The result type might be a single field for simple returns, a slice of interfaces for anonymous returns and a struct for named returns.

type TableFactoryCallerSession

type TableFactoryCallerSession struct {
	Contract *TableFactoryCaller // Generic contract caller binding to set the session for
	CallOpts bind.CallOpts       // Call options to use throughout this session
}

TableFactoryCallerSession is an auto generated read-only Go binding around a Solidity contract, with pre-set call options.

type TableFactoryFilterer

type TableFactoryFilterer struct {
	// contains filtered or unexported fields
}

TableFactoryFilterer is an auto generated log filtering Go binding around a Solidity contract events.

func NewTableFactoryFilterer

func NewTableFactoryFilterer(address common.Address, filterer bind.ContractFilterer) (*TableFactoryFilterer, error)

NewTableFactoryFilterer creates a new log filterer instance of TableFactory, bound to a specific deployed contract.

type TableFactoryRaw

type TableFactoryRaw struct {
	Contract *TableFactory // Generic contract binding to access the raw methods on
}

TableFactoryRaw is an auto generated low-level Go binding around a Solidity contract.

func (*TableFactoryRaw) Call

func (_TableFactory *TableFactoryRaw) Call(opts *bind.CallOpts, result interface{}, method string, params ...interface{}) error

Call invokes the (constant) contract method with params as input values and sets the output to result. The result type might be a single field for simple returns, a slice of interfaces for anonymous returns and a struct for named returns.

func (*TableFactoryRaw) Transact

func (_TableFactory *TableFactoryRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, *types.Receipt, error)

Transact invokes the (paid) contract method with params as input values.

func (*TableFactoryRaw) Transfer

func (_TableFactory *TableFactoryRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, *types.Receipt, error)

Transfer initiates a plain transaction to move funds to the contract, calling its default method if one is available.

type TableFactorySession

type TableFactorySession struct {
	Contract     *TableFactory     // Generic contract binding to set the session for
	CallOpts     bind.CallOpts     // Call options to use throughout this session
	TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session
}

TableFactorySession is an auto generated Go binding around a Solidity contract, with pre-set call and transact options.

func (*TableFactorySession) AsyncCreateTable

func (_TableFactory *TableFactorySession) AsyncCreateTable(handler func(*types.Receipt, error), tableName string, key string, valueField string) (*types.Transaction, error)

func (*TableFactorySession) CreateTable

func (_TableFactory *TableFactorySession) CreateTable(tableName string, key string, valueField string) (*types.Transaction, *types.Receipt, error)

CreateTable is a paid mutator transaction binding the contract method 0x56004b6a.

Solidity: function createTable(string tableName, string key, string valueField) returns(int256)

type TableFactoryTransactor

type TableFactoryTransactor struct {
	// contains filtered or unexported fields
}

TableFactoryTransactor is an auto generated write-only Go binding around a Solidity contract.

func NewTableFactoryTransactor

func NewTableFactoryTransactor(address common.Address, transactor bind.ContractTransactor) (*TableFactoryTransactor, error)

NewTableFactoryTransactor creates a new write-only instance of TableFactory, bound to a specific deployed contract.

func (*TableFactoryTransactor) AsyncCreateTable

func (_TableFactory *TableFactoryTransactor) AsyncCreateTable(handler func(*types.Receipt, error), opts *bind.TransactOpts, tableName string, key string, valueField string) (*types.Transaction, error)

func (*TableFactoryTransactor) CreateTable

func (_TableFactory *TableFactoryTransactor) CreateTable(opts *bind.TransactOpts, tableName string, key string, valueField string) (*types.Transaction, *types.Receipt, error)

CreateTable is a paid mutator transaction binding the contract method 0x56004b6a.

Solidity: function createTable(string tableName, string key, string valueField) returns(int256)

type TableFactoryTransactorRaw

type TableFactoryTransactorRaw struct {
	Contract *TableFactoryTransactor // Generic write-only contract binding to access the raw methods on
}

TableFactoryTransactorRaw is an auto generated low-level write-only Go binding around a Solidity contract.

func (*TableFactoryTransactorRaw) Transact

func (_TableFactory *TableFactoryTransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, *types.Receipt, error)

Transact invokes the (paid) contract method with params as input values.

func (*TableFactoryTransactorRaw) Transfer

func (_TableFactory *TableFactoryTransactorRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, *types.Receipt, error)

Transfer initiates a plain transaction to move funds to the contract, calling its default method if one is available.

type TableFactoryTransactorSession

type TableFactoryTransactorSession struct {
	Contract     *TableFactoryTransactor // Generic contract transactor binding to set the session for
	TransactOpts bind.TransactOpts       // Transaction auth options to use throughout this session
}

TableFactoryTransactorSession is an auto generated write-only Go binding around a Solidity contract, with pre-set transact options.

func (*TableFactoryTransactorSession) AsyncCreateTable

func (_TableFactory *TableFactoryTransactorSession) AsyncCreateTable(handler func(*types.Receipt, error), tableName string, key string, valueField string) (*types.Transaction, error)

func (*TableFactoryTransactorSession) CreateTable

func (_TableFactory *TableFactoryTransactorSession) CreateTable(tableName string, key string, valueField string) (*types.Transaction, *types.Receipt, error)

CreateTable is a paid mutator transaction binding the contract method 0x56004b6a.

Solidity: function createTable(string tableName, string key, string valueField) returns(int256)

Jump to

Keyboard shortcuts

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