crypto

package
v1.6.0 Latest Latest
Warning

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

Go to latest
Published: Jun 20, 2023 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var File_proto_crypto_proto protoreflect.FileDescriptor

Functions

func NewCryptoEndpoints

func NewCryptoEndpoints() []*api.Endpoint

func RegisterCryptoHandler

func RegisterCryptoHandler(s server.Server, hdlr CryptoHandler, opts ...server.HandlerOption) error

Types

type Article

type Article struct {

	// title of the article
	Title string `protobuf:"bytes,1,opt,name=title,proto3" json:"title,omitempty"`
	// its description
	Description string `protobuf:"bytes,2,opt,name=description,proto3" json:"description,omitempty"`
	// the source url
	Url string `protobuf:"bytes,3,opt,name=url,proto3" json:"url,omitempty"`
	// the date published
	Date string `protobuf:"bytes,4,opt,name=date,proto3" json:"date,omitempty"`
	// the source
	Source string `protobuf:"bytes,5,opt,name=source,proto3" json:"source,omitempty"`
	// contains filtered or unexported fields
}

func (*Article) Descriptor deprecated

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

Deprecated: Use Article.ProtoReflect.Descriptor instead.

func (*Article) GetDate

func (x *Article) GetDate() string

func (*Article) GetDescription

func (x *Article) GetDescription() string

func (*Article) GetSource

func (x *Article) GetSource() string

func (*Article) GetTitle

func (x *Article) GetTitle() string

func (*Article) GetUrl

func (x *Article) GetUrl() string

func (*Article) ProtoMessage

func (*Article) ProtoMessage()

func (*Article) ProtoReflect

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

func (*Article) Reset

func (x *Article) Reset()

func (*Article) String

func (x *Article) String() string

type CryptoService

type CryptoService interface {
	News(ctx context.Context, in *NewsRequest, opts ...client.CallOption) (*NewsResponse, error)
	Quote(ctx context.Context, in *QuoteRequest, opts ...client.CallOption) (*QuoteResponse, error)
	Price(ctx context.Context, in *PriceRequest, opts ...client.CallOption) (*PriceResponse, error)
	History(ctx context.Context, in *HistoryRequest, opts ...client.CallOption) (*HistoryResponse, error)
	Symbols(ctx context.Context, in *SymbolsRequest, opts ...client.CallOption) (*SymbolsResponse, error)
}

func NewCryptoService

func NewCryptoService(name string, c client.Client) CryptoService

type HistoryRequest

type HistoryRequest struct {

	// the crypto symbol e.g BTCUSD
	Symbol string `protobuf:"bytes,1,opt,name=symbol,proto3" json:"symbol,omitempty"`
	// contains filtered or unexported fields
}

Returns the history for the previous close

func (*HistoryRequest) Descriptor deprecated

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

Deprecated: Use HistoryRequest.ProtoReflect.Descriptor instead.

func (*HistoryRequest) GetSymbol

func (x *HistoryRequest) GetSymbol() string

func (*HistoryRequest) ProtoMessage

func (*HistoryRequest) ProtoMessage()

func (*HistoryRequest) ProtoReflect

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

func (*HistoryRequest) Reset

func (x *HistoryRequest) Reset()

func (*HistoryRequest) String

func (x *HistoryRequest) String() string

type HistoryResponse

type HistoryResponse struct {

	// the crypto symbol
	Symbol string `protobuf:"bytes,1,opt,name=symbol,proto3" json:"symbol,omitempty"`
	// the open price
	Open float64 `protobuf:"fixed64,2,opt,name=open,proto3" json:"open,omitempty"`
	// the close price
	Close float64 `protobuf:"fixed64,3,opt,name=close,proto3" json:"close,omitempty"`
	// the peak price
	High float64 `protobuf:"fixed64,4,opt,name=high,proto3" json:"high,omitempty"`
	// the low price
	Low float64 `protobuf:"fixed64,5,opt,name=low,proto3" json:"low,omitempty"`
	// the volume
	Volume float64 `protobuf:"fixed64,6,opt,name=volume,proto3" json:"volume,omitempty"`
	// the date
	Date string `protobuf:"bytes,7,opt,name=date,proto3" json:"date,omitempty"`
	// contains filtered or unexported fields
}

func (*HistoryResponse) Descriptor deprecated

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

Deprecated: Use HistoryResponse.ProtoReflect.Descriptor instead.

func (*HistoryResponse) GetClose

func (x *HistoryResponse) GetClose() float64

func (*HistoryResponse) GetDate

func (x *HistoryResponse) GetDate() string

func (*HistoryResponse) GetHigh

func (x *HistoryResponse) GetHigh() float64

func (*HistoryResponse) GetLow

func (x *HistoryResponse) GetLow() float64

