models

package
v0.0.0-...-07ee8ad Latest Latest
Warning

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

Go to latest
Published: Oct 29, 2024 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const LockType = "lock"
View Source
const PresenceType = "presence"

Variables

View Source
var (
	ErrInvalidLengthLocket        = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflowLocket          = fmt.Errorf("proto: integer overflow")
	ErrUnexpectedEndOfGroupLocket = fmt.Errorf("proto: unexpected end of group")
)
View Source
var ErrInvalidOwner = status.Errorf(codes.InvalidArgument, "invalid-owner")
View Source
var ErrInvalidTTL = status.Errorf(codes.InvalidArgument, "invalid-ttl")
View Source
var ErrInvalidType = status.Errorf(codes.NotFound, "invalid-type")
View Source
var ErrLockCollision = status.Errorf(codes.AlreadyExists, "lock-collision")
View Source
var ErrResourceNotFound = status.Errorf(codes.NotFound, "resource-not-found")
View Source
var TypeCode_name = map[int32]string{
	0: "UNKNOWN",
	1: "LOCK",
	2: "PRESENCE",
}
View Source
var TypeCode_value = map[string]int32{
	"UNKNOWN":  0,
	"LOCK":     1,
	"PRESENCE": 2,
}

Functions

func GetType

func GetType(resource *Resource) string

func RegisterLocketServer

func RegisterLocketServer(s *grpc.Server, srv LocketServer)

Types

type FetchAllRequest

type FetchAllRequest struct {
	Type     string   `protobuf:"bytes,1,opt,name=type,proto3" json:"type,omitempty"` // Deprecated: Do not use.
	TypeCode TypeCode `protobuf:"varint,2,opt,name=type_code,json=typeCode,proto3,enum=models.TypeCode" json:"type_code,omitempty"`
}

func (*FetchAllRequest) Descriptor

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

func (*FetchAllRequest) Equal

func (this *FetchAllRequest) Equal(that interface{}) bool

func (*FetchAllRequest) GetType deprecated

func (m *FetchAllRequest) GetType() string

Deprecated: Do not use.

func (*FetchAllRequest) GetTypeCode

func (m *FetchAllRequest) GetTypeCode() TypeCode

func (*FetchAllRequest) GoString

func (this *FetchAllRequest) GoString() string

func (*FetchAllRequest) Marshal

func (m *FetchAllRequest) Marshal() (dAtA []byte, err error)

func (*FetchAllRequest) MarshalTo

func (m *FetchAllRequest) MarshalTo(dAtA []byte) (int, error)

func (*FetchAllRequest) MarshalToSizedBuffer

func (m *FetchAllRequest) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*FetchAllRequest) ProtoMessage

func (*FetchAllRequest) ProtoMessage()

func (*FetchAllRequest) Reset

func (m *FetchAllRequest) Reset()

func (*FetchAllRequest) Size

func (m *FetchAllRequest) Size() (n int)

func (*FetchAllRequest) String

func (this *FetchAllRequest) String() string

func (*FetchAllRequest) Unmarshal

func (m *FetchAllRequest) Unmarshal(dAtA []byte) error

func (*FetchAllRequest) XXX_DiscardUnknown

func (m *FetchAllRequest) XXX_DiscardUnknown()

func (*FetchAllRequest) XXX_Marshal

func (m *FetchAllRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*FetchAllRequest) XXX_Merge

func (m *FetchAllRequest) XXX_Merge(src proto.Message)

func (*FetchAllRequest) XXX_Size

func (m *FetchAllRequest) XXX_Size() int

func (*FetchAllRequest) XXX_Unmarshal

func (m *FetchAllRequest) XXX_Unmarshal(b []byte) error

type FetchAllResponse

type FetchAllResponse struct {
	Resources []*Resource `protobuf:"bytes,1,rep,name=resources,proto3" json:"resources,omitempty"`
}

func (*FetchAllResponse) Descriptor

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

func (*FetchAllResponse) Equal

func (this *FetchAllResponse) Equal(that interface{}) bool

