v1

package
v0.53.0 Latest Latest
Warning

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

Go to latest
Published: Jul 12, 2022 License: MIT Imports: 7 Imported by: 5

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	OracleSpec_Status_name = map[int32]string{
		0: "STATUS_UNSPECIFIED",
		1: "STATUS_ACTIVE",
		2: "STATUS_DEACTIVATED",
	}
	OracleSpec_Status_value = map[string]int32{
		"STATUS_UNSPECIFIED": 0,
		"STATUS_ACTIVE":      1,
		"STATUS_DEACTIVATED": 2,
	}
)

Enum value maps for OracleSpec_Status.

View Source
var (
	PropertyKey_Type_name = map[int32]string{
		0: "TYPE_UNSPECIFIED",
		1: "TYPE_EMPTY",
		2: "TYPE_INTEGER",
		3: "TYPE_STRING",
		4: "TYPE_BOOLEAN",
		5: "TYPE_DECIMAL",
		6: "TYPE_TIMESTAMP",
	}
	PropertyKey_Type_value = map[string]int32{
		"TYPE_UNSPECIFIED": 0,
		"TYPE_EMPTY":       1,
		"TYPE_INTEGER":     2,
		"TYPE_STRING":      3,
		"TYPE_BOOLEAN":     4,
		"TYPE_DECIMAL":     5,
		"TYPE_TIMESTAMP":   6,
	}
)

Enum value maps for PropertyKey_Type.

View Source
var (
	Condition_Operator_name = map[int32]string{
		0: "OPERATOR_UNSPECIFIED",
		1: "OPERATOR_EQUALS",
		2: "OPERATOR_GREATER_THAN",
		3: "OPERATOR_GREATER_THAN_OR_EQUAL",
		4: "OPERATOR_LESS_THAN",
		5: "OPERATOR_LESS_THAN_OR_EQUAL",
	}
	Condition_Operator_value = map[string]int32{
		"OPERATOR_UNSPECIFIED":           0,
		"OPERATOR_EQUALS":                1,
		"OPERATOR_GREATER_THAN":          2,
		"OPERATOR_GREATER_THAN_OR_EQUAL": 3,
		"OPERATOR_LESS_THAN":             4,
		"OPERATOR_LESS_THAN_OR_EQUAL":    5,
	}
)

Enum value maps for Condition_Operator.

View Source
var File_vega_oracles_v1_data_proto protoreflect.FileDescriptor
View Source
var File_vega_oracles_v1_spec_proto protoreflect.FileDescriptor

Functions

func NewID added in v0.50.2

func NewID(pubKeys []string, filters []*Filter) string

Types

type Condition

type Condition struct {

	// comparator is the type of comparison to make on the value.
	Operator Condition_Operator `protobuf:"varint,1,opt,name=operator,proto3,enum=oracles.v1.Condition_Operator" json:"operator,omitempty"`
	// value is used by the comparator.
	Value string `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"`
	// contains filtered or unexported fields
}

Condition describes the condition that must be validated by the

func (Condition) DeepClone

func (c Condition) DeepClone() *Condition

func (*Condition) Descriptor deprecated

func (*Condition) Descriptor() ([]byte, []int)

Deprecated: Use Condition.ProtoReflect.Descriptor instead.

func (*Condition) GetOperator

func (x *Condition) GetOperator() Condition_Operator

func (*Condition) GetValue

func (x *Condition) GetValue() string

func (*Condition) ProtoMessage

func (*Condition) ProtoMessage()

func (*Condition) ProtoReflect added in v0.49.0

func (x *Condition) ProtoReflect() protoreflect.Message

func (*Condition) Reset

func (x *Condition) Reset()

func (*Condition) String

func (x *Condition) String() string

type Condition_Operator

type Condition_Operator int32

Comparator describes the type of comparison.

const (
	// The default value
	Condition_OPERATOR_UNSPECIFIED Condition_Operator = 0
	// Verify if the property values are strictly equal or not.
	Condition_OPERATOR_EQUALS Condition_Operator = 1
	// Verify if the oracle data value is greater than the Condition value.
	Condition_OPERATOR_GREATER_THAN Condition_Operator = 2
	// Verify if the oracle data value is greater than or equal to the Condition
	// value.
	Condition_OPERATOR_GREATER_THAN_OR_EQUAL Condition_Operator = 3
	// Verify if the oracle data value is less than the Condition value.
	Condition_OPERATOR_LESS_THAN Condition_Operator = 4
	// Verify if the oracle data value is less or equal to than the Condition
	// value.
	Condition_OPERATOR_LESS_THAN_OR_EQUAL Condition_Operator = 5
)

