proto

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: May 12, 2020 License: MIT Imports: 16 Imported by: 0

Documentation

Overview

Package proto is a reverse proxy.

It translates gRPC into RESTful JSON APIs.

Index

Constants

This section is empty.

Variables

View Source
var (
	PricePatterns_name = map[int32]string{
		0: "FLUCTUATING",
		1: "BIGSPIKE",
		2: "DECREASING",
		3: "SMALLSPIKE",
		4: "UNKNOWN",
	}
	PricePatterns_value = map[string]int32{
		"FLUCTUATING": 0,
		"BIGSPIKE":    1,
		"DECREASING":  2,
		"SMALLSPIKE":  3,
		"UNKNOWN":     4,
	}
)

Enum value maps for PricePatterns.

View Source
var File_proto_service_proto protoreflect.FileDescriptor

Functions

func RegisterStalkForecasterHandler

func RegisterStalkForecasterHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error

RegisterStalkForecasterHandler registers the http handlers for service StalkForecaster to "mux". The handlers forward requests to the grpc endpoint over "conn".

func RegisterStalkForecasterHandlerClient

func RegisterStalkForecasterHandlerClient(ctx context.Context, mux *runtime.ServeMux, client StalkForecasterClient) error

RegisterStalkForecasterHandlerClient registers the http handlers for service StalkForecaster to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "StalkForecasterClient". Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "StalkForecasterClient" doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in "StalkForecasterClient" to call the correct interceptors.

func RegisterStalkForecasterHandlerFromEndpoint

func RegisterStalkForecasterHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error)

RegisterStalkForecasterHandlerFromEndpoint is same as RegisterStalkForecasterHandler but automatically dials to "endpoint" and closes the connection when "ctx" gets done.

func RegisterStalkForecasterHandlerServer

func RegisterStalkForecasterHandlerServer(ctx context.Context, mux *runtime.ServeMux, server StalkForecasterServer) error

RegisterStalkForecasterHandlerServer registers the http handlers for service StalkForecaster to "mux". UnaryRPC :call StalkForecasterServer directly. StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906.

func RegisterStalkForecasterServer

func RegisterStalkForecasterServer(s *grpc.Server, srv StalkForecasterServer)

Types

type Forecast

type Forecast struct {
	PricesSummary *PricesSummary      `protobuf:"bytes,1,opt,name=prices_summary,json=pricesSummary,proto3" json:"prices_summary,omitempty"`
	Spikes        *ForecastSpikes     `protobuf:"bytes,2,opt,name=spikes,proto3" json:"spikes,omitempty"`
	Patterns      []*PotentialPattern `protobuf:"bytes,3,rep,name=patterns,proto3" json:"patterns,omitempty"`
	// contains filtered or unexported fields
}

A forecast for prices on your island

func (*Forecast) Descriptor deprecated

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

Deprecated: Use Forecast.ProtoReflect.Descriptor instead.

func (*Forecast) GetPatterns

func (x *Forecast) GetPatterns() []*PotentialPattern

func (*Forecast) GetPricesSummary

func (x *Forecast) GetPricesSummary() *PricesSummary

func (*Forecast) GetSpikes

func (x *Forecast) GetSpikes() *ForecastSpikes

func (*Forecast) ProtoMessage

func (*Forecast) ProtoMessage()

func (*Forecast) ProtoReflect

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

func (*Forecast) Reset

func (x *Forecast) Reset()

func (*Forecast) String

func (x *Forecast) String() string

type ForecastSpikes

type ForecastSpikes struct {

	// The chances of a small spike happening this week.
	Small *SpikeChances `protobuf:"bytes,1,opt,name=small,proto3" json:"small,omitempty"`
	// The chances of a big spike happening this week.
	Big *SpikeChances `protobuf:"bytes,2,opt,name=big,proto3" json:"big,omitempty"`
	// The chances of any spike happening this week.
	Any *SpikeChances `protobuf:"bytes,3,opt,name=any,proto3" json:"any,omitempty"`
	// contains filtered or unexported fields
}

Contains the overall chances of a price spike occurring this week, as well as a breakdown of likelihood for each price period, by spike type.

func (*ForecastSpikes) Descriptor deprecated

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

Deprecated: Use ForecastSpikes.ProtoReflect.Descriptor instead.

func (*ForecastSpikes) GetAny

func (x *ForecastSpikes) GetAny() *SpikeChances

func (*ForecastSpikes) GetBig

