v1

package
v0.0.0-...-36d8597 Latest Latest
Warning

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

Go to latest
Published: Jan 3, 2023 License: MIT Imports: 11 Imported by: 0

Documentation

Overview

Link entity

Index

Constants

View Source
const (
	// MQ_EVENT_LINK_NEW - subscribe on request created link
	MQ_EVENT_LINK_NEW = "shortlink.link.event.new"

	// MQ_EVENT_LINK_CREATED - subscribe on created link
	MQ_EVENT_LINK_CREATED = "shortlink.link.event.created"
)

MQ events

Variables

View Source
var (
	LinkEvent_name = map[int32]string{
		0: "LINK_EVENT_UNSPECIFIED",
		1: "LINK_EVENT_ADD",
		2: "LINK_EVENT_GET",
		3: "LINK_EVENT_LIST",
		4: "LINK_EVENT_UPDATE",
		5: "LINK_EVENT_DELETE",
	}
	LinkEvent_value = map[string]int32{
		"LINK_EVENT_UNSPECIFIED": 0,
		"LINK_EVENT_ADD":         1,
		"LINK_EVENT_GET":         2,
		"LINK_EVENT_LIST":        3,
		"LINK_EVENT_UPDATE":      4,
		"LINK_EVENT_DELETE":      5,
	}
)

Enum value maps for LinkEvent.

View Source
var (
	// METHOD_ADD - new link created
	METHOD_ADD = notify.NewEventID()
	// METHOD_GET - get link
	METHOD_GET = notify.NewEventID()
	// METHOD_LIST - get links
	METHOD_LIST = notify.NewEventID()
	// METHOD_UPDATE - update link
	METHOD_UPDATE = notify.NewEventID()
	// METHOD_DELETE - delete link from system
	METHOD_DELETE = notify.NewEventID()
)

Link CRUD methods

View Source
var File_domain_link_v1_link_proto protoreflect.FileDescriptor

Functions

func CreateHash

func CreateHash(str, secret []byte) string

CreateHash return hash by getting link

func NewHash

func NewHash(url string) string

func NewURL

func NewURL(link *Link) error

NewURL return new link

Types

type Link struct {
	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
}

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 LinkEvent

type LinkEvent int32
const (
	LinkEvent_LINK_EVENT_UNSPECIFIED LinkEvent = 0
	LinkEvent_LINK_EVENT_ADD         LinkEvent = 1
	LinkEvent_LINK_EVENT_GET         LinkEvent = 2
	LinkEvent_LINK_EVENT_LIST        LinkEvent = 3
	LinkEvent_LINK_EVENT_UPDATE      LinkEvent = 4
	LinkEvent_LINK_EVENT_DELETE      LinkEvent = 5
)

func (LinkEvent) Descriptor

func (LinkEvent) Descriptor() protoreflect.EnumDescriptor

func (LinkEvent) Enum

func (x LinkEvent) Enum() *LinkEvent

func (LinkEvent) EnumDescriptor deprecated

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

Deprecated: Use LinkEvent.Descriptor instead.

func (LinkEvent) Number

func (x LinkEvent) Number() protoreflect.EnumNumber

func (LinkEvent) String

func (x LinkEvent) String() string

func (LinkEvent) Type

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

func (*Links) Descriptor deprecated

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

Deprecated: Use Links.ProtoReflect.Descriptor instead.

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

func (*Links) Len

func (l *Links) Len() int

func (*Links) Less

func (l *Links) Less(i, j int) bool

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

func (*Links) Swap

func (l *Links) Swap(i, j int)

type NotFoundError

type NotFoundError struct {
	Link *Link
	Err  error
}

NotFoundError - not found link

func (*NotFoundError) Error

func (e *NotFoundError) Error() string

type NotUniqError

type NotUniqError struct {
	Link *Link
	Err  error
}

func (*NotUniqError) Error

func (e *NotUniqError) Error() string

Jump to

Keyboard shortcuts

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