v1

package
v0.0.42 Latest Latest
Warning

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

Go to latest
Published: Sep 21, 2023 License: Apache-2.0 Imports: 22 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 File_vince_snippets_v1_snippets_proto protoreflect.FileDescriptor
View Source
var Snippets_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "v1.Snippets",
	HandlerType: (*SnippetsServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "CreateSnippet",
			Handler:    _Snippets_CreateSnippet_Handler,
		},
		{
			MethodName: "UpdateSnippet",
			Handler:    _Snippets_UpdateSnippet_Handler,
		},
		{
			MethodName: "ListSnippets",
			Handler:    _Snippets_ListSnippets_Handler,
		},
		{
			MethodName: "DeleteSnippet",
			Handler:    _Snippets_DeleteSnippet_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "vince/snippets/v1/snippets.proto",
}

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

Functions

func RegisterSnippetsHandler

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

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

func RegisterSnippetsHandlerClient

func RegisterSnippetsHandlerClient(ctx context.Context, mux *runtime.ServeMux, client SnippetsClient) error

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

func RegisterSnippetsHandlerFromEndpoint

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

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

func RegisterSnippetsHandlerServer

func RegisterSnippetsHandlerServer(ctx context.Context, mux *runtime.ServeMux, server SnippetsServer) error

RegisterSnippetsHandlerServer registers the http handlers for service Snippets to "mux". UnaryRPC :call SnippetsServer 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 RegisterSnippetsHandlerFromEndpoint instead.

func RegisterSnippetsServer

func RegisterSnippetsServer(s grpc.ServiceRegistrar, srv SnippetsServer)

Types

type CreateSnippetRequest

