id

package
v1.7.0 Latest Latest
Warning

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

Go to latest
Published: Aug 31, 2023 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var File_proto_id_proto protoreflect.FileDescriptor

Functions

func NewIdEndpoints

func NewIdEndpoints() []*api.Endpoint

func RegisterIdHandler

func RegisterIdHandler(s server.Server, hdlr IdHandler, opts ...server.HandlerOption) error

Types

type GenerateRequest

type GenerateRequest struct {

	// type of id e.g uuid, shortid, snowflake (64 bit), bigflake (128 bit)
	Type string `protobuf:"bytes,1,opt,name=type,proto3" json:"type,omitempty"`
	// contains filtered or unexported fields
}

Generate a unique ID. Defaults to uuid.

func (*GenerateRequest) Descriptor deprecated

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

Deprecated: Use GenerateRequest.ProtoReflect.Descriptor instead.

func (*GenerateRequest) GetType

func (x *GenerateRequest) GetType() string

func (*GenerateRequest) ProtoMessage

func (*GenerateRequest) ProtoMessage()

func (*GenerateRequest) ProtoReflect

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

func (*GenerateRequest) Reset

func (x *GenerateRequest) Reset()

func (*GenerateRequest) String

func (x *GenerateRequest) String() string

type GenerateResponse

type GenerateResponse struct {

	// the unique id generated
	Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
	// the type of id generated
	Type string `protobuf:"bytes,2,opt,name=type,proto3" json:"type,omitempty"`
	// contains filtered or unexported fields
}

func (*GenerateResponse) Descriptor deprecated

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

Deprecated: Use GenerateResponse.ProtoReflect.Descriptor instead.

func (*GenerateResponse) GetId

func (x *GenerateResponse) GetId() string

func (*GenerateResponse) GetType

func (x *GenerateResponse) GetType() string

func (*GenerateResponse) ProtoMessage

func (*GenerateResponse) ProtoMessage()

func (*GenerateResponse) ProtoReflect

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

func (*GenerateResponse) Reset

func (x *GenerateResponse) Reset()

func (*GenerateResponse) String

func (x *GenerateResponse) String() string

type IdHandler

type IdHandler interface {
	Generate(context.Context, *GenerateRequest, *GenerateResponse) error
	Types(context.Context, *TypesRequest, *TypesResponse) error
}

type IdService

type IdService interface {
	Generate(ctx context.Context, in *GenerateRequest, opts ...client.CallOption) (*GenerateResponse, error)
	Types(ctx context.Context, in *TypesRequest, opts ...client.CallOption) (*TypesResponse, error)
}

func NewIdService

func NewIdService(name string, c client.Client) IdService

type TypesRequest

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

List the types of IDs available. No query params needed.

func (*TypesRequest) Descriptor deprecated

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

Deprecated: Use TypesRequest.ProtoReflect.Descriptor instead.

func (*TypesRequest) ProtoMessage

func (*TypesRequest) ProtoMessage()

func (*TypesRequest) ProtoReflect

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

func (*TypesRequest) Reset

func (x *TypesRequest) Reset()

func (*TypesRequest) String

func (x *TypesRequest) String() string

type TypesResponse

type TypesResponse struct {
	Types []string `protobuf:"bytes,1,rep,name=types,proto3" json:"types,omitempty"`
	// contains filtered or unexported fields
}

func (*TypesResponse) Descriptor deprecated

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

Deprecated: Use TypesResponse.ProtoReflect.Descriptor instead.

func (*TypesResponse) GetTypes

func (x *TypesResponse) GetTypes() []string

func (*TypesResponse) ProtoMessage

func (*TypesResponse) ProtoMessage()

func (*TypesResponse) ProtoReflect

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

func (*TypesResponse) Reset

func (x *TypesResponse) Reset()

func (*TypesResponse) String

func (x *TypesResponse) String() string

Jump to

Keyboard shortcuts

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