crud

package
v0.0.0-...-5663add Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const (
	TableKeyMaxLength int    = 255
	SysTable          string = "_sys_tables_"
	UserTablePrefix   string = "_user_"
)
View Source
const CrudABI = "" /* 1439-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.

Variables

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

CRUDPrecompileAddress is the contract address of CRUD

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

TableFactoryPrecompileAddress is the contract address of TableFactory

Functions

This section is empty.

Types

type CRUDService

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

CRUDService is a precompile contract service.

func NewCRUDService

func NewCRUDService(client *client.Client, privateKey *ecdsa.PrivateKey) (*CRUDService, error)

NewCRUDService returns ptr of CRUDService

func (*CRUDService) CreateTable

func (service *CRUDService) CreateTable(table *Table) (int, error)

CreateTable returns the status of the creating that 0 represents succeed

func (*CRUDService) Desc

func (service *CRUDService) Desc(tableName string) (*Table, error)

Desc is used for Table

func (*CRUDService) Insert

func (service *CRUDService) Insert(table *Table, entry *Entry) (int, error)

Insert entry

func (*CRUDService) Remove

func (service *CRUDService) Remove(table *Table, condition *Condition) (int, error)

Remove entry

func (*CRUDService) Select

func (service *CRUDService) Select(table *Table, condition *Condition) ([]map[string]string, error)

Select entry

func (*CRUDService) Update

func (service *CRUDService) Update(table *Table, entry *Entry, condition *Condition) (int, error)

Update entry

type Condition

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

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 an Ethereum 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 an Ethereum 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) Select

func (_Crud *CrudCaller) Select(opts *bind.CallOpts, tableName string, key string, condition string, optional 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 optional) 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 an Ethereum 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 an Ethereum contract, with pre-set call options.

func (*CrudCallerSession) Select

func (_Crud *CrudCallerSession) Select(tableName string, key string, condition string, optional 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 optional) constant returns(string)

type CrudFilterer

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

CrudFilterer is an auto generated log filtering Go binding around an Ethereum 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 an Ethereum 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.RawTransaction, error)

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

func (*CrudRaw) Transfer

func (_Crud *CrudRaw) Transfer(opts *bind.TransactOpts) (*types.RawTransaction, 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 an Ethereum contract, with pre-set call and transact options.

func (*CrudSession) Insert

func (_Crud *CrudSession) Insert(tableName string, key string, entry string, optional string) (*types.RawTransaction, error)

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

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

func (*CrudSession) Remove

func (_Crud *CrudSession) Remove(tableName string, key string, condition string, optional string) (*types.RawTransaction, error)

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

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

func (*CrudSession) Select

func (_Crud *CrudSession) Select(tableName string, key string, condition string, optional 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 optional) constant returns(string)

func (*CrudSession) Update

func (_Crud *CrudSession) Update(tableName string, key string, entry string, condition string, optional string) (*types.RawTransaction, error)

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

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

type CrudTransactor

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

CrudTransactor is an auto generated write-only Go binding around an Ethereum 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) Insert

func (_Crud *CrudTransactor) Insert(opts *bind.TransactOpts, tableName string, key string, entry string, optional string) (*types.RawTransaction, error)

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

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

func (*CrudTransactor) Remove

func (_Crud *CrudTransactor) Remove(opts *bind.TransactOpts, tableName string, key string, condition string, optional string) (*types.RawTransaction, error)

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

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

func (*CrudTransactor) Update

func (_Crud *CrudTransactor) Update(opts *bind.TransactOpts, tableName string, key string, entry string, condition string, optional string) (*types.RawTransaction, error)

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

Solidity: function update(string tableName, string key, string entry, string condition, string optional) 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 an Ethereum contract.

func (*CrudTransactorRaw) Transact

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

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

func (*CrudTransactorRaw) Transfer

func (_Crud *CrudTransactorRaw) Transfer(opts *bind.TransactOpts) (*types.RawTransaction, 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 an Ethereum contract, with pre-set transact options.

func (*CrudTransactorSession) Insert

func (_Crud *CrudTransactorSession) Insert(tableName string, key string, entry string, optional string) (*types.RawTransaction, error)

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

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

func (*CrudTransactorSession) Remove

func (_Crud *CrudTransactorSession) Remove(tableName string, key string, condition string, optional string) (*types.RawTransaction, error)

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

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

func (*CrudTransactorSession) Update

func (_Crud *CrudTransactorSession) Update(tableName string, key string, entry string, condition string, optional string) (*types.RawTransaction, error)

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

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

type Entry

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

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 Table

type Table struct {
	TableName   string
	Key         string
	ValueFields string
	Optional    string
}

func (*Table) GetCondition

func (t *Table) GetCondition() *Condition

func (*Table) GetEntry

func (t *Table) GetEntry() *Entry

func (*Table) GetKey

func (t *Table) GetKey() string

func (*Table) GetOptional

func (t *Table) GetOptional() string

func (*Table) GetTableName

func (t *Table) GetTableName() string

func (*Table) GetValueFields

func (t *Table) GetValueFields() string

func (*Table) SetKey

func (t *Table) SetKey(key string)

func (*Table) SetOptional

func (t *Table) SetOptional(optional string)

func (*Table) SetTableName

func (t *Table) SetTableName(name string)

func (*Table) SetValueFields

func (t *Table) SetValueFields(value string)

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 an Ethereum 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 an Ethereum 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 an Ethereum 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 an Ethereum 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 an Ethereum 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 an Ethereum 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.RawTransaction, error)

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

func (*TableFactoryRaw) Transfer

func (_TableFactory *TableFactoryRaw) Transfer(opts *bind.TransactOpts) (*types.RawTransaction, 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 an Ethereum contract, with pre-set call and transact options.

func (*TableFactorySession) CreateTable

func (_TableFactory *TableFactorySession) CreateTable(tableName string, key string, valueField string) (*types.RawTransaction, 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 an Ethereum 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) CreateTable

func (_TableFactory *TableFactoryTransactor) CreateTable(opts *bind.TransactOpts, tableName string, key string, valueField string) (*types.RawTransaction, 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 an Ethereum contract.

func (*TableFactoryTransactorRaw) Transact

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

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

func (*TableFactoryTransactorRaw) Transfer

func (_TableFactory *TableFactoryTransactorRaw) Transfer(opts *bind.TransactOpts) (*types.RawTransaction, 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 an Ethereum contract, with pre-set transact options.

func (*TableFactoryTransactorSession) CreateTable

func (_TableFactory *TableFactoryTransactorSession) CreateTable(tableName string, key string, valueField string) (*types.RawTransaction, 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