preferences

package
v0.69.83 Latest Latest
Warning

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

Go to latest
Published: Apr 15, 2024 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Overview

Package preferences is a reverse proxy.

It translates gRPC into RESTful JSON APIs.

Index

Constants

View Source
const (
	Preferences_GetPreferences_FullMethodName = "/blueapi.preferences.v1.Preferences/GetPreferences"
)

Variables

View Source
var File_preferences_v1_preferences_proto protoreflect.FileDescriptor
View Source
var Preferences_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "blueapi.preferences.v1.Preferences",
	HandlerType: (*PreferencesServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "GetPreferences",
			Handler:    _Preferences_GetPreferences_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "preferences/v1/preferences.proto",
}

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

Functions

func RegisterPreferencesHandler

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

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

func RegisterPreferencesHandlerClient

func RegisterPreferencesHandlerClient(ctx context.Context, mux *runtime.ServeMux, client PreferencesClient) error

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

func RegisterPreferencesHandlerFromEndpoint

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

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

func RegisterPreferencesHandlerServer

func RegisterPreferencesHandlerServer(ctx context.Context, mux *runtime.ServeMux, server PreferencesServer) error

RegisterPreferencesHandlerServer registers the http handlers for service Preferences to "mux". UnaryRPC :call PreferencesServer 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 RegisterPreferencesHandlerFromEndpoint instead.

func RegisterPreferencesServer

func RegisterPreferencesServer(s grpc.ServiceRegistrar, srv PreferencesServer)

Types

type ClientOptions

type ClientOptions struct {
	Conn *conn.GrpcClientConn
}

ClientOptions represents the optional options to NewClient.

type GetPreferencesRequest

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

Request message for the Preferences.GetPreferences rpc.

func (*GetPreferencesRequest) Descriptor deprecated

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

Deprecated: Use GetPreferencesRequest.ProtoReflect.Descriptor instead.

func (*GetPreferencesRequest) ProtoMessage

func (*GetPreferencesRequest) ProtoMessage()

func (*GetPreferencesRequest) ProtoReflect

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

func (*GetPreferencesRequest) Reset

func (x *GetPreferencesRequest) Reset()

func (*GetPreferencesRequest) String

func (x *GetPreferencesRequest) String() string

type GrpcClient

type GrpcClient struct {
	PreferencesClient
	// contains filtered or unexported fields
}

func NewClient

func NewClient(ctx context.Context, opts ...*ClientOptions) (*GrpcClient, error)

NewClient returns a client connection to the 'preferences' service.

func (*GrpcClient) Close

func (c *GrpcClient) Close()

type Preference

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

func (*Preference) Descriptor deprecated

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

Deprecated: Use Preference.ProtoReflect.Descriptor instead.

func (*Preference) ProtoMessage

func (*Preference) ProtoMessage()

func (*Preference) ProtoReflect

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

func (*Preference) Reset

func (x *Preference) Reset()

func (*Preference) String

func (x *Preference) String() string

type PreferencesClient

type PreferencesClient interface {
	// WORK-IN-PROGRESS: Gets current preferences.
	GetPreferences(ctx context.Context, in *GetPreferencesRequest, opts ...grpc.CallOption) (*Preference, error)
}

PreferencesClient is the client API for Preferences 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 PreferencesServer

type PreferencesServer interface {
	// WORK-IN-PROGRESS: Gets current preferences.
	GetPreferences(context.Context, *GetPreferencesRequest) (*Preference, error)
	// contains filtered or unexported methods
}

PreferencesServer is the server API for Preferences service. All implementations must embed UnimplementedPreferencesServer for forward compatibility

type UnimplementedPreferencesServer

type UnimplementedPreferencesServer struct {
}

UnimplementedPreferencesServer must be embedded to have forward compatible implementations.

func (UnimplementedPreferencesServer) GetPreferences

type UnsafePreferencesServer

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

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

Jump to

Keyboard shortcuts

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