v1

package
v0.0.0-...-78e288f Latest Latest
Warning

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

Go to latest
Published: May 4, 2024 License: MIT Imports: 19 Imported by: 0

Documentation

Index

Constants

View Source
const (
	LinkService_Get_FullMethodName    = "/infrastructure.rpc.link.v1.LinkService/Get"
	LinkService_List_FullMethodName   = "/infrastructure.rpc.link.v1.LinkService/List"
	LinkService_Add_FullMethodName    = "/infrastructure.rpc.link.v1.LinkService/Add"
	LinkService_Update_FullMethodName = "/infrastructure.rpc.link.v1.LinkService/Update"
	LinkService_Delete_FullMethodName = "/infrastructure.rpc.link.v1.LinkService/Delete"
)

Variables

View Source
var ErrEmptyPayload = errors.New("error empty payload")
View Source
var ErrParsePayloadAsString = errors.New("error parse payload as string")
View Source
var File_infrastructure_rpc_link_v1_link_rpc_proto protoreflect.FileDescriptor
View Source
var LinkService_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "infrastructure.rpc.link.v1.LinkService",
	HandlerType: (*LinkServiceServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "Get",
			Handler:    _LinkService_Get_Handler,
		},
		{
			MethodName: "List",
			Handler:    _LinkService_List_Handler,
		},
		{
			MethodName: "Add",
			Handler:    _LinkService_Add_Handler,
		},
		{
			MethodName: "Update",
			Handler:    _LinkService_Update_Handler,
		},
		{
			MethodName: "Delete",
			Handler:    _LinkService_Delete_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "infrastructure/rpc/link/v1/link_rpc.proto",
}

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

Functions

func RegisterLinkServiceServer

func RegisterLinkServiceServer(s grpc.ServiceRegistrar, srv LinkServiceServer)

Types

type AddRequest

type AddRequest struct {

	// Link is the link.
	Link *Link `protobuf:"bytes,1,opt,name=link,proto3" json:"link,omitempty"`
	// contains filtered or unexported fields
}

AddRequest is the request message for LinkService.Add.

func (*AddRequest) Descriptor deprecated

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

Deprecated: Use AddRequest.ProtoReflect.Descriptor instead.

func (x *AddRequest) GetLink() *Link

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

func (*AddRequest) ToEntity

func (in *AddRequest) ToEntity() (*domain.Link, error)

type AddResponse

type AddResponse struct {

	// Link is the link.
	Link *Link `protobuf:"bytes,1,opt,name=link,proto3" json:"link,omitempty"`
	// contains filtered or unexported fields
}

AddResponse is the response message for LinkService.Add.

func (*AddResponse) Descriptor deprecated

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

Deprecated: Use AddResponse.ProtoReflect.Descriptor instead.

func (x *AddResponse) GetLink() *Link

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 DeleteRequest

type DeleteRequest struct {

	// Hash is the hash of the link.
	Hash string `protobuf:"bytes,1,opt,name=hash,proto3" json:"hash,omitempty"`
	// contains filtered or unexported fields
}

DeleteRequest is the request message for LinkService.Delete.

func (*DeleteRequest) Descriptor deprecated

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

Deprecated: Use DeleteRequest.ProtoReflect.Descriptor instead.

func (*DeleteRequest) GetHash

func (x *DeleteRequest) GetHash() string

func (*DeleteRequest) ProtoMessage

func (*DeleteRequest) ProtoMessage()

func (*DeleteRequest) ProtoReflect

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

func (*DeleteRequest) Reset

func (x *DeleteRequest) Reset()

func (*DeleteRequest) String

func (x *DeleteRequest) String() string

type GetRequest

type GetRequest struct {

	// Hash is the hash of the link.
	Hash string `protobuf:"bytes,1,opt,name=hash,proto3" json:"hash,omitempty"`
	// contains filtered or unexported fields
}

GetRequest is the request message for LinkService.Get.

func (*GetRequest) Descriptor deprecated

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

Deprecated: Use GetRequest.ProtoReflect.Descriptor instead.

func (*GetRequest) GetHash

func (x *GetRequest) GetHash() string

func (*GetRequest) ProtoMessage

func (*GetRequest) ProtoMessage()

func (*GetRequest) ProtoReflect

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

func (*GetRequest) Reset

func (x *GetRequest) Reset()

func (*GetRequest) String

func (x *GetRequest) String() string

type GetResponse

type GetResponse struct {

	// Link is the link.
	Link *Link `protobuf:"bytes,1,opt,name=link,proto3" json:"link,omitempty"`
	// contains filtered or unexported fields
}

GetResponse is the response message for LinkService.Get.

func (*GetResponse) Descriptor deprecated

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

Deprecated: Use GetResponse.ProtoReflect.Descriptor instead.

