api

package
v0.9.3 Latest Latest
Warning

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

Go to latest
Published: Dec 20, 2021 License: Apache-2.0 Imports: 0 Imported by: 0

Documentation

Index

Constants

View Source
const (
	BlockType_TX                     = "tx"              // corresponds to blocks containing regular transactions
	BlockType_Config                 = "config"          // corresponds to blocks containing channel configurations and updates
	EventPayloadType_Bytes           = "bytes"           // default data type of the event payload, no special processing is done before returning to the subscribing client
	EventPayloadType_String          = "string"          // event payload will be an UTF-8 encoded string
	EventPayloadType_StringifiedJSON = "stringifiedJSON" // event payload will be a structured map with UTF-8 encoded string values
)

Variables

This section is empty.

Functions

This section is empty.

Types

type EventEntry

type EventEntry struct {
	ChaincodeId   string      `json:"chaincodeId"`
	BlockNumber   uint64      `json:"blockNumber"`
	TransactionId string      `json:"transactionId"`
	EventName     string      `json:"eventName"`
	Payload       interface{} `json:"payload"`
	Timestamp     uint64      `json:"timestamp,omitempty"`
	SubID         string      `json:"subId"`
}

type SubscriptionInfo

type SubscriptionInfo struct {
	TimeSorted
	ID          string          `json:"id,omitempty"`
	ChannelId   string          `json:"channel,omitempty"`
	Path        string          `json:"path"`
	Summary     string          `json:"-"`      // System generated name for the subscription
	Name        string          `json:"name"`   // User provided name for the subscription, set to Summary if missing
	Stream      string          `json:"stream"` // the event stream this subscription is associated under
	Signer      string          `json:"signer"`
	FromBlock   string          `json:"fromBlock,omitempty"`
	Filter      persistedFilter `json:"filter"`
	PayloadType string          `json:"payloadType,omitempty"` // optional. data type of the payload bytes; "bytes", "string" or "stringifiedJSON". Default to "bytes"
}

SubscriptionInfo is the persisted data for the subscription

func (*SubscriptionInfo) GetID

func (info *SubscriptionInfo) GetID() string

GetID returns the ID (for sorting)

type TimeSortable

type TimeSortable interface {
	IsLessThan(TimeSortable, TimeSortable) bool
	GetISO8601() string
	GetID() string
}

TimeSortable interface can be implemented by embedding TimeSorted and adding getID

type TimeSorted

type TimeSorted struct {
	CreatedISO8601 string `json:"created"`
}

TimeSorted base structure for time sortable things

func (*TimeSorted) GetISO8601

func (i *TimeSorted) GetISO8601() string

GetISO8601 returns an ISO8601 string

func (*TimeSorted) IsLessThan

func (*TimeSorted) IsLessThan(i TimeSortable, j TimeSortable) bool

IsLessThan performs reverse sorting by age, then forward sorting by ID

Jump to

Keyboard shortcuts

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