pricesrpc

package
v0.6.3 Latest Latest
Warning

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

Go to latest
Published: Nov 30, 2026 License: MIT Imports: 17 Imported by: 2 modules, 1 package

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package pricesrpc is a reverse proxy.

It translates gRPC into RESTful JSON APIs.

Index

Constants

This section is empty.

Variables

View Source
var File_prices_proto protoreflect.FileDescriptor
View Source
var Prices_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "pricesrpc.Prices",
	HandlerType: (*PricesServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "GetPrice",
			Handler:    _Prices_GetPrice_Handler,
		},
		{
			MethodName: "ChallengeMinted",
			Handler:    _Prices_ChallengeMinted_Handler,
		},
		{
			MethodName: "AuthorizeRequest",
			Handler:    _Prices_AuthorizeRequest_Handler,
		},
		{
			MethodName: "ReportUsage",
			Handler:    _Prices_ReportUsage_Handler,
		},
		{
			MethodName: "QuoteSession",
			Handler:    _Prices_QuoteSession_Handler,
		},
		{
			MethodName: "SettleSession",
			Handler:    _Prices_SettleSession_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "prices.proto",
}

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

Functions

func RegisterPricesHandler

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

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

func RegisterPricesHandlerClient

func RegisterPricesHandlerClient(ctx context.Context, mux *runtime.ServeMux, client PricesClient) error

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

func RegisterPricesHandlerFromEndpoint

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

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

func RegisterPricesHandlerServer

func RegisterPricesHandlerServer(ctx context.Context, mux *runtime.ServeMux, server PricesServer) error

RegisterPricesHandlerServer registers the http handlers for service Prices to "mux". UnaryRPC :call PricesServer directly. StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterPricesHandlerFromEndpoint instead. GRPC interceptors will not work for this type of registration. To use interceptors, you must use the "runtime.WithMiddlewares" option in the "runtime.NewServeMux" call.

func RegisterPricesServer

func RegisterPricesServer(s grpc.ServiceRegistrar, srv PricesServer)

Types

type AuthorizeRequestRequest added in v0.6.0

type AuthorizeRequestRequest struct {

	// The URL path of the request.
	Path string `protobuf:"bytes,1,opt,name=path,proto3" json:"path,omitempty"`
	// The full HTTP request serialized as text.
	HttpRequestText string `protobuf:"bytes,2,opt,name=http_request_text,json=httpRequestText,proto3" json:"http_request_text,omitempty"`
	// The hex-encoded L402 token ID the request authenticated with.
	TokenId string `protobuf:"bytes,3,opt,name=token_id,json=tokenId,proto3" json:"token_id,omitempty"`
	// The name of the aperture service the request is for.
	ServiceName string `protobuf:"bytes,4,opt,name=service_name,json=serviceName,proto3" json:"service_name,omitempty"`
	// contains filtered or unexported fields
}

func (*AuthorizeRequestRequest) Descriptor deprecated added in v0.6.0

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

Deprecated: Use AuthorizeRequestRequest.ProtoReflect.Descriptor instead.

func (*AuthorizeRequestRequest) GetHttpRequestText added in v0.6.0

func (x *AuthorizeRequestRequest) GetHttpRequestText() string

func (*AuthorizeRequestRequest) GetPath added in v0.6.0

func (x *AuthorizeRequestRequest) GetPath() string

func (*AuthorizeRequestRequest) GetServiceName added in v0.6.0

func (x *AuthorizeRequestRequest) GetServiceName() string

func (*AuthorizeRequestRequest) GetTokenId added in v0.6.0

func (x *AuthorizeRequestRequest) GetTokenId() string

func (*AuthorizeRequestRequest) ProtoMessage added in v0.6.0

func (*AuthorizeRequestRequest) ProtoMessage()

func (*AuthorizeRequestRequest) ProtoReflect added in v0.6.0

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

func (*AuthorizeRequestRequest) Reset added in v0.6.0

func (x *AuthorizeRequestRequest) Reset()

func (*AuthorizeRequestRequest) String added in v0.6.0

func (x *AuthorizeRequestRequest) String() string