func (x *GetResponse) GetLink() *Link

func (*GetResponse) ProtoMessage

func (*GetResponse) ProtoMessage()

func (*GetResponse) ProtoReflect

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

func (*GetResponse) Reset

func (x *GetResponse) Reset()

func (*GetResponse) String

func (x *GetResponse) String() string
type Link struct {

	// Field mask
	FieldMask *fieldmaskpb.FieldMask `protobuf:"bytes,6,opt,name=field_mask,json=fieldMask,proto3" json:"field_mask,omitempty"`
	// URL
	Url string `protobuf:"bytes,1,opt,name=url,proto3" json:"url,omitempty"`
	// Hash by URL + salt
	Hash string `protobuf:"bytes,2,opt,name=hash,proto3" json:"hash,omitempty"`
	// Describe of link
	Describe string `protobuf:"bytes,3,opt,name=describe,proto3" json:"describe,omitempty"`
	// Create at
	CreatedAt *timestamppb.Timestamp `protobuf:"bytes,4,opt,name=created_at,json=createdAt,proto3" json:"created_at,omitempty"`
	// Update at
	UpdatedAt *timestamppb.Timestamp `protobuf:"bytes,5,opt,name=updated_at,json=updatedAt,proto3" json:"updated_at,omitempty"`
	// contains filtered or unexported fields
}

Link

func (*Link) Descriptor deprecated

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

Deprecated: Use Link.ProtoReflect.Descriptor instead.

func (*Link) GetCreatedAt

func (x *Link) GetCreatedAt() *timestamppb.Timestamp

func (*Link) GetDescribe

func (x *Link) GetDescribe() string

func (*Link) GetFieldMask

func (x *Link) GetFieldMask() *fieldmaskpb.FieldMask

func (*Link) GetHash

func (x *Link) GetHash() string

func (*Link) GetUpdatedAt

func (x *Link) GetUpdatedAt() *timestamppb.Timestamp

func (*Link) GetUrl

func (x *Link) GetUrl() string

func (*Link) ProtoMessage

func (*Link) ProtoMessage()

func (*Link) ProtoReflect

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

func (*Link) Reset

func (x *Link) Reset()

func (*Link) String

func (x *Link) String() string

type LinkRPC

type LinkRPC struct {
	LinkServiceServer
	// contains filtered or unexported fields
}

func New

func New(runRPCServer *rpc.Server, application *link_application.UC, log logger.Logger) (*LinkRPC, error)

func (*LinkRPC) Add

func (l *LinkRPC) Add(ctx context.Context, in *AddRequest) (*AddResponse, error)

func (*LinkRPC) Delete

func (l *LinkRPC) Delete(ctx context.Context, in *DeleteRequest) (*emptypb.Empty, error)

func (*LinkRPC) Get

func (l *LinkRPC) Get(ctx context.Context, in *GetRequest) (*GetResponse, error)

func (*LinkRPC) List

func (l *LinkRPC) List(ctx context.Context, in *ListRequest) (*ListResponse, error)

func (*LinkRPC) Update

func (l *LinkRPC) Update(ctx context.Context, in *UpdateRequest) (*UpdateResponse, error)

type LinkServiceClient

type LinkServiceClient interface {
	// Get returns a link by hash.
	Get(ctx context.Context, in *GetRequest, opts ...grpc.CallOption) (*GetResponse, error)
	// List returns a list of links.
	List(ctx context.Context, in *ListRequest, opts ...grpc.CallOption) (*ListResponse, error)
	// Add adds a link.
	Add(ctx context.Context, in *AddRequest, opts ...grpc.CallOption) (*AddResponse, error)
	// Update updates a link.
	Update(ctx context.Context, in *UpdateRequest, opts ...grpc.CallOption) (*UpdateResponse, error)
	// Delete deletes a link by hash.
	Delete(ctx context.Context, in *DeleteRequest, opts ...grpc.CallOption) (*emptypb.Empty, error)
}

LinkServiceClient is the client API for LinkService 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 LinkServiceServer

type LinkServiceServer interface {
	// Get returns a link by hash.
	Get(context.Context, *GetRequest) (*GetResponse, error)
	// List returns a list of links.
	List(context.Context, *ListRequest) (*ListResponse, error)
	// Add adds a link.
	Add(context.Context, *AddRequest) (*AddResponse, error)
	// Update updates a link.
	Update(context.Context, *UpdateRequest) (*UpdateResponse, error)
	// Delete deletes a link by hash.
	Delete(context.Context, *DeleteRequest) (*emptypb.Empty, error)
	// contains filtered or unexported methods
}

LinkServiceServer is the server API for LinkService service. All implementations must embed UnimplementedLinkServiceServer for forward compatibility

