askv

package
v1.0.1-0...-3085023 Latest Latest
Warning

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

Go to latest
Published: Sep 11, 2024 License: MPL-2.0 Imports: 15 Imported by: 0

Documentation

Overview

Package askv is a reverse proxy.

It translates gRPC into RESTful JSON APIs.

Index

Constants

View Source
const (
	Askv_Exists_FullMethodName      = "/api.public.askv.Askv/Exists"
	Askv_Add_FullMethodName         = "/api.public.askv.Askv/Add"
	Askv_PruneOrg_FullMethodName    = "/api.public.askv.Askv/PruneOrg"
	Askv_PruneTarget_FullMethodName = "/api.public.askv.Askv/PruneTarget"
)

Variables

View Source
var Askv_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "api.public.askv.Askv",
	HandlerType: (*AskvServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "Exists",
			Handler:    _Askv_Exists_Handler,
		},
		{
			MethodName: "Add",
			Handler:    _Askv_Add_Handler,
		},
		{
			MethodName: "PruneOrg",
			Handler:    _Askv_PruneOrg_Handler,
		},
		{
			MethodName: "PruneTarget",
			Handler:    _Askv_PruneTarget_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "askv.proto",
}

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

Functions

func RegisterAskvHandler

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

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

func RegisterAskvHandlerClient

func RegisterAskvHandlerClient(ctx context.Context, mux *runtime.ServeMux, client AskvClient) error

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

func RegisterAskvHandlerFromEndpoint

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

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

func RegisterAskvHandlerServer

func RegisterAskvHandlerServer(ctx context.Context, mux *runtime.ServeMux, server AskvServer) error

RegisterAskvHandlerServer registers the http handlers for service Askv to "mux". UnaryRPC :call AskvServer 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 RegisterAskvHandlerFromEndpoint instead.

func RegisterAskvServer

func RegisterAskvServer(s grpc.ServiceRegistrar, srv AskvServer)

Types

type AddRequest

type AddRequest struct {
	OrgName    string `protobuf:"bytes,1,opt,name=org_name,json=orgName,proto3" json:"org_name,omitempty"`
	Hash       []byte `protobuf:"bytes,4,opt,name=hash,proto3" json:"hash,omitempty"`
	TargetName string `protobuf:"bytes,5,opt,name=target_name,json=targetName,proto3" json:"target_name,omitempty"`
	TargetPath string `protobuf:"bytes,6,opt,name=target_path,json=targetPath,proto3" json:"target_path,omitempty"`
	// contains filtered or unexported fields
}

func (*AddRequest) Descriptor deprecated

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

Deprecated: Use AddRequest.ProtoReflect.Descriptor instead.

func (*AddRequest) GetHash

func (x *AddRequest) GetHash() []byte

func (*AddRequest) GetOrgName

func (x *AddRequest) GetOrgName() string

func (*AddRequest) GetTargetName

func (x *AddRequest) GetTargetName() string

func (*AddRequest) GetTargetPath

func (x *AddRequest) GetTargetPath() string

func (*AddRequest) ProtoMessage

func (*AddRequest) ProtoMessage()

func (*AddRequest) ProtoReflect

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

func (*AddRequest) Reset

func (x *AddRequest) Reset()

func (*AddRequest) String

func (x *AddRequest) String() string

type AddResponse

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

func (*AddResponse) Descriptor deprecated

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

Deprecated: Use AddResponse.ProtoReflect.Descriptor instead.

func (*AddResponse) ProtoMessage

func (*AddResponse) ProtoMessage()

func (*AddResponse) ProtoReflect

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

func (*AddResponse) Reset

func (x *AddResponse) Reset()

func (*AddResponse) String

func (x *AddResponse) String() string

type AskvClient

type AskvClient interface {
	Exists(ctx context.Context, in *ExistsRequest, opts ...grpc.CallOption) (*ExistsResponse, error)
	Add(ctx context.Context, in *AddRequest, opts ...grpc.CallOption) (*AddResponse, error)
	PruneOrg(ctx context.Context, in *PruneOrgRequest, opts ...grpc.CallOption) (*PruneOrgResponse, error)
	PruneTarget(ctx context.Context, in *PruneTargetRequest, opts ...grpc.CallOption) (*PruneTargetResponse, error)
}

AskvClient is the client API for Askv 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 NewAskvClient

func NewAskvClient(cc grpc.ClientConnInterface) AskvClient

type AskvServer

type AskvServer interface {
	Exists(context.Context, *ExistsRequest) (*ExistsResponse, error)
	Add(context.Context, *AddRequest) (*AddResponse, error)
	PruneOrg(context.Context, *PruneOrgRequest) (*PruneOrgResponse, error)
	PruneTarget(context.Context, *PruneTargetRequest) (*PruneTargetResponse, error)
	// contains filtered or unexported methods
}

AskvServer is the server API for Askv service. All implementations must embed UnimplementedAskvServer for forward compatibility

type ExistsRequest

type ExistsRequest struct {
	OrgName string `protobuf:"bytes,1,opt,name=org_name,json=orgName,proto3" json:"org_name,omitempty"`
	Hash    []byte `protobuf:"bytes,4,opt,name=hash,proto3" json:"hash,omitempty"`
	// contains filtered or unexported fields
}