type CreateSnippetRequest struct {
	Name   string           `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
	Query  string           `protobuf:"bytes,2,opt,name=query,proto3" json:"query,omitempty"`
	Params []*v1.QueryParam `protobuf:"bytes,3,rep,name=params,proto3" json:"params,omitempty"`
	// contains filtered or unexported fields
}

func (*CreateSnippetRequest) Descriptor deprecated

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

Deprecated: Use CreateSnippetRequest.ProtoReflect.Descriptor instead.

func (*CreateSnippetRequest) GetName

func (x *CreateSnippetRequest) GetName() string

func (*CreateSnippetRequest) GetParams

func (x *CreateSnippetRequest) GetParams() []*v1.QueryParam

func (*CreateSnippetRequest) GetQuery

func (x *CreateSnippetRequest) GetQuery() string

func (*CreateSnippetRequest) MarshalToSizedBufferVT

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

func (*CreateSnippetRequest) MarshalToVT

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

func (*CreateSnippetRequest) MarshalVT

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

func (*CreateSnippetRequest) ProtoMessage

func (*CreateSnippetRequest) ProtoMessage()

func (*CreateSnippetRequest) ProtoReflect

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

func (*CreateSnippetRequest) Reset

func (x *CreateSnippetRequest) Reset()

func (*CreateSnippetRequest) SizeVT

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

func (*CreateSnippetRequest) String

func (x *CreateSnippetRequest) String() string

func (*CreateSnippetRequest) UnmarshalVT

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

type DeleteSnippetRequest

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

func (*DeleteSnippetRequest) Descriptor deprecated

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

Deprecated: Use DeleteSnippetRequest.ProtoReflect.Descriptor instead.

func (*DeleteSnippetRequest) GetId

func (x *DeleteSnippetRequest) GetId() string

func (*DeleteSnippetRequest) MarshalToSizedBufferVT

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

func (*DeleteSnippetRequest) MarshalToVT

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

func (*DeleteSnippetRequest) MarshalVT

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

func (*DeleteSnippetRequest) ProtoMessage

func (*DeleteSnippetRequest) ProtoMessage()

func (*DeleteSnippetRequest) ProtoReflect

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

func (*DeleteSnippetRequest) Reset

func (x *DeleteSnippetRequest) Reset()

func (*DeleteSnippetRequest) SizeVT

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

func (*DeleteSnippetRequest) String

func (x *DeleteSnippetRequest) String() string

func (*DeleteSnippetRequest) UnmarshalVT

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

type ListSnippetsRequest

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

func (*ListSnippetsRequest) Descriptor deprecated

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

Deprecated: Use ListSnippetsRequest.ProtoReflect.Descriptor instead.

func (*ListSnippetsRequest) MarshalToSizedBufferVT

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

func (*ListSnippetsRequest) MarshalToVT

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

func (*ListSnippetsRequest) MarshalVT

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

func (*ListSnippetsRequest) ProtoMessage

func (*ListSnippetsRequest) ProtoMessage()

func (*ListSnippetsRequest) ProtoReflect

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

func (*ListSnippetsRequest) Reset

func (x *ListSnippetsRequest) Reset()

func (*ListSnippetsRequest) SizeVT

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

func (*ListSnippetsRequest) String

func (x *ListSnippetsRequest) String() string

func (*ListSnippetsRequest) UnmarshalVT

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

type ListSnippetsResponse

type ListSnippetsResponse struct {
	Snippets []*Snippet `protobuf:"bytes,1,rep,name=snippets,proto3" json:"snippets,omitempty"`
	// contains filtered or unexported fields
}

func (*ListSnippetsResponse) Descriptor deprecated

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

Deprecated: Use ListSnippetsResponse.ProtoReflect.Descriptor instead.

func (*ListSnippetsResponse) GetSnippets

func (x *ListSnippetsResponse) GetSnippets() []*Snippet

func (*ListSnippetsResponse) MarshalToSizedBufferVT

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

func (*ListSnippetsResponse) MarshalToVT

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

func (*ListSnippetsResponse) MarshalVT

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

func (*ListSnippetsResponse) ProtoMessage

func (*ListSnippetsResponse) ProtoMessage()

func (*ListSnippetsResponse) ProtoReflect

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

func (*ListSnippetsResponse) Reset

func (x *ListSnippetsResponse) Reset()

func (*ListSnippetsResponse) SizeVT

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

func (*ListSnippetsResponse) String

func (x *ListSnippetsResponse) String() string

func (*ListSnippetsResponse) UnmarshalVT

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

type Snippet

type Snippet struct {
	Id        string                 `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
	Name      string                 `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"`
	Query     string                 `protobuf:"bytes,3,opt,name=query,proto3" json:"query,omitempty"`
	Params    []*v1.QueryParam       `protobuf:"bytes,4,rep,name=params,proto3" json:"params,omitempty"`
	CreatedAt *timestamppb.Timestamp `protobuf:"bytes,5,opt,name=created_at,json=createdAt,proto3" json:"created_at,omitempty"`
	UpdatedAt *timestamppb.Timestamp `protobuf:"bytes,6,opt,name=updated_at,json=updatedAt,proto3" json:"updated_at,omitempty"`
	// contains filtered or unexported fields
}

func (*Snippet) Descriptor deprecated

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

Deprecated: Use Snippet.ProtoReflect.Descriptor instead.

func (*Snippet) GetCreatedAt

func (x *Snippet) GetCreatedAt() *timestamppb.Timestamp

func (*Snippet) GetId

func (x *Snippet) GetId() string

func (*Snippet) GetName

func (x *Snippet) GetName() string

func (*Snippet) GetParams

func (x *Snippet) GetParams() []*v1.QueryParam

func (*Snippet) GetQuery

func (x *Snippet) GetQuery() string

func (*Snippet) GetUpdatedAt

func (x *Snippet) GetUpdatedAt() *timestamppb.Timestamp

func (*Snippet) MarshalToSizedBufferVT

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

func (*Snippet) MarshalToVT

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

func (*Snippet) MarshalVT

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

func (*Snippet) ProtoMessage