func (x *ForecastSpikes) GetBig() *SpikeChances

func (*ForecastSpikes) GetSmall

func (x *ForecastSpikes) GetSmall() *SpikeChances

func (*ForecastSpikes) ProtoMessage

func (*ForecastSpikes) ProtoMessage()

func (*ForecastSpikes) ProtoReflect

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

func (*ForecastSpikes) Reset

func (x *ForecastSpikes) Reset()

func (*ForecastSpikes) String

func (x *ForecastSpikes) String() string

type PotentialPattern

type PotentialPattern struct {
	Pattern        PricePatterns    `protobuf:"varint,1,opt,name=pattern,proto3,enum=proto.PricePatterns" json:"pattern,omitempty"`
	Chance         float64          `protobuf:"fixed64,2,opt,name=chance,proto3" json:"chance,omitempty"`
	PricesSummary  *PricesSummary   `protobuf:"bytes,3,opt,name=prices_summary,json=pricesSummary,proto3" json:"prices_summary,omitempty"`
	Spike          *SpikeRange      `protobuf:"bytes,4,opt,name=spike,proto3" json:"spike,omitempty"`
	PotentialWeeks []*PotentialWeek `protobuf:"bytes,5,rep,name=potential_weeks,json=potentialWeeks,proto3" json:"potential_weeks,omitempty"`
	// contains filtered or unexported fields
}

Describes the potential course a price pattern may take given the user's price ticker.

func (*PotentialPattern) Descriptor deprecated

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

Deprecated: Use PotentialPattern.ProtoReflect.Descriptor instead.

func (*PotentialPattern) GetChance

func (x *PotentialPattern) GetChance() float64

func (*PotentialPattern) GetPattern

func (x *PotentialPattern) GetPattern() PricePatterns

func (*PotentialPattern) GetPotentialWeeks

func (x *PotentialPattern) GetPotentialWeeks() []*PotentialWeek

func (*PotentialPattern) GetPricesSummary

func (x *PotentialPattern) GetPricesSummary() *PricesSummary

func (*PotentialPattern) GetSpike

func (x *PotentialPattern) GetSpike() *SpikeRange

func (*PotentialPattern) ProtoMessage

func (*PotentialPattern) ProtoMessage()

func (*PotentialPattern) ProtoReflect

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

func (*PotentialPattern) Reset

func (x *PotentialPattern) Reset()

func (*PotentialPattern) String

func (x *PotentialPattern) String() string

type PotentialWeek

type PotentialWeek struct {

	// The chance this price fluctuation will occur.
	Chance float64 `protobuf:"fixed64,1,opt,name=chance,proto3" json:"chance,omitempty"`
	// Price information for each price period. Will always have 12 items.
	Prices []*PricePeriod `protobuf:"bytes,3,rep,name=prices,proto3" json:"prices,omitempty"`
	// A summary of the prices in this fluctuation.
	PricesSummary *PricesSummary `protobuf:"bytes,4,opt,name=prices_summary,json=pricesSummary,proto3" json:"prices_summary,omitempty"`
	// A summary of whether there will be a spike and what periods it will occur on.
	Spike *SpikeRange `protobuf:"bytes,5,opt,name=spike,proto3" json:"spike,omitempty"`
	// contains filtered or unexported fields
}

Describes a potential price fluctuation for a week of a given price pattern.

func (*PotentialWeek) Descriptor deprecated

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

Deprecated: Use PotentialWeek.ProtoReflect.Descriptor instead.

func (*PotentialWeek) GetChance

func (x *PotentialWeek) GetChance() float64

func (*PotentialWeek) GetPrices

func (x *PotentialWeek) GetPrices() []*PricePeriod

func (*PotentialWeek) GetPricesSummary

func (x *PotentialWeek) GetPricesSummary() *PricesSummary

func (*PotentialWeek) GetSpike

func (x *PotentialWeek) GetSpike() *SpikeRange

func (*PotentialWeek) ProtoMessage

func (*PotentialWeek) ProtoMessage()

func (*PotentialWeek) ProtoReflect

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

func (*PotentialWeek) Reset

func (x *PotentialWeek) Reset()

func (*PotentialWeek) String

func (x *PotentialWeek) String() string

type PricePatterns

type PricePatterns int32

Enum of the price patterns that can occur in animal crossing.