func (*HistoryResponse) GetOpen

func (x *HistoryResponse) GetOpen() float64

func (*HistoryResponse) GetSymbol

func (x *HistoryResponse) GetSymbol() string

func (*HistoryResponse) GetVolume

func (x *HistoryResponse) GetVolume() float64

func (*HistoryResponse) ProtoMessage

func (*HistoryResponse) ProtoMessage()

func (*HistoryResponse) ProtoReflect

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

func (*HistoryResponse) Reset

func (x *HistoryResponse) Reset()

func (*HistoryResponse) String

func (x *HistoryResponse) String() string

type NewsRequest

type NewsRequest struct {

	// cryptocurrency ticker to request news for e.g BTC
	Symbol string `protobuf:"bytes,1,opt,name=symbol,proto3" json:"symbol,omitempty"`
	// contains filtered or unexported fields
}

Get news related to a currency

func (*NewsRequest) Descriptor deprecated

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

Deprecated: Use NewsRequest.ProtoReflect.Descriptor instead.

func (*NewsRequest) GetSymbol

func (x *NewsRequest) GetSymbol() string

func (*NewsRequest) ProtoMessage

func (*NewsRequest) ProtoMessage()

func (*NewsRequest) ProtoReflect

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

func (*NewsRequest) Reset

func (x *NewsRequest) Reset()

func (*NewsRequest) String

func (x *NewsRequest) String() string

type NewsResponse

type NewsResponse struct {

	// symbol requested for
	Symbol string `protobuf:"bytes,1,opt,name=symbol,proto3" json:"symbol,omitempty"`
	// list of articles
	Articles []*Article `protobuf:"bytes,2,rep,name=articles,proto3" json:"articles,omitempty"`
	// contains filtered or unexported fields
}

func (*NewsResponse) Descriptor deprecated

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

Deprecated: Use NewsResponse.ProtoReflect.Descriptor instead.

func (*NewsResponse) GetArticles

func (x *NewsResponse) GetArticles() []*Article

func (*NewsResponse) GetSymbol

func (x *NewsResponse) GetSymbol() string

func (*NewsResponse) ProtoMessage

func (*NewsResponse) ProtoMessage()

func (*NewsResponse) ProtoReflect

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

func (*NewsResponse) Reset

func (x *NewsResponse) Reset()

func (*NewsResponse) String

func (x *NewsResponse) String() string

type PriceRequest

type PriceRequest struct {

	// the crypto symbol e.g BTCUSD
	Symbol string `protobuf:"bytes,1,opt,name=symbol,proto3" json:"symbol,omitempty"`
	// contains filtered or unexported fields
}

Get the last price for a given crypto ticker

func (*PriceRequest) Descriptor deprecated

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

Deprecated: Use PriceRequest.ProtoReflect.Descriptor instead.

func (*PriceRequest) GetSymbol

func (x *PriceRequest) GetSymbol() string

func (*PriceRequest) ProtoMessage

func (*PriceRequest) ProtoMessage()

func (*PriceRequest) ProtoReflect

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

func (*PriceRequest) Reset

func (x *PriceRequest) Reset()

func (*PriceRequest) String

func (x *PriceRequest) String() string

type PriceResponse

type PriceResponse struct {

	// the crypto symbol e.g BTCUSD
	Symbol string `protobuf:"bytes,1,opt,name=symbol,proto3" json:"symbol,omitempty"`
	// the last price
	Price float64 `protobuf:"fixed64,2,opt,name=price,proto3" json:"price,omitempty"`
	// contains filtered or unexported fields
}

func (*PriceResponse) Descriptor deprecated

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

Deprecated: Use PriceResponse.ProtoReflect.Descriptor instead.

func (*PriceResponse) GetPrice

func (x *PriceResponse) GetPrice() float64

func (*PriceResponse) GetSymbol

func (x *PriceResponse) GetSymbol() string

func (*PriceResponse) ProtoMessage

func (*PriceResponse) ProtoMessage()

func (*PriceResponse) ProtoReflect

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

func (*PriceResponse) Reset

func (x *PriceResponse) Reset()

func (*PriceResponse) String

func (x *PriceResponse) String() string

type QuoteRequest

type QuoteRequest struct {

	// the crypto symbol e.g BTCUSD
	Symbol string `protobuf:"bytes,1,opt,name=symbol,proto3" json:"symbol,omitempty"`
	// contains filtered or unexported fields
}

Get the last quote for a given crypto ticker

func (*QuoteRequest) Descriptor deprecated

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

Deprecated: Use QuoteRequest.ProtoReflect.Descriptor instead.

func (*QuoteRequest) GetSymbol

func (x *QuoteRequest) GetSymbol() string

func (*QuoteRequest) ProtoMessage

