pb

package
v0.0.0-...-f3969ab Latest Latest
Warning

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

Go to latest
Published: Apr 29, 2023 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	RecordStatus_name = map[int32]string{
		0: "NORMAL",
		1: "EXPIRED",
		2: "NOTFOUND",
	}
	RecordStatus_value = map[string]int32{
		"NORMAL":   0,
		"EXPIRED":  1,
		"NOTFOUND": 2,
	}
)

Enum value maps for RecordStatus.

View Source
var File_service_proto protoreflect.FileDescriptor
View Source
var RecordService_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "pb.RecordService",
	HandlerType: (*RecordServiceServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "CreateRecord",
			Handler:    _RecordService_CreateRecord_Handler,
		},
		{
			MethodName: "GetOriginUrl",
			Handler:    _RecordService_GetOriginUrl_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "service.proto",
}

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

Functions

func RegisterRecordServiceServer

func RegisterRecordServiceServer(s grpc.ServiceRegistrar, srv RecordServiceServer)

Types

type CreateRecordRequest

type CreateRecordRequest struct {
	OriginUrl string                 `protobuf:"bytes,1,opt,name=origin_url,json=originUrl,proto3" json:"origin_url,omitempty"`
	ExpireAt  *timestamppb.Timestamp `protobuf:"bytes,2,opt,name=expireAt,proto3" json:"expireAt,omitempty"`
	// contains filtered or unexported fields
}

func (*CreateRecordRequest) Descriptor deprecated

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

Deprecated: Use CreateRecordRequest.ProtoReflect.Descriptor instead.

func (*CreateRecordRequest) GetExpireAt

func (x *CreateRecordRequest) GetExpireAt() *timestamppb.Timestamp

func (*CreateRecordRequest) GetOriginUrl

func (x *CreateRecordRequest) GetOriginUrl() string

func (*CreateRecordRequest) ProtoMessage

func (*CreateRecordRequest) ProtoMessage()

func (*CreateRecordRequest) ProtoReflect

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

func (*CreateRecordRequest) Reset

func (x *CreateRecordRequest) Reset()

func (*CreateRecordRequest) String

func (x *CreateRecordRequest) String() string

type CreateRecordResponse

type CreateRecordResponse struct {
	ShortenedId string `protobuf:"bytes,1,opt,name=shortened_id,json=shortenedId,proto3" json:"shortened_id,omitempty"`
	// contains filtered or unexported fields
}

func (*CreateRecordResponse) Descriptor deprecated

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

Deprecated: Use CreateRecordResponse.ProtoReflect.Descriptor instead.

func (*CreateRecordResponse) GetShortenedId

func (x *CreateRecordResponse) GetShortenedId() string

func (*CreateRecordResponse) ProtoMessage

func (*CreateRecordResponse) ProtoMessage()

func (*CreateRecordResponse) ProtoReflect

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

func (*CreateRecordResponse) Reset

func (x *CreateRecordResponse) Reset()

func (*CreateRecordResponse) String

func (x *CreateRecordResponse) String() string

type GetOriginUrlRequest

type GetOriginUrlRequest struct {
	ShortenedId string `protobuf:"bytes,1,opt,name=shortened_id,json=shortenedId,proto3" json:"shortened_id,omitempty"`
	// contains filtered or unexported fields
}

func (*GetOriginUrlRequest) Descriptor deprecated

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

Deprecated: Use GetOriginUrlRequest.ProtoReflect.Descriptor instead.

func (*GetOriginUrlRequest) GetShortenedId

func (x *GetOriginUrlRequest) GetShortenedId() string

func (*GetOriginUrlRequest) ProtoMessage

func (*GetOriginUrlRequest) ProtoMessage()

func (*GetOriginUrlRequest) ProtoReflect

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

func (*GetOriginUrlRequest) Reset

func (x *GetOriginUrlRequest) Reset()

func (*GetOriginUrlRequest) String

func (x *GetOriginUrlRequest) String() string

type GetOriginUrlResponse

type GetOriginUrlResponse struct {
	OriginUrl string       `protobuf:"bytes,1,opt,name=origin_url,json=originUrl,proto3" json:"origin_url,omitempty"`
	Status    RecordStatus `protobuf:"varint,2,opt,name=status,proto3,enum=pb.RecordStatus" json:"status,omitempty"`
	// contains filtered or unexported fields
}

func (*GetOriginUrlResponse) Descriptor deprecated

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

Deprecated: Use GetOriginUrlResponse.ProtoReflect.Descriptor instead.

func (*GetOriginUrlResponse) GetOriginUrl

func (x *GetOriginUrlResponse) GetOriginUrl() string

func (*GetOriginUrlResponse) GetStatus

func (x *GetOriginUrlResponse) GetStatus() RecordStatus

func (*GetOriginUrlResponse) ProtoMessage

func (*GetOriginUrlResponse) ProtoMessage()

func (*GetOriginUrlResponse) ProtoReflect

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

func (*GetOriginUrlResponse) Reset

func (x *GetOriginUrlResponse) Reset()

func (*GetOriginUrlResponse) String

func (x *GetOriginUrlResponse) String() string

type RecordServiceClient

type RecordServiceClient interface {
	CreateRecord(ctx context.Context, in *CreateRecordRequest, opts ...grpc.CallOption) (*CreateRecordResponse, error)
	GetOriginUrl(ctx context.Context, in *GetOriginUrlRequest, opts ...grpc.CallOption) (*GetOriginUrlResponse, error)
}

RecordServiceClient is the client API for RecordService 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.

type RecordServiceServer

type RecordServiceServer interface {
	CreateRecord(context.Context, *CreateRecordRequest) (*CreateRecordResponse, error)
	GetOriginUrl(context.Context, *GetOriginUrlRequest) (*GetOriginUrlResponse, error)
	// contains filtered or unexported methods
}

RecordServiceServer is the server API for RecordService service. All implementations must embed UnimplementedRecordServiceServer for forward compatibility

type RecordStatus

type RecordStatus int32
const (
	RecordStatus_NORMAL   RecordStatus = 0
	RecordStatus_EXPIRED  RecordStatus = 1
	RecordStatus_NOTFOUND RecordStatus = 2
)

func (RecordStatus) Descriptor

func (RecordStatus) Enum

func (x RecordStatus) Enum() *RecordStatus

func (RecordStatus) EnumDescriptor deprecated

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

Deprecated: Use RecordStatus.Descriptor instead.

func (RecordStatus) Number

func (RecordStatus) String

func (x RecordStatus) String() string

func (RecordStatus) Type

type UnimplementedRecordServiceServer

type UnimplementedRecordServiceServer struct {
}

UnimplementedRecordServiceServer must be embedded to have forward compatible implementations.

func (UnimplementedRecordServiceServer) CreateRecord

func (UnimplementedRecordServiceServer) GetOriginUrl

type UnsafeRecordServiceServer

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

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

Jump to

Keyboard shortcuts

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