v1

package
v1.3.41 Latest Latest
Warning

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

Go to latest
Published: Apr 28, 2023 License: Unlicense Imports: 18 Imported by: 0

Documentation

Overview

Package v1 is a reverse proxy.

It translates gRPC into RESTful JSON APIs.

Index

Constants

View Source
const (
	FilterService_GetName_FullMethodName      = "/protos.edge.filtering.v1.FilterService/GetName"
	FilterService_ShouldFilter_FullMethodName = "/protos.edge.filtering.v1.FilterService/ShouldFilter"
)

Variables

View Source
var File_protos_edge_filtering_v1_service_proto protoreflect.FileDescriptor
View Source
var FilterService_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "protos.edge.filtering.v1.FilterService",
	HandlerType: (*FilterServiceServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "GetName",
			Handler:    _FilterService_GetName_Handler,
		},
		{
			MethodName: "ShouldFilter",
			Handler:    _FilterService_ShouldFilter_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "protos/edge/filtering/v1/service.proto",
}

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

Functions

func RegisterFilterServiceHandler

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

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

func RegisterFilterServiceHandlerClient

func RegisterFilterServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client FilterServiceClient) error

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

func RegisterFilterServiceHandlerFromEndpoint

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

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

func RegisterFilterServiceHandlerServer

func RegisterFilterServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server FilterServiceServer) error

RegisterFilterServiceHandlerServer registers the http handlers for service FilterService to "mux". UnaryRPC :call FilterServiceServer 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 RegisterFilterServiceHandlerFromEndpoint instead.

func RegisterFilterServiceServer

func RegisterFilterServiceServer(s grpc.ServiceRegistrar, srv FilterServiceServer)

Types

type FilterResult

type FilterResult struct {
	Stop bool `protobuf:"varint,1,opt,name=stop,proto3" json:"stop,omitempty"` // Whether or not the functionality should be stopped (true) or
	// whether it may continue to run (false)
	Until *gopb.UnixDuration `protobuf:"bytes,2,opt,name=until,proto3" json:"until,omitempty"` // A duration expressing how long the filter should wait until it
	// may be checked again. This is only considered in situations where
	// stop is true.
	Allowed data.AllowedTrades `protobuf:"varint,3,opt,name=allowed,proto3,enum=protos.edge.data.AllowedTrades" json:"allowed,omitempty"` // Which trades should be allowed by the filter
	// contains filtered or unexported fields
}

FilterResult describes whether or not the operation associated with the strategy context should be

paused or whether it may continue to run.

func (*FilterResult) Descriptor deprecated

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

Deprecated: Use FilterResult.ProtoReflect.Descriptor instead.

func (*FilterResult) GetAllowed added in v1.3.0

func (x *FilterResult) GetAllowed() data.AllowedTrades

func (*FilterResult) GetStop

func (x *FilterResult) GetStop() bool

func (*FilterResult) GetUntil

func (x *FilterResult) GetUntil() *gopb.UnixDuration

func (*FilterResult) ProtoMessage

func (*FilterResult) ProtoMessage()

func (*FilterResult) ProtoReflect

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

func (*FilterResult) Reset

func (x *FilterResult) Reset()

func (*FilterResult) String

func (x *FilterResult) String() string

type FilterServiceClient

type FilterServiceClient interface {
	// GetName retrieves an identifier associated with the service, allowing the strategy runner to
	// uniquely identify it when multiple filter services are being referenced. It will return a
	// name result showing the address, ID and human-readable name of the filter service that processed
	// the original request.
	GetName(ctx context.Context, in *empty.Empty, opts ...grpc.CallOption) (*data.NameResult, error)
	// ShouldFilter determines whether or not a given entry rule should run based on the strategy context
	// that was submitted to the service. The result determines whether or not a function should be
	// paused and for how long.
	ShouldFilter(ctx context.Context, in *data.StrategyContext, opts ...grpc.CallOption) (*FilterResult, error)
}

FilterServiceClient is the client API for FilterService 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.

type FilterServiceServer

type FilterServiceServer interface {
	// GetName retrieves an identifier associated with the service, allowing the strategy runner to
	// uniquely identify it when multiple filter services are being referenced. It will return a
	// name result showing the address, ID and human-readable name of the filter service that processed
	// the original request.
	GetName(context.Context, *empty.Empty) (*data.NameResult, error)
	// ShouldFilter determines whether or not a given entry rule should run based on the strategy context
	// that was submitted to the service. The result determines whether or not a function should be
	// paused and for how long.
	ShouldFilter(context.Context, *data.StrategyContext) (*FilterResult, error)
	// contains filtered or unexported methods
}

FilterServiceServer is the server API for FilterService service. All implementations must embed UnimplementedFilterServiceServer for forward compatibility

type UnimplementedFilterServiceServer

type UnimplementedFilterServiceServer struct {
}

UnimplementedFilterServiceServer must be embedded to have forward compatible implementations.

func (UnimplementedFilterServiceServer) GetName

func (UnimplementedFilterServiceServer) ShouldFilter

type UnsafeFilterServiceServer

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

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

Jump to

Keyboard shortcuts

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