func (*FetchAllResponse) GetResources

func (m *FetchAllResponse) GetResources() []*Resource

func (*FetchAllResponse) GoString

func (this *FetchAllResponse) GoString() string

func (*FetchAllResponse) Marshal

func (m *FetchAllResponse) Marshal() (dAtA []byte, err error)

func (*FetchAllResponse) MarshalTo

func (m *FetchAllResponse) MarshalTo(dAtA []byte) (int, error)

func (*FetchAllResponse) MarshalToSizedBuffer

func (m *FetchAllResponse) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*FetchAllResponse) ProtoMessage

func (*FetchAllResponse) ProtoMessage()

func (*FetchAllResponse) Reset

func (m *FetchAllResponse) Reset()

func (*FetchAllResponse) Size

func (m *FetchAllResponse) Size() (n int)

func (*FetchAllResponse) String

func (this *FetchAllResponse) String() string

func (*FetchAllResponse) Unmarshal

func (m *FetchAllResponse) Unmarshal(dAtA []byte) error

func (*FetchAllResponse) XXX_DiscardUnknown

func (m *FetchAllResponse) XXX_DiscardUnknown()

func (*FetchAllResponse) XXX_Marshal

func (m *FetchAllResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*FetchAllResponse) XXX_Merge

func (m *FetchAllResponse) XXX_Merge(src proto.Message)

func (*FetchAllResponse) XXX_Size

func (m *FetchAllResponse) XXX_Size() int

func (*FetchAllResponse) XXX_Unmarshal

func (m *FetchAllResponse) XXX_Unmarshal(b []byte) error

type FetchRequest

type FetchRequest struct {
	Key string `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"`
}

func (*FetchRequest) Descriptor

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

func (*FetchRequest) Equal

func (this *FetchRequest) Equal(that interface{}) bool

func (*FetchRequest) GetKey

func (m *FetchRequest) GetKey() string

func (*FetchRequest) GoString

func (this *FetchRequest) GoString() string

func (*FetchRequest) Marshal

func (m *FetchRequest) Marshal() (dAtA []byte, err error)

func (*FetchRequest) MarshalTo

func (m *FetchRequest) MarshalTo(dAtA []byte) (int, error)

func (*FetchRequest) MarshalToSizedBuffer

func (m *FetchRequest) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*FetchRequest) ProtoMessage

func (*FetchRequest) ProtoMessage()

func (*FetchRequest) Reset

func (m *FetchRequest) Reset()

func (*FetchRequest) Size

func (m *FetchRequest) Size() (n int)

func (*FetchRequest) String

func (this *FetchRequest) String() string

func (*FetchRequest) Unmarshal

func (m *FetchRequest) Unmarshal(dAtA []byte) error

func (*FetchRequest) XXX_DiscardUnknown

func (m *FetchRequest) XXX_DiscardUnknown()

func (*FetchRequest) XXX_Marshal

func (m *FetchRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*FetchRequest) XXX_Merge

func (m *FetchRequest) XXX_Merge(src proto.Message)

func (*FetchRequest) XXX_Size

func (m *FetchRequest) XXX_Size() int

func (*FetchRequest) XXX_Unmarshal

func (m *FetchRequest) XXX_Unmarshal(b []byte) error

type FetchResponse

type FetchResponse struct {
	Resource *Resource `protobuf:"bytes,1,opt,name=resource,proto3" json:"resource,omitempty"`
}

func (*FetchResponse) Descriptor

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

func (*FetchResponse) Equal

func (this *FetchResponse) Equal(that interface{}) bool

func (*FetchResponse) GetResource

func (m *FetchResponse) GetResource() *Resource

func (*FetchResponse) GoString

func (this *FetchResponse) GoString() string

func (*FetchResponse) Marshal

func (m *FetchResponse) Marshal() (dAtA []byte, err error)

func (*FetchResponse) MarshalTo

func (m *FetchResponse) MarshalTo(dAtA []byte) (int, error)

func (*FetchResponse) MarshalToSizedBuffer

