v1

package
v0.48.0-pre1 Latest Latest
Warning

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

Go to latest
Published: Jan 31, 2022 License: MIT Imports: 6 Imported by: 5

Documentation

Index

Constants

This section is empty.

Variables

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",
}
View Source
var 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,
}
View Source
var OracleSpec_Status_name = map[int32]string{
	0: "STATUS_UNSPECIFIED",
	1: "STATUS_ACTIVE",
	2: "STATUS_DEACTIVATED",
}
View Source
var OracleSpec_Status_value = map[string]int32{
	"STATUS_UNSPECIFIED": 0,
	"STATUS_ACTIVE":      1,
	"STATUS_DEACTIVATED": 2,
}
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",
}
View Source
var 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,
}

Functions

This section is empty.

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"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

Condition describes the condition that must be validated by the

func (Condition) DeepClone

func (c Condition) DeepClone() *Condition

func (*Condition) Descriptor

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

func (*Condition) GetOperator

func (m *Condition) GetOperator() Condition_Operator

func (*Condition) GetValue

func (m *Condition) GetValue() string

func (*Condition) ProtoMessage

func (*Condition) ProtoMessage()

func (*Condition) Reset

func (m *Condition) Reset()

func (*Condition) String

func (m *Condition) String() string

func (*Condition) XXX_DiscardUnknown

func (m *Condition) XXX_DiscardUnknown()

func (*Condition) XXX_Marshal

func (m *Condition) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*Condition) XXX_Merge

func (m *Condition) XXX_Merge(src proto.Message)

func (*Condition) XXX_Size

func (m *Condition) XXX_Size() int

func (*Condition) XXX_Unmarshal

func (m *Condition) XXX_Unmarshal(b []byte) error

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) EnumDescriptor

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

func (Condition_Operator) String

func (x Condition_Operator) String() string

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"`
	XXX_NoUnkeyedLiteral struct{}     `json:"-"`
	XXX_unrecognized     []byte       `json:"-"`
	XXX_sizecache        int32        `json:"-"`
}

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

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

func (*Filter) GetConditions

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

func (*Filter) GetKey

func (m *Filter) GetKey() *PropertyKey

func (*Filter) ProtoMessage

func (*Filter) ProtoMessage()

func (*Filter) Reset

func (m *Filter) Reset()

func (*Filter) String

func (m *Filter) String() string

func (*Filter) XXX_DiscardUnknown

func (m *Filter) XXX_DiscardUnknown()

func (*Filter) XXX_Marshal

func (m *Filter) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*Filter) XXX_Merge

func (m *Filter) XXX_Merge(src proto.Message)

func (*Filter) XXX_Size

func (m *Filter) XXX_Size() int

func (*Filter) XXX_Unmarshal

func (m *Filter) XXX_Unmarshal(b []byte) error

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.
	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 for the first
	// time.
	BroadcastAt          int64    `protobuf:"varint,4,opt,name=broadcast_at,json=broadcastAt,proto3" json:"broadcast_at,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

OracleData describes an oracle data that has been broadcast.

func (OracleData) DeepClone

func (o OracleData) DeepClone() *OracleData

func (*OracleData) Descriptor

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

func (*OracleData) GetBroadcastAt

func (m *OracleData) GetBroadcastAt() int64

func (*OracleData) GetData

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

func (*OracleData) GetMatchedSpecIds

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

func (*OracleData) GetPubKeys

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

func (*OracleData) ProtoMessage

func (*OracleData) ProtoMessage()

func (*OracleData) Reset

func (m *OracleData) Reset()

func (*OracleData) String

func (m *OracleData) String() string

func (*OracleData) XXX_DiscardUnknown

func (m *OracleData) XXX_DiscardUnknown()

func (*OracleData) XXX_Marshal

func (m *OracleData) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*OracleData) XXX_Merge

func (m *OracleData) XXX_Merge(src proto.Message)

func (*OracleData) XXX_Size

func (m *OracleData) XXX_Size() int

func (*OracleData) XXX_Unmarshal

func (m *OracleData) XXX_Unmarshal(b []byte) error

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"`
	XXX_NoUnkeyedLiteral struct{}          `json:"-"`
	XXX_unrecognized     []byte            `json:"-"`
	XXX_sizecache        int32             `json:"-"`
}

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

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

func (*OracleSpec) GetCreatedAt

func (m *OracleSpec) GetCreatedAt() int64

func (*OracleSpec) GetFilters

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

func (*OracleSpec) GetId

func (m *OracleSpec) GetId() string

func (*OracleSpec) GetPubKeys

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

func (*OracleSpec) GetStatus

func (m *OracleSpec) GetStatus() OracleSpec_Status

func (*OracleSpec) GetUpdatedAt

