protoadapter

package
v0.0.0-...-698e449 Latest Latest
Warning

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

Go to latest
Published: Sep 1, 2023 License: MIT Imports: 8 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	JobTypes_name = map[int32]string{
		0: "DATA_FEED",
		1: "RANDOM_NUMBER",
	}
	JobTypes_value = map[string]int32{
		"DATA_FEED":     0,
		"RANDOM_NUMBER": 1,
	}
)

Enum value maps for JobTypes.

View Source
var (
	RequestType_name = map[int32]string{
		0: "GET",
		1: "POST",
	}
	RequestType_value = map[string]int32{
		"GET":  0,
		"POST": 1,
	}
)

Enum value maps for RequestType.

View Source
var (
	FeedCategory_name = map[int32]string{
		0: "RNG",
		1: "SPORT",
		2: "PRICE_FEED",
		3: "WEATHER",
		4: "FLIGHT",
		5: "BLOCKCHAIN",
		6: "NFT_DATA",
	}
	FeedCategory_value = map[string]int32{
		"RNG":        0,
		"SPORT":      1,
		"PRICE_FEED": 2,
		"WEATHER":    3,
		"FLIGHT":     4,
		"BLOCKCHAIN": 5,
		"NFT_DATA":   6,
	}
)

Enum value maps for FeedCategory.

View Source
var DataProviderService_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "protoadapter.DataProviderService",
	HandlerType: (*DataProviderServiceServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "AddToKnownPeers",
			Handler:    _DataProviderService_AddToKnownPeers_Handler,
		},
		{
			MethodName: "ListKnownPeers",
			Handler:    _DataProviderService_ListKnownPeers_Handler,
		},
		{
			MethodName: "ListFeeds",
			Handler:    _DataProviderService_ListFeeds_Handler,
		},
		{
			MethodName: "ListFeedsFromAll",
			Handler:    _DataProviderService_ListFeedsFromAll_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "data-provider/protoadapter/adapter.proto",
}

DataProviderService_ServiceDesc is the grpc.ServiceDesc for DataProviderService service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)

View Source
var File_data_provider_protoadapter_adapter_proto protoreflect.FileDescriptor

Functions

func RegisterDataProviderServiceServer

func RegisterDataProviderServiceServer(s grpc.ServiceRegistrar, srv DataProviderServiceServer)

Types

type Adapter

type Adapter struct {
	Active        bool         `protobuf:"varint,1,opt,name=active,proto3" json:"active,omitempty"`
	Name          string       `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"`
	JobType       JobTypes     `protobuf:"varint,3,opt,name=job_type,json=jobType,proto3,enum=protoadapter.JobTypes" json:"job_type,omitempty"`
	AdapterId     string       `protobuf:"bytes,4,opt,name=adapter_id,json=adapterId,proto3" json:"adapter_id,omitempty"`
	OracleAddress string       `protobuf:"bytes,5,opt,name=oracle_address,json=oracleAddress,proto3" json:"oracle_address,omitempty"`
	Feeds         []*Feed      `protobuf:"bytes,6,rep,name=feeds,proto3" json:"feeds,omitempty"`
	Category      FeedCategory `protobuf:"varint,7,opt,name=category,proto3,enum=protoadapter.FeedCategory" json:"category,omitempty"`
	Frequency     int64        `protobuf:"varint,8,opt,name=frequency,proto3" json:"frequency,omitempty"`
	// contains filtered or unexported fields
}

func (*Adapter) Descriptor deprecated

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

Deprecated: Use Adapter.ProtoReflect.Descriptor instead.

func (*Adapter) GetActive

func (x *Adapter) GetActive() bool

func (*Adapter) GetAdapterId

func (x *Adapter) GetAdapterId() string

func (*Adapter) GetCategory

func (x *Adapter) GetCategory() FeedCategory

func (*Adapter) GetFeeds

func (x *Adapter) GetFeeds() []*Feed

func (*Adapter) GetFrequency

func (x *Adapter) GetFrequency() int64

func (*Adapter) GetJobType

func (x *Adapter) GetJobType() JobTypes

func (*Adapter) GetName

func (x *Adapter) GetName() string

func (*Adapter) GetOracleAddress

func (x *Adapter) GetOracleAddress() string

func (*Adapter) ProtoMessage

func (*Adapter) ProtoMessage()

func (*Adapter) ProtoReflect

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

func (*Adapter) Reset

func (x *Adapter) Reset()

func (*Adapter) String

func (x *Adapter) String() string