func (Condition_Operator) Descriptor added in v0.49.0

func (Condition_Operator) Enum added in v0.49.0

func (Condition_Operator) EnumDescriptor deprecated

func (Condition_Operator) EnumDescriptor() ([]byte, []int)

Deprecated: Use Condition_Operator.Descriptor instead.

func (Condition_Operator) Number added in v0.49.0

func (Condition_Operator) String

func (x Condition_Operator) String() string

func (Condition_Operator) Type added in v0.49.0

type Filter

type Filter struct {

	// key is the oracle data property key targeted by the filter.
	Key *PropertyKey `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"`
	// conditions are the conditions that should be matched by the data to be
	// considered of interest.
	Conditions []*Condition `protobuf:"bytes,2,rep,name=conditions,proto3" json:"conditions,omitempty"`
	// contains filtered or unexported fields
}

Filter describes the conditions under which an oracle data is considered of interest or not.

func (Filter) DeepClone

func (f Filter) DeepClone() *Filter

func (*Filter) Descriptor deprecated

func (*Filter) Descriptor() ([]byte, []int)

Deprecated: Use Filter.ProtoReflect.Descriptor instead.

func (*Filter) GetConditions

func (x *Filter) GetConditions() []*Condition

func (*Filter) GetKey

func (x *Filter) GetKey() *PropertyKey

func (*Filter) ProtoMessage

func (*Filter) ProtoMessage()

func (*Filter) ProtoReflect added in v0.49.0

func (x *Filter) ProtoReflect() protoreflect.Message

func (*Filter) Reset

func (x *Filter) Reset()

func (*Filter) String

func (x *Filter) String() string

type OracleData

type OracleData struct {

	// pubKeys is the list of authorized public keys that signed the data for this
	// oracle. All the public keys in the oracle data should be contained in these
	// public keys.
	PubKeys []string `protobuf:"bytes,1,rep,name=pub_keys,json=pubKeys,proto3" json:"pub_keys,omitempty"`
	// data holds all the properties of the oracle data
	Data []*Property `protobuf:"bytes,2,rep,name=data,proto3" json:"data,omitempty"`
	// matched_specs_ids lists all the oracle specs that matched this oracle data.
	// When the array is empty, it means no oracle spec matched this oracle data.
	MatchedSpecIds []string `protobuf:"bytes,3,rep,name=matched_spec_ids,json=matchedSpecIds,proto3" json:"matched_spec_ids,omitempty"`
	// broadcast_at is the time at which the data was broadcast to the markets
	// with a matching oracle spec.
	// It has no value when the oracle date did not match any oracle spec.
	// The value is a Unix timestamp in nanoseconds.
	BroadcastAt int64 `protobuf:"varint,4,opt,name=broadcast_at,json=broadcastAt,proto3" json:"broadcast_at,omitempty"`
	// contains filtered or unexported fields
}

OracleData describes valid oracle data that has been received by the node. It represents both matched and unmatched oracle data.

func (OracleData) DeepClone

func (o OracleData) DeepClone() *OracleData

func (*OracleData) Descriptor deprecated

func (*OracleData) Descriptor() ([]byte, []int)

Deprecated: Use OracleData.ProtoReflect.Descriptor instead.

func (*OracleData) GetBroadcastAt

func (x *OracleData) GetBroadcastAt() int64

func (*OracleData) GetData

func (x *OracleData) GetData() []*Property

func (*OracleData) GetMatchedSpecIds

func (x *OracleData) GetMatchedSpecIds() []string

func (*OracleData) GetPubKeys

func (x *OracleData) GetPubKeys() []string

func (*OracleData) ProtoMessage

func (*OracleData) ProtoMessage()

func (*OracleData) ProtoReflect added in v0.49.0

func (x *OracleData) ProtoReflect() protoreflect.Message

func (*OracleData) Reset

func (x *OracleData) Reset()

func (*OracleData) String

func (x *OracleData) String() string

type OracleSpec