type AuthorizeRequestResponse added in v0.6.0

type AuthorizeRequestResponse struct {

	// Whether the request is allowed to proceed to the backend.
	Allowed bool `protobuf:"varint,1,opt,name=allowed,proto3" json:"allowed,omitempty"`
	// When not allowed, the price in satoshis for the fresh 402 challenge
	// aperture should mint. If zero, aperture falls back to GetPrice.
	PriceSats int64 `protobuf:"varint,2,opt,name=price_sats,json=priceSats,proto3" json:"price_sats,omitempty"`
	// An optional human-readable reason for a denied request.
	Reason string `protobuf:"bytes,3,opt,name=reason,proto3" json:"reason,omitempty"`
	// The per-request token estimate the price server reserved against the
	// token's balance when allowing this request. Aperture echoes it back
	// in the matching ReportUsageRequest so the exact reservation can be
	// released, rather than an approximate default.
	ReservedEstimate int64 `protobuf:"varint,4,opt,name=reserved_estimate,json=reservedEstimate,proto3" json:"reserved_estimate,omitempty"`
	// When not allowed, whether the balance is only reserved by requests in
	// flight. Aperture then answers 429 with Retry-After instead of a 402.
	RetryLater bool `protobuf:"varint,5,opt,name=retry_later,json=retryLater,proto3" json:"retry_later,omitempty"`
	// The tokens the price server debits when this request's response ends
	// without a usage object, such as a stream the client walked away from.
	// It is a realistic cost estimate, no larger than reserved_estimate,
	// which is sized generously for admission. Aperture echoes it in the
	// matching ReportUsageRequest.
	SettleEstimate int64 `protobuf:"varint,6,opt,name=settle_estimate,json=settleEstimate,proto3" json:"settle_estimate,omitempty"`
	// contains filtered or unexported fields
}

func (*AuthorizeRequestResponse) Descriptor deprecated added in v0.6.0

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

Deprecated: Use AuthorizeRequestResponse.ProtoReflect.Descriptor instead.

func (*AuthorizeRequestResponse) GetAllowed added in v0.6.0

func (x *AuthorizeRequestResponse) GetAllowed() bool

func (*AuthorizeRequestResponse) GetPriceSats added in v0.6.0

func (x *AuthorizeRequestResponse) GetPriceSats() int64

func (*AuthorizeRequestResponse) GetReason added in v0.6.0

func (x *AuthorizeRequestResponse) GetReason() string

func (*AuthorizeRequestResponse) GetReservedEstimate added in v0.6.0

func (x *AuthorizeRequestResponse) GetReservedEstimate() int64

func (*AuthorizeRequestResponse) GetRetryLater added in v0.6.1

func (x *AuthorizeRequestResponse) GetRetryLater() bool

func (*AuthorizeRequestResponse) GetSettleEstimate added in v0.6.1

func (x *AuthorizeRequestResponse) GetSettleEstimate() int64

func (*AuthorizeRequestResponse) ProtoMessage added in v0.6.0

func (*AuthorizeRequestResponse) ProtoMessage()

func (*AuthorizeRequestResponse) ProtoReflect added in v0.6.0

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

func (*AuthorizeRequestResponse) Reset added in v0.6.0

func (x *AuthorizeRequestResponse) Reset()

func (*AuthorizeRequestResponse) String added in v0.6.0

func (x *AuthorizeRequestResponse) String() string

type ChallengeMintedRequest added in v0.6.0

type ChallengeMintedRequest struct {

	// The URL path of the request that triggered the challenge.
	Path string `protobuf:"bytes,1,opt,name=path,proto3" json:"path,omitempty"`
	// The full HTTP request serialized as text.
	HttpRequestText string `protobuf:"bytes,2,opt,name=http_request_text,json=httpRequestText,proto3" json:"http_request_text,omitempty"`
	// The hex-encoded L402 token ID of the minted macaroon.
	TokenId string `protobuf:"bytes,3,opt,name=token_id,json=tokenId,proto3" json:"token_id,omitempty"`
	// The price in satoshis the challenge invoice was created for.
	PriceSats int64 `protobuf:"varint,4,opt,name=price_sats,json=priceSats,proto3" json:"price_sats,omitempty"`
	// The name of the aperture service the challenge was minted for.
	ServiceName string `protobuf:"bytes,5,opt,name=service_name,json=serviceName,proto3" json:"service_name,omitempty"`
	// contains filtered or unexported fields
}