type AdapterHead

type AdapterHead struct {
	AdapterId     string `protobuf:"bytes,1,opt,name=adapter_id,json=adapterId,proto3" json:"adapter_id,omitempty"`
	OracleAddress string `protobuf:"bytes,2,opt,name=oracle_address,json=oracleAddress,proto3" json:"oracle_address,omitempty"`
	// contains filtered or unexported fields
}

Contains field that doesn't change throughout the lifetime of an adapter.

func (*AdapterHead) Descriptor deprecated

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

Deprecated: Use AdapterHead.ProtoReflect.Descriptor instead.

func (*AdapterHead) GetAdapterId

func (x *AdapterHead) GetAdapterId() string

func (*AdapterHead) GetOracleAddress

func (x *AdapterHead) GetOracleAddress() string

func (*AdapterHead) ProtoMessage

func (*AdapterHead) ProtoMessage()

func (*AdapterHead) ProtoReflect

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

func (*AdapterHead) Reset

func (x *AdapterHead) Reset()

func (*AdapterHead) String

func (x *AdapterHead) String() string

type Adapters

type Adapters struct {
	Adapters []*Adapter `protobuf:"bytes,1,rep,name=adapters,proto3" json:"adapters,omitempty"`
	// contains filtered or unexported fields
}

func (*Adapters) Descriptor deprecated

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

Deprecated: Use Adapters.ProtoReflect.Descriptor instead.

func (*Adapters) GetAdapters

func (x *Adapters) GetAdapters() []*Adapter

func (*Adapters) ProtoMessage

func (*Adapters) ProtoMessage()

func (*Adapters) ProtoReflect

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

func (*Adapters) Reset

func (x *Adapters) Reset()

func (*Adapters) String

func (x *Adapters) String() string

type DPInfo

type DPInfo struct {
	ListenAddress string             `protobuf:"bytes,1,opt,name=listen_address,json=listenAddress,proto3" json:"listen_address,omitempty"`
	Name          string             `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"`
	KOrgId        string             `protobuf:"bytes,3,opt,name=k_org_id,json=kOrgId,proto3" json:"k_org_id,omitempty"`
	KnownPeers    map[string]*DPInfo `` /* 161-byte string literal not displayed */
	Bootstraps    map[string]*DPInfo `` /* 161-byte string literal not displayed */
	Website       string             `protobuf:"bytes,6,opt,name=website,proto3" json:"website,omitempty"`
	Uptime        int64              `protobuf:"varint,8,opt,name=uptime,proto3" json:"uptime,omitempty"`
	// contains filtered or unexported fields
}

func (*DPInfo) Descriptor deprecated

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

Deprecated: Use DPInfo.ProtoReflect.Descriptor instead.

func (*DPInfo) GetBootstraps

func (x *DPInfo) GetBootstraps() map[string]*DPInfo

func (*DPInfo) GetKOrgId

func (x *DPInfo) GetKOrgId() string

func (*DPInfo) GetKnownPeers

func (x *DPInfo) GetKnownPeers() map[string]*DPInfo

func (*DPInfo) GetListenAddress

func (x *DPInfo) GetListenAddress() string

func (*DPInfo) GetName

func (x *DPInfo) GetName() string

func (*DPInfo) GetUptime

func (x *DPInfo) GetUptime() int64

func (*DPInfo) GetWebsite

func (x *DPInfo) GetWebsite() string

func (*DPInfo) ProtoMessage

func (*DPInfo) ProtoMessage()

func (*DPInfo) ProtoReflect

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

func (*DPInfo) Reset

func (x *DPInfo) Reset()

func (*DPInfo) String

func (x *DPInfo) String() string

type DPInfos

type DPInfos struct {
	List []*DPInfo `protobuf:"bytes,1,rep,name=list,proto3" json:"list,omitempty"`
	// contains filtered or unexported fields
}

func (*DPInfos) Descriptor deprecated

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

Deprecated: Use DPInfos.ProtoReflect.Descriptor instead.

func (*DPInfos) GetList

func (x *DPInfos) GetList() []*DPInfo

func (*DPInfos) ProtoMessage

func (*DPInfos) ProtoMessage()

func (*DPInfos) ProtoReflect

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

func (*DPInfos) Reset

func (x *DPInfos) Reset()

func (*DPInfos) String

func (x *DPInfos) String() string

type DataProviderServiceClient