const (
	PricePatterns_FLUCTUATING PricePatterns = 0
	PricePatterns_BIGSPIKE    PricePatterns = 1
	PricePatterns_DECREASING  PricePatterns = 2
	PricePatterns_SMALLSPIKE  PricePatterns = 3
	PricePatterns_UNKNOWN     PricePatterns = 4
)

func (PricePatterns) Descriptor

func (PricePatterns) Enum

func (x PricePatterns) Enum() *PricePatterns

func (PricePatterns) EnumDescriptor deprecated

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

Deprecated: Use PricePatterns.Descriptor instead.

func (PricePatterns) Number

func (PricePatterns) String

func (x PricePatterns) String() string

func (PricePatterns) Type

type PricePeriod

type PricePeriod struct {

	// The minimum price that might occur during this period.
	Min int32 `protobuf:"varint,1,opt,name=min,proto3" json:"min,omitempty"`
	// The maximum price that might occur during this period.
	Max     int32 `protobuf:"varint,2,opt,name=max,proto3" json:"max,omitempty"`
	IsSpike bool  `protobuf:"varint,3,opt,name=is_spike,json=isSpike,proto3" json:"is_spike,omitempty"`
	// contains filtered or unexported fields
}

Price info for a single price period.

func (*PricePeriod) Descriptor deprecated

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

Deprecated: Use PricePeriod.ProtoReflect.Descriptor instead.

func (*PricePeriod) GetIsSpike

func (x *PricePeriod) GetIsSpike() bool

func (*PricePeriod) GetMax

func (x *PricePeriod) GetMax() int32

func (*PricePeriod) GetMin

func (x *PricePeriod) GetMin() int32

func (*PricePeriod) ProtoMessage

func (*PricePeriod) ProtoMessage()

func (*PricePeriod) ProtoReflect

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

func (*PricePeriod) Reset

func (x *PricePeriod) Reset()

func (*PricePeriod) String

func (x *PricePeriod) String() string

type PricesSummary

type PricesSummary struct {

	// The minimum guaranteed price for the parent. This is the highest minimum price
	// we can say will happen with 100% certainty.
	Min int32 `protobuf:"varint,1,opt,name=min,proto3" json:"min,omitempty"`
	// The potential maximum price of the parent object.
	Max int32 `protobuf:"varint,2,opt,name=max,proto3" json:"max,omitempty"`
	// The price periods during which “min“ might occur.
	MinPeriods []int32 `protobuf:"varint,3,rep,packed,name=min_periods,json=minPeriods,proto3" json:"min_periods,omitempty"`
	// The price periods during which “max“ might occur.
	MaxPeriods []int32 `protobuf:"varint,4,rep,packed,name=max_periods,json=maxPeriods,proto3" json:"max_periods,omitempty"`
	// contains filtered or unexported fields
}

Price info for a series of prices.

func (*PricesSummary) Descriptor deprecated

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

Deprecated: Use PricesSummary.ProtoReflect.Descriptor instead.

func (*PricesSummary) GetMax

func (x *PricesSummary) GetMax() int32

func (*PricesSummary) GetMaxPeriods

func (x *PricesSummary) GetMaxPeriods() []int32

func (*PricesSummary) GetMin

func (x *PricesSummary) GetMin() int32

func (*PricesSummary) GetMinPeriods

func (x *PricesSummary) GetMinPeriods() []int32

func (*PricesSummary) ProtoMessage

func (*PricesSummary) ProtoMessage()

func (*PricesSummary) ProtoReflect

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

func (*PricesSummary) Reset

func (x *PricesSummary) Reset()

func (*PricesSummary) String

func (x *PricesSummary) String() string

type SpikeChances

type SpikeChances struct {

	// Whether the parent has this type of spike.
	Has bool `protobuf:"varint,1,opt,name=has,proto3" json:"has,omitempty"`
	// The price period (0-11) the spike might start on.
	Start int32 `protobuf:"varint,2,opt,name=start,proto3" json:"start,omitempty"`
	// The price period (0-11) the spike might end on.
	End int32 `protobuf:"varint,3,opt,name=end,proto3" json:"end,omitempty"`
	// The overall chance this type of spike will occur
	Chance float64 `protobuf:"fixed64,4,opt,name=chance,proto3" json:"chance,omitempty"`
	// A period-by-period breakdown of the chances this type of spike will occur on the
	// given price period.
	Breakdown []float64 `protobuf:"fixed64,5,rep,packed,name=breakdown,proto3" json:"breakdown,omitempty"`
	// contains filtered or unexported fields
}

Spike info for the overall prediction.