func (*ChallengeMintedRequest) Descriptor deprecated added in v0.6.0

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

Deprecated: Use ChallengeMintedRequest.ProtoReflect.Descriptor instead.

func (*ChallengeMintedRequest) GetHttpRequestText added in v0.6.0

func (x *ChallengeMintedRequest) GetHttpRequestText() string

func (*ChallengeMintedRequest) GetPath added in v0.6.0

func (x *ChallengeMintedRequest) GetPath() string

func (*ChallengeMintedRequest) GetPriceSats added in v0.6.0

func (x *ChallengeMintedRequest) GetPriceSats() int64

func (*ChallengeMintedRequest) GetServiceName added in v0.6.0

func (x *ChallengeMintedRequest) GetServiceName() string

func (*ChallengeMintedRequest) GetTokenId added in v0.6.0

func (x *ChallengeMintedRequest) GetTokenId() string

func (*ChallengeMintedRequest) ProtoMessage added in v0.6.0

func (*ChallengeMintedRequest) ProtoMessage()

func (*ChallengeMintedRequest) ProtoReflect added in v0.6.0

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

func (*ChallengeMintedRequest) Reset added in v0.6.0

func (x *ChallengeMintedRequest) Reset()

func (*ChallengeMintedRequest) String added in v0.6.0

func (x *ChallengeMintedRequest) String() string

type ChallengeMintedResponse added in v0.6.0

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

func (*ChallengeMintedResponse) Descriptor deprecated added in v0.6.0

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

Deprecated: Use ChallengeMintedResponse.ProtoReflect.Descriptor instead.

func (*ChallengeMintedResponse) ProtoMessage added in v0.6.0

func (*ChallengeMintedResponse) ProtoMessage()

func (*ChallengeMintedResponse) ProtoReflect added in v0.6.0

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

func (*ChallengeMintedResponse) Reset added in v0.6.0

func (x *ChallengeMintedResponse) Reset()

func (*ChallengeMintedResponse) String added in v0.6.0

func (x *ChallengeMintedResponse) String() string

type GetPriceRequest

type GetPriceRequest struct {
	Path            string `protobuf:"bytes,1,opt,name=path,proto3" json:"path,omitempty"`
	HttpRequestText string `protobuf:"bytes,2,opt,name=http_request_text,json=httpRequestText,proto3" json:"http_request_text,omitempty"`
	// contains filtered or unexported fields
}

func (*GetPriceRequest) Descriptor deprecated

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

Deprecated: Use GetPriceRequest.ProtoReflect.Descriptor instead.

func (*GetPriceRequest) GetHttpRequestText

func (x *GetPriceRequest) GetHttpRequestText() string

func (*GetPriceRequest) GetPath

func (x *GetPriceRequest) GetPath() string

func (*GetPriceRequest) ProtoMessage

func (*GetPriceRequest) ProtoMessage()

func (*GetPriceRequest) ProtoReflect

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

func (*GetPriceRequest) Reset

func (x *GetPriceRequest) Reset()

func (*GetPriceRequest) String

func (x *GetPriceRequest) String() string

type GetPriceResponse

type GetPriceResponse struct {
	PriceSats int64 `protobuf:"varint,1,opt,name=price_sats,json=priceSats,proto3" json:"price_sats,omitempty"`
	// contains filtered or unexported fields
}

func (*GetPriceResponse) Descriptor deprecated

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

Deprecated: Use GetPriceResponse.ProtoReflect.Descriptor instead.

func (*GetPriceResponse) GetPriceSats

func (x *GetPriceResponse) GetPriceSats() int64

func (*GetPriceResponse) ProtoMessage

func (*GetPriceResponse) ProtoMessage()

func (*GetPriceResponse) ProtoReflect

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

func (*GetPriceResponse) Reset

func (x *GetPriceResponse) Reset()