func (*Snippet) ProtoMessage()

func (*Snippet) ProtoReflect

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

func (*Snippet) Reset

func (x *Snippet) Reset()

func (*Snippet) SizeVT

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

func (*Snippet) String

func (x *Snippet) String() string

func (*Snippet) UnmarshalVT

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

type SnippetsClient

type SnippetsClient interface {
	CreateSnippet(ctx context.Context, in *CreateSnippetRequest, opts ...grpc.CallOption) (*Snippet, error)
	UpdateSnippet(ctx context.Context, in *UpdateSnippetRequest, opts ...grpc.CallOption) (*Snippet, error)
	ListSnippets(ctx context.Context, in *ListSnippetsRequest, opts ...grpc.CallOption) (*ListSnippetsResponse, error)
	DeleteSnippet(ctx context.Context, in *DeleteSnippetRequest, opts ...grpc.CallOption) (*emptypb.Empty, error)
}

SnippetsClient is the client API for Snippets 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 NewSnippetsClient

func NewSnippetsClient(cc grpc.ClientConnInterface) SnippetsClient

type SnippetsServer

type SnippetsServer interface {
	CreateSnippet(context.Context, *CreateSnippetRequest) (*Snippet, error)
	UpdateSnippet(context.Context, *UpdateSnippetRequest) (*Snippet, error)
	ListSnippets(context.Context, *ListSnippetsRequest) (*ListSnippetsResponse, error)
	DeleteSnippet(context.Context, *DeleteSnippetRequest) (*emptypb.Empty, error)
	// contains filtered or unexported methods
}

SnippetsServer is the server API for Snippets service. All implementations must embed UnimplementedSnippetsServer for forward compatibility

type UnimplementedSnippetsServer

type UnimplementedSnippetsServer struct {
}

UnimplementedSnippetsServer must be embedded to have forward compatible implementations.

func (UnimplementedSnippetsServer) CreateSnippet

func (UnimplementedSnippetsServer) DeleteSnippet added in v0.0.37

func (UnimplementedSnippetsServer) ListSnippets

func (UnimplementedSnippetsServer) UpdateSnippet

type UnsafeSnippetsServer

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

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

type UpdateSnippetRequest

type UpdateSnippetRequest struct {
	Id     string           `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
	Name   string           `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"`
	Query  string           `protobuf:"bytes,3,opt,name=query,proto3" json:"query,omitempty"`
	Params []*v1.QueryParam `protobuf:"bytes,4,rep,name=params,proto3" json:"params,omitempty"`
	// contains filtered or unexported fields
}

func (*UpdateSnippetRequest) Descriptor deprecated

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

Deprecated: Use UpdateSnippetRequest.ProtoReflect.Descriptor instead.

func (*UpdateSnippetRequest) GetId

func (x *UpdateSnippetRequest) GetId() string

func (*UpdateSnippetRequest) GetName

func (x *UpdateSnippetRequest) GetName() string

func (*UpdateSnippetRequest) GetParams

func (x *UpdateSnippetRequest) GetParams() []*v1.QueryParam

func (*UpdateSnippetRequest) GetQuery

func (x *UpdateSnippetRequest) GetQuery() string

func (*UpdateSnippetRequest) MarshalToSizedBufferVT

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

func (*UpdateSnippetRequest) MarshalToVT

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

func (*UpdateSnippetRequest) MarshalVT

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

func (*UpdateSnippetRequest) ProtoMessage

func (*UpdateSnippetRequest) ProtoMessage()

func (*UpdateSnippetRequest) ProtoReflect

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

func (*UpdateSnippetRequest) Reset

func (x *UpdateSnippetRequest) Reset()

func (*UpdateSnippetRequest) SizeVT

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

func (*UpdateSnippetRequest) String

func (x *UpdateSnippetRequest) String() string

func (*UpdateSnippetRequest) UnmarshalVT

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

Jump to

Keyboard shortcuts

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