Documentation ¶
Overview ¶
Package v1 is a reverse proxy.
It translates gRPC into RESTful JSON APIs.
Package v1 contains the API used to fetch currency information.
Index ¶
- Constants
- Variables
- func ForEachCurrency(ctx context.Context, ...) error
- func RegisterCurrencyServiceHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error
- func RegisterCurrencyServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client CurrencyServiceClient) error
- func RegisterCurrencyServiceHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, ...) (err error)
- func RegisterCurrencyServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server CurrencyServiceServer) error
- func RegisterCurrencyServiceServer(s *grpc.Server, srv CurrencyServiceServer)
- type Currency
- func (*Currency) Descriptor() ([]byte, []int)deprecated
- func (x *Currency) GetId() string
- func (x *Currency) GetIso4217Code() string
- func (x *Currency) GetName() string
- func (x *Currency) GetSign() string
- func (*Currency) ProtoMessage()
- func (x *Currency) ProtoReflect() protoreflect.Message
- func (x *Currency) Reset()
- func (x *Currency) String() string
- type CurrencyCallback
- type CurrencyList
- type CurrencyServiceClient
- type CurrencyServiceServer
- type GetDefaultCurrencyRequest
- func (*GetDefaultCurrencyRequest) Descriptor() ([]byte, []int)deprecated
- func (x *GetDefaultCurrencyRequest) GetOrganizationId() string
- func (*GetDefaultCurrencyRequest) ProtoMessage()
- func (x *GetDefaultCurrencyRequest) ProtoReflect() protoreflect.Message
- func (x *GetDefaultCurrencyRequest) Reset()
- func (x *GetDefaultCurrencyRequest) String() string
- type UnimplementedCurrencyServiceServer
- func (*UnimplementedCurrencyServiceServer) GetAPIVersion(context.Context, *v1.Empty) (*v1.Version, error)
- func (*UnimplementedCurrencyServiceServer) GetCurrency(context.Context, *v1.IDOptions) (*Currency, error)
- func (*UnimplementedCurrencyServiceServer) GetDefaultCurrency(context.Context, *GetDefaultCurrencyRequest) (*Currency, error)
- func (*UnimplementedCurrencyServiceServer) ListCurrencies(context.Context, *v1.ListOptions) (*CurrencyList, error)
Constants ¶
const ( // APIID contains identifier of this API APIID = "currency/v1" // APIMajorVersion contains major version of this API APIMajorVersion = 1 // APIMinorVersion contains minor version of this API APIMinorVersion = 1 // APIPatchVersion contains patch version of this API APIPatchVersion = 0 )
Variables ¶
var File_currency_proto protoreflect.FileDescriptor
Functions ¶
func ForEachCurrency ¶
func ForEachCurrency(ctx context.Context, listFunc func(ctx context.Context, req *common.ListOptions) (*CurrencyList, error), opts *common.ListOptions, cb CurrencyCallback) error
ForEachCurrency iterates over all currencies, invoking the given callback for each IP currencies.
func RegisterCurrencyServiceHandler ¶
func RegisterCurrencyServiceHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error
RegisterCurrencyServiceHandler registers the http handlers for service CurrencyService to "mux". The handlers forward requests to the grpc endpoint over "conn".
func RegisterCurrencyServiceHandlerClient ¶
func RegisterCurrencyServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client CurrencyServiceClient) error
RegisterCurrencyServiceHandlerClient registers the http handlers for service CurrencyService to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "CurrencyServiceClient". Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "CurrencyServiceClient" doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in "CurrencyServiceClient" to call the correct interceptors.
func RegisterCurrencyServiceHandlerFromEndpoint ¶
func RegisterCurrencyServiceHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error)
RegisterCurrencyServiceHandlerFromEndpoint is same as RegisterCurrencyServiceHandler but automatically dials to "endpoint" and closes the connection when "ctx" gets done.
func RegisterCurrencyServiceHandlerServer ¶
func RegisterCurrencyServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server CurrencyServiceServer) error
RegisterCurrencyServiceHandlerServer registers the http handlers for service CurrencyService to "mux". UnaryRPC :call CurrencyServiceServer 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 RegisterCurrencyServiceHandlerFromEndpoint instead.
func RegisterCurrencyServiceServer ¶
func RegisterCurrencyServiceServer(s *grpc.Server, srv CurrencyServiceServer)
Types ¶
type Currency ¶
type Currency struct { // System identifier of the currency. // E.g. "eur" or "usd" Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` // Human readable name of the currency // E.g. "US Dollar" Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` // Human readable sign for the currency. // E.g. "$" Sign string `protobuf:"bytes,3,opt,name=sign,proto3" json:"sign,omitempty"` // ISO 4217 currency code. // E.g. "USD" Iso4217Code string `protobuf:"bytes,4,opt,name=iso4217_code,json=iso4217Code,proto3" json:"iso4217_code,omitempty"` // contains filtered or unexported fields }
Currency represents a specific monetary currency.
func (*Currency) Descriptor
deprecated
func (*Currency) GetIso4217Code ¶
func (*Currency) ProtoMessage ¶
func (*Currency) ProtoMessage()
func (*Currency) ProtoReflect ¶ added in v0.89.0
func (x *Currency) ProtoReflect() protoreflect.Message
type CurrencyCallback ¶
CurrencyCallback is a callback for individual currencies.
type CurrencyList ¶
type CurrencyList struct { Items []*Currency `protobuf:"bytes,1,rep,name=items,proto3" json:"items,omitempty"` // contains filtered or unexported fields }
List of currencies.
func (*CurrencyList) Descriptor
deprecated
func (*CurrencyList) Descriptor() ([]byte, []int)
Deprecated: Use CurrencyList.ProtoReflect.Descriptor instead.
func (*CurrencyList) GetItems ¶
func (x *CurrencyList) GetItems() []*Currency
func (*CurrencyList) ProtoMessage ¶
func (*CurrencyList) ProtoMessage()
func (*CurrencyList) ProtoReflect ¶ added in v0.89.0
func (x *CurrencyList) ProtoReflect() protoreflect.Message
func (*CurrencyList) Reset ¶
func (x *CurrencyList) Reset()
func (*CurrencyList) String ¶
func (x *CurrencyList) String() string
type CurrencyServiceClient ¶
type CurrencyServiceClient interface { // Get the current API version of this service. // Required permissions: // - None GetAPIVersion(ctx context.Context, in *v1.Empty, opts ...grpc.CallOption) (*v1.Version, error) // Fetch all providers that are supported by the ArangoDB cloud. // Required permissions: // - None ListCurrencies(ctx context.Context, in *v1.ListOptions, opts ...grpc.CallOption) (*CurrencyList, error) // Fetch a currency by its id. // Required permissions: // - None GetCurrency(ctx context.Context, in *v1.IDOptions, opts ...grpc.CallOption) (*Currency, error) // Fetch the default currency for a given (optional) organization. // Required permissions: // - resourcemanager.organization.get On the organization identified by given id. // - None In case no organization identifier was given. GetDefaultCurrency(ctx context.Context, in *GetDefaultCurrencyRequest, opts ...grpc.CallOption) (*Currency, error) }
CurrencyServiceClient is the client API for CurrencyService service.
For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.
func NewCurrencyServiceClient ¶
func NewCurrencyServiceClient(cc grpc.ClientConnInterface) CurrencyServiceClient
type CurrencyServiceServer ¶
type CurrencyServiceServer interface { // Get the current API version of this service. // Required permissions: // - None GetAPIVersion(context.Context, *v1.Empty) (*v1.Version, error) // Fetch all providers that are supported by the ArangoDB cloud. // Required permissions: // - None ListCurrencies(context.Context, *v1.ListOptions) (*CurrencyList, error) // Fetch a currency by its id. // Required permissions: // - None GetCurrency(context.Context, *v1.IDOptions) (*Currency, error) // Fetch the default currency for a given (optional) organization. // Required permissions: // - resourcemanager.organization.get On the organization identified by given id. // - None In case no organization identifier was given. GetDefaultCurrency(context.Context, *GetDefaultCurrencyRequest) (*Currency, error) }
CurrencyServiceServer is the server API for CurrencyService service.
type GetDefaultCurrencyRequest ¶
type GetDefaultCurrencyRequest struct { // Optional identifier for the organization to request the default // currency for. OrganizationId string `protobuf:"bytes,1,opt,name=organization_id,json=organizationId,proto3" json:"organization_id,omitempty"` // contains filtered or unexported fields }
Request arguments for GetDefaultCurrency.
func (*GetDefaultCurrencyRequest) Descriptor
deprecated
func (*GetDefaultCurrencyRequest) Descriptor() ([]byte, []int)
Deprecated: Use GetDefaultCurrencyRequest.ProtoReflect.Descriptor instead.
func (*GetDefaultCurrencyRequest) GetOrganizationId ¶
func (x *GetDefaultCurrencyRequest) GetOrganizationId() string
func (*GetDefaultCurrencyRequest) ProtoMessage ¶
func (*GetDefaultCurrencyRequest) ProtoMessage()
func (*GetDefaultCurrencyRequest) ProtoReflect ¶ added in v0.89.0
func (x *GetDefaultCurrencyRequest) ProtoReflect() protoreflect.Message
func (*GetDefaultCurrencyRequest) Reset ¶
func (x *GetDefaultCurrencyRequest) Reset()
func (*GetDefaultCurrencyRequest) String ¶
func (x *GetDefaultCurrencyRequest) String() string
type UnimplementedCurrencyServiceServer ¶
type UnimplementedCurrencyServiceServer struct { }
UnimplementedCurrencyServiceServer can be embedded to have forward compatible implementations.
func (*UnimplementedCurrencyServiceServer) GetAPIVersion ¶
func (*UnimplementedCurrencyServiceServer) GetCurrency ¶
func (*UnimplementedCurrencyServiceServer) GetDefaultCurrency ¶
func (*UnimplementedCurrencyServiceServer) GetDefaultCurrency(context.Context, *GetDefaultCurrencyRequest) (*Currency, error)
func (*UnimplementedCurrencyServiceServer) ListCurrencies ¶
func (*UnimplementedCurrencyServiceServer) ListCurrencies(context.Context, *v1.ListOptions) (*CurrencyList, error)