func (*GetPriceResponse) String

func (x *GetPriceResponse) String() string

type PricesClient

type PricesClient interface {
	GetPrice(ctx context.Context, in *GetPriceRequest, opts ...grpc.CallOption) (*GetPriceResponse, error)
	// ChallengeMinted notifies the pricer that aperture minted a fresh L402
	// challenge for a metered service. The token ID identifies the macaroon
	// embedded in the challenge, and the price is the amount quoted by a
	// preceding GetPrice call. The pricer uses this to associate the token,
	// once paid, with the balance it purchased.
	ChallengeMinted(ctx context.Context, in *ChallengeMintedRequest, opts ...grpc.CallOption) (*ChallengeMintedResponse, error)
	// AuthorizeRequest is invoked for every authenticated request to a metered
	// service. The pricer decides whether the token still has balance left; if
	// not, aperture responds with a fresh 402 challenge at the returned price,
	// prompting the client to purchase a new bundle.
	AuthorizeRequest(ctx context.Context, in *AuthorizeRequestRequest, opts ...grpc.CallOption) (*AuthorizeRequestResponse, error)
	// ReportUsage is invoked once the response for an authorized request has
	// completed (or aborted). The pricer performs the cost analysis on the
	// captured response excerpt (for example the trailing usage object of an
	// SSE stream) and debits the token's balance.
	ReportUsage(ctx context.Context, in *ReportUsageRequest, opts ...grpc.CallOption) (*ReportUsageResponse, error)
	// QuoteSession prices a single request drawn against a prepaid MPP session
	// balance. GetPrice quotes a whole one-shot purchase, which for a metered
	// pricer is a token bundle; this quotes the estimated cost of the one
	// request in hand. That estimate is what a session challenge advertises as
	// its per-unit amount and what aperture deducts from the session balance
	// before proxying.
	QuoteSession(ctx context.Context, in *QuoteSessionRequest, opts ...grpc.CallOption) (*QuoteSessionResponse, error)
	// SettleSession costs a response that was served against a session balance
	// and returns what the request should actually have cost, derived from the
	// captured response excerpt in the same way ReportUsage derives a debit.
	// Aperture already deducted an estimate before proxying, so it reconciles
	// the difference against the session's balance. Unlike ReportUsage, the
	// balance itself lives in aperture rather than in the pricer: the pricer
	// costs, aperture holds and moves the funds.
	SettleSession(ctx context.Context, in *SettleSessionRequest, opts ...grpc.CallOption) (*SettleSessionResponse, error)
}

PricesClient is the client API for Prices 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.

func NewPricesClient

func NewPricesClient(cc grpc.ClientConnInterface) PricesClient

type PricesServer

type PricesServer interface {
	GetPrice(context.Context, *GetPriceRequest) (*GetPriceResponse, error)
	// ChallengeMinted notifies the pricer that aperture minted a fresh L402
	// challenge for a metered service. The token ID identifies the macaroon
	// embedded in the challenge, and the price is the amount quoted by a
	// preceding GetPrice call. The pricer uses this to associate the token,
	// once paid, with the balance it purchased.
	ChallengeMinted(context.Context, *ChallengeMintedRequest) (*ChallengeMintedResponse, error)
	// AuthorizeRequest is invoked for every authenticated request to a metered
	// service. The pricer decides whether the token still has balance left; if
	// not, aperture responds with a fresh 402 challenge at the returned price,
	// prompting the client to purchase a new bundle.
	AuthorizeRequest(context.Context, *AuthorizeRequestRequest) (*AuthorizeRequestResponse, error)
	// ReportUsage is invoked once the response for an authorized request has
	// completed (or aborted). The pricer performs the cost analysis on the
	// captured response excerpt (for example the trailing usage object of an
	// SSE stream) and debits the token's balance.
	ReportUsage(context.Context, *ReportUsageRequest) (*ReportUsageResponse, error)
	// QuoteSession prices a single request drawn against a prepaid MPP session
	// balance. GetPrice quotes a whole one-shot purchase, which for a metered
	// pricer is a token bundle; this quotes the estimated cost of the one
	// request in hand. That estimate is what a session challenge advertises as
	// its per-unit amount and what aperture deducts from the session balance
	// before proxying.
	QuoteSession(context.Context, *QuoteSessionRequest) (*QuoteSessionResponse, error)
	// SettleSession costs a response that was served against a session balance
	// and returns what the request should actually have cost, derived from the
	// captured response excerpt in the same way ReportUsage derives a debit.
	// Aperture already deducted an estimate before proxying, so it reconciles
	// the difference against the session's balance. Unlike ReportUsage, the
	// balance itself lives in aperture rather than in the pricer: the pricer
	// costs, aperture holds and moves the funds.
	SettleSession(context.Context, *SettleSessionRequest) (*SettleSessionResponse, error)
	// contains filtered or unexported methods
}