func (m *FetchResponse) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*FetchResponse) ProtoMessage

func (*FetchResponse) ProtoMessage()

func (*FetchResponse) Reset

func (m *FetchResponse) Reset()

func (*FetchResponse) Size

func (m *FetchResponse) Size() (n int)

func (*FetchResponse) String

func (this *FetchResponse) String() string

func (*FetchResponse) Unmarshal

func (m *FetchResponse) Unmarshal(dAtA []byte) error

func (*FetchResponse) XXX_DiscardUnknown

func (m *FetchResponse) XXX_DiscardUnknown()

func (*FetchResponse) XXX_Marshal

func (m *FetchResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*FetchResponse) XXX_Merge

func (m *FetchResponse) XXX_Merge(src proto.Message)

func (*FetchResponse) XXX_Size

func (m *FetchResponse) XXX_Size() int

func (*FetchResponse) XXX_Unmarshal

func (m *FetchResponse) XXX_Unmarshal(b []byte) error

type LockRequest

type LockRequest struct {
	Resource     *Resource `protobuf:"bytes,1,opt,name=resource,proto3" json:"resource,omitempty"`
	TtlInSeconds int64     `protobuf:"varint,2,opt,name=ttl_in_seconds,json=ttlInSeconds,proto3" json:"ttl_in_seconds,omitempty"`
}

func (*LockRequest) Descriptor

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

func (*LockRequest) Equal

func (this *LockRequest) Equal(that interface{}) bool

func (*LockRequest) GetResource

func (m *LockRequest) GetResource() *Resource

func (*LockRequest) GetTtlInSeconds

func (m *LockRequest) GetTtlInSeconds() int64

func (*LockRequest) GoString

func (this *LockRequest) GoString() string

func (*LockRequest) Marshal

func (m *LockRequest) Marshal() (dAtA []byte, err error)

func (*LockRequest) MarshalTo

func (m *LockRequest) MarshalTo(dAtA []byte) (int, error)

func (*LockRequest) MarshalToSizedBuffer

func (m *LockRequest) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*LockRequest) ProtoMessage

func (*LockRequest) ProtoMessage()

func (*LockRequest) Reset

func (m *LockRequest) Reset()

func (*LockRequest) Size

func (m *LockRequest) Size() (n int)

func (*LockRequest) String

func (this *LockRequest) String() string

func (*LockRequest) Unmarshal

func (m *LockRequest) Unmarshal(dAtA []byte) error

func (*LockRequest) XXX_DiscardUnknown

func (m *LockRequest) XXX_DiscardUnknown()

func (*LockRequest) XXX_Marshal

func (m *LockRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*LockRequest) XXX_Merge

func (m *LockRequest) XXX_Merge(src proto.Message)

func (*LockRequest) XXX_Size

func (m *LockRequest) XXX_Size() int

func (*LockRequest) XXX_Unmarshal

func (m *LockRequest) XXX_Unmarshal(b []byte) error

type LockResponse

type LockResponse struct {
}

func (*LockResponse) Descriptor

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

func (*LockResponse) Equal

func (this *LockResponse) Equal(that interface{}) bool

func (*LockResponse) GoString

func (this *LockResponse) GoString() string

func (*LockResponse) Marshal

func (m *LockResponse) Marshal() (dAtA []byte, err error)

func (*LockResponse) MarshalTo

func (m *LockResponse) MarshalTo(dAtA []byte) (int, error)

func (*LockResponse) MarshalToSizedBuffer

func (m *LockResponse) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*LockResponse) ProtoMessage

func (*LockResponse) ProtoMessage()

func (*LockResponse) Reset

func (m *LockResponse) Reset()

func (*LockResponse) Size

func (m *LockResponse) Size() (n int)

func (*LockResponse) String

func (this *LockResponse) String() string

func (*LockResponse) Unmarshal

func (m *LockResponse) Unmarshal(dAtA []byte) error

func (*LockResponse) XXX_DiscardUnknown

