Documentation ¶
Overview ¶
Package api provides API for chestnut.
Package api provides API for chestnut.
Package api provides API for chestnut.
Package api provides API for chestnut.
Package api provides API for chestnut.
Package api provides API for chestnut.
Package api provides API for chestnut.
Package api provides API for chestnut.
Package api provides API for chestnut.
Package api provides API for chestnut.
Package api provides API for chestnut.
Package api provides API for chestnut.
Package api provides API for chestnut.
Package api provides API for chestnut.
Package api provides API for chestnut.
Package api provides API for chestnut.
Package api provides API for chestnut.
Package api provides API for chestnut.
Package api provides API for chestnut.
Package api provides API for chestnut.
Package api provides API for chestnut.
Package api provides API for chestnut.
Package api provides API for chestnut.
Package api provides API for chestnut ¶
Package api provides API for chestnut.
Package api provides API for chestnut.
Package api provides API for chestnut.
Index ¶
- Constants
- func StartAPIServer(config cli.Config, signalch chan os.Signal, h *Handler, apph *appapi.Handler, ...)
- type AddPeerResult
- type AnnounceParam
- type AnnounceResult
- type AnnouncedProducerListItem
- type AnnouncedUserListItem
- type CreateGroupParam
- type CreateGroupResult
- type CustomBinder
- type CustomValidatorPost
- type CustomValidatorProfile
- type CustomValidatorSchema
- type DeniedUserListItem
- type DenyListParam
- type DenyUserResult
- type ErrorResponse
- type GetTrxParam
- type GroupContentObjectItem
- type GroupInfoList
- type GrpProducerParam
- type GrpProducerResult
- type Handler
- func (h *Handler) AddPeers(c echo.Context) (err error)
- func (h *Handler) Announce(c echo.Context) (err error)
- func (h *Handler) CreateGroup(c echo.Context) (err error)
- func (h *Handler) GetAnnouncedGroupProducer(c echo.Context) (err error)
- func (h *Handler) GetAnnouncedGroupUsers(c echo.Context) (err error)
- func (h *Handler) GetBlockById(c echo.Context) (err error)
- func (h *Handler) GetDeniedUserList(c echo.Context) (err error)
- func (h *Handler) GetGroupAppSchema(c echo.Context) (err error)
- func (h *Handler) GetGroupCtn(c echo.Context) (err error)
- func (h *Handler) GetGroupProducers(c echo.Context) (err error)
- func (h *Handler) GetGroups(c echo.Context) (err error)
- func (h *Handler) GetNetwork(nodehost *host.Host, nodeinfo *p2p.NodeInfo, nodeopt *options.NodeOptions, ...) echo.HandlerFunc
- func (h *Handler) GetNodeInfo(c echo.Context) (err error)
- func (h *Handler) GetTrx(c echo.Context) (err error)
- func (h *Handler) GroupProducer(c echo.Context) (err error)
- func (h *Handler) JoinGroup(c echo.Context) (err error)
- func (h *Handler) LeaveGroup(c echo.Context) (err error)
- func (h *Handler) MgrGrpBlkList(c echo.Context) (err error)
- func (h *Handler) PSPingPeer(node *p2p.Node) echo.HandlerFunc
- func (h *Handler) PostToGroup(c echo.Context) (err error)
- func (h *Handler) RmGroup(c echo.Context) (err error)
- func (h *Handler) Schema(c echo.Context) (err error)
- func (h *Handler) StartSync(c echo.Context) (err error)
- func (h *Handler) UpdateProfile(c echo.Context) (err error)
- type JoinGroupParam
- type JoinGroupResult
- type LeaveGroupParam
- type LeaveGroupResult
- type NetworkInfo
- type NodeInfo
- type PSPingParam
- type PingResult
- type ProducerListItem
- type RmGroupParam
- type RmGroupResult
- type SchemaParam
- type SchemaResult
- type StartSyncResult
- type TrxResult
Constants ¶
const ( GROUP_NAME string = "group_name" GROUP_ID string = "group_id" GROUP_OWNER_PUBKEY string = "owner_pubkey" GROUP_ITEMS string = "group_items" GROUP_ITEM string = "group_item" GENESIS_BLOCK string = "genesis_block" NODE_VERSION string = "node_version" NODE_PUBKEY string = "node_publickey" NODE_STATUS string = "node_status" NODE_ID string = "node_id" SIGNATURE string = "signature" TRX_ID string = "trx_id" PEERS string = "peers" NODETYPE string = "node_type" )
const name
const ( Add = "Add" Update = "Update" Remove = "Remove" Group = "Group" User = "User" Auth = "Auth" Note = "Note" Producer = "Producer" Announce = "Announce" App = "App" )
const BLACK_LIST_OP_PREFIX string = "blklistop_"
const ERROR_INFO string = "error"
error
const GROUP_NAME_MIN_LENGTH int = 5
config
Variables ¶
This section is empty.
Functions ¶
Types ¶
type AddPeerResult ¶
type AnnounceParam ¶
type AnnounceParam struct { GroupId string `from:"group_id" json:"group_id" validate:"required"` Action string `from:"action" json:"action" validate:"required,oneof=add remove"` Type string `from:"type" json:"type" validate:"required,oneof=user producer"` Memo string `from:"memo" json:"memo" validate:"required"` }
type AnnounceResult ¶
type AnnouncedUserListItem ¶
type CreateGroupParam ¶
type CreateGroupParam struct { GroupName string `from:"group_name" json:"group_name" validate:"required,max=20,min=5"` ConsensusType string `from:"consensus_type" json:"consensus_type" validate:"required,oneof=pos poa"` EncryptionType string `from:"encryption_type" json:"encryption_type" validate:"required,oneof=public private"` AppKey string `from:"app_key" json:"app_key" validate:"required,max=20,min=5"` }
type CreateGroupResult ¶
type CreateGroupResult struct { GenesisBlock *chestnutpb.Block `json:"genesis_block"` GroupId string `json:"group_id"` GroupName string `json:"group_name"` OwnerPubkey string `json:"owner_pubkey"` OwnerEncryptPubkey string `json:"owner_encryptpubkey"` ConsensusType string `json:"consensus_type"` EncryptionType string `json:"encryption_type"` CipherKey string `json:"cipher_key"` AppKey string `json:"app_key"` Signature string `json:"signature"` }
type CustomBinder ¶
type CustomBinder struct{}
func (*CustomBinder) Bind ¶
func (cb *CustomBinder) Bind(i interface{}, c echo.Context) (err error)
type CustomValidatorPost ¶
type CustomValidatorPost struct {
Validator *validator.Validate
}
func (*CustomValidatorPost) Validate ¶
func (cv *CustomValidatorPost) Validate(i interface{}) error
type CustomValidatorProfile ¶
type CustomValidatorProfile struct {
Validator *validator.Validate
}
func (*CustomValidatorProfile) Validate ¶
func (cv *CustomValidatorProfile) Validate(i interface{}) error
type CustomValidatorSchema ¶
type CustomValidatorSchema struct {
Validator *validator.Validate
}
type DeniedUserListItem ¶
type DenyListParam ¶
type DenyUserResult ¶
type ErrorResponse ¶
type ErrorResponse struct {
Error string `json:"error" validate:"required"`
}
type GetTrxParam ¶
type GetTrxParam struct {
TrxId string `from:"trx_id" json:"trx_id" validate:"required"`
}
type GroupContentObjectItem ¶
type GroupInfoList ¶
type GroupInfoList struct {
GroupInfos []*groupInfo `json:"groups"`
}
func (*GroupInfoList) Len ¶
func (s *GroupInfoList) Len() int
func (*GroupInfoList) Less ¶
func (s *GroupInfoList) Less(i, j int) bool
func (*GroupInfoList) Swap ¶
func (s *GroupInfoList) Swap(i, j int)
type GrpProducerParam ¶
type GrpProducerParam struct { Action string `from:"action" json:"action" validate:"required,oneof=add remove"` ProducerPubkey string `from:"producer_pubkey" json:"producer_pubkey" validate:"required"` GroupId string `from:"group_id" json:"group_id" validate:"required"` Memo string `from:"memo" json:"memo"` }
type GrpProducerResult ¶
type Handler ¶
type Handler struct { Ctx context.Context Node *p2p.Node NodeCtx *nodectx.NodeCtx GitCommit string Appdb *appdata.AppDb }
func (*Handler) CreateGroup ¶
func (*Handler) GetAnnouncedGroupProducer ¶
func (*Handler) GetAnnouncedGroupUsers ¶
func (*Handler) GetBlockById ¶
func (*Handler) GetDeniedUserList ¶
func (*Handler) GetGroupAppSchema ¶
func (*Handler) GetGroupCtn ¶
func (*Handler) GetGroupProducers ¶
func (*Handler) GetNetwork ¶
func (*Handler) GetNodeInfo ¶
func (*Handler) GroupProducer ¶
func (*Handler) LeaveGroup ¶
func (*Handler) MgrGrpBlkList ¶
func (*Handler) PSPingPeer ¶
func (*Handler) PostToGroup ¶
func (*Handler) UpdateProfile ¶
type JoinGroupParam ¶
type JoinGroupParam struct { GenesisBlock *chestnutpb.Block `from:"genesis_block" json:"genesis_block" validate:"required"` GroupId string `from:"group_id" json:"group_id" validate:"required"` GroupName string `from:"group_name" json:"group_name" validate:"required"` OwnerPubKey string `from:"owner_pubkey" json:"owner_pubkey" validate:"required"` ConsensusType string `from:"consensus_type" json:"consensus_type" validate:"required"` EncryptionType string `from:"encryption_type" json:"encryption_type" validate:"required"` CipherKey string `from:"cipher_key" json:"cipher_key" validate:"required"` AppKey string `from:"app_key" json:"app_key" validate:"required"` Signature string `from:"signature" json:"signature" validate:"required"` }
type JoinGroupResult ¶
type JoinGroupResult struct { GroupId string `json:"group_id"` GroupName string `json:"group_name"` OwnerPubkey string `json:"owner_pubkey"` UserPubkey string `json:"user_pubkey"` UserEncryptPubkey string `json:"user_encryptpubkey"` ConsensusType string `json:"consensus_type"` EncryptionType string `json:"encryption_type"` CipherKey string `json:"cipher_key"` AppKey string `json:"app_key"` Signature string `json:"signature"` }
type LeaveGroupParam ¶
type LeaveGroupParam struct {
GroupId string `from:"group_id" json:"group_id" validate:"required"`
}
type LeaveGroupResult ¶
type NetworkInfo ¶
type PSPingParam ¶
type PSPingParam struct {
PeerId string `from:"peer_id" json:"peer_id" validate:"required,max=53,min=53"`
}
type PingResult ¶
type PingResult struct {
Result [10]int64 `json:"pingresult"`
}
type ProducerListItem ¶
type RmGroupParam ¶
type RmGroupParam struct {
GroupId string `from:"group_id" json:"group_id" validate:"required"`
}
type RmGroupResult ¶
type SchemaParam ¶
type SchemaParam struct { GroupId string `from:"group_id" json:"group_id" validate:"required"` Action string `from:"action" json:"action" validate:"required,oneof=add remove"` Type string `from:"type" json:"type" validate:"required"` Rule string `from:"rule" json:"rule" validate:"required"` Memo string `from:"memo" json:"memo" validate:"required"` }
type SchemaResult ¶
type SchemaResult struct { GroupId string `json:"group_id" validate:"required"` OwnerPubkey string `json:"owner_pubkey" validate:"required"` SchemaType string `json:"schema_type" validate:"required"` SchemaRule string `json:"schema_rule" validate:"required"` Action string `json:"action" validate:"required"` Sign string `json:"sign" validate:"required"` TrxId string `json:"trx_id" validate:"required"` }
type StartSyncResult ¶
Source Files ¶
- addpeers.go
- announce.go
- config.go
- creategroup.go
- getannouncedgroupproducer.go
- getannouncedgroupuser.go
- getblkbyid.go
- getblkedusr.go
- getgroupctx.go
- getgroupproducer.go
- getgroups.go
- getnetwork.go
- getnodeinfo.go
- getshema.go
- gettrx.go
- handle.go
- joingroup.go
- leavegroup.go
- mgrgrpblklist.go
- posttogroup.go
- producer.go
- psping.go
- rmgroup.go
- server.go
- shema.go
- startsync.go
- updateprofile.go