v1

package
v0.0.47 Latest Latest
Warning

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

Go to latest
Published: Oct 10, 2023 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Overview

Package v1 is a reverse proxy.

It translates gRPC into RESTful JSON APIs.

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInvalidLength        = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflow          = fmt.Errorf("proto: integer overflow")
	ErrUnexpectedEndOfGroup = fmt.Errorf("proto: unexpected end of group")
)
View Source
var Events_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "v1.Events",
	HandlerType: (*EventsServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "SendEvent",
			Handler:    _Events_SendEvent_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "vince/events/v1/events.proto",
}

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

View Source
var File_vince_events_v1_events_proto protoreflect.FileDescriptor

Functions

func RegisterEventsHandler

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

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

func RegisterEventsHandlerClient

func RegisterEventsHandlerClient(ctx context.Context, mux *runtime.ServeMux, client EventsClient) error

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

func RegisterEventsHandlerFromEndpoint

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

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

func RegisterEventsHandlerServer

func RegisterEventsHandlerServer(ctx context.Context, mux *runtime.ServeMux, server EventsServer) error

RegisterEventsHandlerServer registers the http handlers for service Events to "mux". UnaryRPC :call EventsServer 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 RegisterEventsHandlerFromEndpoint instead.

func RegisterEventsServer

func RegisterEventsServer(s grpc.ServiceRegistrar, srv EventsServer)

Types

type Event

type Event struct {

	// / EventName
	N   string `protobuf:"bytes,1,opt,name=n,proto3" json:"n,omitempty"`
	Url string `protobuf:"bytes,2,opt,name=url,proto3" json:"url,omitempty"`
	// Domain
	D string `protobuf:"bytes,3,opt,name=d,proto3" json:"d,omitempty"`
	// Screen width
	W int32 `protobuf:"varint,4,opt,name=w,proto3" json:"w,omitempty"`
	// Hash mode
	H  bool   `protobuf:"varint,5,opt,name=h,proto3" json:"h,omitempty"`
	Ip string `protobuf:"bytes,6,opt,name=ip,proto3" json:"ip,omitempty"`
	// user agent
	Ua string `protobuf:"bytes,7,opt,name=ua,proto3" json:"ua,omitempty"`
	// Referrer
	R string `protobuf:"bytes,8,opt,name=r,proto3" json:"r,omitempty"`
	// contains filtered or unexported fields
}

func (*Event) Descriptor deprecated

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

Deprecated: Use Event.ProtoReflect.Descriptor instead.

func (*Event) GetD

func (x *Event) GetD() string

func (*Event) GetH

func (x *Event) GetH() bool

func (*Event) GetIp

func (x *Event) GetIp() string

func (*Event) GetN

func (x *Event) GetN() string

func (*Event) GetR

func (x *Event) GetR() string

func (*Event) GetUa

func (x *Event) GetUa() string

func (*Event) GetUrl

func (x *Event) GetUrl() string

func (*Event) GetW

func (x *Event) GetW() int32

func (*Event) MarshalToSizedBufferVT

func (m *Event) MarshalToSizedBufferVT(dAtA []byte) (int, error)

func (*Event) MarshalToVT

func (m *Event) MarshalToVT(dAtA []byte) (int, error)

func (*Event) MarshalVT

func (m *Event) MarshalVT() (dAtA []byte, err error)

func (*Event) ProtoMessage

func (*Event) ProtoMessage()

func (*Event) ProtoReflect

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

func (*Event) Reset

func (x *Event) Reset()

func (*Event) SizeVT

func (m *Event) SizeVT() (n int)

func (*Event) String

func (x *Event) String() string

func (*Event) UnmarshalVT

func (m *Event) UnmarshalVT(dAtA []byte) error

type EventsClient

type EventsClient interface {
	SendEvent(ctx context.Context, in *Event, opts ...grpc.CallOption) (*emptypb.Empty, error)
}

EventsClient is the client API for Events 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 NewEventsClient

func NewEventsClient(cc grpc.ClientConnInterface) EventsClient

type EventsServer

type EventsServer interface {
	SendEvent(context.Context, *Event) (*emptypb.Empty, error)
	// contains filtered or unexported methods
}

EventsServer is the server API for Events service. All implementations must embed UnimplementedEventsServer for forward compatibility

type UnimplementedEventsServer

type UnimplementedEventsServer struct {
}

UnimplementedEventsServer must be embedded to have forward compatible implementations.

func (UnimplementedEventsServer) SendEvent

type UnsafeEventsServer

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

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

Jump to

Keyboard shortcuts

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