func (m *LockResponse) XXX_DiscardUnknown()

func (*LockResponse) XXX_Marshal

func (m *LockResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*LockResponse) XXX_Merge

func (m *LockResponse) XXX_Merge(src proto.Message)

func (*LockResponse) XXX_Size

func (m *LockResponse) XXX_Size() int

func (*LockResponse) XXX_Unmarshal

func (m *LockResponse) XXX_Unmarshal(b []byte) error

type LocketClient

type LocketClient interface {
	Lock(ctx context.Context, in *LockRequest, opts ...grpc.CallOption) (*LockResponse, error)
	Fetch(ctx context.Context, in *FetchRequest, opts ...grpc.CallOption) (*FetchResponse, error)
	Release(ctx context.Context, in *ReleaseRequest, opts ...grpc.CallOption) (*ReleaseResponse, error)
	FetchAll(ctx context.Context, in *FetchAllRequest, opts ...grpc.CallOption) (*FetchAllResponse, error)
}

LocketClient is the client API for Locket service.

For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.

func NewLocketClient

func NewLocketClient(cc *grpc.ClientConn) LocketClient

type LocketServer

LocketServer is the server API for Locket service.

type ReleaseRequest

type ReleaseRequest struct {
	Resource *Resource `protobuf:"bytes,1,opt,name=resource,proto3" json:"resource,omitempty"`
}

func (*ReleaseRequest) Descriptor

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

func (*ReleaseRequest) Equal

func (this *ReleaseRequest) Equal(that interface{}) bool

func (*ReleaseRequest) GetResource

func (m *ReleaseRequest) GetResource() *Resource

func (*ReleaseRequest) GoString

func (this *ReleaseRequest) GoString() string

func (*ReleaseRequest) Marshal

func (m *ReleaseRequest) Marshal() (dAtA []byte, err error)

func (*ReleaseRequest) MarshalTo

func (m *ReleaseRequest) MarshalTo(dAtA []byte) (int, error)

func (*ReleaseRequest) MarshalToSizedBuffer

func (m *ReleaseRequest) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*ReleaseRequest) ProtoMessage

func (*ReleaseRequest) ProtoMessage()

func (*ReleaseRequest) Reset

func (m *ReleaseRequest) Reset()

func (*ReleaseRequest) Size

func (m *ReleaseRequest) Size() (n int)

func (*ReleaseRequest) String

func (this *ReleaseRequest) String() string

func (*ReleaseRequest) Unmarshal

func (m *ReleaseRequest) Unmarshal(dAtA []byte) error

func (*ReleaseRequest) XXX_DiscardUnknown

func (m *ReleaseRequest) XXX_DiscardUnknown()

func (*ReleaseRequest) XXX_Marshal

func (m *ReleaseRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*ReleaseRequest) XXX_Merge

func (m *ReleaseRequest) XXX_Merge(src proto.Message)

func (*ReleaseRequest) XXX_Size

func (m *ReleaseRequest) XXX_Size() int

func (*ReleaseRequest) XXX_Unmarshal

func (m *ReleaseRequest) XXX_Unmarshal(b []byte) error

type ReleaseResponse

type ReleaseResponse struct {
}

func (*ReleaseResponse) Descriptor

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

func (*ReleaseResponse) Equal

func (this *ReleaseResponse) Equal(that interface{}) bool

func (*ReleaseResponse) GoString

func (this *ReleaseResponse) GoString() string

func (*ReleaseResponse) Marshal

func (m *ReleaseResponse) Marshal() (dAtA []byte, err error)

func (*ReleaseResponse) MarshalTo

func (m *ReleaseResponse) MarshalTo(dAtA []byte) (int, error)

func (*ReleaseResponse) MarshalToSizedBuffer

func (m *ReleaseResponse) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*ReleaseResponse) ProtoMessage

func (*ReleaseResponse) ProtoMessage()

func (*ReleaseResponse) Reset

func (m *ReleaseResponse) Reset()

func (*ReleaseResponse) Size

func (m *ReleaseResponse) Size() (n int)

