Documentation ¶
Index ¶
- Variables
- func NewPriceEndpoints() []*api.Endpoint
- func RegisterPriceHandler(s server.Server, hdlr PriceHandler, opts ...server.HandlerOption) error
- type AddRequest
- func (*AddRequest) Descriptor() ([]byte, []int)deprecated
- func (x *AddRequest) GetAuthor() string
- func (x *AddRequest) GetCurrency() string
- func (x *AddRequest) GetName() string
- func (x *AddRequest) GetPrice() float64
- func (x *AddRequest) GetSource() string
- func (x *AddRequest) GetSymbol() string
- func (*AddRequest) ProtoMessage()
- func (x *AddRequest) ProtoReflect() protoreflect.Message
- func (x *AddRequest) Reset()
- func (x *AddRequest) String() string
- type AddResponse
- type GetRequest
- func (*GetRequest) Descriptor() ([]byte, []int)deprecated
- func (x *GetRequest) GetCurrency() string
- func (x *GetRequest) GetName() string
- func (x *GetRequest) GetSymbol() string
- func (*GetRequest) ProtoMessage()
- func (x *GetRequest) ProtoReflect() protoreflect.Message
- func (x *GetRequest) Reset()
- func (x *GetRequest) String() string
- type GetResponse
- type Index
- type IndexRequest
- type IndexResponse
- type ListRequest
- func (*ListRequest) Descriptor() ([]byte, []int)deprecated
- func (x *ListRequest) GetCurrency() string
- func (x *ListRequest) GetLimit() int32
- func (x *ListRequest) GetOffset() int32
- func (*ListRequest) ProtoMessage()
- func (x *ListRequest) ProtoReflect() protoreflect.Message
- func (x *ListRequest) Reset()
- func (x *ListRequest) String() string
- type ListResponse
- type PriceHandler
- type PriceService
- type Report
- func (*Report) Descriptor() ([]byte, []int)deprecated
- func (x *Report) GetAuthor() string
- func (x *Report) GetComment() string
- func (x *Report) GetName() string
- func (x *Report) GetSymbol() string
- func (*Report) ProtoMessage()
- func (x *Report) ProtoReflect() protoreflect.Message
- func (x *Report) Reset()
- func (x *Report) String() string
- type ReportRequest
- func (*ReportRequest) Descriptor() ([]byte, []int)deprecated
- func (x *ReportRequest) GetComment() string
- func (x *ReportRequest) GetName() string
- func (x *ReportRequest) GetSymbol() string
- func (*ReportRequest) ProtoMessage()
- func (x *ReportRequest) ProtoReflect() protoreflect.Message
- func (x *ReportRequest) Reset()
- func (x *ReportRequest) String() string
- type ReportResponse
- type Value
- func (*Value) Descriptor() ([]byte, []int)deprecated
- func (x *Value) GetAuthor() string
- func (x *Value) GetCurrency() string
- func (x *Value) GetName() string
- func (x *Value) GetPrice() float64
- func (x *Value) GetSource() string
- func (x *Value) GetSymbol() string
- func (x *Value) GetTimestamp() string
- func (*Value) ProtoMessage()
- func (x *Value) ProtoReflect() protoreflect.Message
- func (x *Value) Reset()
- func (x *Value) String() string
Constants ¶
This section is empty.
Variables ¶
var File_proto_price_proto protoreflect.FileDescriptor
Functions ¶
func NewPriceEndpoints ¶
func RegisterPriceHandler ¶
func RegisterPriceHandler(s server.Server, hdlr PriceHandler, opts ...server.HandlerOption) error
Types ¶
type AddRequest ¶
type AddRequest struct { // name of the thing e.g bitcoin Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` // price of the thing e.g 10001.00 Price float64 `protobuf:"fixed64,2,opt,name=price,proto3" json:"price,omitempty"` // symbol of value Symbol string `protobuf:"bytes,3,opt,name=symbol,proto3" json:"symbol,omitempty"` // currency e.g USD Currency string `protobuf:"bytes,4,opt,name=currency,proto3" json:"currency,omitempty"` // source of the price Source string `protobuf:"bytes,5,opt,name=source,proto3" json:"source,omitempty"` // author of the price Author string `protobuf:"bytes,6,opt,name=author,proto3" json:"author,omitempty"` // contains filtered or unexported fields }
Add a price
func (*AddRequest) Descriptor
deprecated
func (*AddRequest) Descriptor() ([]byte, []int)
Deprecated: Use AddRequest.ProtoReflect.Descriptor instead.
func (*AddRequest) GetAuthor ¶
func (x *AddRequest) GetAuthor() string
func (*AddRequest) GetCurrency ¶
func (x *AddRequest) GetCurrency() string
func (*AddRequest) GetName ¶
func (x *AddRequest) GetName() string
func (*AddRequest) GetPrice ¶
func (x *AddRequest) GetPrice() float64
func (*AddRequest) GetSource ¶
func (x *AddRequest) GetSource() string
func (*AddRequest) GetSymbol ¶
func (x *AddRequest) GetSymbol() string
func (*AddRequest) ProtoMessage ¶
func (*AddRequest) ProtoMessage()
func (*AddRequest) ProtoReflect ¶
func (x *AddRequest) ProtoReflect() protoreflect.Message
func (*AddRequest) Reset ¶
func (x *AddRequest) Reset()
func (*AddRequest) String ¶
func (x *AddRequest) String() string
type AddResponse ¶
type AddResponse struct { Value *Value `protobuf:"bytes,1,opt,name=value,proto3" json:"value,omitempty"` // contains filtered or unexported fields }
func (*AddResponse) Descriptor
deprecated
func (*AddResponse) Descriptor() ([]byte, []int)
Deprecated: Use AddResponse.ProtoReflect.Descriptor instead.
func (*AddResponse) GetValue ¶
func (x *AddResponse) GetValue() *Value
func (*AddResponse) ProtoMessage ¶
func (*AddResponse) ProtoMessage()
func (*AddResponse) ProtoReflect ¶
func (x *AddResponse) ProtoReflect() protoreflect.Message
func (*AddResponse) Reset ¶
func (x *AddResponse) Reset()
func (*AddResponse) String ¶
func (x *AddResponse) String() string
type GetRequest ¶
type GetRequest struct { // name of the value Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` // symbol of value Symbol string `protobuf:"bytes,2,opt,name=symbol,proto3" json:"symbol,omitempty"` // currency to get Currency string `protobuf:"bytes,3,opt,name=currency,proto3" json:"currency,omitempty"` // contains filtered or unexported fields }
Get the price of anything
func (*GetRequest) Descriptor
deprecated
func (*GetRequest) Descriptor() ([]byte, []int)
Deprecated: Use GetRequest.ProtoReflect.Descriptor instead.
func (*GetRequest) GetCurrency ¶
func (x *GetRequest) GetCurrency() string
func (*GetRequest) GetName ¶
func (x *GetRequest) GetName() string
func (*GetRequest) GetSymbol ¶
func (x *GetRequest) GetSymbol() string
func (*GetRequest) ProtoMessage ¶
func (*GetRequest) ProtoMessage()
func (*GetRequest) ProtoReflect ¶
func (x *GetRequest) ProtoReflect() protoreflect.Message
func (*GetRequest) Reset ¶
func (x *GetRequest) Reset()
func (*GetRequest) String ¶
func (x *GetRequest) String() string
type GetResponse ¶
type GetResponse struct { Values []*Value `protobuf:"bytes,1,rep,name=values,proto3" json:"values,omitempty"` // contains filtered or unexported fields }
func (*GetResponse) Descriptor
deprecated
func (*GetResponse) Descriptor() ([]byte, []int)
Deprecated: Use GetResponse.ProtoReflect.Descriptor instead.
func (*GetResponse) GetValues ¶
func (x *GetResponse) GetValues() []*Value
func (*GetResponse) ProtoMessage ¶
func (*GetResponse) ProtoMessage()
func (*GetResponse) ProtoReflect ¶
func (x *GetResponse) ProtoReflect() protoreflect.Message
func (*GetResponse) Reset ¶
func (x *GetResponse) Reset()
func (*GetResponse) String ¶
func (x *GetResponse) String() string
type Index ¶
type Index struct { // name of item Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` // symbol of item Symbol string `protobuf:"bytes,2,opt,name=symbol,proto3" json:"symbol,omitempty"` // currency of value Currency string `protobuf:"bytes,3,opt,name=currency,proto3" json:"currency,omitempty"` // contains filtered or unexported fields }
func (*Index) Descriptor
deprecated
func (*Index) GetCurrency ¶
func (*Index) ProtoMessage ¶
func (*Index) ProtoMessage()
func (*Index) ProtoReflect ¶
func (x *Index) ProtoReflect() protoreflect.Message
type IndexRequest ¶
type IndexRequest struct {
// contains filtered or unexported fields
}
Get the index for available prices
func (*IndexRequest) Descriptor
deprecated
func (*IndexRequest) Descriptor() ([]byte, []int)
Deprecated: Use IndexRequest.ProtoReflect.Descriptor instead.
func (*IndexRequest) ProtoMessage ¶
func (*IndexRequest) ProtoMessage()
func (*IndexRequest) ProtoReflect ¶
func (x *IndexRequest) ProtoReflect() protoreflect.Message
func (*IndexRequest) Reset ¶
func (x *IndexRequest) Reset()
func (*IndexRequest) String ¶
func (x *IndexRequest) String() string
type IndexResponse ¶
type IndexResponse struct { Index []*Index `protobuf:"bytes,1,rep,name=index,proto3" json:"index,omitempty"` // contains filtered or unexported fields }
func (*IndexResponse) Descriptor
deprecated
func (*IndexResponse) Descriptor() ([]byte, []int)
Deprecated: Use IndexResponse.ProtoReflect.Descriptor instead.
func (*IndexResponse) GetIndex ¶
func (x *IndexResponse) GetIndex() []*Index
func (*IndexResponse) ProtoMessage ¶
func (*IndexResponse) ProtoMessage()
func (*IndexResponse) ProtoReflect ¶
func (x *IndexResponse) ProtoReflect() protoreflect.Message
func (*IndexResponse) Reset ¶
func (x *IndexResponse) Reset()
func (*IndexResponse) String ¶
func (x *IndexResponse) String() string
type ListRequest ¶
type ListRequest struct { // currency to get Currency string `protobuf:"bytes,1,opt,name=currency,proto3" json:"currency,omitempty"` // limit number of values Limit int32 `protobuf:"varint,2,opt,name=limit,proto3" json:"limit,omitempty"` // offset to read from Offset int32 `protobuf:"varint,3,opt,name=offset,proto3" json:"offset,omitempty"` // contains filtered or unexported fields }
List prices for a given currency
func (*ListRequest) Descriptor
deprecated
func (*ListRequest) Descriptor() ([]byte, []int)
Deprecated: Use ListRequest.ProtoReflect.Descriptor instead.
func (*ListRequest) GetCurrency ¶
func (x *ListRequest) GetCurrency() string
func (*ListRequest) GetLimit ¶
func (x *ListRequest) GetLimit() int32
func (*ListRequest) GetOffset ¶
func (x *ListRequest) GetOffset() int32
func (*ListRequest) ProtoMessage ¶
func (*ListRequest) ProtoMessage()
func (*ListRequest) ProtoReflect ¶
func (x *ListRequest) ProtoReflect() protoreflect.Message
func (*ListRequest) Reset ¶
func (x *ListRequest) Reset()
func (*ListRequest) String ¶
func (x *ListRequest) String() string
type ListResponse ¶
type ListResponse struct { Values []*Value `protobuf:"bytes,1,rep,name=values,proto3" json:"values,omitempty"` // contains filtered or unexported fields }
func (*ListResponse) Descriptor
deprecated
func (*ListResponse) Descriptor() ([]byte, []int)
Deprecated: Use ListResponse.ProtoReflect.Descriptor instead.
func (*ListResponse) GetValues ¶
func (x *ListResponse) GetValues() []*Value
func (*ListResponse) ProtoMessage ¶
func (*ListResponse) ProtoMessage()
func (*ListResponse) ProtoReflect ¶
func (x *ListResponse) ProtoReflect() protoreflect.Message
func (*ListResponse) Reset ¶
func (x *ListResponse) Reset()
func (*ListResponse) String ¶
func (x *ListResponse) String() string
type PriceHandler ¶
type PriceHandler interface { Add(context.Context, *AddRequest, *AddResponse) error Get(context.Context, *GetRequest, *GetResponse) error List(context.Context, *ListRequest, *ListResponse) error Index(context.Context, *IndexRequest, *IndexResponse) error Report(context.Context, *ReportRequest, *ReportResponse) error }
type PriceService ¶
type PriceService interface { Add(ctx context.Context, in *AddRequest, opts ...client.CallOption) (*AddResponse, error) Get(ctx context.Context, in *GetRequest, opts ...client.CallOption) (*GetResponse, error) List(ctx context.Context, in *ListRequest, opts ...client.CallOption) (*ListResponse, error) Index(ctx context.Context, in *IndexRequest, opts ...client.CallOption) (*IndexResponse, error) Report(ctx context.Context, in *ReportRequest, opts ...client.CallOption) (*ReportResponse, error) }
func NewPriceService ¶
func NewPriceService(name string, c client.Client) PriceService
type Report ¶
type Report struct { Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` Symbol string `protobuf:"bytes,2,opt,name=symbol,proto3" json:"symbol,omitempty"` Comment string `protobuf:"bytes,3,opt,name=comment,proto3" json:"comment,omitempty"` Author string `protobuf:"bytes,4,opt,name=author,proto3" json:"author,omitempty"` // contains filtered or unexported fields }
func (*Report) Descriptor
deprecated
func (*Report) GetComment ¶
func (*Report) ProtoMessage ¶
func (*Report) ProtoMessage()
func (*Report) ProtoReflect ¶
func (x *Report) ProtoReflect() protoreflect.Message
type ReportRequest ¶
type ReportRequest struct { // name of value Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` // symbol of value Symbol string `protobuf:"bytes,2,opt,name=symbol,proto3" json:"symbol,omitempty"` // additional comment Comment string `protobuf:"bytes,3,opt,name=comment,proto3" json:"comment,omitempty"` // contains filtered or unexported fields }
Report an invalid price
func (*ReportRequest) Descriptor
deprecated
func (*ReportRequest) Descriptor() ([]byte, []int)
Deprecated: Use ReportRequest.ProtoReflect.Descriptor instead.
func (*ReportRequest) GetComment ¶
func (x *ReportRequest) GetComment() string
func (*ReportRequest) GetName ¶
func (x *ReportRequest) GetName() string
func (*ReportRequest) GetSymbol ¶
func (x *ReportRequest) GetSymbol() string
func (*ReportRequest) ProtoMessage ¶
func (*ReportRequest) ProtoMessage()
func (*ReportRequest) ProtoReflect ¶
func (x *ReportRequest) ProtoReflect() protoreflect.Message
func (*ReportRequest) Reset ¶
func (x *ReportRequest) Reset()
func (*ReportRequest) String ¶
func (x *ReportRequest) String() string
type ReportResponse ¶
type ReportResponse struct {
// contains filtered or unexported fields
}
func (*ReportResponse) Descriptor
deprecated
func (*ReportResponse) Descriptor() ([]byte, []int)
Deprecated: Use ReportResponse.ProtoReflect.Descriptor instead.
func (*ReportResponse) ProtoMessage ¶
func (*ReportResponse) ProtoMessage()
func (*ReportResponse) ProtoReflect ¶
func (x *ReportResponse) ProtoReflect() protoreflect.Message
func (*ReportResponse) Reset ¶
func (x *ReportResponse) Reset()
func (*ReportResponse) String ¶
func (x *ReportResponse) String() string
type Value ¶
type Value struct { // name of thing Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` // price of thing Price float64 `protobuf:"fixed64,2,opt,name=price,proto3" json:"price,omitempty"` // symbol of value Symbol string `protobuf:"bytes,3,opt,name=symbol,proto3" json:"symbol,omitempty"` // currency of thing Currency string `protobuf:"bytes,4,opt,name=currency,proto3" json:"currency,omitempty"` // time it was added Timestamp string `protobuf:"bytes,5,opt,name=timestamp,proto3" json:"timestamp,omitempty"` // where it came from Source string `protobuf:"bytes,6,opt,name=source,proto3" json:"source,omitempty"` // who added it Author string `protobuf:"bytes,7,opt,name=author,proto3" json:"author,omitempty"` // contains filtered or unexported fields }
func (*Value) Descriptor
deprecated
func (*Value) GetCurrency ¶
func (*Value) GetTimestamp ¶
func (*Value) ProtoMessage ¶
func (*Value) ProtoMessage()
func (*Value) ProtoReflect ¶
func (x *Value) ProtoReflect() protoreflect.Message