type OracleSpec struct {

	// id is a hash generated from the OracleSpec data.
	Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
	// Creation Date time
	CreatedAt int64 `protobuf:"varint,2,opt,name=created_at,json=createdAt,proto3" json:"created_at,omitempty"`
	// Last Updated timestamp
	UpdatedAt int64 `protobuf:"varint,3,opt,name=updated_at,json=updatedAt,proto3" json:"updated_at,omitempty"`
	// pubKeys is the list of authorized public keys that signed the data for this
	// oracle. All the public keys in the oracle data should be contained in these
	// public keys.
	PubKeys []string `protobuf:"bytes,4,rep,name=pub_keys,json=pubKeys,proto3" json:"pub_keys,omitempty"`
	// filters describes which oracle data are considered of interest or not for
	// the product (or the risk model).
	Filters []*Filter `protobuf:"bytes,5,rep,name=filters,proto3" json:"filters,omitempty"`
	// status describes the status of the oracle spec
	Status OracleSpec_Status `protobuf:"varint,6,opt,name=status,proto3,enum=oracles.v1.OracleSpec_Status" json:"status,omitempty"`
	// contains filtered or unexported fields
}

An oracle spec describe the oracle data that a product (or a risk model) wants to get from the oracle engine. This message contains additional information used by the API.

func NewOracleSpec

func NewOracleSpec(pubKeys []string, filters []*Filter) *OracleSpec

func (OracleSpec) DeepClone

func (o OracleSpec) DeepClone() *OracleSpec

func (*OracleSpec) Descriptor deprecated

func (*OracleSpec) Descriptor() ([]byte, []int)

Deprecated: Use OracleSpec.ProtoReflect.Descriptor instead.

func (*OracleSpec) GetCreatedAt

func (x *OracleSpec) GetCreatedAt() int64

func (*OracleSpec) GetFilters

func (x *OracleSpec) GetFilters() []*Filter

func (*OracleSpec) GetId

func (x *OracleSpec) GetId() string

func (*OracleSpec) GetPubKeys

func (x *OracleSpec) GetPubKeys() []string

func (*OracleSpec) GetStatus

func (x *OracleSpec) GetStatus() OracleSpec_Status

func (*OracleSpec) GetUpdatedAt

func (x *OracleSpec) GetUpdatedAt() int64

func (OracleSpec) IsEvent

func (OracleSpec) IsEvent()

func (*OracleSpec) ProtoMessage

func (*OracleSpec) ProtoMessage()

func (*OracleSpec) ProtoReflect added in v0.49.0

func (x *OracleSpec) ProtoReflect() protoreflect.Message

func (*OracleSpec) Reset

func (x *OracleSpec) Reset()

func (*OracleSpec) String

func (x *OracleSpec) String() string

type OracleSpecConfiguration

type OracleSpecConfiguration struct {

	// pubKeys is the list of authorized public keys that signed the data for this
	// oracle. All the public keys in the oracle data should be contained in these
	// public keys.
	PubKeys []string `protobuf:"bytes,1,rep,name=pub_keys,json=pubKeys,proto3" json:"pub_keys,omitempty"`
	// filters describes which oracle data are considered of interest or not for
	// the product (or the risk model).
	Filters []*Filter `protobuf:"bytes,2,rep,name=filters,proto3" json:"filters,omitempty"`
	// contains filtered or unexported fields
}

An oracle spec describe the oracle data that a product (or a risk model) wants to get from the oracle engine.

func (OracleSpecConfiguration) DeepClone

func (*OracleSpecConfiguration) Descriptor deprecated

func (*OracleSpecConfiguration) Descriptor() ([]byte, []int)

Deprecated: Use OracleSpecConfiguration.ProtoReflect.Descriptor instead.

func (*OracleSpecConfiguration) GetFilters

func (x *OracleSpecConfiguration) GetFilters() []*Filter

func (*OracleSpecConfiguration) GetPubKeys

func (x *OracleSpecConfiguration) GetPubKeys() []string

func (*OracleSpecConfiguration) ProtoMessage

func (*OracleSpecConfiguration) ProtoMessage()

func (*OracleSpecConfiguration) ProtoReflect added in v0.49.0

func (x *OracleSpecConfiguration) ProtoReflect() protoreflect.Message

func (*OracleSpecConfiguration) Reset

func (x *OracleSpecConfiguration) Reset()

func (*OracleSpecConfiguration) String

func (x *OracleSpecConfiguration) String() string

func (*OracleSpecConfiguration) ToOracleSpec

func (o *OracleSpecConfiguration) ToOracleSpec() *OracleSpec

type OracleSpec_Status

type OracleSpec_Status int32

Status describe the status of the oracle spec

