price

package
v1.7.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

View Source
var File_proto_price_proto protoreflect.FileDescriptor

Functions

func NewPriceEndpoints

func NewPriceEndpoints() []*api.Endpoint

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) Descriptor() ([]byte, []int)

Deprecated: Use Index.ProtoReflect.Descriptor instead.

func (*Index) GetCurrency

func (x *Index) GetCurrency() string

func (*Index) GetName

func (x *Index) GetName() string

func (*Index) GetSymbol

func (x *Index) GetSymbol() string

func (*Index) ProtoMessage

func (*Index) ProtoMessage()

func (*Index) ProtoReflect

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

func (*Index) Reset

func (x *Index) Reset()

func (*Index) String

func (x *Index) String() string

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 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) Descriptor() ([]byte, []int)

Deprecated: Use Report.ProtoReflect.Descriptor instead.

func (*Report) GetAuthor

func (x *Report) GetAuthor() string

func (*Report) GetComment

func (x *Report) GetComment() string

func (*Report) GetName

func (x *Report) GetName() string

func (*Report) GetSymbol

func (x *Report) GetSymbol() string

func (*Report) ProtoMessage

func (*Report) ProtoMessage()

func (*Report) ProtoReflect

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

func (*Report) Reset

func (x *Report) Reset()

func (*Report) String

func (x *Report) String() string

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) Descriptor() ([]byte, []int)

Deprecated: Use Value.ProtoReflect.Descriptor instead.

func (*Value) GetAuthor

func (x *Value) GetAuthor() string

func (*Value) GetCurrency

func (x *Value) GetCurrency() string

func (*Value) GetName

func (x *Value) GetName() string

func (*Value) GetPrice

func (x *Value) GetPrice() float64

func (*Value) GetSource

func (x *Value) GetSource() string

func (*Value) GetSymbol

func (x *Value) GetSymbol() string

func (*Value) GetTimestamp

func (x *Value) GetTimestamp() string

func (*Value) ProtoMessage

func (*Value) ProtoMessage()

func (*Value) ProtoReflect

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

func (*Value) Reset

func (x *Value) Reset()

func (*Value) String

func (x *Value) String() string

Jump to

Keyboard shortcuts

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