PricesServer is the server API for Prices service. All implementations must embed UnimplementedPricesServer for forward compatibility

type QuoteSessionRequest added in v0.6.0

type QuoteSessionRequest struct {

	// The URL path of the request.
	Path string `protobuf:"bytes,1,opt,name=path,proto3" json:"path,omitempty"`
	// The full HTTP request serialized as text.
	HttpRequestText string `protobuf:"bytes,2,opt,name=http_request_text,json=httpRequestText,proto3" json:"http_request_text,omitempty"`
	// The name of the aperture service the request is for.
	ServiceName string `protobuf:"bytes,3,opt,name=service_name,json=serviceName,proto3" json:"service_name,omitempty"`
	// The session the request will be served against. Empty when the quote is
	// for a fresh challenge, which is minted before any session exists.
	SessionId string `protobuf:"bytes,4,opt,name=session_id,json=sessionId,proto3" json:"session_id,omitempty"`
	// contains filtered or unexported fields
}

func (*QuoteSessionRequest) Descriptor deprecated added in v0.6.0

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

Deprecated: Use QuoteSessionRequest.ProtoReflect.Descriptor instead.

func (*QuoteSessionRequest) GetHttpRequestText added in v0.6.0

func (x *QuoteSessionRequest) GetHttpRequestText() string

func (*QuoteSessionRequest) GetPath added in v0.6.0

func (x *QuoteSessionRequest) GetPath() string

func (*QuoteSessionRequest) GetServiceName added in v0.6.0

func (x *QuoteSessionRequest) GetServiceName() string

func (*QuoteSessionRequest) GetSessionId added in v0.6.0

func (x *QuoteSessionRequest) GetSessionId() string

func (*QuoteSessionRequest) ProtoMessage added in v0.6.0

func (*QuoteSessionRequest) ProtoMessage()

func (*QuoteSessionRequest) ProtoReflect added in v0.6.0

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

func (*QuoteSessionRequest) Reset added in v0.6.0

func (x *QuoteSessionRequest) Reset()

func (*QuoteSessionRequest) String added in v0.6.0

func (x *QuoteSessionRequest) String() string

type QuoteSessionResponse added in v0.6.0

type QuoteSessionResponse struct {

	// The estimated cost in satoshis of serving one request of this shape.
	// This is the per-unit amount a session challenge advertises and the
	// amount deducted from the session balance before proxying.
	UnitPriceSats int64 `protobuf:"varint,1,opt,name=unit_price_sats,json=unitPriceSats,proto3" json:"unit_price_sats,omitempty"`
	// The deposit in satoshis to ask for when opening a fresh session. Zero
	// leaves the deposit to aperture's configured deposit multiplier.
	DepositSats int64 `protobuf:"varint,2,opt,name=deposit_sats,json=depositSats,proto3" json:"deposit_sats,omitempty"`
	// contains filtered or unexported fields
}

func (*QuoteSessionResponse) Descriptor deprecated added in v0.6.0

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

Deprecated: Use QuoteSessionResponse.ProtoReflect.Descriptor instead.

func (*QuoteSessionResponse) GetDepositSats added in v0.6.0

func (x *QuoteSessionResponse) GetDepositSats() int64

func (*QuoteSessionResponse) GetUnitPriceSats added in v0.6.0

func (x *QuoteSessionResponse) GetUnitPriceSats() int64