func (*ExistsRequest) Descriptor deprecated

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

Deprecated: Use ExistsRequest.ProtoReflect.Descriptor instead.

func (*ExistsRequest) GetHash

func (x *ExistsRequest) GetHash() []byte

func (*ExistsRequest) GetOrgName

func (x *ExistsRequest) GetOrgName() string

func (*ExistsRequest) ProtoMessage

func (*ExistsRequest) ProtoMessage()

func (*ExistsRequest) ProtoReflect

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

func (*ExistsRequest) Reset

func (x *ExistsRequest) Reset()

func (*ExistsRequest) String

func (x *ExistsRequest) String() string

type ExistsResponse

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

func (*ExistsResponse) Descriptor deprecated

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

Deprecated: Use ExistsResponse.ProtoReflect.Descriptor instead.

func (*ExistsResponse) GetExists

func (x *ExistsResponse) GetExists() bool

func (*ExistsResponse) ProtoMessage

func (*ExistsResponse) ProtoMessage()

func (*ExistsResponse) ProtoReflect

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

func (*ExistsResponse) Reset

func (x *ExistsResponse) Reset()

func (*ExistsResponse) String

func (x *ExistsResponse) String() string

type PruneOrgRequest

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

func (*PruneOrgRequest) Descriptor deprecated

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

Deprecated: Use PruneOrgRequest.ProtoReflect.Descriptor instead.

func (*PruneOrgRequest) GetOrgName

func (x *PruneOrgRequest) GetOrgName() string

func (*PruneOrgRequest) ProtoMessage

func (*PruneOrgRequest) ProtoMessage()

func (*PruneOrgRequest) ProtoReflect

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

func (*PruneOrgRequest) Reset

func (x *PruneOrgRequest) Reset()

func (*PruneOrgRequest) String

func (x *PruneOrgRequest) String() string

type PruneOrgResponse

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

func (*PruneOrgResponse) Descriptor deprecated

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

Deprecated: Use PruneOrgResponse.ProtoReflect.Descriptor instead.

func (*PruneOrgResponse) ProtoMessage

func (*PruneOrgResponse) ProtoMessage()

func (*PruneOrgResponse) ProtoReflect

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

func (*PruneOrgResponse) Reset

func (x *PruneOrgResponse) Reset()

func (*PruneOrgResponse) String

func (x *PruneOrgResponse) String() string

type PruneTargetRequest

type PruneTargetRequest struct {
	OrgName       string `protobuf:"bytes,1,opt,name=org_name,json=orgName,proto3" json:"org_name,omitempty"`
	TargetName    string `protobuf:"bytes,3,opt,name=target_name,json=targetName,proto3" json:"target_name,omitempty"`
	TargetPath    string `protobuf:"bytes,4,opt,name=target_path,json=targetPath,proto3" json:"target_path,omitempty"`
	UsePathPrefix bool   `protobuf:"varint,5,opt,name=use_path_prefix,json=usePathPrefix,proto3" json:"use_path_prefix,omitempty"`
	// contains filtered or unexported fields
}

func (*PruneTargetRequest) Descriptor deprecated

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

Deprecated: Use PruneTargetRequest.ProtoReflect.Descriptor instead.

func (*PruneTargetRequest) GetOrgName

func (x *PruneTargetRequest) GetOrgName() string

func (*PruneTargetRequest) GetTargetName

func (x *PruneTargetRequest) GetTargetName() string

func (*PruneTargetRequest) GetTargetPath

func (x *PruneTargetRequest) GetTargetPath() string

func (*PruneTargetRequest) GetUsePathPrefix

func (x *PruneTargetRequest) GetUsePathPrefix() bool

func (*PruneTargetRequest) ProtoMessage

func (*PruneTargetRequest) ProtoMessage()

func (*PruneTargetRequest) ProtoReflect

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

func (*PruneTargetRequest) Reset

func (x *PruneTargetRequest) Reset()

func (*PruneTargetRequest) String

func (x *PruneTargetRequest) String() string

type PruneTargetResponse

type PruneTargetResponse struct {
	Count int32 `protobuf:"varint,1,opt,name=count,proto3" json:"count,omitempty"`
	// contains filtered or unexported fields
}

func (*PruneTargetResponse) Descriptor deprecated

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

Deprecated: Use PruneTargetResponse.ProtoReflect.Descriptor instead.

func (*PruneTargetResponse) GetCount

func (x *PruneTargetResponse) GetCount() int32

func (*PruneTargetResponse) ProtoMessage

func (*PruneTargetResponse) ProtoMessage()

func (*PruneTargetResponse) ProtoReflect

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

func (*PruneTargetResponse) Reset

func (x *PruneTargetResponse) Reset()

func (*PruneTargetResponse) String

func (x *PruneTargetResponse) String() string

type UnimplementedAskvServer

type UnimplementedAskvServer struct {
}

UnimplementedAskvServer must be embedded to have forward compatible implementations.

func (UnimplementedAskvServer) Add

func (UnimplementedAskvServer) Exists

func (UnimplementedAskvServer) PruneOrg

func (UnimplementedAskvServer) PruneTarget

type UnsafeAskvServer

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

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

Jump to

Keyboard shortcuts

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