func (*ReleaseResponse) String

func (this *ReleaseResponse) String() string

func (*ReleaseResponse) Unmarshal

func (m *ReleaseResponse) Unmarshal(dAtA []byte) error

func (*ReleaseResponse) XXX_DiscardUnknown

func (m *ReleaseResponse) XXX_DiscardUnknown()

func (*ReleaseResponse) XXX_Marshal

func (m *ReleaseResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*ReleaseResponse) XXX_Merge

func (m *ReleaseResponse) XXX_Merge(src proto.Message)

func (*ReleaseResponse) XXX_Size

func (m *ReleaseResponse) XXX_Size() int

func (*ReleaseResponse) XXX_Unmarshal

func (m *ReleaseResponse) XXX_Unmarshal(b []byte) error

type Resource

type Resource struct {
	Key      string   `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"`
	Owner    string   `protobuf:"bytes,2,opt,name=owner,proto3" json:"owner,omitempty"`
	Value    string   `protobuf:"bytes,3,opt,name=value,proto3" json:"value,omitempty"`
	Type     string   `protobuf:"bytes,4,opt,name=type,proto3" json:"type,omitempty"` // Deprecated: Do not use.
	TypeCode TypeCode `protobuf:"varint,5,opt,name=type_code,json=typeCode,proto3,enum=models.TypeCode" json:"type_code,omitempty"`
}

func GetResource

func GetResource(resource *Resource) *Resource

func (*Resource) Descriptor

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

func (*Resource) Equal

func (this *Resource) Equal(that interface{}) bool

func (*Resource) GetKey

func (m *Resource) GetKey() string

func (*Resource) GetOwner

func (m *Resource) GetOwner() string

func (*Resource) GetType deprecated

func (m *Resource) GetType() string

Deprecated: Do not use.

func (*Resource) GetTypeCode

func (m *Resource) GetTypeCode() TypeCode

func (*Resource) GetValue

func (m *Resource) GetValue() string

func (*Resource) GoString

func (this *Resource) GoString() string

func (*Resource) Marshal

func (m *Resource) Marshal() (dAtA []byte, err error)

func (*Resource) MarshalTo

func (m *Resource) MarshalTo(dAtA []byte) (int, error)

func (*Resource) MarshalToSizedBuffer

func (m *Resource) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*Resource) ProtoMessage

func (*Resource) ProtoMessage()

func (*Resource) Reset

func (m *Resource) Reset()

func (*Resource) Size

func (m *Resource) Size() (n int)

func (*Resource) String

func (this *Resource) String() string

func (*Resource) Unmarshal

func (m *Resource) Unmarshal(dAtA []byte) error

func (*Resource) XXX_DiscardUnknown

func (m *Resource) XXX_DiscardUnknown()

func (*Resource) XXX_Marshal

func (m *Resource) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*Resource) XXX_Merge

func (m *Resource) XXX_Merge(src proto.Message)

func (*Resource) XXX_Size

func (m *Resource) XXX_Size() int

func (*Resource) XXX_Unmarshal

func (m *Resource) XXX_Unmarshal(b []byte) error

type TypeCode

type TypeCode int32
const (
	UNKNOWN  TypeCode = 0
	LOCK     TypeCode = 1
	PRESENCE TypeCode = 2
)

func GetTypeCode

func GetTypeCode(lockType string) TypeCode

func (TypeCode) EnumDescriptor

func (TypeCode) EnumDescriptor() ([]byte, []int)

func (TypeCode) String

func (x TypeCode) String() string

type UnimplementedLocketServer

type UnimplementedLocketServer struct {
}

UnimplementedLocketServer can be embedded to have forward compatible implementations.

func (*UnimplementedLocketServer) Fetch

func (*UnimplementedLocketServer) FetchAll

func (*UnimplementedLocketServer) Lock

func (*UnimplementedLocketServer) Release

Directories

Path Synopsis
Code generated by counterfeiter.
Code generated by counterfeiter.

Jump to

Keyboard shortcuts

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