func (*QuoteSessionResponse) ProtoMessage added in v0.6.0

func (*QuoteSessionResponse) ProtoMessage()

func (*QuoteSessionResponse) ProtoReflect added in v0.6.0

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

func (*QuoteSessionResponse) Reset added in v0.6.0

func (x *QuoteSessionResponse) Reset()

func (*QuoteSessionResponse) String added in v0.6.0

func (x *QuoteSessionResponse) String() string

type ReportUsageRequest added in v0.6.0

type ReportUsageRequest struct {

	// The hex-encoded L402 token ID the request authenticated with.
	TokenId string `protobuf:"bytes,1,opt,name=token_id,json=tokenId,proto3" json:"token_id,omitempty"`
	// The URL path of the request.
	Path string `protobuf:"bytes,2,opt,name=path,proto3" json:"path,omitempty"`
	// The name of the aperture service the request was for.
	ServiceName string `protobuf:"bytes,3,opt,name=service_name,json=serviceName,proto3" json:"service_name,omitempty"`
	// The HTTP status code the backend responded with.
	HttpStatus int32 `protobuf:"varint,4,opt,name=http_status,json=httpStatus,proto3" json:"http_status,omitempty"`
	// The Content-Type of the backend response.
	ContentType string `protobuf:"bytes,5,opt,name=content_type,json=contentType,proto3" json:"content_type,omitempty"`
	// Whether the response body was read to completion. False indicates the
	// stream was truncated, for example by a client disconnect.
	Complete bool `protobuf:"varint,6,opt,name=complete,proto3" json:"complete,omitempty"`
	// A capped tail of the response body. For SSE streams this contains the
	// trailing chunks, including any final usage object.
	ResponseTail []byte `protobuf:"bytes,7,opt,name=response_tail,json=responseTail,proto3" json:"response_tail,omitempty"`
	// The Content-Encoding the backend responded with. Metered requests strip
	// the client's Accept-Encoding so the observed tail is always plaintext;
	// a non-identity encoding here signals that the observer captured
	// compressed bytes it could not parse, which is treated as an error
	// condition worth alerting on.
	ContentEncoding string `protobuf:"bytes,8,opt,name=content_encoding,json=contentEncoding,proto3" json:"content_encoding,omitempty"`
	// The reserved_estimate value the AuthorizeRequest response for this
	// request carried, echoed back verbatim. Lets the price server release
	// the exact reservation it took at authorization time. Zero when the
	// authorization predates this field.
	ReservedEstimate int64 `protobuf:"varint,9,opt,name=reserved_estimate,json=reservedEstimate,proto3" json:"reserved_estimate,omitempty"`
	// The settle_estimate value the AuthorizeRequest response for this
	// request carried, echoed back verbatim. It is what a successful response
	// without a usage object is debited. Zero when the authorization predates
	// this field, in which case the price server settles at the reservation.
	SettleEstimate int64 `protobuf:"varint,10,opt,name=settle_estimate,json=settleEstimate,proto3" json:"settle_estimate,omitempty"`
	// contains filtered or unexported fields
}

func (*ReportUsageRequest) Descriptor deprecated added in v0.6.0

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

Deprecated: Use ReportUsageRequest.ProtoReflect.Descriptor instead.

func (*ReportUsageRequest) GetComplete added in v0.6.0

func (x *ReportUsageRequest) GetComplete() bool

func (*ReportUsageRequest) GetContentEncoding added in v0.6.0

func (x *ReportUsageRequest) GetContentEncoding() string

func (*ReportUsageRequest) GetContentType added in v0.6.0

func (x *ReportUsageRequest) GetContentType() string

func (*ReportUsageRequest) GetHttpStatus added in v0.6.0

func (x *ReportUsageRequest) GetHttpStatus() int32

func (*ReportUsageRequest) GetPath added in v0.6.0

func (x *ReportUsageRequest) GetPath() string

func (*ReportUsageRequest) GetReservedEstimate added in v0.6.0

func (x *ReportUsageRequest) GetReservedEstimate() int64

func (*ReportUsageRequest) GetResponseTail added in v0.6.0

