Documentation
¶
Overview ¶
Package analytics is a reverse proxy.
It translates gRPC into RESTful JSON APIs.
Index ¶
- Constants
- Variables
- func RegisterAnalyticsHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error
- func RegisterAnalyticsHandlerClient(ctx context.Context, mux *runtime.ServeMux, client AnalyticsClient) error
- func RegisterAnalyticsHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, ...) (err error)
- func RegisterAnalyticsHandlerServer(ctx context.Context, mux *runtime.ServeMux, server AnalyticsServer) error
- func RegisterAnalyticsServer(s grpc.ServiceRegistrar, srv AnalyticsServer)
- type AnalyticsClient
- type AnalyticsServer
- type UnimplementedAnalyticsServer
- type UnsafeAnalyticsServer
Constants ¶
const (
Analytics_GetAnalytics_FullMethodName = "/analytics.Analytics/getAnalytics"
)
Variables ¶
var Analytics_ServiceDesc = grpc.ServiceDesc{ ServiceName: "analytics.Analytics", HandlerType: (*AnalyticsServer)(nil), Methods: []grpc.MethodDesc{ { MethodName: "getAnalytics", Handler: _Analytics_GetAnalytics_Handler, }, }, Streams: []grpc.StreamDesc{}, Metadata: "io/analytics/a_rpc.proto", }
Analytics_ServiceDesc is the grpc.ServiceDesc for Analytics service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)
var File_io_analytics_a_rpc_proto protoreflect.FileDescriptor
Functions ¶
func RegisterAnalyticsHandler ¶
func RegisterAnalyticsHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error
RegisterAnalyticsHandler registers the http handlers for service Analytics to "mux". The handlers forward requests to the grpc endpoint over "conn".
func RegisterAnalyticsHandlerClient ¶
func RegisterAnalyticsHandlerClient(ctx context.Context, mux *runtime.ServeMux, client AnalyticsClient) error
RegisterAnalyticsHandlerClient registers the http handlers for service Analytics to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "AnalyticsClient". Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "AnalyticsClient" doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in "AnalyticsClient" to call the correct interceptors. This client ignores the HTTP middlewares.
func RegisterAnalyticsHandlerFromEndpoint ¶
func RegisterAnalyticsHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error)
RegisterAnalyticsHandlerFromEndpoint is same as RegisterAnalyticsHandler but automatically dials to "endpoint" and closes the connection when "ctx" gets done.
func RegisterAnalyticsHandlerServer ¶
func RegisterAnalyticsHandlerServer(ctx context.Context, mux *runtime.ServeMux, server AnalyticsServer) error
RegisterAnalyticsHandlerServer registers the http handlers for service Analytics to "mux". UnaryRPC :call AnalyticsServer 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 RegisterAnalyticsHandlerFromEndpoint 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 RegisterAnalyticsServer ¶
func RegisterAnalyticsServer(s grpc.ServiceRegistrar, srv AnalyticsServer)
Types ¶
type AnalyticsClient ¶
type AnalyticsClient interface { // Retrieves analytics data for a class or project, such as daily check-ins, installs, redemptions, etc. Required fields: classId, protocol. GetAnalytics(ctx context.Context, in *io.AnalyticsRequest, opts ...grpc.CallOption) (*io.AnalyticsResponse, error) }
AnalyticsClient is the client API for Analytics 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.
Analytics provides access to daily, monthly, or yearly analytics reports.
func NewAnalyticsClient ¶
func NewAnalyticsClient(cc grpc.ClientConnInterface) AnalyticsClient
type AnalyticsServer ¶
type AnalyticsServer interface { // Retrieves analytics data for a class or project, such as daily check-ins, installs, redemptions, etc. Required fields: classId, protocol. GetAnalytics(context.Context, *io.AnalyticsRequest) (*io.AnalyticsResponse, error) }
AnalyticsServer is the server API for Analytics service. All implementations should embed UnimplementedAnalyticsServer for forward compatibility.
Analytics provides access to daily, monthly, or yearly analytics reports.
type UnimplementedAnalyticsServer ¶
type UnimplementedAnalyticsServer struct{}
UnimplementedAnalyticsServer should be embedded to have forward compatible implementations.
NOTE: this should be embedded by value instead of pointer to avoid a nil pointer dereference when methods are called.
func (UnimplementedAnalyticsServer) GetAnalytics ¶
func (UnimplementedAnalyticsServer) GetAnalytics(context.Context, *io.AnalyticsRequest) (*io.AnalyticsResponse, error)
type UnsafeAnalyticsServer ¶
type UnsafeAnalyticsServer interface {
// contains filtered or unexported methods
}
UnsafeAnalyticsServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to AnalyticsServer will result in compilation errors.