me

package
v0.0.18 Latest Latest
Warning

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

Go to latest
Published: Jan 6, 2026 License: Apache-2.0 Imports: 21 Imported by: 0

Documentation

Overview

Package me is a reverse proxy.

It translates gRPC into RESTful JSON APIs.

Index

Constants

View Source
const (
	Me_Me_FullMethodName              = "/Superplane.Me.Me/Me"
	Me_RegenerateToken_FullMethodName = "/Superplane.Me.Me/RegenerateToken"
)

Variables

View Source
var Me_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "Superplane.Me.Me",
	HandlerType: (*MeServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "Me",
			Handler:    _Me_Me_Handler,
		},
		{
			MethodName: "RegenerateToken",
			Handler:    _Me_RegenerateToken_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "me.proto",
}

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

Functions

func RegisterMeHandler

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

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

func RegisterMeHandlerClient

func RegisterMeHandlerClient(ctx context.Context, mux *runtime.ServeMux, client MeClient) error

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

func RegisterMeHandlerFromEndpoint

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

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

func RegisterMeHandlerServer

func RegisterMeHandlerServer(ctx context.Context, mux *runtime.ServeMux, server MeServer) error

RegisterMeHandlerServer registers the http handlers for service Me to "mux". UnaryRPC :call MeServer 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 RegisterMeHandlerFromEndpoint 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 RegisterMeServer

func RegisterMeServer(s grpc.ServiceRegistrar, srv MeServer)

Types

type MeClient

type MeClient interface {
	// Endpoint for getting the currently authenticated user.
	Me(ctx context.Context, in *empty.Empty, opts ...grpc.CallOption) (*User, error)
	// Endpoint for regenerating the currently authenticated user's API token.
	RegenerateToken(ctx context.Context, in *empty.Empty, opts ...grpc.CallOption) (*RegenerateTokenResponse, error)
}

MeClient is the client API for Me 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 NewMeClient

func NewMeClient(cc grpc.ClientConnInterface) MeClient

type MeServer

type MeServer interface {
	// Endpoint for getting the currently authenticated user.
	Me(context.Context, *empty.Empty) (*User, error)
	// Endpoint for regenerating the currently authenticated user's API token.
	RegenerateToken(context.Context, *empty.Empty) (*RegenerateTokenResponse, error)
}

MeServer is the server API for Me service. All implementations should embed UnimplementedMeServer for forward compatibility.

type RegenerateTokenResponse

type RegenerateTokenResponse struct {
	Token string `protobuf:"bytes,1,opt,name=token,proto3" json:"token,omitempty"`
	// contains filtered or unexported fields
}

func (*RegenerateTokenResponse) Descriptor deprecated

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

Deprecated: Use RegenerateTokenResponse.ProtoReflect.Descriptor instead.

func (*RegenerateTokenResponse) GetToken

func (x *RegenerateTokenResponse) GetToken() string

func (*RegenerateTokenResponse) ProtoMessage

func (*RegenerateTokenResponse) ProtoMessage()

func (*RegenerateTokenResponse) ProtoReflect

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

func (*RegenerateTokenResponse) Reset

func (x *RegenerateTokenResponse) Reset()

func (*RegenerateTokenResponse) String

func (x *RegenerateTokenResponse) String() string

type UnimplementedMeServer

type UnimplementedMeServer struct{}

UnimplementedMeServer 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 (UnimplementedMeServer) Me

func (UnimplementedMeServer) RegenerateToken

type UnsafeMeServer

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

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

type User

type User struct {
	Id             string               `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
	Email          string               `protobuf:"bytes,2,opt,name=email,proto3" json:"email,omitempty"`
	OrganizationId string               `protobuf:"bytes,3,opt,name=organization_id,json=organizationId,proto3" json:"organization_id,omitempty"`
	CreatedAt      *timestamp.Timestamp `protobuf:"bytes,4,opt,name=created_at,json=createdAt,proto3" json:"created_at,omitempty"`
	HasToken       bool                 `protobuf:"varint,5,opt,name=has_token,json=hasToken,proto3" json:"has_token,omitempty"`
	// contains filtered or unexported fields
}

func (*User) Descriptor deprecated

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

Deprecated: Use User.ProtoReflect.Descriptor instead.

func (*User) GetCreatedAt

func (x *User) GetCreatedAt() *timestamp.Timestamp

func (*User) GetEmail

func (x *User) GetEmail() string

func (*User) GetHasToken

func (x *User) GetHasToken() bool

func (*User) GetId

func (x *User) GetId() string

func (*User) GetOrganizationId

func (x *User) GetOrganizationId() string

func (*User) ProtoMessage

func (*User) ProtoMessage()

func (*User) ProtoReflect

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

func (*User) Reset

func (x *User) Reset()

func (*User) String

func (x *User) String() string

Jump to

Keyboard shortcuts

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