sampleappv1

package
v0.0.0-...-2cbf6af Latest Latest
Warning

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

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

Documentation

Overview

Package sampleappv1 is a reverse proxy.

It translates gRPC into RESTful JSON APIs.

Index

Constants

View Source
const (
	SampleApp_Fetch_FullMethodName  = "/sample.sampleapp.v1.SampleApp/Fetch"
	SampleApp_Create_FullMethodName = "/sample.sampleapp.v1.SampleApp/Create"
	SampleApp_Delete_FullMethodName = "/sample.sampleapp.v1.SampleApp/Delete"
)

Variables

View Source
var File_sample_sampleapp_v1_sampleapp_proto protoreflect.FileDescriptor
View Source
var SampleApp_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "sample.sampleapp.v1.SampleApp",
	HandlerType: (*SampleAppServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "Fetch",
			Handler:    _SampleApp_Fetch_Handler,
		},
		{
			MethodName: "Create",
			Handler:    _SampleApp_Create_Handler,
		},
		{
			MethodName: "Delete",
			Handler:    _SampleApp_Delete_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "sample/sampleapp/v1/sampleapp.proto",
}

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

Functions

func RegisterSampleAppHandler

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

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

func RegisterSampleAppHandlerClient

func RegisterSampleAppHandlerClient(ctx context.Context, mux *runtime.ServeMux, client SampleAppClient) error

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

func RegisterSampleAppHandlerFromEndpoint

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

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

func RegisterSampleAppHandlerServer

func RegisterSampleAppHandlerServer(ctx context.Context, mux *runtime.ServeMux, server SampleAppServer) error

RegisterSampleAppHandlerServer registers the http handlers for service SampleApp to "mux". UnaryRPC :call SampleAppServer 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 RegisterSampleAppHandlerFromEndpoint instead.

func RegisterSampleAppServer

func RegisterSampleAppServer(s grpc.ServiceRegistrar, srv SampleAppServer)

Types

type CreateRequest

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

func (*CreateRequest) Descriptor deprecated

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

Deprecated: Use CreateRequest.ProtoReflect.Descriptor instead.

func (*CreateRequest) GetName

func (x *CreateRequest) GetName() string

func (*CreateRequest) ProtoMessage

func (*CreateRequest) ProtoMessage()

func (*CreateRequest) ProtoReflect

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

func (*CreateRequest) Reset

func (x *CreateRequest) Reset()

func (*CreateRequest) String

func (x *CreateRequest) String() string

func (*CreateRequest) Validate

func (m *CreateRequest) Validate() error

Validate checks the field values on CreateRequest with the rules defined in the proto definition for this message. If any rules are violated, the first error encountered is returned, or nil if there are no violations.

func (*CreateRequest) ValidateAll

func (m *CreateRequest) ValidateAll() error

ValidateAll checks the field values on CreateRequest with the rules defined in the proto definition for this message. If any rules are violated, the result is a list of violation errors wrapped in CreateRequestMultiError, or nil if none found.

type CreateRequestMultiError

type CreateRequestMultiError []error

CreateRequestMultiError is an error wrapping multiple validation errors returned by CreateRequest.ValidateAll() if the designated constraints aren't met.

func (CreateRequestMultiError) AllErrors

func (m CreateRequestMultiError) AllErrors() []error

AllErrors returns a list of validation violation errors.

func (CreateRequestMultiError) Error

func (m CreateRequestMultiError) Error() string

Error returns a concatenation of all the error messages it wraps.

type CreateRequestValidationError

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

CreateRequestValidationError is the validation error returned by CreateRequest.Validate if the designated constraints aren't met.

func (CreateRequestValidationError) Cause

Cause function returns cause value.

func (CreateRequestValidationError) Error

Error satisfies the builtin error interface

func (CreateRequestValidationError) ErrorName

func (e CreateRequestValidationError) ErrorName() string

ErrorName returns error name.

func (CreateRequestValidationError) Field

Field function returns field value.

func (CreateRequestValidationError) Key

Key function returns key value.

func (CreateRequestValidationError) Reason

Reason function returns reason value.

type CreateResponse

type CreateResponse 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"`
	// contains filtered or unexported fields
}