func (m *OracleSpec) GetUpdatedAt() int64

func (OracleSpec) IsEvent

func (OracleSpec) IsEvent()

func (*OracleSpec) ProtoMessage

func (*OracleSpec) ProtoMessage()

func (*OracleSpec) Reset

func (m *OracleSpec) Reset()

func (*OracleSpec) String

func (m *OracleSpec) String() string

func (*OracleSpec) XXX_DiscardUnknown

func (m *OracleSpec) XXX_DiscardUnknown()

func (*OracleSpec) XXX_Marshal

func (m *OracleSpec) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*OracleSpec) XXX_Merge

func (m *OracleSpec) XXX_Merge(src proto.Message)

func (*OracleSpec) XXX_Size

func (m *OracleSpec) XXX_Size() int

func (*OracleSpec) XXX_Unmarshal

func (m *OracleSpec) XXX_Unmarshal(b []byte) error

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"`
	XXX_NoUnkeyedLiteral struct{}  `json:"-"`
	XXX_unrecognized     []byte    `json:"-"`
	XXX_sizecache        int32     `json:"-"`
}

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

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

func (*OracleSpecConfiguration) GetFilters

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

func (*OracleSpecConfiguration) GetPubKeys

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

func (*OracleSpecConfiguration) ProtoMessage

func (*OracleSpecConfiguration) ProtoMessage()

func (*OracleSpecConfiguration) Reset

func (m *OracleSpecConfiguration) Reset()

func (*OracleSpecConfiguration) String

func (m *OracleSpecConfiguration) String() string

func (*OracleSpecConfiguration) ToOracleSpec

func (o *OracleSpecConfiguration) ToOracleSpec() *OracleSpec

func (*OracleSpecConfiguration) XXX_DiscardUnknown

func (m *OracleSpecConfiguration) XXX_DiscardUnknown()

func (*OracleSpecConfiguration) XXX_Marshal

func (m *OracleSpecConfiguration) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*OracleSpecConfiguration) XXX_Merge

func (m *OracleSpecConfiguration) XXX_Merge(src proto.Message)

func (*OracleSpecConfiguration) XXX_Size

func (m *OracleSpecConfiguration) XXX_Size() int

func (*OracleSpecConfiguration) XXX_Unmarshal

func (m *OracleSpecConfiguration) XXX_Unmarshal(b []byte) error

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) EnumDescriptor

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

func (OracleSpec_Status) String

func (x OracleSpec_Status) String() string

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"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

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

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

func (*Property) GetName

func (m *Property) GetName() string

func (*Property) GetValue

func (m *Property) GetValue() string

func (*Property) ProtoMessage

func (*Property) ProtoMessage()

func (*Property) Reset

func (m *Property) Reset()

func (*Property) String

func (m *Property) String() string

func (*Property) XXX_DiscardUnknown

func (m *Property) XXX_DiscardUnknown()

func (*Property) XXX_Marshal

func (m *Property) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*Property) XXX_Merge

func (m *Property) XXX_Merge(src proto.Message)

func (*Property) XXX_Size

func (m *Property) XXX_Size() int

func (*Property) XXX_Unmarshal

func (m *Property) XXX_Unmarshal(b []byte) error

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"`
	XXX_NoUnkeyedLiteral struct{}         `json:"-"`
	XXX_unrecognized     []byte           `json:"-"`
	XXX_sizecache        int32            `json:"-"`
}

PropertyKey describes the property key contained in an oracle data.

func (PropertyKey) DeepClone

func (p PropertyKey) DeepClone() *PropertyKey

func (*PropertyKey) Descriptor

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

func (*PropertyKey) GetName

func (m *PropertyKey) GetName() string

func (*PropertyKey) GetType

func (m *PropertyKey) GetType() PropertyKey_Type

func (*PropertyKey) ProtoMessage

func (*PropertyKey) ProtoMessage()

func (*PropertyKey) Reset

func (m *PropertyKey) Reset()

func (*PropertyKey) String

func (m *PropertyKey) String() string

func (*PropertyKey) XXX_DiscardUnknown

func (m *PropertyKey) XXX_DiscardUnknown()

func (*PropertyKey) XXX_Marshal

func (m *PropertyKey) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*PropertyKey) XXX_Merge

func (m *PropertyKey) XXX_Merge(src proto.Message)

func (*PropertyKey) XXX_Size

func (m *PropertyKey) XXX_Size() int

func (*PropertyKey) XXX_Unmarshal

func (m *PropertyKey) XXX_Unmarshal(b []byte) error

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) EnumDescriptor

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

func (PropertyKey_Type) String

func (x PropertyKey_Type) String() string

Jump to

Keyboard shortcuts

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