func (*QuoteRequest) ProtoMessage()

func (*QuoteRequest) ProtoReflect

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

func (*QuoteRequest) Reset

func (x *QuoteRequest) Reset()

func (*QuoteRequest) String

func (x *QuoteRequest) String() string

type QuoteResponse

type QuoteResponse struct {

	// the crypto symbol
	Symbol string `protobuf:"bytes,1,opt,name=symbol,proto3" json:"symbol,omitempty"`
	// the asking price
	AskPrice float64 `protobuf:"fixed64,2,opt,name=ask_price,json=askPrice,proto3" json:"ask_price,omitempty"`
	// the bidding price
	BidPrice float64 `protobuf:"fixed64,3,opt,name=bid_price,json=bidPrice,proto3" json:"bid_price,omitempty"`
	// the ask size
	AskSize float64 `protobuf:"fixed64,4,opt,name=ask_size,json=askSize,proto3" json:"ask_size,omitempty"`
	// the bid size
	BidSize float64 `protobuf:"fixed64,5,opt,name=bid_size,json=bidSize,proto3" json:"bid_size,omitempty"`
	// the UTC timestamp of the quote
	Timestamp string `protobuf:"bytes,6,opt,name=timestamp,proto3" json:"timestamp,omitempty"`
	// contains filtered or unexported fields
}

func (*QuoteResponse) Descriptor deprecated

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

Deprecated: Use QuoteResponse.ProtoReflect.Descriptor instead.

func (*QuoteResponse) GetAskPrice

func (x *QuoteResponse) GetAskPrice() float64

func (*QuoteResponse) GetAskSize

func (x *QuoteResponse) GetAskSize() float64

func (*QuoteResponse) GetBidPrice

func (x *QuoteResponse) GetBidPrice() float64

func (*QuoteResponse) GetBidSize

func (x *QuoteResponse) GetBidSize() float64

func (*QuoteResponse) GetSymbol

func (x *QuoteResponse) GetSymbol() string

func (*QuoteResponse) GetTimestamp

func (x *QuoteResponse) GetTimestamp() string

func (*QuoteResponse) ProtoMessage

func (*QuoteResponse) ProtoMessage()

func (*QuoteResponse) ProtoReflect

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

func (*QuoteResponse) Reset

func (x *QuoteResponse) Reset()

func (*QuoteResponse) String

func (x *QuoteResponse) String() string

type Symbol added in v0.26.0

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

func (*Symbol) Descriptor deprecated added in v0.26.0

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

Deprecated: Use Symbol.ProtoReflect.Descriptor instead.

func (*Symbol) GetName added in v0.26.0

func (x *Symbol) GetName() string

func (*Symbol) GetSymbol added in v0.26.0

func (x *Symbol) GetSymbol() string

func (*Symbol) ProtoMessage added in v0.26.0

func (*Symbol) ProtoMessage()

func (*Symbol) ProtoReflect added in v0.26.0

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

func (*Symbol) Reset added in v0.26.0

func (x *Symbol) Reset()

func (*Symbol) String added in v0.26.0

func (x *Symbol) String() string

type SymbolsRequest added in v0.26.0

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

Returns the full list of supported symbols

func (*SymbolsRequest) Descriptor deprecated added in v0.26.0

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

Deprecated: Use SymbolsRequest.ProtoReflect.Descriptor instead.

func (*SymbolsRequest) ProtoMessage added in v0.26.0

func (*SymbolsRequest) ProtoMessage()

func (*SymbolsRequest) ProtoReflect added in v0.26.0

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

func (*SymbolsRequest) Reset added in v0.26.0

func (x *SymbolsRequest) Reset()

func (*SymbolsRequest) String added in v0.26.0

func (x *SymbolsRequest) String() string

type SymbolsResponse added in v0.26.0

type SymbolsResponse struct {
	Symbols []*Symbol `protobuf:"bytes,1,rep,name=symbols,proto3" json:"symbols,omitempty"`
	// contains filtered or unexported fields
}

func (*SymbolsResponse) Descriptor deprecated added in v0.26.0

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

Deprecated: Use SymbolsResponse.ProtoReflect.Descriptor instead.

func (*SymbolsResponse) GetSymbols added in v0.26.0

func (x *SymbolsResponse) GetSymbols() []*Symbol

func (*SymbolsResponse) ProtoMessage added in v0.26.0

func (*SymbolsResponse) ProtoMessage()

func (*SymbolsResponse) ProtoReflect added in v0.26.0

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

func (*SymbolsResponse) Reset added in v0.26.0

func (x *SymbolsResponse) Reset()

func (*SymbolsResponse) String added in v0.26.0

func (x *SymbolsResponse) String() string

Jump to

Keyboard shortcuts

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