func (*CreateResponse) Descriptor deprecated

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

Deprecated: Use CreateResponse.ProtoReflect.Descriptor instead.

func (*CreateResponse) GetId

func (x *CreateResponse) GetId() string

func (*CreateResponse) GetName

func (x *CreateResponse) GetName() string

func (*CreateResponse) ProtoMessage

func (*CreateResponse) ProtoMessage()

func (*CreateResponse) ProtoReflect

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

func (*CreateResponse) Reset

func (x *CreateResponse) Reset()

func (*CreateResponse) String

func (x *CreateResponse) String() string

func (*CreateResponse) Validate

func (m *CreateResponse) Validate() error

Validate checks the field values on CreateResponse with the rules defined in the proto definition for this message. If any rules are violated, the first error encountered is returned, or nil if there are no violations.

func (*CreateResponse) ValidateAll

func (m *CreateResponse) ValidateAll() error

ValidateAll checks the field values on CreateResponse with the rules defined in the proto definition for this message. If any rules are violated, the result is a list of violation errors wrapped in CreateResponseMultiError, or nil if none found.

type CreateResponseMultiError

type CreateResponseMultiError []error

CreateResponseMultiError is an error wrapping multiple validation errors returned by CreateResponse.ValidateAll() if the designated constraints aren't met.

func (CreateResponseMultiError) AllErrors

func (m CreateResponseMultiError) AllErrors() []error

AllErrors returns a list of validation violation errors.

func (CreateResponseMultiError) Error

func (m CreateResponseMultiError) Error() string

Error returns a concatenation of all the error messages it wraps.

type CreateResponseValidationError

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

CreateResponseValidationError is the validation error returned by CreateResponse.Validate if the designated constraints aren't met.

func (CreateResponseValidationError) Cause

Cause function returns cause value.

func (CreateResponseValidationError) Error

Error satisfies the builtin error interface

func (CreateResponseValidationError) ErrorName

func (e CreateResponseValidationError) ErrorName() string

ErrorName returns error name.

func (CreateResponseValidationError) Field

Field function returns field value.

func (CreateResponseValidationError) Key

Key function returns key value.

func (CreateResponseValidationError) Reason

Reason function returns reason value.

type DeleteRequest

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

func (*DeleteRequest) Descriptor deprecated

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

Deprecated: Use DeleteRequest.ProtoReflect.Descriptor instead.

func (*DeleteRequest) GetId

func (x *DeleteRequest) GetId() string

func (*DeleteRequest) ProtoMessage

func (*DeleteRequest) ProtoMessage()

func (*DeleteRequest) ProtoReflect

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

func (*DeleteRequest) Reset

func (x *DeleteRequest) Reset()

func (*DeleteRequest) String

func (x *DeleteRequest) String() string

func (*DeleteRequest) Validate

func (m *DeleteRequest) Validate() error

Validate checks the field values on DeleteRequest with the rules defined in the proto definition for this message. If any rules are violated, the first error encountered is returned, or nil if there are no violations.

func (*DeleteRequest) ValidateAll

func (m *DeleteRequest) ValidateAll() error

ValidateAll checks the field values on DeleteRequest with the rules defined in the proto definition for this message. If any rules are violated, the result is a list of violation errors wrapped in DeleteRequestMultiError, or nil if none found.

type DeleteRequestMultiError

type DeleteRequestMultiError []error

DeleteRequestMultiError is an error wrapping multiple validation errors returned by DeleteRequest.ValidateAll() if the designated constraints aren't met.

func (DeleteRequestMultiError) AllErrors

func (m DeleteRequestMultiError) AllErrors() []error

AllErrors returns a list of validation violation errors.

func (DeleteRequestMultiError) Error

func (m DeleteRequestMultiError) Error() string

Error returns a concatenation of all the error messages it wraps.

type DeleteRequestValidationError

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

DeleteRequestValidationError is the validation error returned by DeleteRequest.Validate if the designated constraints aren't met.

func (DeleteRequestValidationError) Cause

Cause function returns cause value.

func (DeleteRequestValidationError) Error

Error satisfies the builtin error interface

func (DeleteRequestValidationError) ErrorName

