picture

package
v5.0.13 Latest Latest
Warning

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

Go to latest
Published: Nov 7, 2024 License: AGPL-3.0 Imports: 29 Imported by: 0

Documentation

Overview

Package picture is a reverse proxy.

It translates gRPC into RESTful JSON APIs.

Index

Constants

View Source
const (
	Picture_Background_FullMethodName = "/picture.Picture/Background"
)

Variables

View Source
var File_picture_picture_proto protoreflect.FileDescriptor
View Source
var Picture_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "picture.Picture",
	HandlerType: (*PictureServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "Background",
			Handler:    _Picture_Background_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "picture/picture.proto",
}

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

Functions

func RegisterPictureHandler

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

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

func RegisterPictureHandlerClient

func RegisterPictureHandlerClient(ctx context.Context, mux *runtime.ServeMux, client PictureClient) error

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

func RegisterPictureHandlerFromEndpoint

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

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

func RegisterPictureHandlerServer

func RegisterPictureHandlerServer(ctx context.Context, mux *runtime.ServeMux, server PictureServer) error

RegisterPictureHandlerServer registers the http handlers for service Picture to "mux". UnaryRPC :call PictureServer 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 RegisterPictureHandlerFromEndpoint instead.

func RegisterPictureServer

func RegisterPictureServer(s grpc.ServiceRegistrar, srv PictureServer)

Types

type BackgroundRequest

type BackgroundRequest struct {
	Random bool `protobuf:"varint,1,opt,name=random,proto3" json:"random,omitempty"`
	// contains filtered or unexported fields
}

func (*BackgroundRequest) Descriptor deprecated

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

Deprecated: Use BackgroundRequest.ProtoReflect.Descriptor instead.

func (*BackgroundRequest) GetRandom

func (x *BackgroundRequest) GetRandom() bool

func (*BackgroundRequest) ProtoMessage

func (*BackgroundRequest) ProtoMessage()

func (*BackgroundRequest) ProtoReflect

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

func (*BackgroundRequest) Reset

func (x *BackgroundRequest) Reset()

func (*BackgroundRequest) String

func (x *BackgroundRequest) String() string

func (*BackgroundRequest) Validate

func (m *BackgroundRequest) Validate() error

Validate checks the field values on BackgroundRequest 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 (*BackgroundRequest) ValidateAll

func (m *BackgroundRequest) ValidateAll() error

ValidateAll checks the field values on BackgroundRequest 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 BackgroundRequestMultiError, or nil if none found.

type BackgroundRequestMultiError

type BackgroundRequestMultiError []error

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

func (BackgroundRequestMultiError) AllErrors

func (m BackgroundRequestMultiError) AllErrors() []error

AllErrors returns a list of validation violation errors.

func (BackgroundRequestMultiError) Error

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

type BackgroundRequestValidationError

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

BackgroundRequestValidationError is the validation error returned by BackgroundRequest.Validate if the designated constraints aren't met.

func (BackgroundRequestValidationError) Cause

Cause function returns cause value.

func (BackgroundRequestValidationError) Error

Error satisfies the builtin error interface

func (BackgroundRequestValidationError) ErrorName

ErrorName returns error name.

func (BackgroundRequestValidationError) Field

Field function returns field value.

func (BackgroundRequestValidationError) Key

Key function returns key value.

func (BackgroundRequestValidationError) Reason

Reason function returns reason value.

type BackgroundResponse

type BackgroundResponse struct {
	Url       string `protobuf:"bytes,1,opt,name=url,proto3" json:"url,omitempty"`
	Copyright string `protobuf:"bytes,2,opt,name=copyright,proto3" json:"copyright,omitempty"`
	// contains filtered or unexported fields
}

func (*BackgroundResponse) Descriptor deprecated

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

Deprecated: Use BackgroundResponse.ProtoReflect.Descriptor instead.

func (*BackgroundResponse) GetCopyright

func (x *BackgroundResponse) GetCopyright() string

func (*BackgroundResponse) GetUrl

func (x *BackgroundResponse) GetUrl() string

func (*BackgroundResponse) ProtoMessage

func (*BackgroundResponse) ProtoMessage()

func (*BackgroundResponse) ProtoReflect

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

func (*BackgroundResponse) Reset

func (x *BackgroundResponse) Reset()

func (*BackgroundResponse) String

func (x *BackgroundResponse) String() string

func (*BackgroundResponse) Validate

func (m *BackgroundResponse) Validate() error

Validate checks the field values on BackgroundResponse 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 (*BackgroundResponse) ValidateAll

func (m *BackgroundResponse) ValidateAll() error

ValidateAll checks the field values on BackgroundResponse 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 BackgroundResponseMultiError, or nil if none found.

type BackgroundResponseMultiError

type BackgroundResponseMultiError []error

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

func (BackgroundResponseMultiError) AllErrors

func (m BackgroundResponseMultiError) AllErrors() []error

AllErrors returns a list of validation violation errors.

func (BackgroundResponseMultiError) Error

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

type BackgroundResponseValidationError

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

BackgroundResponseValidationError is the validation error returned by BackgroundResponse.Validate if the designated constraints aren't met.

func (BackgroundResponseValidationError) Cause

Cause function returns cause value.

func (BackgroundResponseValidationError) Error

Error satisfies the builtin error interface

func (BackgroundResponseValidationError) ErrorName

ErrorName returns error name.

func (BackgroundResponseValidationError) Field

Field function returns field value.

func (BackgroundResponseValidationError) Key

Key function returns key value.

func (BackgroundResponseValidationError) Reason

Reason function returns reason value.

type PictureClient

type PictureClient interface {
	// Background 获取背景图片
	Background(ctx context.Context, in *BackgroundRequest, opts ...grpc.CallOption) (*BackgroundResponse, error)
}

PictureClient is the client API for Picture 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 NewPictureClient

func NewPictureClient(cc grpc.ClientConnInterface) PictureClient

type PictureServer

type PictureServer interface {
	// Background 获取背景图片
	Background(context.Context, *BackgroundRequest) (*BackgroundResponse, error)
	// contains filtered or unexported methods
}

PictureServer is the server API for Picture service. All implementations must embed UnimplementedPictureServer for forward compatibility

type UnimplementedPictureServer

type UnimplementedPictureServer struct {
}

UnimplementedPictureServer must be embedded to have forward compatible implementations.

func (UnimplementedPictureServer) Background

type UnsafePictureServer

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

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

Jump to

Keyboard shortcuts

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