const (
	// The default value.
	OracleSpec_STATUS_UNSPECIFIED OracleSpec_Status = 0
	// STATUS_ACTIVE describes an active oracle spec.
	OracleSpec_STATUS_ACTIVE OracleSpec_Status = 1
	// STATUS_DEACTIVATED describes an oracle spec that is not listening to data
	// anymore.
	OracleSpec_STATUS_DEACTIVATED OracleSpec_Status = 2
)

func (OracleSpec_Status) Descriptor added in v0.49.0

func (OracleSpec_Status) Enum added in v0.49.0

func (OracleSpec_Status) EnumDescriptor deprecated

func (OracleSpec_Status) EnumDescriptor() ([]byte, []int)

Deprecated: Use OracleSpec_Status.Descriptor instead.

func (OracleSpec_Status) Number added in v0.49.0

func (OracleSpec_Status) String

func (x OracleSpec_Status) String() string

func (OracleSpec_Status) Type added in v0.49.0

type Property

type Property struct {

	// name is the name of the property.
	Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
	// value is the value of the property.
	Value string `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"`
	// contains filtered or unexported fields
}

Property describes one property of an oracle spec with a key with its value.

func (Property) DeepClone

func (p Property) DeepClone() *Property

func (*Property) Descriptor deprecated

func (*Property) Descriptor() ([]byte, []int)

Deprecated: Use Property.ProtoReflect.Descriptor instead.

func (*Property) GetName

func (x *Property) GetName() string

func (*Property) GetValue

func (x *Property) GetValue() string

func (*Property) ProtoMessage

func (*Property) ProtoMessage()

func (*Property) ProtoReflect added in v0.49.0

func (x *Property) ProtoReflect() protoreflect.Message

func (*Property) Reset

func (x *Property) Reset()

func (*Property) String

func (x *Property) String() string

type PropertyKey

type PropertyKey struct {

	// name is the name of the property.
	Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
	// type is the type of the property.
	Type PropertyKey_Type `protobuf:"varint,2,opt,name=type,proto3,enum=oracles.v1.PropertyKey_Type" json:"type,omitempty"`
	// contains filtered or unexported fields
}

PropertyKey describes the property key contained in an oracle data.

func (PropertyKey) DeepClone

func (p PropertyKey) DeepClone() *PropertyKey

func (*PropertyKey) Descriptor deprecated

func (*PropertyKey) Descriptor() ([]byte, []int)

Deprecated: Use PropertyKey.ProtoReflect.Descriptor instead.

func (*PropertyKey) GetName

func (x *PropertyKey) GetName() string

func (*PropertyKey) GetType

func (x *PropertyKey) GetType() PropertyKey_Type

func (*PropertyKey) ProtoMessage

func (*PropertyKey) ProtoMessage()

func (*PropertyKey) ProtoReflect added in v0.49.0

func (x *PropertyKey) ProtoReflect() protoreflect.Message

func (*PropertyKey) Reset

func (x *PropertyKey) Reset()

func (*PropertyKey) String

func (x *PropertyKey) String() string

type PropertyKey_Type

type PropertyKey_Type int32

Type describes the type of properties that are supported by the oracle engine.

const (
	// The default value.
	PropertyKey_TYPE_UNSPECIFIED PropertyKey_Type = 0
	// Any type.
	PropertyKey_TYPE_EMPTY PropertyKey_Type = 1
	// Integer type.
	PropertyKey_TYPE_INTEGER PropertyKey_Type = 2
	// String type.
	PropertyKey_TYPE_STRING PropertyKey_Type = 3
	// Boolean type.
	PropertyKey_TYPE_BOOLEAN PropertyKey_Type = 4
	// Any floating point decimal type.
	PropertyKey_TYPE_DECIMAL PropertyKey_Type = 5
	// Timestamp date type.
	PropertyKey_TYPE_TIMESTAMP PropertyKey_Type = 6
)

func (PropertyKey_Type) Descriptor added in v0.49.0

func (PropertyKey_Type) Enum added in v0.49.0

func (PropertyKey_Type) EnumDescriptor deprecated

func (PropertyKey_Type) EnumDescriptor() ([]byte, []int)

Deprecated: Use PropertyKey_Type.Descriptor instead.

func (PropertyKey_Type) Number added in v0.49.0

func (PropertyKey_Type) String

func (x PropertyKey_Type) String() string

func (PropertyKey_Type) Type added in v0.49.0

Jump to

Keyboard shortcuts

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