func (e DeleteRequestValidationError) ErrorName() string

ErrorName returns error name.

func (DeleteRequestValidationError) Field

Field function returns field value.

func (DeleteRequestValidationError) Key

Key function returns key value.

func (DeleteRequestValidationError) Reason

Reason function returns reason value.

type DeleteResponse

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

func (*DeleteResponse) Descriptor deprecated

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

Deprecated: Use DeleteResponse.ProtoReflect.Descriptor instead.

func (*DeleteResponse) ProtoMessage

func (*DeleteResponse) ProtoMessage()

func (*DeleteResponse) ProtoReflect

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

func (*DeleteResponse) Reset

func (x *DeleteResponse) Reset()

func (*DeleteResponse) String

func (x *DeleteResponse) String() string

func (*DeleteResponse) Validate

func (m *DeleteResponse) Validate() error

Validate checks the field values on DeleteResponse with the rules defined in the proto definition for this message. If any rules are violated, the first error encountered is returned, or nil if there are no violations.

func (*DeleteResponse) ValidateAll

func (m *DeleteResponse) ValidateAll() error

ValidateAll checks the field values on DeleteResponse with the rules defined in the proto definition for this message. If any rules are violated, the result is a list of violation errors wrapped in DeleteResponseMultiError, or nil if none found.

type DeleteResponseMultiError

type DeleteResponseMultiError []error

DeleteResponseMultiError is an error wrapping multiple validation errors returned by DeleteResponse.ValidateAll() if the designated constraints aren't met.

func (DeleteResponseMultiError) AllErrors

func (m DeleteResponseMultiError) AllErrors() []error

AllErrors returns a list of validation violation errors.

func (DeleteResponseMultiError) Error

func (m DeleteResponseMultiError) Error() string

Error returns a concatenation of all the error messages it wraps.

type DeleteResponseValidationError

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

DeleteResponseValidationError is the validation error returned by DeleteResponse.Validate if the designated constraints aren't met.

func (DeleteResponseValidationError) Cause

Cause function returns cause value.

func (DeleteResponseValidationError) Error

Error satisfies the builtin error interface

func (DeleteResponseValidationError) ErrorName

func (e DeleteResponseValidationError) ErrorName() string

ErrorName returns error name.

func (DeleteResponseValidationError) Field

Field function returns field value.

func (DeleteResponseValidationError) Key

Key function returns key value.

func (DeleteResponseValidationError) Reason

Reason function returns reason value.

type FetchRequest

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

func (*FetchRequest) Descriptor deprecated

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

Deprecated: Use FetchRequest.ProtoReflect.Descriptor instead.

func (*FetchRequest) GetId

func (x *FetchRequest) GetId() string

func (*FetchRequest) ProtoMessage

func (*FetchRequest) ProtoMessage()

func (*FetchRequest) ProtoReflect

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

func (*FetchRequest) Reset

func (x *FetchRequest) Reset()

func (*FetchRequest) String

func (x *FetchRequest) String() string

func (*FetchRequest) Validate

func (m *FetchRequest) Validate() error

Validate checks the field values on FetchRequest with the rules defined in the proto definition for this message. If any rules are violated, the first error encountered is returned, or nil if there are no violations.

func (*FetchRequest) ValidateAll

func (m *FetchRequest) ValidateAll() error

ValidateAll checks the field values on FetchRequest with the rules defined in the proto definition for this message. If any rules are violated, the result is a list of violation errors wrapped in FetchRequestMultiError, or nil if none found.

type FetchRequestMultiError

type FetchRequestMultiError []error

FetchRequestMultiError is an error wrapping multiple validation errors returned by FetchRequest.ValidateAll() if the designated constraints aren't met.

func (FetchRequestMultiError) AllErrors

func (m FetchRequestMultiError) AllErrors() []error

AllErrors returns a list of validation violation errors.

func (FetchRequestMultiError) Error

func (m FetchRequestMultiError) Error() string

Error returns a concatenation of all the error messages it wraps.

type FetchRequestValidationError

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

FetchRequestValidationError is the validation error returned by FetchRequest.Validate if the designated constraints aren't met.

func (FetchRequestValidationError) Cause