func (x *ReportUsageRequest) GetResponseTail() []byte

func (*ReportUsageRequest) GetServiceName added in v0.6.0

func (x *ReportUsageRequest) GetServiceName() string

func (*ReportUsageRequest) GetSettleEstimate added in v0.6.1

func (x *ReportUsageRequest) GetSettleEstimate() int64

func (*ReportUsageRequest) GetTokenId added in v0.6.0

func (x *ReportUsageRequest) GetTokenId() string

func (*ReportUsageRequest) ProtoMessage added in v0.6.0

func (*ReportUsageRequest) ProtoMessage()

func (*ReportUsageRequest) ProtoReflect added in v0.6.0

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

func (*ReportUsageRequest) Reset added in v0.6.0

func (x *ReportUsageRequest) Reset()

func (*ReportUsageRequest) String added in v0.6.0

func (x *ReportUsageRequest) String() string

type ReportUsageResponse added in v0.6.0

type ReportUsageResponse struct {

	// The amount in satoshis debited from the token's balance as a result
	// of this usage report. Informational.
	DebitedSats int64 `protobuf:"varint,1,opt,name=debited_sats,json=debitedSats,proto3" json:"debited_sats,omitempty"`
	// The remaining balance of the token in satoshis. Informational.
	RemainingSats int64 `protobuf:"varint,2,opt,name=remaining_sats,json=remainingSats,proto3" json:"remaining_sats,omitempty"`
	// contains filtered or unexported fields
}

func (*ReportUsageResponse) Descriptor deprecated added in v0.6.0

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

Deprecated: Use ReportUsageResponse.ProtoReflect.Descriptor instead.

func (*ReportUsageResponse) GetDebitedSats added in v0.6.0

func (x *ReportUsageResponse) GetDebitedSats() int64

func (*ReportUsageResponse) GetRemainingSats added in v0.6.0

func (x *ReportUsageResponse) GetRemainingSats() int64

func (*ReportUsageResponse) ProtoMessage added in v0.6.0

func (*ReportUsageResponse) ProtoMessage()

func (*ReportUsageResponse) ProtoReflect added in v0.6.0

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

func (*ReportUsageResponse) Reset added in v0.6.0

func (x *ReportUsageResponse) Reset()

func (*ReportUsageResponse) String added in v0.6.0

func (x *ReportUsageResponse) String() string

type SettleSessionRequest added in v0.6.0

type SettleSessionRequest struct {

	// The session the request was served against.
	SessionId string `protobuf:"bytes,1,opt,name=session_id,json=sessionId,proto3" json:"session_id,omitempty"`
	// The URL path of the request.
	Path string `protobuf:"bytes,2,opt,name=path,proto3" json:"path,omitempty"`
	// The name of the aperture service the request was for.
	ServiceName string `protobuf:"bytes,3,opt,name=service_name,json=serviceName,proto3" json:"service_name,omitempty"`
	// The HTTP status code the backend responded with.
	HttpStatus int32 `protobuf:"varint,4,opt,name=http_status,json=httpStatus,proto3" json:"http_status,omitempty"`
	// The Content-Type of the backend response.
	ContentType string `protobuf:"bytes,5,opt,name=content_type,json=contentType,proto3" json:"content_type,omitempty"`
	// The Content-Encoding the backend responded with. A non-identity value
	// means the captured tail is compressed and could not be costed.
	ContentEncoding string `protobuf:"bytes,6,opt,name=content_encoding,json=contentEncoding,proto3" json:"content_encoding,omitempty"`
	// Whether the response body was read to completion.
	Complete bool `protobuf:"varint,7,opt,name=complete,proto3" json:"complete,omitempty"`
	// A capped tail of the response body. For SSE streams this contains the
	// trailing chunks, including any final usage object.
	ResponseTail []byte `protobuf:"bytes,8,opt,name=response_tail,json=responseTail,proto3" json:"response_tail,omitempty"`
	// The estimate in satoshis aperture already deducted from the session
	// balance before proxying this request.
	EstimateSats int64 `protobuf:"varint,9,opt,name=estimate_sats,json=estimateSats,proto3" json:"estimate_sats,omitempty"`
	// The full HTTP request serialized as text. A session books no model the
	// way an L402 token bundle does, so the request is echoed back here for
	// the pricer to resolve the model it must be costed at.
	HttpRequestText string `protobuf:"bytes,10,opt,name=http_request_text,json=httpRequestText,proto3" json:"http_request_text,omitempty"`
	// contains filtered or unexported fields
}