func (*SpikeChances) Descriptor deprecated

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

Deprecated: Use SpikeChances.ProtoReflect.Descriptor instead.

func (*SpikeChances) GetBreakdown

func (x *SpikeChances) GetBreakdown() []float64

func (*SpikeChances) GetChance

func (x *SpikeChances) GetChance() float64

func (*SpikeChances) GetEnd

func (x *SpikeChances) GetEnd() int32

func (*SpikeChances) GetHas

func (x *SpikeChances) GetHas() bool

func (*SpikeChances) GetStart

func (x *SpikeChances) GetStart() int32

func (*SpikeChances) ProtoMessage

func (*SpikeChances) ProtoMessage()

func (*SpikeChances) ProtoReflect

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

func (*SpikeChances) Reset

func (x *SpikeChances) Reset()

func (*SpikeChances) String

func (x *SpikeChances) String() string

type SpikeRange

type SpikeRange struct {

	// Whether the parent has this type of spike.
	Has bool `protobuf:"varint,1,opt,name=has,proto3" json:"has,omitempty"`
	// The price period (0-11) the spike starts on.
	Start int32 `protobuf:"varint,2,opt,name=start,proto3" json:"start,omitempty"`
	// The price period (0-11) the spike ends on.
	End int32 `protobuf:"varint,3,opt,name=end,proto3" json:"end,omitempty"`
	// contains filtered or unexported fields
}

Spike info for weeks, weeks and patterns.

func (*SpikeRange) Descriptor deprecated

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

Deprecated: Use SpikeRange.ProtoReflect.Descriptor instead.

func (*SpikeRange) GetEnd

func (x *SpikeRange) GetEnd() int32

func (*SpikeRange) GetHas

func (x *SpikeRange) GetHas() bool

func (*SpikeRange) GetStart

func (x *SpikeRange) GetStart() int32

func (*SpikeRange) ProtoMessage

func (*SpikeRange) ProtoMessage()

func (*SpikeRange) ProtoReflect

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

func (*SpikeRange) Reset

func (x *SpikeRange) Reset()

func (*SpikeRange) String

func (x *SpikeRange) String() string

type StalkForecasterClient

type StalkForecasterClient interface {
	// Returns a turnip price forecast for supplied price ticker.
	ForecastPrices(ctx context.Context, in *Ticker, opts ...grpc.CallOption) (*Forecast, error)
}

StalkForecasterClient is the client API for StalkForecaster service.

For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.

type StalkForecasterServer

type StalkForecasterServer interface {
	// Returns a turnip price forecast for supplied price ticker.
	ForecastPrices(context.Context, *Ticker) (*Forecast, error)
}

StalkForecasterServer is the server API for StalkForecaster service.

type Ticker

type Ticker struct {

	// The purchase price of the turnips on sunday.
	PurchasePrice int32 `protobuf:"varint,1,opt,name=purchase_price,json=purchasePrice,proto3" json:"purchase_price,omitempty"`
	// The pattern of the previous week's prices for this island.
	PreviousPattern PricePatterns `` /* 132-byte string literal not displayed */
	// The known nook prices for bells. This is expected to be a 12-value array with
	// a price of '0' standing in for "unknown". If this field contains less than
	// 12 values, it is assumed the remaining values are 0. The server will reject a
	// ticker with less than 12 values
	Prices []int32 `protobuf:"varint,3,rep,packed,name=prices,proto3" json:"prices,omitempty"`
	// contains filtered or unexported fields
}

Island price data sent when requesting a prediction

func (*Ticker) Descriptor deprecated

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

Deprecated: Use Ticker.ProtoReflect.Descriptor instead.

func (*Ticker) GetPreviousPattern

func (x *Ticker) GetPreviousPattern() PricePatterns

func (*Ticker) GetPrices

func (x *Ticker) GetPrices() []int32

func (*Ticker) GetPurchasePrice

func (x *Ticker) GetPurchasePrice() int32

func (*Ticker) ProtoMessage

func (*Ticker) ProtoMessage()

func (*Ticker) ProtoReflect

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

func (*Ticker) Reset

func (x *Ticker) Reset()

func (*Ticker) String

func (x *Ticker) String() string

type UnimplementedStalkForecasterServer

type UnimplementedStalkForecasterServer struct {
}

UnimplementedStalkForecasterServer can be embedded to have forward compatible implementations.

func (*UnimplementedStalkForecasterServer) ForecastPrices

Jump to

Keyboard shortcuts

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