type DataProviderServiceClient interface {
	AddToKnownPeers(ctx context.Context, in *DPInfo, opts ...grpc.CallOption) (*Null, error)
	ListKnownPeers(ctx context.Context, in *Null, opts ...grpc.CallOption) (*DPInfos, error)
	ListFeeds(ctx context.Context, in *Null, opts ...grpc.CallOption) (*Adapters, error)
	ListFeedsFromAll(ctx context.Context, in *Null, opts ...grpc.CallOption) (*Adapters, error)
}

DataProviderServiceClient is the client API for DataProviderService service.

For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.

type DataProviderServiceServer

type DataProviderServiceServer interface {
	AddToKnownPeers(context.Context, *DPInfo) (*Null, error)
	ListKnownPeers(context.Context, *Null) (*DPInfos, error)
	ListFeeds(context.Context, *Null) (*Adapters, error)
	ListFeedsFromAll(context.Context, *Null) (*Adapters, error)
	// contains filtered or unexported methods
}

DataProviderServiceServer is the server API for DataProviderService service. All implementations must embed UnimplementedDataProviderServiceServer for forward compatibility

type Feed

type Feed struct {
	Url         string         `protobuf:"bytes,1,opt,name=url,proto3" json:"url,omitempty"`
	Headers     []*Feed_Header `protobuf:"bytes,2,rep,name=headers,proto3" json:"headers,omitempty"`
	RequestType RequestType    `protobuf:"varint,3,opt,name=request_type,json=requestType,proto3,enum=protoadapter.RequestType" json:"request_type,omitempty"`
	Reducers    []*Reducer     `protobuf:"bytes,4,rep,name=reducers,proto3" json:"reducers,omitempty"`
	Payload     string         `protobuf:"bytes,5,opt,name=payload,proto3" json:"payload,omitempty"`
	// contains filtered or unexported fields
}

func (*Feed) Descriptor deprecated

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

Deprecated: Use Feed.ProtoReflect.Descriptor instead.

func (*Feed) GetHeaders

func (x *Feed) GetHeaders() []*Feed_Header

func (*Feed) GetPayload

func (x *Feed) GetPayload() string

func (*Feed) GetReducers

func (x *Feed) GetReducers() []*Reducer

func (*Feed) GetRequestType

func (x *Feed) GetRequestType() RequestType

func (*Feed) GetUrl

func (x *Feed) GetUrl() string

func (*Feed) ProtoMessage

func (*Feed) ProtoMessage()

func (*Feed) ProtoReflect

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

func (*Feed) Reset

func (x *Feed) Reset()

func (*Feed) String

func (x *Feed) String() string

type FeedCategory

type FeedCategory int32
const (
	FeedCategory_RNG        FeedCategory = 0 // random number generator
	FeedCategory_SPORT      FeedCategory = 1 // live scores, past data e.t.c
	FeedCategory_PRICE_FEED FeedCategory = 2 // data such as spot prices
	FeedCategory_WEATHER    FeedCategory = 3 // transactions or balances happening on other blockchains
	FeedCategory_FLIGHT     FeedCategory = 4 // departure and arrival statuses on-chain
	FeedCategory_BLOCKCHAIN FeedCategory = 5 // transactions or balances happening on other blockchains
	FeedCategory_NFT_DATA   FeedCategory = 6 // floor Prices, Asset Listings, Collection Details
)

func (FeedCategory) Descriptor

func (FeedCategory) Enum

func (x FeedCategory) Enum() *FeedCategory

func (FeedCategory) EnumDescriptor deprecated

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

Deprecated: Use FeedCategory.Descriptor instead.

func (FeedCategory) Number

func (FeedCategory) String

func (x FeedCategory) String() string

func (FeedCategory) Type

type Feed_Header

type Feed_Header struct {
	Field map[string]string `` /* 151-byte string literal not displayed */
	// contains filtered or unexported fields
}

func (*Feed_Header) Descriptor deprecated

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

Deprecated: Use Feed_Header.ProtoReflect.Descriptor instead.

func (*Feed_Header) GetField

func (x *Feed_Header) GetField() map[string]string

func (*Feed_Header) ProtoMessage

func (*Feed_Header) ProtoMessage()

func (*Feed_Header) ProtoReflect

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

func (*Feed_Header) Reset

func (x *Feed_Header) Reset()

func (*Feed_Header) String

func (x *Feed_Header) String() string

type JobTypes

type JobTypes int32
const (
	JobTypes_DATA_FEED     JobTypes = 0
	JobTypes_RANDOM_NUMBER JobTypes = 1
)

func (JobTypes) Descriptor