func (*SettleSessionRequest) Descriptor deprecated added in v0.6.0

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

Deprecated: Use SettleSessionRequest.ProtoReflect.Descriptor instead.

func (*SettleSessionRequest) GetComplete added in v0.6.0

func (x *SettleSessionRequest) GetComplete() bool

func (*SettleSessionRequest) GetContentEncoding added in v0.6.0

func (x *SettleSessionRequest) GetContentEncoding() string

func (*SettleSessionRequest) GetContentType added in v0.6.0

func (x *SettleSessionRequest) GetContentType() string

func (*SettleSessionRequest) GetEstimateSats added in v0.6.0

func (x *SettleSessionRequest) GetEstimateSats() int64

func (*SettleSessionRequest) GetHttpRequestText added in v0.6.0

func (x *SettleSessionRequest) GetHttpRequestText() string

func (*SettleSessionRequest) GetHttpStatus added in v0.6.0

func (x *SettleSessionRequest) GetHttpStatus() int32

func (*SettleSessionRequest) GetPath added in v0.6.0

func (x *SettleSessionRequest) GetPath() string

func (*SettleSessionRequest) GetResponseTail added in v0.6.0

func (x *SettleSessionRequest) GetResponseTail() []byte

func (*SettleSessionRequest) GetServiceName added in v0.6.0

func (x *SettleSessionRequest) GetServiceName() string

func (*SettleSessionRequest) GetSessionId added in v0.6.0

func (x *SettleSessionRequest) GetSessionId() string

func (*SettleSessionRequest) ProtoMessage added in v0.6.0

func (*SettleSessionRequest) ProtoMessage()

func (*SettleSessionRequest) ProtoReflect added in v0.6.0

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

func (*SettleSessionRequest) Reset added in v0.6.0

func (x *SettleSessionRequest) Reset()

func (*SettleSessionRequest) String added in v0.6.0

func (x *SettleSessionRequest) String() string

type SettleSessionResponse added in v0.6.0

type SettleSessionResponse struct {

	// What the request actually cost, in satoshis. Aperture reconciles this
	// against the estimate it already deducted, charging the shortfall or
	// giving back the excess.
	CostSats int64 `protobuf:"varint,1,opt,name=cost_sats,json=costSats,proto3" json:"cost_sats,omitempty"`
	// contains filtered or unexported fields
}

func (*SettleSessionResponse) Descriptor deprecated added in v0.6.0

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

Deprecated: Use SettleSessionResponse.ProtoReflect.Descriptor instead.

func (*SettleSessionResponse) GetCostSats added in v0.6.0

func (x *SettleSessionResponse) GetCostSats() int64

func (*SettleSessionResponse) ProtoMessage added in v0.6.0

func (*SettleSessionResponse) ProtoMessage()

func (*SettleSessionResponse) ProtoReflect added in v0.6.0

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

func (*SettleSessionResponse) Reset added in v0.6.0

func (x *SettleSessionResponse) Reset()

func (*SettleSessionResponse) String added in v0.6.0

func (x *SettleSessionResponse) String() string

type UnimplementedPricesServer

type UnimplementedPricesServer struct {
}

UnimplementedPricesServer must be embedded to have forward compatible implementations.

func (UnimplementedPricesServer) AuthorizeRequest added in v0.6.0

func (UnimplementedPricesServer) ChallengeMinted added in v0.6.0

func (UnimplementedPricesServer) GetPrice

func (UnimplementedPricesServer) QuoteSession added in v0.6.0

func (UnimplementedPricesServer) ReportUsage added in v0.6.0

func (UnimplementedPricesServer) SettleSession added in v0.6.0

type UnsafePricesServer

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

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

Jump to

Keyboard shortcuts

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