governance

package
v1.3.0 Latest Latest
Warning

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

Go to latest
Published: Apr 26, 2021 License: Apache-2.0 Imports: 1 Imported by: 9

Documentation

Index

Constants

View Source
const (
	REGISTERED = 0
	APPROVED   = 1

	GovernanceRegisting   GovernanceStatus = "registering"
	GovernanceAvailable   GovernanceStatus = "available"
	GovernanceUnavailable GovernanceStatus = "unavailable"
	GovernanceUpdating    GovernanceStatus = "updating"
	GovernanceFreezing    GovernanceStatus = "freezing"
	GovernanceActivating  GovernanceStatus = "activating"
	GovernanceFrozen      GovernanceStatus = "frozen"
	GovernanceLogouting   GovernanceStatus = "logouting"
	GovernanceBinding     GovernanceStatus = "binding"
	GovernanceUnbinding   GovernanceStatus = "unbinding"
	GovernanceBindable    GovernanceStatus = "bindable"
	GovernanceForbidden   GovernanceStatus = "forbidden"

	EventRegister EventType = "register"
	EventUpdate   EventType = "update"
	EventFreeze   EventType = "freeze"
	EventActivate EventType = "activate"
	EventLogout   EventType = "logout"
	EventApprove  EventType = "approve"
	EventReject   EventType = "reject"
	EventBind     EventType = "bind"
	EventUnbind   EventType = "unbind"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type EventType

type EventType string

type Governance added in v1.3.0

type Governance interface {
	// ChangeStatus changes state of object
	ChangeStatus(id, trigger string, extra []byte) (bool, []byte)

	// CountAvailable counts all available objects
	CountAvailable(extra []byte) (bool, []byte)

	// CountAll counts all objects including approved, rejected, registered and so on
	CountAll(extra []byte) (bool, []byte)

	// ALL returns all objects
	All(extra []byte) (bool, []byte)

	// QueryById returns object info by id
	QueryById(id string, extra []byte) (bool, []byte)
}

type GovernanceStatus

type GovernanceStatus string

type Persister added in v1.3.0

type Persister interface {
	// Caller
	Caller() string
	// Logger
	Logger() logrus.FieldLogger
	// Has judges key
	Has(key string) bool
	// Get gets value from datastore by key
	Get(key string) (bool, []byte)
	// GetObject
	GetObject(key string, ret interface{}) bool
	// Set sets k-v
	Set(key string, value []byte)
	// SetObject sets k with object v, v will be marshaled using json
	SetObject(key string, value interface{})
	// Delete deletes k-v
	Delete(key string)
	// QueryByPrefix queries object by prefix
	Query(prefix string) (bool, [][]byte)
	// GetAccount get ledger account address
	GetAccount(address string) (bool, interface{})
}

type RegisterResult added in v1.3.0

type RegisterResult struct {
	IsRegistered bool   `json:"is_registered"`
	ID           string `json:"id"`
}

Jump to

Keyboard shortcuts

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