Cause function returns cause value.

func (FetchRequestValidationError) Error

Error satisfies the builtin error interface

func (FetchRequestValidationError) ErrorName

func (e FetchRequestValidationError) ErrorName() string

ErrorName returns error name.

func (FetchRequestValidationError) Field

Field function returns field value.

func (FetchRequestValidationError) Key

Key function returns key value.

func (FetchRequestValidationError) Reason

Reason function returns reason value.

type FetchResponse

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

func (*FetchResponse) Descriptor deprecated

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

Deprecated: Use FetchResponse.ProtoReflect.Descriptor instead.

func (*FetchResponse) GetName

func (x *FetchResponse) GetName() string

func (*FetchResponse) ProtoMessage

func (*FetchResponse) ProtoMessage()

func (*FetchResponse) ProtoReflect

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

func (*FetchResponse) Reset

func (x *FetchResponse) Reset()

func (*FetchResponse) String

func (x *FetchResponse) String() string

func (*FetchResponse) Validate

func (m *FetchResponse) Validate() error

Validate checks the field values on FetchResponse with the rules defined in the proto definition for this message. If any rules are violated, the first error encountered is returned, or nil if there are no violations.

func (*FetchResponse) ValidateAll

func (m *FetchResponse) ValidateAll() error

ValidateAll checks the field values on FetchResponse with the rules defined in the proto definition for this message. If any rules are violated, the result is a list of violation errors wrapped in FetchResponseMultiError, or nil if none found.

type FetchResponseMultiError

type FetchResponseMultiError []error

FetchResponseMultiError is an error wrapping multiple validation errors returned by FetchResponse.ValidateAll() if the designated constraints aren't met.

func (FetchResponseMultiError) AllErrors

func (m FetchResponseMultiError) AllErrors() []error

AllErrors returns a list of validation violation errors.

func (FetchResponseMultiError) Error

func (m FetchResponseMultiError) Error() string

Error returns a concatenation of all the error messages it wraps.

type FetchResponseValidationError

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

FetchResponseValidationError is the validation error returned by FetchResponse.Validate if the designated constraints aren't met.

func (FetchResponseValidationError) Cause

Cause function returns cause value.

func (FetchResponseValidationError) Error

Error satisfies the builtin error interface

func (FetchResponseValidationError) ErrorName

func (e FetchResponseValidationError) ErrorName() string

ErrorName returns error name.

func (FetchResponseValidationError) Field

Field function returns field value.

func (FetchResponseValidationError) Key

Key function returns key value.

func (FetchResponseValidationError) Reason

Reason function returns reason value.

type SampleAppClient

type SampleAppClient interface {
	// Fetch a single user.
	Fetch(ctx context.Context, in *FetchRequest, opts ...grpc.CallOption) (*FetchResponse, error)
	// Create a user.
	Create(ctx context.Context, in *CreateRequest, opts ...grpc.CallOption) (*CreateResponse, error)
	// Delete users.
	Delete(ctx context.Context, in *DeleteRequest, opts ...grpc.CallOption) (*DeleteResponse, error)
}

SampleAppClient is the client API for SampleApp 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 NewSampleAppClient

func NewSampleAppClient(cc grpc.ClientConnInterface) SampleAppClient

type SampleAppServer

type SampleAppServer interface {
	// Fetch a single user.
	Fetch(context.Context, *FetchRequest) (*FetchResponse, error)
	// Create a user.
	Create(context.Context, *CreateRequest) (*CreateResponse, error)
	// Delete users.
	Delete(context.Context, *DeleteRequest) (*DeleteResponse, error)
	// contains filtered or unexported methods
}

SampleAppServer is the server API for SampleApp service. All implementations must embed UnimplementedSampleAppServer for forward compatibility

type UnimplementedSampleAppServer

type UnimplementedSampleAppServer struct {
}

UnimplementedSampleAppServer must be embedded to have forward compatible implementations.

func (UnimplementedSampleAppServer) Create

func (UnimplementedSampleAppServer) Delete

func (UnimplementedSampleAppServer) Fetch

type UnsafeSampleAppServer

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

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

Jump to

Keyboard shortcuts

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