api

package
v0.0.0-...-649f594 Latest Latest
Warning

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

Go to latest
Published: Jan 6, 2022 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Puff_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "puff.puff",
	HandlerType: (*PuffServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "Lock",
			Handler:    _Puff_Lock_Handler,
		},
		{
			MethodName: "Unlock",
			Handler:    _Puff_Unlock_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "puff.proto",
}

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

Functions

func RegisterPuffServer

func RegisterPuffServer(s grpc.ServiceRegistrar, srv PuffServer)

Types

type LockReply

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

The response message containing the greetings

func (*LockReply) Descriptor deprecated

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

Deprecated: Use LockReply.ProtoReflect.Descriptor instead.

func (*LockReply) GetResult

func (x *LockReply) GetResult() bool

func (*LockReply) ProtoMessage

func (*LockReply) ProtoMessage()

func (*LockReply) ProtoReflect

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

func (*LockReply) Reset

func (x *LockReply) Reset()

func (*LockReply) String

func (x *LockReply) String() string

type LockRequest

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

The request message containing the lock's name.

func (*LockRequest) Descriptor deprecated

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

Deprecated: Use LockRequest.ProtoReflect.Descriptor instead.

func (*LockRequest) GetKey

func (x *LockRequest) GetKey() string

func (*LockRequest) ProtoMessage

func (*LockRequest) ProtoMessage()

func (*LockRequest) ProtoReflect

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

func (*LockRequest) Reset

func (x *LockRequest) Reset()

func (*LockRequest) String

func (x *LockRequest) String() string

type PuffClient

type PuffClient interface {
	// Sends a get lock request
	Lock(ctx context.Context, in *LockRequest, opts ...grpc.CallOption) (*LockReply, error)
	// Sends a unlock request
	Unlock(ctx context.Context, in *LockRequest, opts ...grpc.CallOption) (*UnlockReply, error)
}

PuffClient is the client API for Puff 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 NewPuffClient

func NewPuffClient(cc grpc.ClientConnInterface) PuffClient

type PuffServer

type PuffServer interface {
	// Sends a get lock request
	Lock(context.Context, *LockRequest) (*LockReply, error)
	// Sends a unlock request
	Unlock(context.Context, *LockRequest) (*UnlockReply, error)
	// contains filtered or unexported methods
}

PuffServer is the server API for Puff service. All implementations must embed UnimplementedPuffServer for forward compatibility

type UnimplementedPuffServer

type UnimplementedPuffServer struct {
}

UnimplementedPuffServer must be embedded to have forward compatible implementations.

func (UnimplementedPuffServer) Lock

func (UnimplementedPuffServer) Unlock

type UnlockReply

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

The response message containing the greetings

func (*UnlockReply) Descriptor deprecated

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

Deprecated: Use UnlockReply.ProtoReflect.Descriptor instead.

func (*UnlockReply) GetResult

func (x *UnlockReply) GetResult() bool

func (*UnlockReply) ProtoMessage

func (*UnlockReply) ProtoMessage()

func (*UnlockReply) ProtoReflect

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

func (*UnlockReply) Reset

func (x *UnlockReply) Reset()

func (*UnlockReply) String

func (x *UnlockReply) String() string

type UnlockRequest

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

The request message containing the lock's name.

func (*UnlockRequest) Descriptor deprecated

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

Deprecated: Use UnlockRequest.ProtoReflect.Descriptor instead.

func (*UnlockRequest) GetKey

func (x *UnlockRequest) GetKey() string

func (*UnlockRequest) ProtoMessage

func (*UnlockRequest) ProtoMessage()

func (*UnlockRequest) ProtoReflect

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

func (*UnlockRequest) Reset

func (x *UnlockRequest) Reset()

func (*UnlockRequest) String

func (x *UnlockRequest) String() string

type UnsafePuffServer

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

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

Jump to

Keyboard shortcuts

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