func (JobTypes) Descriptor() protoreflect.EnumDescriptor

func (JobTypes) Enum

func (x JobTypes) Enum() *JobTypes

func (JobTypes) EnumDescriptor deprecated

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

Deprecated: Use JobTypes.Descriptor instead.

func (JobTypes) Number

func (x JobTypes) Number() protoreflect.EnumNumber

func (JobTypes) String

func (x JobTypes) String() string

func (JobTypes) Type

type Node

type Node struct {
	IP string `protobuf:"bytes,1,opt,name=IP,proto3" json:"IP,omitempty"`
	// contains filtered or unexported fields
}

Node sends its IP details, sign `an arbitrary message and provides hash of message and signature to proof that it can request information from a Data Provider

func (*Node) Descriptor deprecated

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

Deprecated: Use Node.ProtoReflect.Descriptor instead.

func (*Node) GetIP

func (x *Node) GetIP() string

func (*Node) ProtoMessage

func (*Node) ProtoMessage()

func (*Node) ProtoReflect

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

func (*Node) Reset

func (x *Node) Reset()

func (*Node) String

func (x *Node) String() string

type Null

type Null struct {
	// contains filtered or unexported fields
}

func (*Null) Descriptor deprecated

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

Deprecated: Use Null.ProtoReflect.Descriptor instead.

func (*Null) ProtoMessage

func (*Null) ProtoMessage()

func (*Null) ProtoReflect

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

func (*Null) Reset

func (x *Null) Reset()

func (*Null) String

func (x *Null) String() string

type Reducer

type Reducer struct {
	Function string   `protobuf:"bytes,1,opt,name=function,proto3" json:"function,omitempty"`
	Args     []string `protobuf:"bytes,2,rep,name=args,proto3" json:"args,omitempty"`
	// contains filtered or unexported fields
}

func (*Reducer) Descriptor deprecated

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

Deprecated: Use Reducer.ProtoReflect.Descriptor instead.

func (*Reducer) GetArgs

func (x *Reducer) GetArgs() []string

func (*Reducer) GetFunction

func (x *Reducer) GetFunction() string

func (*Reducer) ProtoMessage

func (*Reducer) ProtoMessage()

func (*Reducer) ProtoReflect

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

func (*Reducer) Reset

func (x *Reducer) Reset()

func (*Reducer) String

func (x *Reducer) String() string

type RequestType

type RequestType int32
const (
	RequestType_GET  RequestType = 0
	RequestType_POST RequestType = 1
)

func (RequestType) Descriptor

func (RequestType) Enum

func (x RequestType) Enum() *RequestType

func (RequestType) EnumDescriptor deprecated

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

Deprecated: Use RequestType.Descriptor instead.

func (RequestType) Number

func (x RequestType) Number() protoreflect.EnumNumber

func (RequestType) String

func (x RequestType) String() string

func (RequestType) Type

type ServerStatus

type ServerStatus struct {
	Alive   bool   `protobuf:"varint,1,opt,name=alive,proto3" json:"alive,omitempty"`
	Message string `protobuf:"bytes,2,opt,name=message,proto3" json:"message,omitempty"`
	// contains filtered or unexported fields
}

func (*ServerStatus) Descriptor deprecated

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

Deprecated: Use ServerStatus.ProtoReflect.Descriptor instead.

func (*ServerStatus) GetAlive

func (x *ServerStatus) GetAlive() bool

func (*ServerStatus) GetMessage

func (x *ServerStatus) GetMessage() string

func (*ServerStatus) ProtoMessage

func (*ServerStatus) ProtoMessage()

func (*ServerStatus) ProtoReflect

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

func (*ServerStatus) Reset

func (x *ServerStatus) Reset()

func (*ServerStatus) String

func (x *ServerStatus) String() string

type UnimplementedDataProviderServiceServer

type UnimplementedDataProviderServiceServer struct {
}

UnimplementedDataProviderServiceServer must be embedded to have forward compatible implementations.

func (UnimplementedDataProviderServiceServer) AddToKnownPeers

func (UnimplementedDataProviderServiceServer) ListFeeds

func (UnimplementedDataProviderServiceServer) ListFeedsFromAll

func (UnimplementedDataProviderServiceServer) ListKnownPeers

type UnsafeDataProviderServiceServer

type UnsafeDataProviderServiceServer interface {
	// contains filtered or unexported methods
}

UnsafeDataProviderServiceServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to DataProviderServiceServer will result in compilation errors.

Jump to

Keyboard shortcuts

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