templates

package
v0.0.0-...-06c96c1 Latest Latest
Warning

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

Go to latest
Published: Jul 19, 2020 License: MIT Imports: 17 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var TemplateMessageFactory = dynamic.NewMessageFactoryWithDefaults()

Functions

func CreateNewMessage

func CreateNewMessage(id string) (proto.Message, error)

func DecodeDescriptorSet

func DecodeDescriptorSet(rt *RecordTemplate, descriptorSetProto []byte) (err error)

func EditTemplate

func EditTemplate(tmpl *RecordTemplate, newRaw string, editTxid string) error

func IntakeRecordTemplate

func IntakeRecordTemplate(rt *pb_templates.RecordTemplateProto, pubKey []byte, tx *datastore.TransactionData) (*elastic.BulkIndexRequest, error)

func LoadTemplatesFromES

func LoadTemplatesFromES(ctx context.Context) error

Types

type Applied

type Applied struct {
	Applied bool `json:"applied"`
}

type MetaApplied

type MetaApplied struct {
	Meta Applied `json:"meta"`
}

type RecordTemplate

type RecordTemplate struct {
	// Human readable name to quickly identify type (non-unique)
	FriendlyName string `json:"friendly_name,omitempty"`
	// Generated name
	Name string `json:"name"`
	// Description of the purpose behind this new type
	Description string `json:"description,omitempty"`
	// Message
	MessageDescriptor *desc.MessageDescriptor `json:"-"`
	// File
	// FileDescriptor *desc.FileDescriptor `json:"-"`
	FileDescriptorSet string `json:"file_descriptor_set"`
	// Message type
	// MessageType reflect.Type `json:"-"`
	// Populated by oipd with the unique identifier for this type
	Identifier uint32 `json:"identifier"`
	// List of unique template identifiers recommended for use with this template
	Extends []uint32 `json:"extends,omitempty"`

	Txid     string `json:"-"`
	SignedBy string `json:"-"`
}

func GetTemplate

func GetTemplate(txid string) (*RecordTemplate, error)

type TMeta

type TMeta struct {
	Block     int64                      `json:"block,omitempty"`
	BlockHash string                     `json:"block_hash,omitempty"`
	SignedBy  string                     `json:"signed_by,omitempty"`
	Time      int64                      `json:"time,omitempty"`
	Tx        *datastore.TransactionData `json:"-"`
	Txid      string                     `json:"txid,omitempty"`
}

Jump to

Keyboard shortcuts

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