type Links struct {

	// Links
	Link []*Link `protobuf:"bytes,1,rep,name=link,proto3" json:"link,omitempty"`
	// contains filtered or unexported fields
}

Link list

func (*Links) Descriptor deprecated

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

Deprecated: Use Links.ProtoReflect.Descriptor instead.

func (x *Links) GetLink() []*Link

func (*Links) ProtoMessage

func (*Links) ProtoMessage()

func (*Links) ProtoReflect

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

func (*Links) Reset

func (x *Links) Reset()

func (*Links) String

func (x *Links) String() string

type ListRequest

type ListRequest struct {

	// Filter is the filter of the list.
	Filter string `protobuf:"bytes,1,opt,name=filter,proto3" json:"filter,omitempty"`
	// Limit is the limit of the list.
	Limit uint32 `protobuf:"varint,2,opt,name=limit,proto3" json:"limit,omitempty"`
	// Cursor is the token of the list.
	Cursor string `protobuf:"bytes,3,opt,name=cursor,proto3" json:"cursor,omitempty"`
	// contains filtered or unexported fields
}

ListRequest is the request message for LinkService.List.

func (*ListRequest) Descriptor deprecated

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

Deprecated: Use ListRequest.ProtoReflect.Descriptor instead.

func (*ListRequest) GetCursor

func (x *ListRequest) GetCursor() string

func (*ListRequest) GetFilter

func (x *ListRequest) GetFilter() string

func (*ListRequest) GetLimit

func (x *ListRequest) GetLimit() uint32

func (*ListRequest) ProtoMessage

func (*ListRequest) ProtoMessage()

func (*ListRequest) ProtoReflect

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

func (*ListRequest) Reset

func (x *ListRequest) Reset()

func (*ListRequest) String

func (x *ListRequest) String() string

type ListResponse

type ListResponse struct {

	// Links is the list of links.
	Links *Links `protobuf:"bytes,1,opt,name=links,proto3" json:"links,omitempty"`
	// Cursor is the next token of the list.
	Cursor string `protobuf:"bytes,2,opt,name=cursor,proto3" json:"cursor,omitempty"`
	// contains filtered or unexported fields
}

ListResponse is the response message for LinkService.List.

func (*ListResponse) Descriptor deprecated

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

Deprecated: Use ListResponse.ProtoReflect.Descriptor instead.

func (*ListResponse) GetCursor

func (x *ListResponse) GetCursor() string
func (x *ListResponse) GetLinks() *Links

func (*ListResponse) ProtoMessage

func (*ListResponse) ProtoMessage()

func (*ListResponse) ProtoReflect

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

func (*ListResponse) Reset

func (x *ListResponse) Reset()

func (*ListResponse) String

func (x *ListResponse) String() string

type UnimplementedLinkServiceServer

type UnimplementedLinkServiceServer struct {
}

UnimplementedLinkServiceServer must be embedded to have forward compatible implementations.

func (UnimplementedLinkServiceServer) Add

func (UnimplementedLinkServiceServer) Delete

func (UnimplementedLinkServiceServer) Get

func (UnimplementedLinkServiceServer) List

func (UnimplementedLinkServiceServer) Update

type UnsafeLinkServiceServer

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

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

type UpdateRequest

type UpdateRequest struct {

	// Link is the link.
	Link *Link `protobuf:"bytes,1,opt,name=link,proto3" json:"link,omitempty"`
	// contains filtered or unexported fields
}

UpdateRequest is the request message for LinkService.Update.

func (*UpdateRequest) Descriptor deprecated

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

Deprecated: Use UpdateRequest.ProtoReflect.Descriptor instead.

func (x *UpdateRequest) GetLink() *Link

func (*UpdateRequest) ProtoMessage

func (*UpdateRequest) ProtoMessage()

func (*UpdateRequest) ProtoReflect

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

func (*UpdateRequest) Reset

func (x *UpdateRequest) Reset()

func (*UpdateRequest) String

func (x *UpdateRequest) String() string

type UpdateResponse

type UpdateResponse struct {

	// Link is the link.
	Link *Link `protobuf:"bytes,1,opt,name=link,proto3" json:"link,omitempty"`
	// contains filtered or unexported fields
}

UpdateResponse is the response message for LinkService.Update.

func (*UpdateResponse) Descriptor deprecated

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

Deprecated: Use UpdateResponse.ProtoReflect.Descriptor instead.

func (x *UpdateResponse) GetLink() *Link

func (*UpdateResponse) ProtoMessage

func (*UpdateResponse) ProtoMessage()

func (*UpdateResponse) ProtoReflect

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

func (*UpdateResponse) Reset

func (x *UpdateResponse) Reset()

func (*UpdateResponse) String

func (x *UpdateResponse) String() string

Jump to

Keyboard shortcuts

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