assetsv1

package
v0.0.0-...-9a5b211 Latest Latest
Warning

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

Go to latest
Published: Jul 1, 2023 License: MPL-2.0 Imports: 29 Imported by: 0

Documentation

Overview

Package assetsv1 is a reverse proxy.

It translates gRPC into RESTful JSON APIs.

Index

Constants

View Source
const (
	AssetsAPI_Fetch_FullMethodName = "/datalift.assets.v1.AssetsAPI/Fetch"
)

Variables

View Source
var AssetsAPI_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "datalift.assets.v1.AssetsAPI",
	HandlerType: (*AssetsAPIServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "Fetch",
			Handler:    _AssetsAPI_Fetch_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "assets/v1/assets.proto",
}

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

View Source
var File_assets_v1_assets_proto protoreflect.FileDescriptor

Functions

func RegisterAssetsAPIHandler

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

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

func RegisterAssetsAPIHandlerClient

func RegisterAssetsAPIHandlerClient(ctx context.Context, mux *runtime.ServeMux, client AssetsAPIClient) error

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

func RegisterAssetsAPIHandlerFromEndpoint

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

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

func RegisterAssetsAPIHandlerServer

func RegisterAssetsAPIHandlerServer(ctx context.Context, mux *runtime.ServeMux, server AssetsAPIServer) error

RegisterAssetsAPIHandlerServer registers the http handlers for service AssetsAPI to "mux". UnaryRPC :call AssetsAPIServer 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 RegisterAssetsAPIHandlerFromEndpoint instead.

func RegisterAssetsAPIServer

func RegisterAssetsAPIServer(s grpc.ServiceRegistrar, srv AssetsAPIServer)

Types

type AssetsAPIClient

type AssetsAPIClient interface {
	// Fetch is a simple endpoint that is used to execute middleware (e.g. authentication) before serving an asset.
	Fetch(ctx context.Context, in *FetchRequest, opts ...grpc.CallOption) (*FetchResponse, error)
}

AssetsAPIClient is the client API for AssetsAPI 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 NewAssetsAPIClient

func NewAssetsAPIClient(cc grpc.ClientConnInterface) AssetsAPIClient

type AssetsAPIServer

type AssetsAPIServer interface {
	// Fetch is a simple endpoint that is used to execute middleware (e.g. authentication) before serving an asset.
	Fetch(context.Context, *FetchRequest) (*FetchResponse, error)
}

AssetsAPIServer is the server API for AssetsAPI service. All implementations should embed UnimplementedAssetsAPIServer for forward compatibility

type FetchRequest

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

func (*FetchRequest) Descriptor deprecated

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

Deprecated: Use FetchRequest.ProtoReflect.Descriptor instead.

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 {
	// contains filtered or unexported fields
}

func (*FetchResponse) Descriptor deprecated

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

Deprecated: Use FetchResponse.ProtoReflect.Descriptor instead.

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 UnimplementedAssetsAPIServer

type UnimplementedAssetsAPIServer struct {
}

UnimplementedAssetsAPIServer should be embedded to have forward compatible implementations.

func (UnimplementedAssetsAPIServer) Fetch

type UnsafeAssetsAPIServer

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

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

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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