service

package
v1.6.3 Latest Latest
Warning

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

Go to latest
Published: Sep 11, 2023 License: GPL-3.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNoPermission = errors.New("ErrNoPermission")
	ErrDisableProof = errors.New("ErrDisableProof")
	ErrParams       = errors.New("ErrParams")
	ErrDecode       = errors.New("ErrDecode")
)

vars

Functions

func LogID

func LogID(hash string) string

LogID log-hash

func NewConvert

func NewConvert(paraTitle, symbol string, name string) db.Convert

NewConvert 2注册插件需要的插件创建函数

func ProofID

func ProofID(hash string) string

ProofID proof-hash

func TemplateID

func TemplateID(hash string) string

TemplateID template-hash

Types

type DataParser

type DataParser interface {
	// contains filtered or unexported methods
}

type LogRecord

type LogRecord struct {
	*db.IKey
	*db.Op
	Log *model.Log
}

LogRecord 用于db 记录

func (*LogRecord) Value

func (r *LogRecord) Value() []byte

Value impl

type ProofConvert

type ProofConvert struct {
	Title    string
	OrgTitle string
	Symbol   string
	Name     string

	RecordGen proofdb.IProofRecord
	// contains filtered or unexported fields
}

ProofConvert

func (*ProofConvert) AddProof

func (t *ProofConvert) AddProof(env *db.TxEnv, op int) ([]db.Record, error)

AddProof 增加存证: payload中的proof数据,目前只支持格式[{k:v},{k:v},{k:v}...]格式的jsonstr

func (*ProofConvert) AddTemplate

func (t *ProofConvert) AddTemplate(env *db.TxEnv, op int) ([]db.Record, error)

AddTemplate 保存模板

func (*ProofConvert) ConvertTx

func (t *ProofConvert) ConvertTx(env *db.TxEnv, op int) ([]db.Record, error)

ConvertTx payload中的proof数据,目前只支持格式[{k:v},{k:v},{k:v}...]格式的jsonstr

func (*ProofConvert) DelProof

func (t *ProofConvert) DelProof(env *db.TxEnv, op int) ([]db.Record, error)

DelProof 删除存证

func (*ProofConvert) RecoverProof

func (t *ProofConvert) RecoverProof(env *db.TxEnv, op int) ([]db.Record, error)

RecoverProof 恢复存证

func (*ProofConvert) SetDB

func (t *ProofConvert) SetDB(proofDB proofdb.IProofDB, cfgDB proofconfig.ConfigDB) error

SetDB SetDB

type ProofRecord

type ProofRecord struct {
	*db.IKey
	*db.Op
	Proof *model.Proof
}

ProofRecord 用于db 记录

func (*ProofRecord) Value

func (r *ProofRecord) Value() []byte

Value impl

type ProofUpdateRecord

type ProofUpdateRecord struct {
	*db.IKey
	*db.Op
	Proof *model.Proof
}

ProofUpdateRecord 用于db 记录

func (*ProofUpdateRecord) Value

func (r *ProofUpdateRecord) Value() []byte

Value impl

type RecordGen

type RecordGen struct {
	TemplateDB       string
	TemplateTable    string
	ProofUpdateDB    string
	ProofUpdateTable string
	// contains filtered or unexported fields
}

RecordGen gen record

func NewRecordGen

func NewRecordGen(pdb, ptable, ldb, ltable, tdb, ttable, udb, utable string) *RecordGen

NewRecordGen NewRecordGen

func (*RecordGen) Log

func (g *RecordGen) Log(log *model.Log, id string, op int) db.Record

Log gen log record

func (*RecordGen) Proof

func (g *RecordGen) Proof(proof *model.Proof, id string, op int) db.Record

Proof gen proof record

func (*RecordGen) ProofUpdateRecord

func (g *RecordGen) ProofUpdateRecord(proof *model.Proof, id string, op int) db.Record

ProofUpdate gen proof update record

func (*RecordGen) Template

func (g *RecordGen) Template(template *model.Template, id string, op int) db.Record

Template gen template record

type TemplateRecord

type TemplateRecord struct {
	*db.IKey
	*db.Op
	Template *model.Template
}

TemplateRecord 用于db 记录

func (*TemplateRecord) Value

func (r *TemplateRecord) Value() []byte

Value impl

Jump to

Keyboard shortcuts

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