mirror of
https://github.com/anyproto/anytype-heart.git
synced 2025-06-09 17:44:59 +09:00
parent
319eb5e591
commit
32a9e125d2
11 changed files with 1159 additions and 261 deletions
2
Makefile
2
Makefile
|
@ -16,7 +16,7 @@ lint:
|
|||
golint `go list ./... | grep -v /vendor/`
|
||||
|
||||
test:
|
||||
go test github.com/anytypeio/go-anytype-middleware/core github.com/anytypeio/go-anytype-middleware/lib
|
||||
go test github.com/anytypeio/go-anytype-middleware/...
|
||||
|
||||
build-lib:
|
||||
$(eval FLAGS := $$(shell govvv -flags -pkg github.com/anytypeio/go-anytype-middleware/lib))
|
||||
|
|
|
@ -5,11 +5,18 @@ import (
|
|||
|
||||
libCore "github.com/anytypeio/go-anytype-library/core"
|
||||
"github.com/anytypeio/go-anytype-middleware/pb"
|
||||
"github.com/anytypeio/go-anytype-middleware/util/linkpreview"
|
||||
logging "github.com/ipfs/go-log"
|
||||
)
|
||||
|
||||
var log = logging.Logger("anytype-mw")
|
||||
|
||||
func NewMiddleware() *Middleware {
|
||||
return &Middleware{
|
||||
linkPreview: linkpreview.New(),
|
||||
}
|
||||
}
|
||||
|
||||
type Middleware struct {
|
||||
rootPath string
|
||||
pin string
|
||||
|
@ -17,6 +24,7 @@ type Middleware struct {
|
|||
accountSearchCancel context.CancelFunc
|
||||
localAccounts []*pb.Account
|
||||
SendEvent func(event *pb.Event)
|
||||
linkPreview linkpreview.LinkPreview
|
||||
*libCore.Anytype
|
||||
}
|
||||
|
||||
|
|
29
core/linkpreview.go
Normal file
29
core/linkpreview.go
Normal file
|
@ -0,0 +1,29 @@
|
|||
package core
|
||||
|
||||
import (
|
||||
"context"
|
||||
"time"
|
||||
|
||||
"github.com/anytypeio/go-anytype-middleware/pb"
|
||||
)
|
||||
|
||||
var (
|
||||
linkPreviewTimeout = time.Second * 5
|
||||
)
|
||||
|
||||
func (mw *Middleware) LinkPreview(req *pb.LinkPreviewRequest) *pb.LinkPreviewResponse {
|
||||
ctx, cancel := context.WithTimeout(context.Background(), linkPreviewTimeout)
|
||||
defer cancel()
|
||||
resp, err := mw.linkPreview.Fetch(ctx, req.Url)
|
||||
if err != nil {
|
||||
if err == context.DeadlineExceeded {
|
||||
return &pb.LinkPreviewResponse{Error: &pb.LinkPreviewResponse_Error{
|
||||
Code: pb.LinkPreviewResponse_Error_TIMEOUT,
|
||||
}}
|
||||
}
|
||||
return &pb.LinkPreviewResponse{Error: &pb.LinkPreviewResponse_Error{
|
||||
Code: pb.LinkPreviewResponse_Error_UNKNOWN_ERROR,
|
||||
}}
|
||||
}
|
||||
return &resp
|
||||
}
|
|
@ -10,7 +10,7 @@ import (
|
|||
|
||||
var log = logging.Logger("anytype-mw")
|
||||
|
||||
var mw = &core.Middleware{}
|
||||
var mw = core.NewMiddleware()
|
||||
|
||||
func init() {
|
||||
registerClientCommandsHandler(mw)
|
||||
|
|
|
@ -24,30 +24,31 @@ const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package
|
|||
func init() { proto.RegisterFile("service.proto", fileDescriptor_a0b84a42fa06f626) }
|
||||
|
||||
var fileDescriptor_a0b84a42fa06f626 = []byte{
|
||||
// 367 bytes of a gzipped FileDescriptorProto
|
||||
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x74, 0x93, 0xcf, 0x4e, 0xfa, 0x40,
|
||||
0x10, 0xc7, 0x21, 0xbf, 0x04, 0xf2, 0x5b, 0xfe, 0x1c, 0xf6, 0xa2, 0x16, 0x58, 0xdf, 0x80, 0x83,
|
||||
0x5e, 0xbd, 0x58, 0x62, 0xd0, 0x60, 0x34, 0x42, 0xd4, 0xc4, 0x5b, 0x5b, 0x46, 0xd2, 0xb8, 0xdd,
|
||||
0xad, 0xdd, 0x85, 0x84, 0xb7, 0xf0, 0xb1, 0x8c, 0x27, 0x8e, 0x1e, 0x0d, 0xbc, 0x88, 0x91, 0x9d,
|
||||
0x2d, 0x94, 0xb6, 0xb7, 0xed, 0xf7, 0x33, 0xf3, 0x69, 0x27, 0xd3, 0x25, 0x2d, 0x05, 0xc9, 0x22,
|
||||
0x0c, 0xa0, 0x1f, 0x27, 0x52, 0x4b, 0x5a, 0xf7, 0xc4, 0x52, 0x2f, 0x63, 0x70, 0x5a, 0x5e, 0x10,
|
||||
0xc8, 0xb9, 0xd0, 0x26, 0x77, 0xc8, 0x6b, 0xc8, 0xc1, 0x9e, 0xa3, 0x50, 0x05, 0x78, 0x6e, 0xf8,
|
||||
0x5c, 0x06, 0x6f, 0xe6, 0xe1, 0xec, 0xab, 0x46, 0xda, 0x03, 0x1e, 0x82, 0xd0, 0x03, 0x19, 0x45,
|
||||
0x9e, 0x98, 0x2a, 0x3a, 0x22, 0xcd, 0x67, 0x8f, 0x73, 0xd0, 0x83, 0x04, 0x3c, 0x0d, 0xb4, 0xdb,
|
||||
0xc7, 0x17, 0xf4, 0xf7, 0xe3, 0x31, 0xbc, 0xcf, 0x41, 0x69, 0xa7, 0x57, 0x42, 0x55, 0x2c, 0x85,
|
||||
0x02, 0x7a, 0x47, 0x5a, 0x26, 0x1f, 0x43, 0x20, 0x17, 0x90, 0xd0, 0xc3, 0x7a, 0xcc, 0xad, 0x8e,
|
||||
0x95, 0x61, 0xf4, 0x3d, 0x90, 0xf6, 0xa5, 0x99, 0xd2, 0x0a, 0x77, 0x1d, 0x59, 0x60, 0x8d, 0xa7,
|
||||
0xa5, 0x7c, 0xf7, 0x89, 0x48, 0x70, 0xe0, 0xde, 0x61, 0x47, 0x76, 0x62, 0x56, 0x86, 0x73, 0xbe,
|
||||
0x09, 0x70, 0x08, 0x74, 0xde, 0x67, 0xf2, 0x52, 0x9f, 0xc5, 0xe8, 0x1b, 0x91, 0xe6, 0x4d, 0xe4,
|
||||
0xcd, 0x60, 0x08, 0xda, 0xe5, 0xd2, 0xdf, 0xdb, 0xc7, 0x7e, 0x9c, 0xdf, 0x47, 0x96, 0xa2, 0xec,
|
||||
0x8a, 0x90, 0x27, 0x48, 0x54, 0x28, 0xc5, 0x10, 0x34, 0x75, 0xd2, 0xe2, 0x5d, 0x68, 0x45, 0x9d,
|
||||
0x42, 0x86, 0x9a, 0x0b, 0x52, 0xbf, 0x95, 0xb3, 0x09, 0x88, 0x29, 0x3d, 0x4a, 0xeb, 0x30, 0xb1,
|
||||
0x82, 0xe3, 0x3c, 0xc0, 0x6e, 0x97, 0xfc, 0x77, 0xff, 0xfe, 0xc1, 0xfb, 0x18, 0x04, 0x3d, 0x49,
|
||||
0xcb, 0xd2, 0xcc, 0x1a, 0x9c, 0x22, 0x84, 0x8e, 0x6b, 0xd2, 0xd8, 0x86, 0xb8, 0xb3, 0x4e, 0xb6,
|
||||
0x34, 0xbb, 0xb1, 0x6e, 0x31, 0x3c, 0x30, 0x3d, 0xc6, 0xd3, 0x02, 0x93, 0x49, 0x4b, 0x4c, 0x16,
|
||||
0x1a, 0x93, 0xdb, 0xfb, 0x5c, 0xb3, 0xea, 0x6a, 0xcd, 0xaa, 0x3f, 0x6b, 0x56, 0xfd, 0xd8, 0xb0,
|
||||
0xca, 0x6a, 0xc3, 0x2a, 0xdf, 0x1b, 0x56, 0x79, 0xf9, 0xc7, 0x43, 0xdf, 0xaf, 0x6d, 0xaf, 0xdc,
|
||||
0xf9, 0x6f, 0x00, 0x00, 0x00, 0xff, 0xff, 0xe1, 0x87, 0x48, 0xbc, 0xc0, 0x03, 0x00, 0x00,
|
||||
// 383 bytes of a gzipped FileDescriptorProto
|
||||
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x74, 0x93, 0xcb, 0x4e, 0xc2, 0x40,
|
||||
0x14, 0x86, 0x21, 0x26, 0x12, 0x87, 0xcb, 0x62, 0x36, 0x6a, 0x81, 0xf1, 0x0d, 0x58, 0xe8, 0xd6,
|
||||
0x8d, 0x25, 0x06, 0x0d, 0xc4, 0x0b, 0x44, 0x4d, 0xdc, 0xb5, 0xe5, 0x48, 0x26, 0x4c, 0x67, 0x6a,
|
||||
0x3b, 0x60, 0x78, 0x0b, 0x17, 0x3e, 0x94, 0x4b, 0x96, 0x2e, 0x0d, 0xbc, 0x88, 0x91, 0x99, 0xe9,
|
||||
0x85, 0xb6, 0xbb, 0xe9, 0xff, 0x9d, 0xf3, 0xb5, 0x27, 0xa7, 0x83, 0x9a, 0x11, 0x84, 0x4b, 0xea,
|
||||
0x41, 0x2f, 0x08, 0x85, 0x14, 0xb8, 0xe6, 0xf0, 0x95, 0x5c, 0x05, 0x60, 0x35, 0x1d, 0xcf, 0x13,
|
||||
0x0b, 0x2e, 0x55, 0x6e, 0xa1, 0x37, 0xca, 0xc0, 0x9c, 0x7d, 0x1a, 0x79, 0xfa, 0x5c, 0x77, 0x99,
|
||||
0xf0, 0xe6, 0xea, 0xe1, 0xfc, 0xab, 0x86, 0x5a, 0x7d, 0x46, 0x81, 0xcb, 0xbe, 0xf0, 0x7d, 0x87,
|
||||
0x4f, 0x23, 0x3c, 0x44, 0x8d, 0x17, 0x87, 0x31, 0x90, 0xfd, 0x10, 0x1c, 0x09, 0xb8, 0xd3, 0xd3,
|
||||
0x2f, 0xe8, 0xa5, 0xe3, 0x31, 0xbc, 0x2f, 0x20, 0x92, 0x56, 0xb7, 0x84, 0x46, 0x81, 0xe0, 0x11,
|
||||
0xe0, 0x3b, 0xd4, 0x54, 0xf9, 0x18, 0x3c, 0xb1, 0x84, 0x10, 0xef, 0xd7, 0xeb, 0xdc, 0xe8, 0x48,
|
||||
0x19, 0xd6, 0xbe, 0x47, 0xd4, 0xba, 0x52, 0x53, 0x1a, 0x61, 0xd2, 0x91, 0x05, 0xc6, 0x78, 0x56,
|
||||
0xca, 0x93, 0x4f, 0xd4, 0x44, 0x0f, 0xdc, 0xdd, 0xef, 0xc8, 0x4e, 0x4c, 0xca, 0x70, 0xce, 0x37,
|
||||
0x01, 0x06, 0x9e, 0xcc, 0xfb, 0x54, 0x5e, 0xea, 0x33, 0x58, 0xfb, 0x86, 0xa8, 0x71, 0xeb, 0x3b,
|
||||
0x33, 0x18, 0x80, 0xb4, 0x99, 0x70, 0x53, 0xfb, 0x48, 0xc7, 0xf9, 0x7d, 0x64, 0xa9, 0x96, 0x5d,
|
||||
0x23, 0xf4, 0x0c, 0x61, 0x44, 0x05, 0x1f, 0x80, 0xc4, 0x56, 0x5c, 0x9c, 0x84, 0x46, 0xd4, 0x2e,
|
||||
0x64, 0x5a, 0x73, 0x89, 0x6a, 0x23, 0x31, 0x9b, 0x00, 0x9f, 0xe2, 0xe3, 0xb8, 0x4e, 0x27, 0x46,
|
||||
0x70, 0x92, 0x07, 0xba, 0xdb, 0x46, 0x47, 0xf6, 0xff, 0x3f, 0x78, 0x1f, 0x00, 0xc7, 0xa7, 0x71,
|
||||
0x59, 0x9c, 0x19, 0x83, 0x55, 0x84, 0xb4, 0xe3, 0x06, 0xd5, 0x77, 0xa1, 0xde, 0x59, 0x3b, 0x5b,
|
||||
0x9a, 0xdd, 0x58, 0xa7, 0x18, 0xee, 0x99, 0x9e, 0x82, 0x69, 0x81, 0x49, 0xa5, 0x25, 0x26, 0x03,
|
||||
0x13, 0xd3, 0x88, 0xf2, 0xf9, 0x43, 0x08, 0x4b, 0x0a, 0x1f, 0x29, 0x53, 0x2a, 0xcd, 0x9b, 0x32,
|
||||
0x50, 0x99, 0xec, 0xee, 0xf7, 0x86, 0x54, 0xd7, 0x1b, 0x52, 0xfd, 0xdd, 0x90, 0xea, 0xe7, 0x96,
|
||||
0x54, 0xd6, 0x5b, 0x52, 0xf9, 0xd9, 0x92, 0xca, 0xeb, 0x01, 0xa3, 0xae, 0x7b, 0xb8, 0xbb, 0xbc,
|
||||
0x17, 0x7f, 0x01, 0x00, 0x00, 0xff, 0xff, 0x75, 0xdc, 0x35, 0xdf, 0x0a, 0x04, 0x00, 0x00,
|
||||
}
|
||||
|
||||
// This is a compile-time assertion to ensure that this generated file
|
||||
|
@ -68,6 +69,7 @@ type ClientCommandsHandler interface {
|
|||
BlockOpen(*pb.BlockOpenRequest) *pb.BlockOpenResponse
|
||||
BlockCreate(*pb.BlockCreateRequest) *pb.BlockCreateResponse
|
||||
BlockUpdate(*pb.BlockUpdateRequest) *pb.BlockUpdateResponse
|
||||
LinkPreview(*pb.LinkPreviewRequest) *pb.LinkPreviewResponse
|
||||
}
|
||||
|
||||
func registerClientCommandsHandler(srv ClientCommandsHandler) {
|
||||
|
@ -184,6 +186,16 @@ func BlockUpdate(b []byte) []byte {
|
|||
return resp
|
||||
}
|
||||
|
||||
func LinkPreview(b []byte) []byte {
|
||||
in := new(pb.LinkPreviewRequest)
|
||||
if err := in.Unmarshal(b); err != nil {
|
||||
resp, _ := (&pb.LinkPreviewResponse{Error: &pb.LinkPreviewResponse_Error{Code: pb.LinkPreviewResponse_Error_BAD_INPUT, Description: err.Error()}}).Marshal()
|
||||
return resp
|
||||
}
|
||||
resp, _ := clientCommandsHandler.LinkPreview(in).Marshal()
|
||||
return resp
|
||||
}
|
||||
|
||||
func CommandAsync(cmd string, data []byte, callback func(data []byte)) {
|
||||
go func() {
|
||||
var cd []byte
|
||||
|
@ -210,6 +222,8 @@ func CommandAsync(cmd string, data []byte, callback func(data []byte)) {
|
|||
cd = BlockCreate(data)
|
||||
case "BlockUpdate":
|
||||
cd = BlockUpdate(data)
|
||||
case "LinkPreview":
|
||||
cd = LinkPreview(data)
|
||||
default:
|
||||
log.Errorf("unknown command type: %s\n", cmd)
|
||||
}
|
||||
|
|
350
pb/block.pb.go
350
pb/block.pb.go
|
@ -1163,7 +1163,7 @@ type BlockHeaderChange_Icon struct {
|
|||
Icon string `protobuf:"bytes,4,opt,name=icon,proto3,oneof" json:"icon,omitempty"`
|
||||
}
|
||||
type BlockHeaderChange_Permissions struct {
|
||||
Permissions *Permissions `protobuf:"bytes,5,opt,name=permissions,proto3,oneof" json:"permissions,omitempty"`
|
||||
Permissions *BlockPermissions `protobuf:"bytes,5,opt,name=permissions,proto3,oneof" json:"permissions,omitempty"`
|
||||
}
|
||||
|
||||
func (*BlockHeaderChange_Id) isBlockHeaderChange_Change() {}
|
||||
|
@ -1207,7 +1207,7 @@ func (m *BlockHeaderChange) GetIcon() string {
|
|||
return ""
|
||||
}
|
||||
|
||||
func (m *BlockHeaderChange) GetPermissions() *Permissions {
|
||||
func (m *BlockHeaderChange) GetPermissions() *BlockPermissions {
|
||||
if x, ok := m.GetChange().(*BlockHeaderChange_Permissions); ok {
|
||||
return x.Permissions
|
||||
}
|
||||
|
@ -1619,11 +1619,11 @@ func (*Block) XXX_OneofWrappers() []interface{} {
|
|||
}
|
||||
|
||||
type BlockHeader struct {
|
||||
Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
|
||||
Type BlockType `protobuf:"varint,2,opt,name=type,proto3,enum=anytype.BlockType" json:"type,omitempty"`
|
||||
Name string `protobuf:"bytes,3,opt,name=name,proto3" json:"name,omitempty"`
|
||||
Icon string `protobuf:"bytes,4,opt,name=icon,proto3" json:"icon,omitempty"`
|
||||
Permissions *Permissions `protobuf:"bytes,5,opt,name=permissions,proto3" json:"permissions,omitempty"`
|
||||
Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
|
||||
Type BlockType `protobuf:"varint,2,opt,name=type,proto3,enum=anytype.BlockType" json:"type,omitempty"`
|
||||
Name string `protobuf:"bytes,3,opt,name=name,proto3" json:"name,omitempty"`
|
||||
Icon string `protobuf:"bytes,4,opt,name=icon,proto3" json:"icon,omitempty"`
|
||||
Permissions *BlockPermissions `protobuf:"bytes,5,opt,name=permissions,proto3" json:"permissions,omitempty"`
|
||||
}
|
||||
|
||||
func (m *BlockHeader) Reset() { *m = BlockHeader{} }
|
||||
|
@ -1687,33 +1687,33 @@ func (m *BlockHeader) GetIcon() string {
|
|||
return ""
|
||||
}
|
||||
|
||||
func (m *BlockHeader) GetPermissions() *Permissions {
|
||||
func (m *BlockHeader) GetPermissions() *BlockPermissions {
|
||||
if m != nil {
|
||||
return m.Permissions
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
type Permissions struct {
|
||||
Editable bool `protobuf:"varint,1,opt,name=editable,proto3" json:"editable,omitempty"`
|
||||
Removable bool `protobuf:"varint,2,opt,name=removable,proto3" json:"removable,omitempty"`
|
||||
Readable bool `protobuf:"varint,3,opt,name=readable,proto3" json:"readable,omitempty"`
|
||||
Draggable bool `protobuf:"varint,4,opt,name=draggable,proto3" json:"draggable,omitempty"`
|
||||
Droppable bool `protobuf:"varint,5,opt,name=droppable,proto3" json:"droppable,omitempty"`
|
||||
type BlockPermissions struct {
|
||||
Read bool `protobuf:"varint,1,opt,name=read,proto3" json:"read,omitempty"`
|
||||
Edit bool `protobuf:"varint,2,opt,name=edit,proto3" json:"edit,omitempty"`
|
||||
Remove bool `protobuf:"varint,3,opt,name=remove,proto3" json:"remove,omitempty"`
|
||||
Drag bool `protobuf:"varint,4,opt,name=drag,proto3" json:"drag,omitempty"`
|
||||
DropOn bool `protobuf:"varint,5,opt,name=dropOn,proto3" json:"dropOn,omitempty"`
|
||||
}
|
||||
|
||||
func (m *Permissions) Reset() { *m = Permissions{} }
|
||||
func (m *Permissions) String() string { return proto.CompactTextString(m) }
|
||||
func (*Permissions) ProtoMessage() {}
|
||||
func (*Permissions) Descriptor() ([]byte, []int) {
|
||||
func (m *BlockPermissions) Reset() { *m = BlockPermissions{} }
|
||||
func (m *BlockPermissions) String() string { return proto.CompactTextString(m) }
|
||||
func (*BlockPermissions) ProtoMessage() {}
|
||||
func (*BlockPermissions) Descriptor() ([]byte, []int) {
|
||||
return fileDescriptor_8e550b1f5926e92d, []int{17}
|
||||
}
|
||||
func (m *Permissions) XXX_Unmarshal(b []byte) error {
|
||||
func (m *BlockPermissions) XXX_Unmarshal(b []byte) error {
|
||||
return m.Unmarshal(b)
|
||||
}
|
||||
func (m *Permissions) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
||||
func (m *BlockPermissions) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
||||
if deterministic {
|
||||
return xxx_messageInfo_Permissions.Marshal(b, m, deterministic)
|
||||
return xxx_messageInfo_BlockPermissions.Marshal(b, m, deterministic)
|
||||
} else {
|
||||
b = b[:cap(b)]
|
||||
n, err := m.MarshalToSizedBuffer(b)
|
||||
|
@ -1723,49 +1723,49 @@ func (m *Permissions) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
|
|||
return b[:n], nil
|
||||
}
|
||||
}
|
||||
func (m *Permissions) XXX_Merge(src proto.Message) {
|
||||
xxx_messageInfo_Permissions.Merge(m, src)
|
||||
func (m *BlockPermissions) XXX_Merge(src proto.Message) {
|
||||
xxx_messageInfo_BlockPermissions.Merge(m, src)
|
||||
}
|
||||
func (m *Permissions) XXX_Size() int {
|
||||
func (m *BlockPermissions) XXX_Size() int {
|
||||
return m.Size()
|
||||
}
|
||||
func (m *Permissions) XXX_DiscardUnknown() {
|
||||
xxx_messageInfo_Permissions.DiscardUnknown(m)
|
||||
func (m *BlockPermissions) XXX_DiscardUnknown() {
|
||||
xxx_messageInfo_BlockPermissions.DiscardUnknown(m)
|
||||
}
|
||||
|
||||
var xxx_messageInfo_Permissions proto.InternalMessageInfo
|
||||
var xxx_messageInfo_BlockPermissions proto.InternalMessageInfo
|
||||
|
||||
func (m *Permissions) GetEditable() bool {
|
||||
func (m *BlockPermissions) GetRead() bool {
|
||||
if m != nil {
|
||||
return m.Editable
|
||||
return m.Read
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
func (m *Permissions) GetRemovable() bool {
|
||||
func (m *BlockPermissions) GetEdit() bool {
|
||||
if m != nil {
|
||||
return m.Removable
|
||||
return m.Edit
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
func (m *Permissions) GetReadable() bool {
|
||||
func (m *BlockPermissions) GetRemove() bool {
|
||||
if m != nil {
|
||||
return m.Readable
|
||||
return m.Remove
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
func (m *Permissions) GetDraggable() bool {
|
||||
func (m *BlockPermissions) GetDrag() bool {
|
||||
if m != nil {
|
||||
return m.Draggable
|
||||
return m.Drag
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
func (m *Permissions) GetDroppable() bool {
|
||||
func (m *BlockPermissions) GetDropOn() bool {
|
||||
if m != nil {
|
||||
return m.Droppable
|
||||
return m.DropOn
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
@ -2524,7 +2524,7 @@ func init() {
|
|||
proto.RegisterType((*BlockChanges)(nil), "anytype.BlockChanges")
|
||||
proto.RegisterType((*Block)(nil), "anytype.Block")
|
||||
proto.RegisterType((*BlockHeader)(nil), "anytype.BlockHeader")
|
||||
proto.RegisterType((*Permissions)(nil), "anytype.Permissions")
|
||||
proto.RegisterType((*BlockPermissions)(nil), "anytype.BlockPermissions")
|
||||
proto.RegisterType((*BlockConnections)(nil), "anytype.BlockConnections")
|
||||
proto.RegisterType((*BlockConnectionsList)(nil), "anytype.BlockConnectionsList")
|
||||
proto.RegisterType((*BlockHeadersList)(nil), "anytype.BlockHeadersList")
|
||||
|
@ -2543,109 +2543,109 @@ func init() {
|
|||
func init() { proto.RegisterFile("block.proto", fileDescriptor_8e550b1f5926e92d) }
|
||||
|
||||
var fileDescriptor_8e550b1f5926e92d = []byte{
|
||||
// 1629 bytes of a gzipped FileDescriptorProto
|
||||
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x58, 0x4b, 0x6f, 0x1b, 0x47,
|
||||
0x12, 0x9e, 0x19, 0x72, 0x28, 0xb1, 0xa8, 0xc7, 0xb8, 0xad, 0x5d, 0xd3, 0x82, 0x96, 0x10, 0x06,
|
||||
0xbb, 0x5e, 0x63, 0xb5, 0xe6, 0xda, 0x92, 0xac, 0xb5, 0xe1, 0xb5, 0x17, 0xa4, 0xc8, 0x5d, 0x0a,
|
||||
0x7a, 0x50, 0x68, 0x51, 0x76, 0x92, 0x43, 0x8c, 0x11, 0xa7, 0x43, 0x0d, 0x44, 0xce, 0xd0, 0xc3,
|
||||
0x96, 0x2d, 0xe5, 0x2f, 0xc4, 0x87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, 0x09, 0x0f, 0x8e, 0x24, 0x73, 0x90, 0xe5, 0xec, 0x84, 0x07, 0xcc, 0xd0, 0x50, 0xa8,
|
||||
0x58, 0x91, 0xdb, 0xa0, 0x0f, 0xf8, 0x69, 0x97, 0x09, 0x84, 0x66, 0x96, 0x8b, 0x43, 0xf5, 0xc1,
|
||||
0x4e, 0x78, 0x79, 0x0f, 0xe5, 0x0d, 0x85, 0x06, 0x8a, 0x68, 0xd1, 0xb3, 0xfc, 0xa3, 0x41, 0x31,
|
||||
0x23, 0x3c, 0x18, 0x65, 0xb1, 0x8d, 0x72, 0xb4, 0x10, 0x8a, 0x64, 0x11, 0x80, 0x7b, 0x9d, 0x4e,
|
||||
0x97, 0x59, 0x07, 0x5d, 0x56, 0xcc, 0x2e, 0xaa, 0x37, 0x27, 0x1b, 0x0a, 0x4d, 0xec, 0x91, 0xff,
|
||||
0x02, 0xa0, 0x2a, 0xf3, 0xb1, 0x20, 0x8b, 0xba, 0x70, 0xe5, 0x2f, 0x63, 0x0e, 0x0e, 0x94, 0xf0,
|
||||
0x80, 0xd8, 0x84, 0x94, 0x20, 0xdf, 0x3e, 0x64, 0xed, 0x23, 0x71, 0x43, 0x4e, 0xde, 0x10, 0x6f,
|
||||
0x91, 0x79, 0x84, 0x9d, 0xb5, 0x8f, 0x98, 0x5d, 0x9c, 0x90, 0xd2, 0x70, 0xa3, 0x3a, 0x09, 0xb9,
|
||||
0x00, 0x6c, 0xf3, 0x1b, 0x55, 0xc2, 0xb6, 0x6b, 0x75, 0x98, 0x84, 0x2d, 0x02, 0x48, 0x1d, 0x05,
|
||||
0x10, 0x2a, 0x0e, 0x03, 0xf4, 0x10, 0xf2, 0x03, 0xee, 0x1f, 0xb7, 0xf9, 0xb1, 0x1f, 0xc0, 0x5a,
|
||||
0x18, 0x8e, 0x65, 0xdd, 0x73, 0x5d, 0xd6, 0xc6, 0x57, 0x38, 0xd8, 0x72, 0x06, 0x1c, 0x5d, 0x8d,
|
||||
0x2c, 0xc8, 0x2d, 0xc8, 0x89, 0x24, 0x86, 0x00, 0x5f, 0x4d, 0xdb, 0x86, 0x16, 0x52, 0x29, 0xe1,
|
||||
0xfd, 0xb7, 0x21, 0xd1, 0x37, 0x98, 0x65, 0x33, 0x5f, 0xfa, 0x6f, 0xc4, 0xed, 0xa0, 0xa1, 0x60,
|
||||
0x43, 0x20, 0x37, 0x25, 0x23, 0x6a, 0xe3, 0x18, 0x51, 0x3c, 0x0e, 0x44, 0x75, 0x0e, 0xb2, 0xae,
|
||||
0xd5, 0x63, 0xc2, 0x11, 0xf1, 0x64, 0x70, 0x85, 0xbb, 0x4e, 0xdb, 0x73, 0x45, 0x22, 0xc5, 0x2e,
|
||||
0xae, 0xc8, 0x3d, 0x28, 0xf4, 0x99, 0xdf, 0x73, 0x06, 0x03, 0x0c, 0x4b, 0xe4, 0xb0, 0xb0, 0x3c,
|
||||
0x17, 0x1d, 0xbe, 0x1b, 0xcb, 0x1a, 0x0a, 0x4d, 0xaa, 0x26, 0x22, 0xf8, 0x41, 0x85, 0x39, 0xe1,
|
||||
0x45, 0xcd, 0x1a, 0x1c, 0x1e, 0x78, 0x96, 0x6f, 0xcb, 0x20, 0xee, 0xa6, 0x93, 0x30, 0x04, 0x67,
|
||||
0xa4, 0xfd, 0x96, 0x33, 0x71, 0x17, 0x26, 0x0e, 0x05, 0x94, 0x61, 0x2a, 0xae, 0xa7, 0x8d, 0x03,
|
||||
0x9c, 0x43, 0xc3, 0x50, 0x37, 0x11, 0xcf, 0x4b, 0x4d, 0x66, 0xa4, 0xc2, 0xbd, 0x9e, 0xd3, 0x96,
|
||||
0xc1, 0x0c, 0x35, 0x68, 0x52, 0x96, 0x85, 0xa9, 0x8d, 0xab, 0xa7, 0xc0, 0x2e, 0x2a, 0xd9, 0x47,
|
||||
0x72, 0x18, 0x08, 0xae, 0x97, 0xae, 0xcd, 0x8f, 0x72, 0x2d, 0x32, 0x4c, 0x1a, 0xe0, 0x7d, 0x7d,
|
||||
0xab, 0x13, 0x14, 0x62, 0x61, 0xd4, 0x83, 0x8e, 0xef, 0x43, 0x3d, 0x44, 0xd1, 0x0e, 0x11, 0x96,
|
||||
0x79, 0x1d, 0x97, 0x80, 0xc8, 0x32, 0xb6, 0x48, 0xc0, 0x51, 0x83, 0xa9, 0x24, 0xc7, 0x91, 0xd5,
|
||||
0x24, 0x17, 0x66, 0xce, 0x06, 0x91, 0x44, 0x2d, 0x26, 0xc4, 0xaf, 0x34, 0xd0, 0x85, 0x98, 0xfc,
|
||||
0x13, 0x72, 0x01, 0xe6, 0x92, 0x0c, 0xe7, 0x46, 0x61, 0x40, 0xa5, 0x0e, 0xf9, 0x77, 0x32, 0x8c,
|
||||
0x82, 0x30, 0xb8, 0x36, 0x26, 0x8c, 0x54, 0x00, 0x58, 0x2f, 0x02, 0xaf, 0x29, 0x61, 0x43, 0xce,
|
||||
0xe2, 0x15, 0x21, 0xb5, 0x0a, 0x93, 0xb6, 0xc5, 0xad, 0xe7, 0x0e, 0x7b, 0x51, 0x9c, 0x16, 0xda,
|
||||
0x7f, 0x1e, 0xbe, 0x21, 0x90, 0x36, 0x14, 0x1a, 0x69, 0x8a, 0x7a, 0xc4, 0xfc, 0xcf, 0x8c, 0x3a,
|
||||
0x1f, 0xf3, 0x1f, 0x65, 0x7e, 0x09, 0xf4, 0x1e, 0xb3, 0x1d, 0xab, 0x38, 0x3b, 0x8a, 0x19, 0xb6,
|
||||
0x51, 0x24, 0x58, 0x17, 0x3f, 0xaa, 0x79, 0x98, 0x68, 0x7b, 0x2e, 0x67, 0x2e, 0x37, 0xbf, 0x54,
|
||||
0x65, 0x13, 0x91, 0x2f, 0x60, 0xf8, 0x05, 0xde, 0x38, 0x8f, 0x11, 0x24, 0x1f, 0x90, 0x24, 0x1f,
|
||||
0x48, 0x36, 0x20, 0x49, 0x36, 0x90, 0x5c, 0xb0, 0x76, 0x61, 0x2e, 0x48, 0x31, 0x81, 0xf9, 0x85,
|
||||
0x0a, 0x85, 0x84, 0x90, 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 0x0f, 0x2e, 0xcb, 0xf4, 0x49, 0x9e, 0x5f, 0xba, 0x40, 0xc7, 0x8d, 0xfc, 0x5c,
|
||||
0x01, 0x5d, 0xdc, 0x4c, 0xf2, 0xa0, 0xd7, 0xb7, 0x77, 0x5b, 0xef, 0x1b, 0x0a, 0x8e, 0x90, 0xad,
|
||||
0xca, 0xde, 0xa6, 0xa1, 0x92, 0x29, 0x98, 0xac, 0x36, 0x9b, 0x9b, 0xdb, 0x15, 0xba, 0x69, 0x68,
|
||||
0x64, 0x02, 0x32, 0x7b, 0xf5, 0x96, 0x91, 0x31, 0x7f, 0x54, 0x61, 0x26, 0x4d, 0x31, 0x64, 0xe5,
|
||||
0x32, 0x2d, 0xed, 0xad, 0x84, 0xb9, 0x72, 0xf1, 0x76, 0x16, 0x27, 0xb3, 0x18, 0x86, 0x3b, 0x0b,
|
||||
0x85, 0xed, 0xca, 0xc6, 0xce, 0xd3, 0xbd, 0x75, 0x5a, 0xaf, 0xef, 0x18, 0x8a, 0x39, 0x0b, 0xd3,
|
||||
0x29, 0x4e, 0x33, 0x3f, 0xd1, 0x65, 0x06, 0x91, 0xb3, 0xb0, 0x08, 0xe2, 0x71, 0x53, 0xf2, 0x57,
|
||||
0xf9, 0x82, 0xc3, 0x66, 0x18, 0xee, 0x1a, 0xe4, 0xc5, 0x04, 0x89, 0x2e, 0x9d, 0x37, 0x6e, 0xd2,
|
||||
0x58, 0x95, 0x94, 0xce, 0x0e, 0x9c, 0xa9, 0x71, 0xf3, 0xe1, 0xa5, 0xc7, 0xcd, 0xd4, 0xb0, 0xb9,
|
||||
0x70, 0x66, 0xd8, 0x4c, 0x8e, 0x9a, 0xc5, 0xa1, 0x51, 0x33, 0x1a, 0x34, 0xe7, 0xd7, 0x40, 0x17,
|
||||
0xae, 0x92, 0x5b, 0xe1, 0x08, 0x1d, 0x94, 0xc4, 0xb5, 0x31, 0x57, 0xcb, 0xf9, 0x79, 0xfe, 0x3b,
|
||||
0x15, 0xb2, 0x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0x91, 0x05, 0x1c, 0xed, 0x47, 0xcd, 0x50, 0x4d, 0x34, 0x43, 0x6c, 0x1e, 0x16, 0x67, 0x15,
|
||||
0xdb, 0x66, 0xb6, 0xa4, 0xff, 0x78, 0x03, 0x2d, 0x06, 0xce, 0xc7, 0x41, 0x43, 0xd2, 0xa9, 0xf8,
|
||||
0x1e, 0xfe, 0x3b, 0x35, 0x7b, 0xe6, 0xef, 0xd4, 0x7f, 0x7c, 0x18, 0x56, 0x15, 0xc6, 0x3d, 0x0d,
|
||||
0xf9, 0x5a, 0x65, 0xaf, 0x51, 0x6d, 0x56, 0x68, 0x2d, 0x20, 0x9e, 0xdd, 0xca, 0xff, 0xeb, 0x01,
|
||||
0xf1, 0xd4, 0x2a, 0xad, 0xca, 0xe3, 0x8d, 0xfa, 0x13, 0x43, 0x13, 0x84, 0x54, 0x7f, 0xaf, 0x65,
|
||||
0x64, 0xf0, 0xeb, 0x7f, 0x1b, 0x5b, 0x75, 0x23, 0x4b, 0x0a, 0x30, 0xb1, 0xbb, 0xb1, 0xde, 0xda,
|
||||
0xa7, 0x75, 0x43, 0x47, 0x60, 0x1f, 0x6f, 0xd4, 0xea, 0x4d, 0x23, 0x57, 0x5d, 0xf8, 0xfe, 0x75,
|
||||
0x49, 0x7d, 0xf5, 0xba, 0xa4, 0xfe, 0xf2, 0xba, 0xa4, 0x7e, 0xfa, 0xa6, 0xa4, 0xbc, 0x7a, 0x53,
|
||||
0x52, 0x7e, 0x7a, 0x53, 0x52, 0x3e, 0xd0, 0xfa, 0x07, 0x07, 0x39, 0xf1, 0x1f, 0xa7, 0x95, 0xdf,
|
||||
0x03, 0x00, 0x00, 0xff, 0xff, 0x91, 0x40, 0x9e, 0xe5, 0x80, 0x12, 0x00, 0x00,
|
||||
// 1621 bytes of a gzipped FileDescriptorProto
|
||||
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x58, 0x4b, 0x6f, 0x1b, 0xd5,
|
||||
0x17, 0x9f, 0x99, 0x78, 0x1c, 0xfb, 0x38, 0x8f, 0xe9, 0x6d, 0xfe, 0xad, 0x1b, 0xe5, 0x6f, 0x45,
|
||||
0x23, 0x28, 0x15, 0xa1, 0xa6, 0x4d, 0xd2, 0x42, 0x55, 0x5a, 0x64, 0xc7, 0x06, 0x47, 0x79, 0x38,
|
||||
0xba, 0x71, 0x5a, 0x60, 0x41, 0x35, 0xf1, 0x5c, 0x92, 0x51, 0xec, 0x19, 0x77, 0x3c, 0x69, 0x13,
|
||||
0x16, 0x7c, 0x01, 0xba, 0x60, 0x89, 0xf8, 0x08, 0xac, 0x58, 0xb0, 0x63, 0x8b, 0x04, 0x1b, 0xa4,
|
||||
0xb2, 0x43, 0xac, 0x50, 0x2b, 0xb1, 0xe2, 0x43, 0xa0, 0x73, 0xef, 0x9d, 0x97, 0x63, 0x2b, 0x09,
|
||||
0x6a, 0x57, 0x73, 0x1f, 0xe7, 0xdc, 0x7b, 0xce, 0xef, 0xdc, 0xf3, 0x3b, 0xc7, 0x86, 0xc2, 0x6e,
|
||||
0xc7, 0x6b, 0x1f, 0x94, 0x7b, 0xbe, 0x17, 0x78, 0x64, 0xdc, 0x72, 0x8f, 0x83, 0xe3, 0x1e, 0x33,
|
||||
0x4d, 0x30, 0xaa, 0xb8, 0xde, 0xec, 0x31, 0x97, 0xb2, 0xc7, 0x87, 0xac, 0x1f, 0x90, 0x29, 0xd0,
|
||||
0x1c, 0xbb, 0xa8, 0xce, 0xab, 0xd7, 0xf2, 0x54, 0x73, 0x6c, 0xf3, 0x6f, 0x15, 0x2e, 0x24, 0x84,
|
||||
0xfa, 0x3d, 0xcf, 0xed, 0x33, 0x72, 0x1b, 0x74, 0xe6, 0xfb, 0x9e, 0xcf, 0x05, 0x0b, 0x8b, 0xf3,
|
||||
0x65, 0x79, 0x64, 0xf9, 0x84, 0x68, 0xb9, 0x8e, 0x72, 0x54, 0x88, 0xcf, 0x7e, 0xab, 0x82, 0xce,
|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4, 0x86,
|
||||
0x1d, 0xf1, 0xfa, 0x51, 0xbb, 0x09, 0x79, 0x7e, 0xfb, 0xf6, 0xbe, 0xf7, 0x94, 0xbc, 0x01, 0x3a,
|
||||
0x4f, 0x4a, 0xe9, 0xe3, 0x54, 0xda, 0x40, 0x2a, 0x36, 0xcd, 0xfb, 0x50, 0x48, 0x18, 0x7c, 0x7e,
|
||||
0x84, 0x97, 0xa4, 0xbe, 0x78, 0x26, 0x67, 0xbc, 0xf4, 0x47, 0x0d, 0xa6, 0xc5, 0x03, 0x67, 0x47,
|
||||
0x81, 0x38, 0x92, 0xcc, 0x40, 0x26, 0x60, 0x47, 0x81, 0x60, 0x86, 0x86, 0x42, 0xf9, 0x8c, 0xdc,
|
||||
0x00, 0xbd, 0x1f, 0x1c, 0x77, 0x18, 0x47, 0x68, 0x6a, 0xb1, 0x38, 0x90, 0x1f, 0xec, 0x28, 0x28,
|
||||
0x6f, 0xe3, 0x7e, 0x43, 0xa1, 0x42, 0x10, 0x35, 0xba, 0x96, 0x7f, 0xd0, 0x2f, 0x8e, 0x71, 0x0b,
|
||||
0x86, 0x69, 0x6c, 0xe0, 0x3e, 0x6a, 0x70, 0x41, 0x32, 0x0f, 0x10, 0x78, 0x7b, 0x7b, 0x1d, 0x66,
|
||||
0xed, 0x76, 0x58, 0x31, 0x33, 0xaf, 0x5e, 0xcb, 0x35, 0x14, 0x9a, 0x58, 0x23, 0x1f, 0x02, 0xa0,
|
||||
0x28, 0xf3, 0x31, 0x21, 0x8b, 0x3a, 0x37, 0xe5, 0xff, 0x23, 0x0e, 0x16, 0x42, 0x78, 0x40, 0xac,
|
||||
0x42, 0x4a, 0x90, 0x6f, 0xef, 0xb3, 0xf6, 0x01, 0xbf, 0x21, 0x2b, 0x6f, 0x88, 0x97, 0xc8, 0x2c,
|
||||
0xc2, 0xce, 0xda, 0x07, 0xcc, 0x2e, 0x8e, 0xcb, 0xdd, 0x70, 0xa1, 0x9a, 0x83, 0xac, 0x00, 0xdb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3b, 0x54, 0x0c,
|
||||
0x65, 0x13, 0xfe, 0x3c, 0xd3, 0x64, 0x58, 0x2a, 0x81, 0xd7, 0x75, 0xda, 0xd2, 0x99, 0x81, 0x2a,
|
||||
0x4d, 0xca, 0x32, 0x3b, 0xb5, 0x51, 0x49, 0x25, 0xf4, 0xa2, 0xbc, 0xbd, 0x2f, 0x3b, 0x02, 0x71,
|
||||
0xbd, 0x34, 0x6d, 0x76, 0x98, 0x69, 0x91, 0x62, 0x52, 0x01, 0xef, 0xeb, 0x59, 0x7b, 0x22, 0x1b,
|
||||
0x0b, 0xc3, 0x5e, 0x75, 0x7c, 0x1f, 0xca, 0x21, 0x8a, 0x76, 0x88, 0xb0, 0x0c, 0xee, 0xa8, 0x00,
|
||||
0x44, 0x9a, 0xb1, 0x46, 0x02, 0x8e, 0x1a, 0x4c, 0x24, 0x89, 0x8e, 0x2c, 0x27, 0x09, 0x71, 0xec,
|
||||
0xa4, 0x13, 0x49, 0xd4, 0x62, 0x56, 0xfc, 0x41, 0x03, 0x9d, 0x6f, 0x93, 0x77, 0x20, 0x2b, 0x30,
|
||||
0x97, 0x8c, 0x38, 0x33, 0x0c, 0x03, 0x2a, 0x65, 0xc8, 0x7b, 0x49, 0x37, 0x0a, 0x5c, 0xe1, 0xf2,
|
||||
0x08, 0x37, 0x52, 0x0e, 0x60, 0xd2, 0x70, 0xbc, 0x26, 0xb8, 0x0e, 0x39, 0x89, 0x57, 0x84, 0xd4,
|
||||
0x32, 0xe4, 0x6c, 0x2b, 0xb0, 0x9e, 0x38, 0xec, 0x69, 0x71, 0x92, 0x4b, 0x5f, 0x1a, 0xbc, 0x41,
|
||||
0xec, 0x36, 0x14, 0x1a, 0x49, 0xf2, 0xa4, 0xc4, 0xf8, 0x4f, 0x0d, 0x3b, 0x1f, 0xe3, 0x1f, 0x45,
|
||||
0x7e, 0x01, 0xf4, 0x2e, 0xb3, 0x1d, 0xab, 0x38, 0x3d, 0x8c, 0x1e, 0x36, 0x70, 0x8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x12, 0xac, 0x66, 0x56,
|
||||
0xa5, 0x7b, 0x09, 0xf6, 0x22, 0xe5, 0x98, 0xe9, 0xc4, 0x51, 0xc3, 0x53, 0x29, 0x14, 0x32, 0x97,
|
||||
0x01, 0xe2, 0x8a, 0x44, 0xae, 0x46, 0x65, 0x4b, 0x28, 0x0f, 0x76, 0x26, 0x72, 0xd7, 0xfc, 0x53,
|
||||
0x95, 0x3d, 0x14, 0x26, 0x0d, 0x29, 0x9f, 0xb1, 0xba, 0x86, 0x64, 0x7e, 0xf7, 0xbc, 0x64, 0x9e,
|
||||
0xa4, 0xf2, 0x85, 0x33, 0x54, 0xd6, 0xc8, 0xce, 0x25, 0xd0, 0xf9, 0xcd, 0x24, 0x0f, 0x7a, 0x7d,
|
||||
0x63, 0xab, 0xf5, 0xa9, 0xa1, 0x60, 0xab, 0xd8, 0xaa, 0x6c, 0xaf, 0x19, 0x2a, 0x99, 0x80, 0x5c,
|
||||
0xb5, 0xd9, 0x5c, 0xdb, 0xa8, 0xd0, 0x35, 0x43, 0x23, 0xe3, 0x30, 0xb6, 0x5d, 0x6f, 0x19, 0x63,
|
||||
0xe6, 0xef, 0x2a, 0x4c, 0xa5, 0x59, 0x84, 0x2c, 0x9d, 0xa7, 0x6a, 0xbd, 0x12, 0x37, 0x97, 0xce,
|
||||
0x5e, 0xb1, 0xe2, 0x60, 0x16, 0x43, 0x77, 0xa7, 0xa1, 0xb0, 0x51, 0x59, 0xdd, 0x7c, 0xb4, 0xbd,
|
||||
0x42, 0xeb, 0xf5, 0x4d, 0x43, 0x31, 0xa7, 0x61, 0x32, 0x45, 0x5b, 0xe6, 0xd7, 0xba, 0x8c, 0x20,
|
||||
0xd2, 0x12, 0x26, 0x41, 0xdc, 0x56, 0x4a, 0x8a, 0x2a, 0x9f, 0xb1, 0xa9, 0x0c, 0xdd, 0xbd, 0x0d,
|
||||
0x79, 0xde, 0x29, 0xa2, 0x49, 0xa7, 0xb5, 0x95, 0x34, 0x16, 0x25, 0xa5, 0x93, 0x8d, 0x65, 0xaa,
|
||||
0xad, 0xbc, 0x77, 0xee, 0xb6, 0x32, 0xd5, 0x54, 0xce, 0x9d, 0x68, 0x2a, 0x93, 0x2d, 0x65, 0x71,
|
||||
0xa0, 0xa5, 0x8c, 0x1a, 0xca, 0xd9, 0xdb, 0xa0, 0x73, 0x53, 0xc9, 0xf5, 0xb0, 0x55, 0x16, 0x29,
|
||||
0x71, 0x79, 0xc4, 0xd5, 0xb2, 0x4f, 0x9e, 0xfd, 0x45, 0x85, 0x0c, 0xce, 0xf1, 0xcd, 0xf8, 0x58,
|
||||
0xe7, 0x64, 0x49, 0x1b, 0x65, 0x72, 0x99, 0xf2, 0xa2, 0x28, 0x64, 0xc9, 0x8d, 0x14, 0x7f, 0xcf,
|
||||
0x8d, 0xd2, 0x89, 0x99, 0x7c, 0x76, 0x01, 0x74, 0x7e, 0x02, 0xc6, 0xf0, 0x0b, 0xdf, 0xeb, 0xf2,
|
||||
0xeb, 0x74, 0xca, 0xc7, 0x48, 0x76, 0x81, 0xc7, 0x0f, 0xd3, 0xa9, 0x16, 0x78, 0xe6, 0x02, 0x64,
|
||||
0x38, 0x28, 0x3a, 0xa8, 0xdb, 0x86, 0x82, 0x4f, 0x7e, 0xad, 0x5a, 0x33, 0x54, 0x9c, 0xaf, 0x1a,
|
||||
0x1a, 0x7e, 0xaa, 0xc6, 0x18, 0x7e, 0x2a, 0x46, 0xc6, 0xbc, 0x13, 0xbe, 0x26, 0x1d, 0xd4, 0x9e,
|
||||
0xa1, 0x90, 0x2c, 0x68, 0xfb, 0x37, 0x0d, 0x95, 0x7f, 0x17, 0x0d, 0x8d, 0x7f, 0x97, 0x8c, 0x31,
|
||||
0xfe, 0x5d, 0x36, 0x32, 0x98, 0x63, 0x8f, 0x0f, 0xbd, 0x80, 0x19, 0xba, 0x59, 0x06, 0x88, 0xc3,
|
||||
0x81, 0x19, 0xe7, 0x7a, 0x2e, 0x33, 0x14, 0x02, 0x90, 0x75, 0x0f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52, 0xfe, 0x78, 0x59, 0x52, 0x3e, 0xd3, 0x7a,
|
||||
0xbb, 0xbb, 0x59, 0xfe, 0xcf, 0xd2, 0xd2, 0xbf, 0x01, 0x00, 0x00, 0xff, 0xff, 0xd3, 0xb6, 0x3e,
|
||||
0x42, 0x68, 0x12, 0x00, 0x00,
|
||||
}
|
||||
|
||||
func (m *BlockOpenRequest) Marshal() (dAtA []byte, err error) {
|
||||
|
@ -3847,7 +3847,7 @@ func (m *BlockHeader) MarshalToSizedBuffer(dAtA []byte) (int, error) {
|
|||
return len(dAtA) - i, nil
|
||||
}
|
||||
|
||||
func (m *Permissions) Marshal() (dAtA []byte, err error) {
|
||||
func (m *BlockPermissions) Marshal() (dAtA []byte, err error) {
|
||||
size := m.Size()
|
||||
dAtA = make([]byte, size)
|
||||
n, err := m.MarshalToSizedBuffer(dAtA[:size])
|
||||
|
@ -3857,19 +3857,19 @@ func (m *Permissions) Marshal() (dAtA []byte, err error) {
|
|||
return dAtA[:n], nil
|
||||
}
|
||||
|
||||
func (m *Permissions) MarshalTo(dAtA []byte) (int, error) {
|
||||
func (m *BlockPermissions) MarshalTo(dAtA []byte) (int, error) {
|
||||
size := m.Size()
|
||||
return m.MarshalToSizedBuffer(dAtA[:size])
|
||||
}
|
||||
|
||||
func (m *Permissions) MarshalToSizedBuffer(dAtA []byte) (int, error) {
|
||||
func (m *BlockPermissions) MarshalToSizedBuffer(dAtA []byte) (int, error) {
|
||||
i := len(dAtA)
|
||||
_ = i
|
||||
var l int
|
||||
_ = l
|
||||
if m.Droppable {
|
||||
if m.DropOn {
|
||||
i--
|
||||
if m.Droppable {
|
||||
if m.DropOn {
|
||||
dAtA[i] = 1
|
||||
} else {
|
||||
dAtA[i] = 0
|
||||
|
@ -3877,9 +3877,9 @@ func (m *Permissions) MarshalToSizedBuffer(dAtA []byte) (int, error) {
|
|||
i--
|
||||
dAtA[i] = 0x28
|
||||
}
|
||||
if m.Draggable {
|
||||
if m.Drag {
|
||||
i--
|
||||
if m.Draggable {
|
||||
if m.Drag {
|
||||
dAtA[i] = 1
|
||||
} else {
|
||||
dAtA[i] = 0
|
||||
|
@ -3887,9 +3887,9 @@ func (m *Permissions) MarshalToSizedBuffer(dAtA []byte) (int, error) {
|
|||
i--
|
||||
dAtA[i] = 0x20
|
||||
}
|
||||
if m.Readable {
|
||||
if m.Remove {
|
||||
i--
|
||||
if m.Readable {
|
||||
if m.Remove {
|
||||
dAtA[i] = 1
|
||||
} else {
|
||||
dAtA[i] = 0
|
||||
|
@ -3897,9 +3897,9 @@ func (m *Permissions) MarshalToSizedBuffer(dAtA []byte) (int, error) {
|
|||
i--
|
||||
dAtA[i] = 0x18
|
||||
}
|
||||
if m.Removable {
|
||||
if m.Edit {
|
||||
i--
|
||||
if m.Removable {
|
||||
if m.Edit {
|
||||
dAtA[i] = 1
|
||||
} else {
|
||||
dAtA[i] = 0
|
||||
|
@ -3907,9 +3907,9 @@ func (m *Permissions) MarshalToSizedBuffer(dAtA []byte) (int, error) {
|
|||
i--
|
||||
dAtA[i] = 0x10
|
||||
}
|
||||
if m.Editable {
|
||||
if m.Read {
|
||||
i--
|
||||
if m.Editable {
|
||||
if m.Read {
|
||||
dAtA[i] = 1
|
||||
} else {
|
||||
dAtA[i] = 0
|
||||
|
@ -5089,25 +5089,25 @@ func (m *BlockHeader) Size() (n int) {
|
|||
return n
|
||||
}
|
||||
|
||||
func (m *Permissions) Size() (n int) {
|
||||
func (m *BlockPermissions) Size() (n int) {
|
||||
if m == nil {
|
||||
return 0
|
||||
}
|
||||
var l int
|
||||
_ = l
|
||||
if m.Editable {
|
||||
if m.Read {
|
||||
n += 2
|
||||
}
|
||||
if m.Removable {
|
||||
if m.Edit {
|
||||
n += 2
|
||||
}
|
||||
if m.Readable {
|
||||
if m.Remove {
|
||||
n += 2
|
||||
}
|
||||
if m.Draggable {
|
||||
if m.Drag {
|
||||
n += 2
|
||||
}
|
||||
if m.Droppable {
|
||||
if m.DropOn {
|
||||
n += 2
|
||||
}
|
||||
return n
|
||||
|
@ -6993,7 +6993,7 @@ func (m *BlockHeaderChange) Unmarshal(dAtA []byte) error {
|
|||
if postIndex > l {
|
||||
return io.ErrUnexpectedEOF
|
||||
}
|
||||
v := &Permissions{}
|
||||
v := &BlockPermissions{}
|
||||
if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
|
||||
return err
|
||||
}
|
||||
|
@ -7916,7 +7916,7 @@ func (m *BlockHeader) Unmarshal(dAtA []byte) error {
|
|||
return io.ErrUnexpectedEOF
|
||||
}
|
||||
if m.Permissions == nil {
|
||||
m.Permissions = &Permissions{}
|
||||
m.Permissions = &BlockPermissions{}
|
||||
}
|
||||
if err := m.Permissions.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
|
||||
return err
|
||||
|
@ -7946,7 +7946,7 @@ func (m *BlockHeader) Unmarshal(dAtA []byte) error {
|
|||
}
|
||||
return nil
|
||||
}
|
||||
func (m *Permissions) Unmarshal(dAtA []byte) error {
|
||||
func (m *BlockPermissions) Unmarshal(dAtA []byte) error {
|
||||
l := len(dAtA)
|
||||
iNdEx := 0
|
||||
for iNdEx < l {
|
||||
|
@ -7969,15 +7969,15 @@ func (m *Permissions) Unmarshal(dAtA []byte) error {
|
|||
fieldNum := int32(wire >> 3)
|
||||
wireType := int(wire & 0x7)
|
||||
if wireType == 4 {
|
||||
return fmt.Errorf("proto: Permissions: wiretype end group for non-group")
|
||||
return fmt.Errorf("proto: BlockPermissions: wiretype end group for non-group")
|
||||
}
|
||||
if fieldNum <= 0 {
|
||||
return fmt.Errorf("proto: Permissions: illegal tag %d (wire type %d)", fieldNum, wire)
|
||||
return fmt.Errorf("proto: BlockPermissions: illegal tag %d (wire type %d)", fieldNum, wire)
|
||||
}
|
||||
switch fieldNum {
|
||||
case 1:
|
||||
if wireType != 0 {
|
||||
return fmt.Errorf("proto: wrong wireType = %d for field Editable", wireType)
|
||||
return fmt.Errorf("proto: wrong wireType = %d for field Read", wireType)
|
||||
}
|
||||
var v int
|
||||
for shift := uint(0); ; shift += 7 {
|
||||
|
@ -7994,10 +7994,10 @@ func (m *Permissions) Unmarshal(dAtA []byte) error {
|
|||
break
|
||||
}
|
||||
}
|
||||
m.Editable = bool(v != 0)
|
||||
m.Read = bool(v != 0)
|
||||
case 2:
|
||||
if wireType != 0 {
|
||||
return fmt.Errorf("proto: wrong wireType = %d for field Removable", wireType)
|
||||
return fmt.Errorf("proto: wrong wireType = %d for field Edit", wireType)
|
||||
}
|
||||
var v int
|
||||
for shift := uint(0); ; shift += 7 {
|
||||
|
@ -8014,10 +8014,10 @@ func (m *Permissions) Unmarshal(dAtA []byte) error {
|
|||
break
|
||||
}
|
||||
}
|
||||
m.Removable = bool(v != 0)
|
||||
m.Edit = bool(v != 0)
|
||||
case 3:
|
||||
if wireType != 0 {
|
||||
return fmt.Errorf("proto: wrong wireType = %d for field Readable", wireType)
|
||||
return fmt.Errorf("proto: wrong wireType = %d for field Remove", wireType)
|
||||
}
|
||||
var v int
|
||||
for shift := uint(0); ; shift += 7 {
|
||||
|
@ -8034,10 +8034,10 @@ func (m *Permissions) Unmarshal(dAtA []byte) error {
|
|||
break
|
||||
}
|
||||
}
|
||||
m.Readable = bool(v != 0)
|
||||
m.Remove = bool(v != 0)
|
||||
case 4:
|
||||
if wireType != 0 {
|
||||
return fmt.Errorf("proto: wrong wireType = %d for field Draggable", wireType)
|
||||
return fmt.Errorf("proto: wrong wireType = %d for field Drag", wireType)
|
||||
}
|
||||
var v int
|
||||
for shift := uint(0); ; shift += 7 {
|
||||
|
@ -8054,10 +8054,10 @@ func (m *Permissions) Unmarshal(dAtA []byte) error {
|
|||
break
|
||||
}
|
||||
}
|
||||
m.Draggable = bool(v != 0)
|
||||
m.Drag = bool(v != 0)
|
||||
case 5:
|
||||
if wireType != 0 {
|
||||
return fmt.Errorf("proto: wrong wireType = %d for field Droppable", wireType)
|
||||
return fmt.Errorf("proto: wrong wireType = %d for field DropOn", wireType)
|
||||
}
|
||||
var v int
|
||||
for shift := uint(0); ; shift += 7 {
|
||||
|
@ -8074,7 +8074,7 @@ func (m *Permissions) Unmarshal(dAtA []byte) error {
|
|||
break
|
||||
}
|
||||
}
|
||||
m.Droppable = bool(v != 0)
|
||||
m.DropOn = bool(v != 0)
|
||||
default:
|
||||
iNdEx = preIndex
|
||||
skippy, err := skipBlock(dAtA[iNdEx:])
|
||||
|
|
884
pb/misc.pb.go
884
pb/misc.pb.go
|
@ -130,6 +130,68 @@ func (LogSendResponse_Error_Code) EnumDescriptor() ([]byte, []int) {
|
|||
return fileDescriptor_2d3ba2f07ad357c5, []int{3, 0, 0}
|
||||
}
|
||||
|
||||
type LinkPreviewResponse_Type int32
|
||||
|
||||
const (
|
||||
LinkPreviewResponse_PAGE LinkPreviewResponse_Type = 0
|
||||
LinkPreviewResponse_IMAGE LinkPreviewResponse_Type = 1
|
||||
LinkPreviewResponse_TEXT LinkPreviewResponse_Type = 2
|
||||
LinkPreviewResponse_UNEXPECTED LinkPreviewResponse_Type = 3
|
||||
)
|
||||
|
||||
var LinkPreviewResponse_Type_name = map[int32]string{
|
||||
0: "PAGE",
|
||||
1: "IMAGE",
|
||||
2: "TEXT",
|
||||
3: "UNEXPECTED",
|
||||
}
|
||||
|
||||
var LinkPreviewResponse_Type_value = map[string]int32{
|
||||
"PAGE": 0,
|
||||
"IMAGE": 1,
|
||||
"TEXT": 2,
|
||||
"UNEXPECTED": 3,
|
||||
}
|
||||
|
||||
func (x LinkPreviewResponse_Type) String() string {
|
||||
return proto.EnumName(LinkPreviewResponse_Type_name, int32(x))
|
||||
}
|
||||
|
||||
func (LinkPreviewResponse_Type) EnumDescriptor() ([]byte, []int) {
|
||||
return fileDescriptor_2d3ba2f07ad357c5, []int{5, 0}
|
||||
}
|
||||
|
||||
type LinkPreviewResponse_Error_Code int32
|
||||
|
||||
const (
|
||||
LinkPreviewResponse_Error_NULL LinkPreviewResponse_Error_Code = 0
|
||||
LinkPreviewResponse_Error_UNKNOWN_ERROR LinkPreviewResponse_Error_Code = 1
|
||||
LinkPreviewResponse_Error_BAD_INPUT LinkPreviewResponse_Error_Code = 2
|
||||
LinkPreviewResponse_Error_TIMEOUT LinkPreviewResponse_Error_Code = 102
|
||||
)
|
||||
|
||||
var LinkPreviewResponse_Error_Code_name = map[int32]string{
|
||||
0: "NULL",
|
||||
1: "UNKNOWN_ERROR",
|
||||
2: "BAD_INPUT",
|
||||
102: "TIMEOUT",
|
||||
}
|
||||
|
||||
var LinkPreviewResponse_Error_Code_value = map[string]int32{
|
||||
"NULL": 0,
|
||||
"UNKNOWN_ERROR": 1,
|
||||
"BAD_INPUT": 2,
|
||||
"TIMEOUT": 102,
|
||||
}
|
||||
|
||||
func (x LinkPreviewResponse_Error_Code) String() string {
|
||||
return proto.EnumName(LinkPreviewResponse_Error_Code_name, int32(x))
|
||||
}
|
||||
|
||||
func (LinkPreviewResponse_Error_Code) EnumDescriptor() ([]byte, []int) {
|
||||
return fileDescriptor_2d3ba2f07ad357c5, []int{5, 0, 0}
|
||||
}
|
||||
|
||||
type VersionGetRequest struct {
|
||||
}
|
||||
|
||||
|
@ -418,51 +480,237 @@ func (m *LogSendResponse_Error) GetDescription() string {
|
|||
return ""
|
||||
}
|
||||
|
||||
type LinkPreviewRequest struct {
|
||||
Url string `protobuf:"bytes,1,opt,name=url,proto3" json:"url,omitempty"`
|
||||
}
|
||||
|
||||
func (m *LinkPreviewRequest) Reset() { *m = LinkPreviewRequest{} }
|
||||
func (m *LinkPreviewRequest) String() string { return proto.CompactTextString(m) }
|
||||
func (*LinkPreviewRequest) ProtoMessage() {}
|
||||
func (*LinkPreviewRequest) Descriptor() ([]byte, []int) {
|
||||
return fileDescriptor_2d3ba2f07ad357c5, []int{4}
|
||||
}
|
||||
func (m *LinkPreviewRequest) XXX_Unmarshal(b []byte) error {
|
||||
return m.Unmarshal(b)
|
||||
}
|
||||
func (m *LinkPreviewRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
||||
if deterministic {
|
||||
return xxx_messageInfo_LinkPreviewRequest.Marshal(b, m, deterministic)
|
||||
} else {
|
||||
b = b[:cap(b)]
|
||||
n, err := m.MarshalToSizedBuffer(b)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return b[:n], nil
|
||||
}
|
||||
}
|
||||
func (m *LinkPreviewRequest) XXX_Merge(src proto.Message) {
|
||||
xxx_messageInfo_LinkPreviewRequest.Merge(m, src)
|
||||
}
|
||||
func (m *LinkPreviewRequest) XXX_Size() int {
|
||||
return m.Size()
|
||||
}
|
||||
func (m *LinkPreviewRequest) XXX_DiscardUnknown() {
|
||||
xxx_messageInfo_LinkPreviewRequest.DiscardUnknown(m)
|
||||
}
|
||||
|
||||
var xxx_messageInfo_LinkPreviewRequest proto.InternalMessageInfo
|
||||
|
||||
func (m *LinkPreviewRequest) GetUrl() string {
|
||||
if m != nil {
|
||||
return m.Url
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
type LinkPreviewResponse struct {
|
||||
Error *LinkPreviewResponse_Error `protobuf:"bytes,1,opt,name=error,proto3" json:"error,omitempty"`
|
||||
Title string `protobuf:"bytes,2,opt,name=title,proto3" json:"title,omitempty"`
|
||||
Description string `protobuf:"bytes,3,opt,name=description,proto3" json:"description,omitempty"`
|
||||
ImageUrl string `protobuf:"bytes,4,opt,name=imageUrl,proto3" json:"imageUrl,omitempty"`
|
||||
Type LinkPreviewResponse_Type `protobuf:"varint,5,opt,name=type,proto3,enum=anytype.LinkPreviewResponse_Type" json:"type,omitempty"`
|
||||
}
|
||||
|
||||
func (m *LinkPreviewResponse) Reset() { *m = LinkPreviewResponse{} }
|
||||
func (m *LinkPreviewResponse) String() string { return proto.CompactTextString(m) }
|
||||
func (*LinkPreviewResponse) ProtoMessage() {}
|
||||
func (*LinkPreviewResponse) Descriptor() ([]byte, []int) {
|
||||
return fileDescriptor_2d3ba2f07ad357c5, []int{5}
|
||||
}
|
||||
func (m *LinkPreviewResponse) XXX_Unmarshal(b []byte) error {
|
||||
return m.Unmarshal(b)
|
||||
}
|
||||
func (m *LinkPreviewResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
||||
if deterministic {
|
||||
return xxx_messageInfo_LinkPreviewResponse.Marshal(b, m, deterministic)
|
||||
} else {
|
||||
b = b[:cap(b)]
|
||||
n, err := m.MarshalToSizedBuffer(b)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return b[:n], nil
|
||||
}
|
||||
}
|
||||
func (m *LinkPreviewResponse) XXX_Merge(src proto.Message) {
|
||||
xxx_messageInfo_LinkPreviewResponse.Merge(m, src)
|
||||
}
|
||||
func (m *LinkPreviewResponse) XXX_Size() int {
|
||||
return m.Size()
|
||||
}
|
||||
func (m *LinkPreviewResponse) XXX_DiscardUnknown() {
|
||||
xxx_messageInfo_LinkPreviewResponse.DiscardUnknown(m)
|
||||
}
|
||||
|
||||
var xxx_messageInfo_LinkPreviewResponse proto.InternalMessageInfo
|
||||
|
||||
func (m *LinkPreviewResponse) GetError() *LinkPreviewResponse_Error {
|
||||
if m != nil {
|
||||
return m.Error
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (m *LinkPreviewResponse) GetTitle() string {
|
||||
if m != nil {
|
||||
return m.Title
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (m *LinkPreviewResponse) GetDescription() string {
|
||||
if m != nil {
|
||||
return m.Description
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (m *LinkPreviewResponse) GetImageUrl() string {
|
||||
if m != nil {
|
||||
return m.ImageUrl
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (m *LinkPreviewResponse) GetType() LinkPreviewResponse_Type {
|
||||
if m != nil {
|
||||
return m.Type
|
||||
}
|
||||
return LinkPreviewResponse_PAGE
|
||||
}
|
||||
|
||||
type LinkPreviewResponse_Error struct {
|
||||
Code LinkPreviewResponse_Error_Code `protobuf:"varint,1,opt,name=code,proto3,enum=anytype.LinkPreviewResponse_Error_Code" json:"code,omitempty"`
|
||||
Description string `protobuf:"bytes,2,opt,name=description,proto3" json:"description,omitempty"`
|
||||
}
|
||||
|
||||
func (m *LinkPreviewResponse_Error) Reset() { *m = LinkPreviewResponse_Error{} }
|
||||
func (m *LinkPreviewResponse_Error) String() string { return proto.CompactTextString(m) }
|
||||
func (*LinkPreviewResponse_Error) ProtoMessage() {}
|
||||
func (*LinkPreviewResponse_Error) Descriptor() ([]byte, []int) {
|
||||
return fileDescriptor_2d3ba2f07ad357c5, []int{5, 0}
|
||||
}
|
||||
func (m *LinkPreviewResponse_Error) XXX_Unmarshal(b []byte) error {
|
||||
return m.Unmarshal(b)
|
||||
}
|
||||
func (m *LinkPreviewResponse_Error) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
||||
if deterministic {
|
||||
return xxx_messageInfo_LinkPreviewResponse_Error.Marshal(b, m, deterministic)
|
||||
} else {
|
||||
b = b[:cap(b)]
|
||||
n, err := m.MarshalToSizedBuffer(b)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return b[:n], nil
|
||||
}
|
||||
}
|
||||
func (m *LinkPreviewResponse_Error) XXX_Merge(src proto.Message) {
|
||||
xxx_messageInfo_LinkPreviewResponse_Error.Merge(m, src)
|
||||
}
|
||||
func (m *LinkPreviewResponse_Error) XXX_Size() int {
|
||||
return m.Size()
|
||||
}
|
||||
func (m *LinkPreviewResponse_Error) XXX_DiscardUnknown() {
|
||||
xxx_messageInfo_LinkPreviewResponse_Error.DiscardUnknown(m)
|
||||
}
|
||||
|
||||
var xxx_messageInfo_LinkPreviewResponse_Error proto.InternalMessageInfo
|
||||
|
||||
func (m *LinkPreviewResponse_Error) GetCode() LinkPreviewResponse_Error_Code {
|
||||
if m != nil {
|
||||
return m.Code
|
||||
}
|
||||
return LinkPreviewResponse_Error_NULL
|
||||
}
|
||||
|
||||
func (m *LinkPreviewResponse_Error) GetDescription() string {
|
||||
if m != nil {
|
||||
return m.Description
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func init() {
|
||||
proto.RegisterEnum("anytype.VersionGetResponse_Error_Code", VersionGetResponse_Error_Code_name, VersionGetResponse_Error_Code_value)
|
||||
proto.RegisterEnum("anytype.LogSendRequest_Level", LogSendRequest_Level_name, LogSendRequest_Level_value)
|
||||
proto.RegisterEnum("anytype.LogSendResponse_Error_Code", LogSendResponse_Error_Code_name, LogSendResponse_Error_Code_value)
|
||||
proto.RegisterEnum("anytype.LinkPreviewResponse_Type", LinkPreviewResponse_Type_name, LinkPreviewResponse_Type_value)
|
||||
proto.RegisterEnum("anytype.LinkPreviewResponse_Error_Code", LinkPreviewResponse_Error_Code_name, LinkPreviewResponse_Error_Code_value)
|
||||
proto.RegisterType((*VersionGetRequest)(nil), "anytype.VersionGetRequest")
|
||||
proto.RegisterType((*VersionGetResponse)(nil), "anytype.VersionGetResponse")
|
||||
proto.RegisterType((*VersionGetResponse_Error)(nil), "anytype.VersionGetResponse.Error")
|
||||
proto.RegisterType((*LogSendRequest)(nil), "anytype.LogSendRequest")
|
||||
proto.RegisterType((*LogSendResponse)(nil), "anytype.LogSendResponse")
|
||||
proto.RegisterType((*LogSendResponse_Error)(nil), "anytype.LogSendResponse.Error")
|
||||
proto.RegisterType((*LinkPreviewRequest)(nil), "anytype.LinkPreviewRequest")
|
||||
proto.RegisterType((*LinkPreviewResponse)(nil), "anytype.LinkPreviewResponse")
|
||||
proto.RegisterType((*LinkPreviewResponse_Error)(nil), "anytype.LinkPreviewResponse.Error")
|
||||
}
|
||||
|
||||
func init() { proto.RegisterFile("misc.proto", fileDescriptor_2d3ba2f07ad357c5) }
|
||||
|
||||
var fileDescriptor_2d3ba2f07ad357c5 = []byte{
|
||||
// 452 bytes of a gzipped FileDescriptorProto
|
||||
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x93, 0x41, 0x6f, 0xd3, 0x30,
|
||||
0x14, 0xc7, 0xe3, 0xac, 0xa1, 0xe4, 0x55,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0, 0x61, 0xff, 0x44, 0xf0, 0x60, 0x75, 0xd7, 0x42, 0xf1, 0x8b, 0x75, 0xc5, 0xd6, 0xdd,
|
||||
0xa5, 0xfe, 0xe0, 0x77, 0xf7, 0xf3, 0xca, 0xe2, 0xc1, 0x9a, 0xc5, 0x67, 0x9b, 0x8f, 0xff, 0x9b,
|
||||
0x42, 0xfa, 0x1f, 0x0a, 0x37, 0xc8, 0xea, 0x3e, 0xfe, 0x3a, 0xb3, 0xd0, 0xcd, 0xcc, 0x42, 0x3f,
|
||||
0x66, 0x16, 0xfa, 0x38, 0xb7, 0xb4, 0x9b, 0xb9, 0xa5, 0x7d, 0x9f, 0x5b, 0xda, 0x5b, 0x3d, 0x3b,
|
||||
0x3b, 0xbb, 0x57, 0xbe, 0x93, 0xfd, 0x5f, 0x01, 0x00, 0x00, 0xff, 0xff, 0x39, 0x57, 0x42, 0x0b,
|
||||
0x35, 0x03, 0x00, 0x00,
|
||||
// 600 bytes of a gzipped FileDescriptorProto
|
||||
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x94, 0xc1, 0x4e, 0xdb, 0x4c,
|
||||
0x10, 0xc7, 0xe3, 0xd8, 0xfe, 0x20, 0x83, 0xc8, 0xb7, 0x2c, 0x1c, 0xa2, 0xa8, 0xb5, 0xc0, 0x95,
|
||||
0x28, 0x27, 0x1f, 0xa0, 0x88, 0xaa, 0x3d, 0x54, 0x86, 0x98, 0xc8, 0xad, 0x59, 0x5b, 0x8b, 0x0d,
|
||||
0xb4, 0x97, 0x08, 0xc8, 0x16, 0x59, 0x4d, 0x62, 0xd7, 0x36, 0xa9, 0xf2, 0x16, 0x7d, 0x8b, 0x1e,
|
||||
0x7a, 0xab, 0xd4, 0x53, 0x5f, 0xa0, 0x52, 0x2f, 0x1c, 0x7b, 0xac, 0x92, 0xd7, 0xe8, 0xa1, 0x5a,
|
||||
0xdb, 0x09, 0xb8, 0xa9, 0x82, 0xe0, 0xb6, 0x33, 0xfe, 0xef, 0xcc, 0xfc, 0xe7, 0x67, 0x1b, 0xa0,
|
||||
0xeb, 0xc7, 0xe7, 0x5a, 0x18, 0x05, 0x49, 0x80, 0xe7, 0x4e, 0x7b, 0x83, 0x64, 0x10, 0x32, 0x75,
|
||||
0x19, 0x96, 0x8e, 0x58, 0x14, 0xfb, 0x41, 0xaf, 0xc9, 0x12, 0xca, 0xde, 0x5f, 0xb2, 0x38, 0x51,
|
||||
0xbf, 0x96, 0x01, 0xdf, 0xcc, 0xc6, 0x61, 0xd0, 0x8b, 0x19, 0xde, 0x01, 0x99, 0x45, 0x51, 0x10,
|
||||
0xd5, 0x84, 0x55, 0x61, 0x63, 0x61, 0x73, 0x4d, 0xcb, 0x8b, 0x68, 0xd3, 0x5a, 0xcd, 0xe0, 0x42,
|
||||
0x9a, 0xe9, 0x71, 0x0d, 0xe6, 0xfa, 0x99, 0xa4, 0x56, 0x5e, 0x15, 0x36, 0x2a, 0x74, 0x1c, 0xd6,
|
||||
0x7f, 0x08, 0x20, 0xa7, 0x52, 0xfc, 0x0c, 0xa4, 0xf3, 0xa0, 0xcd, 0xd2, 0xda, 0xd5, 0xcd, 0xf5,
|
||||
0x5b, 0x6b, 0x6b, 0x7b, 0x41, 0x9b, 0xd1, 0xf4, 0x0e, 0x5e, 0x85, 0x85, 0x36, 0x8b, 0xcf, 0x23,
|
||||
0x3f, 0x4c, 0xae, 0x7b, 0xdc, 0x4c, 0xa9, 0x6d, 0x90, 0xb8, 0x1e, 0xcf, 0x83, 0x44, 0x3c, 0xcb,
|
||||
0x42, 0x25, 0xbc, 0x04, 0x8b, 0x1e, 0x79, 0x45, 0xec, 0x63, 0xd2, 0x32, 0x28, 0xb5, 0x29, 0x12,
|
||||
0xf0, 0x22, 0x54, 0x76, 0xf5, 0x46, 0xcb, 0x24, 0x8e, 0xe7, 0xa2, 0x32, 0x5e, 0x01, 0x74, 0x64,
|
||||
0xd0, 0x43, 0xd3, 0x26, 0x2d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, 0x8f, 0xea, 0x37, 0x11, 0x96, 0x0b, 0xc2, 0x7c, 0x55, 0x4f, 0x8b, 0xab, 0x52,
|
||||
0xaf, 0xbd, 0x4e, 0x8b, 0x8b, 0x9f, 0xc3, 0x0a, 0xc8, 0x89, 0x9f, 0x74, 0x58, 0xee, 0x32, 0x0b,
|
||||
0xfe, 0xde, 0x80, 0x38, 0xb5, 0x01, 0x5c, 0x87, 0x79, 0xbf, 0x7b, 0x7a, 0xc1, 0xbc, 0xa8, 0x53,
|
||||
0x93, 0xd2, 0xc7, 0x93, 0x18, 0x6f, 0x83, 0xc4, 0x9b, 0xd7, 0xe4, 0x74, 0xf1, 0x6b, 0x33, 0x87,
|
||||
0x71, 0x07, 0x21, 0xa3, 0xa9, 0xbc, 0xfe, 0x69, 0x42, 0xee, 0x79, 0x81, 0xdc, 0xe3, 0xdb, 0xdd,
|
||||
0xdc, 0x8d, 0xde, 0x8b, 0x7b, 0xd0, 0x2b, 0xe0, 0xda, 0x06, 0x89, 0xcf, 0xcd, 0x0b, 0x38, 0x7a,
|
||||
0xd3, 0xc8, 0xde, 0x7b, 0xf3, 0x80, 0x1f, 0x05, 0x9e, 0x74, 0x8d, 0x13, 0x7e, 0xa7, 0x0a, 0xe0,
|
||||
0x11, 0xe3, 0xc4, 0x31, 0xf6, 0x5c, 0xa3, 0x81, 0xc4, 0xdd, 0x07, 0xdf, 0x87, 0x8a, 0x70, 0x35,
|
||||
0x54, 0x84, 0x5f, 0x43, 0x45, 0xf8, 0x38, 0x52, 0x4a, 0x57, 0x23, 0xa5, 0xf4, 0x73, 0xa4, 0x94,
|
||||
0xde, 0x94, 0xc3, 0xb3, 0xb3, 0xff, 0xd2, 0xbf, 0xe1, 0xd6, 0x9f, 0x00, 0x00, 0x00, 0xff, 0xff,
|
||||
0x56, 0x36, 0x32, 0xd1, 0x1b, 0x05, 0x00, 0x00,
|
||||
}
|
||||
|
||||
func (m *VersionGetRequest) Marshal() (dAtA []byte, err error) {
|
||||
|
@ -670,6 +918,132 @@ func (m *LogSendResponse_Error) MarshalToSizedBuffer(dAtA []byte) (int, error) {
|
|||
return len(dAtA) - i, nil
|
||||
}
|
||||
|
||||
func (m *LinkPreviewRequest) Marshal() (dAtA []byte, err error) {
|
||||
size := m.Size()
|
||||
dAtA = make([]byte, size)
|
||||
n, err := m.MarshalToSizedBuffer(dAtA[:size])
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return dAtA[:n], nil
|
||||
}
|
||||
|
||||
func (m *LinkPreviewRequest) MarshalTo(dAtA []byte) (int, error) {
|
||||
size := m.Size()
|
||||
return m.MarshalToSizedBuffer(dAtA[:size])
|
||||
}
|
||||
|
||||
func (m *LinkPreviewRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) {
|
||||
i := len(dAtA)
|
||||
_ = i
|
||||
var l int
|
||||
_ = l
|
||||
if len(m.Url) > 0 {
|
||||
i -= len(m.Url)
|
||||
copy(dAtA[i:], m.Url)
|
||||
i = encodeVarintMisc(dAtA, i, uint64(len(m.Url)))
|
||||
i--
|
||||
dAtA[i] = 0xa
|
||||
}
|
||||
return len(dAtA) - i, nil
|
||||
}
|
||||
|
||||
func (m *LinkPreviewResponse) Marshal() (dAtA []byte, err error) {
|
||||
size := m.Size()
|
||||
dAtA = make([]byte, size)
|
||||
n, err := m.MarshalToSizedBuffer(dAtA[:size])
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return dAtA[:n], nil
|
||||
}
|
||||
|
||||
func (m *LinkPreviewResponse) MarshalTo(dAtA []byte) (int, error) {
|
||||
size := m.Size()
|
||||
return m.MarshalToSizedBuffer(dAtA[:size])
|
||||
}
|
||||
|
||||
func (m *LinkPreviewResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) {
|
||||
i := len(dAtA)
|
||||
_ = i
|
||||
var l int
|
||||
_ = l
|
||||
if m.Type != 0 {
|
||||
i = encodeVarintMisc(dAtA, i, uint64(m.Type))
|
||||
i--
|
||||
dAtA[i] = 0x28
|
||||
}
|
||||
if len(m.ImageUrl) > 0 {
|
||||
i -= len(m.ImageUrl)
|
||||
copy(dAtA[i:], m.ImageUrl)
|
||||
i = encodeVarintMisc(dAtA, i, uint64(len(m.ImageUrl)))
|
||||
i--
|
||||
dAtA[i] = 0x22
|
||||
}
|
||||
if len(m.Description) > 0 {
|
||||
i -= len(m.Description)
|
||||
copy(dAtA[i:], m.Description)
|
||||
i = encodeVarintMisc(dAtA, i, uint64(len(m.Description)))
|
||||
i--
|
||||
dAtA[i] = 0x1a
|
||||
}
|
||||
if len(m.Title) > 0 {
|
||||
i -= len(m.Title)
|
||||
copy(dAtA[i:], m.Title)
|
||||
i = encodeVarintMisc(dAtA, i, uint64(len(m.Title)))
|
||||
i--
|
||||
dAtA[i] = 0x12
|
||||
}
|
||||
if m.Error != nil {
|
||||
{
|
||||
size, err := m.Error.MarshalToSizedBuffer(dAtA[:i])
|
||||
if err != nil {
|
||||
return 0, err
|
||||
}
|
||||
i -= size
|
||||
i = encodeVarintMisc(dAtA, i, uint64(size))
|
||||
}
|
||||
i--
|
||||
dAtA[i] = 0xa
|
||||
}
|
||||
return len(dAtA) - i, nil
|
||||
}
|
||||
|
||||
func (m *LinkPreviewResponse_Error) Marshal() (dAtA []byte, err error) {
|
||||
size := m.Size()
|
||||
dAtA = make([]byte, size)
|
||||
n, err := m.MarshalToSizedBuffer(dAtA[:size])
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return dAtA[:n], nil
|
||||
}
|
||||
|
||||
func (m *LinkPreviewResponse_Error) MarshalTo(dAtA []byte) (int, error) {
|
||||
size := m.Size()
|
||||
return m.MarshalToSizedBuffer(dAtA[:size])
|
||||
}
|
||||
|
||||
func (m *LinkPreviewResponse_Error) MarshalToSizedBuffer(dAtA []byte) (int, error) {
|
||||
i := len(dAtA)
|
||||
_ = i
|
||||
var l int
|
||||
_ = l
|
||||
if len(m.Description) > 0 {
|
||||
i -= len(m.Description)
|
||||
copy(dAtA[i:], m.Description)
|
||||
i = encodeVarintMisc(dAtA, i, uint64(len(m.Description)))
|
||||
i--
|
||||
dAtA[i] = 0x12
|
||||
}
|
||||
if m.Code != 0 {
|
||||
i = encodeVarintMisc(dAtA, i, uint64(m.Code))
|
||||
i--
|
||||
dAtA[i] = 0x8
|
||||
}
|
||||
return len(dAtA) - i, nil
|
||||
}
|
||||
|
||||
func encodeVarintMisc(dAtA []byte, offset int, v uint64) int {
|
||||
offset -= sovMisc(v)
|
||||
base := offset
|
||||
|
@ -768,6 +1142,63 @@ func (m *LogSendResponse_Error) Size() (n int) {
|
|||
return n
|
||||
}
|
||||
|
||||
func (m *LinkPreviewRequest) Size() (n int) {
|
||||
if m == nil {
|
||||
return 0
|
||||
}
|
||||
var l int
|
||||
_ = l
|
||||
l = len(m.Url)
|
||||
if l > 0 {
|
||||
n += 1 + l + sovMisc(uint64(l))
|
||||
}
|
||||
return n
|
||||
}
|
||||
|
||||
func (m *LinkPreviewResponse) Size() (n int) {
|
||||
if m == nil {
|
||||
return 0
|
||||
}
|
||||
var l int
|
||||
_ = l
|
||||
if m.Error != nil {
|
||||
l = m.Error.Size()
|
||||
n += 1 + l + sovMisc(uint64(l))
|
||||
}
|
||||
l = len(m.Title)
|
||||
if l > 0 {
|
||||
n += 1 + l + sovMisc(uint64(l))
|
||||
}
|
||||
l = len(m.Description)
|
||||
if l > 0 {
|
||||
n += 1 + l + sovMisc(uint64(l))
|
||||
}
|
||||
l = len(m.ImageUrl)
|
||||
if l > 0 {
|
||||
n += 1 + l + sovMisc(uint64(l))
|
||||
}
|
||||
if m.Type != 0 {
|
||||
n += 1 + sovMisc(uint64(m.Type))
|
||||
}
|
||||
return n
|
||||
}
|
||||
|
||||
func (m *LinkPreviewResponse_Error) Size() (n int) {
|
||||
if m == nil {
|
||||
return 0
|
||||
}
|
||||
var l int
|
||||
_ = l
|
||||
if m.Code != 0 {
|
||||
n += 1 + sovMisc(uint64(m.Code))
|
||||
}
|
||||
l = len(m.Description)
|
||||
if l > 0 {
|
||||
n += 1 + l + sovMisc(uint64(l))
|
||||
}
|
||||
return n
|
||||
}
|
||||
|
||||
func sovMisc(x uint64) (n int) {
|
||||
return (math_bits.Len64(x|1) + 6) / 7
|
||||
}
|
||||
|
@ -1349,6 +1780,399 @@ func (m *LogSendResponse_Error) Unmarshal(dAtA []byte) error {
|
|||
}
|
||||
return nil
|
||||
}
|
||||
func (m *LinkPreviewRequest) Unmarshal(dAtA []byte) error {
|
||||
l := len(dAtA)
|
||||
iNdEx := 0
|
||||
for iNdEx < l {
|
||||
preIndex := iNdEx
|
||||
var wire uint64
|
||||
for shift := uint(0); ; shift += 7 {
|
||||
if shift >= 64 {
|
||||
return ErrIntOverflowMisc
|
||||
}
|
||||
if iNdEx >= l {
|
||||
return io.ErrUnexpectedEOF
|
||||
}
|
||||
b := dAtA[iNdEx]
|
||||
iNdEx++
|
||||
wire |= uint64(b&0x7F) << shift
|
||||
if b < 0x80 {
|
||||
break
|
||||
}
|
||||
}
|
||||
fieldNum := int32(wire >> 3)
|
||||
wireType := int(wire & 0x7)
|
||||
if wireType == 4 {
|
||||
return fmt.Errorf("proto: LinkPreviewRequest: wiretype end group for non-group")
|
||||
}
|
||||
if fieldNum <= 0 {
|
||||
return fmt.Errorf("proto: LinkPreviewRequest: illegal tag %d (wire type %d)", fieldNum, wire)
|
||||
}
|
||||
switch fieldNum {
|
||||
case 1:
|
||||
if wireType != 2 {
|
||||
return fmt.Errorf("proto: wrong wireType = %d for field Url", wireType)
|
||||
}
|
||||
var stringLen uint64
|
||||
for shift := uint(0); ; shift += 7 {
|
||||
if shift >= 64 {
|
||||
return ErrIntOverflowMisc
|
||||
}
|
||||
if iNdEx >= l {
|
||||
return io.ErrUnexpectedEOF
|
||||
}
|
||||
b := dAtA[iNdEx]
|
||||
iNdEx++
|
||||
stringLen |= uint64(b&0x7F) << shift
|
||||
if b < 0x80 {
|
||||
break
|
||||
}
|
||||
}
|
||||
intStringLen := int(stringLen)
|
||||
if intStringLen < 0 {
|
||||
return ErrInvalidLengthMisc
|
||||
}
|
||||
postIndex := iNdEx + intStringLen
|
||||
if postIndex < 0 {
|
||||
return ErrInvalidLengthMisc
|
||||
}
|
||||
if postIndex > l {
|
||||
return io.ErrUnexpectedEOF
|
||||
}
|
||||
m.Url = string(dAtA[iNdEx:postIndex])
|
||||
iNdEx = postIndex
|
||||
default:
|
||||
iNdEx = preIndex
|
||||
skippy, err := skipMisc(dAtA[iNdEx:])
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
if skippy < 0 {
|
||||
return ErrInvalidLengthMisc
|
||||
}
|
||||
if (iNdEx + skippy) < 0 {
|
||||
return ErrInvalidLengthMisc
|
||||
}
|
||||
if (iNdEx + skippy) > l {
|
||||
return io.ErrUnexpectedEOF
|
||||
}
|
||||
iNdEx += skippy
|
||||
}
|
||||
}
|
||||
|
||||
if iNdEx > l {
|
||||
return io.ErrUnexpectedEOF
|
||||
}
|
||||
return nil
|
||||
}
|
||||
func (m *LinkPreviewResponse) Unmarshal(dAtA []byte) error {
|
||||
l := len(dAtA)
|
||||
iNdEx := 0
|
||||
for iNdEx < l {
|
||||
preIndex := iNdEx
|
||||
var wire uint64
|
||||
for shift := uint(0); ; shift += 7 {
|
||||
if shift >= 64 {
|
||||
return ErrIntOverflowMisc
|
||||
}
|
||||
if iNdEx >= l {
|
||||
return io.ErrUnexpectedEOF
|
||||
}
|
||||
b := dAtA[iNdEx]
|
||||
iNdEx++
|
||||
wire |= uint64(b&0x7F) << shift
|
||||
if b < 0x80 {
|
||||
break
|
||||
}
|
||||
}
|
||||
fieldNum := int32(wire >> 3)
|
||||
wireType := int(wire & 0x7)
|
||||
if wireType == 4 {
|
||||
return fmt.Errorf("proto: LinkPreviewResponse: wiretype end group for non-group")
|
||||
}
|
||||
if fieldNum <= 0 {
|
||||
return fmt.Errorf("proto: LinkPreviewResponse: illegal tag %d (wire type %d)", fieldNum, wire)
|
||||
}
|
||||
switch fieldNum {
|
||||
case 1:
|
||||
if wireType != 2 {
|
||||
return fmt.Errorf("proto: wrong wireType = %d for field Error", wireType)
|
||||
}
|
||||
var msglen int
|
||||
for shift := uint(0); ; shift += 7 {
|
||||
if shift >= 64 {
|
||||
return ErrIntOverflowMisc
|
||||
}
|
||||
if iNdEx >= l {
|
||||
return io.ErrUnexpectedEOF
|
||||
}
|
||||
b := dAtA[iNdEx]
|
||||
iNdEx++
|
||||
msglen |= int(b&0x7F) << shift
|
||||
if b < 0x80 {
|
||||
break
|
||||
}
|
||||
}
|
||||
if msglen < 0 {
|
||||
return ErrInvalidLengthMisc
|
||||
}
|
||||
postIndex := iNdEx + msglen
|
||||
if postIndex < 0 {
|
||||
return ErrInvalidLengthMisc
|
||||
}
|
||||
if postIndex > l {
|
||||
return io.ErrUnexpectedEOF
|
||||
}
|
||||
if m.Error == nil {
|
||||
m.Error = &LinkPreviewResponse_Error{}
|
||||
}
|
||||
if err := m.Error.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
|
||||
return err
|
||||
}
|
||||
iNdEx = postIndex
|
||||
case 2:
|
||||
if wireType != 2 {
|
||||
return fmt.Errorf("proto: wrong wireType = %d for field Title", wireType)
|
||||
}
|
||||
var stringLen uint64
|
||||
for shift := uint(0); ; shift += 7 {
|
||||
if shift >= 64 {
|
||||
return ErrIntOverflowMisc
|
||||
}
|
||||
if iNdEx >= l {
|
||||
return io.ErrUnexpectedEOF
|
||||
}
|
||||
b := dAtA[iNdEx]
|
||||
iNdEx++
|
||||
stringLen |= uint64(b&0x7F) << shift
|
||||
if b < 0x80 {
|
||||
break
|
||||
}
|
||||
}
|
||||
intStringLen := int(stringLen)
|
||||
if intStringLen < 0 {
|
||||
return ErrInvalidLengthMisc
|
||||
}
|
||||
postIndex := iNdEx + intStringLen
|
||||
if postIndex < 0 {
|
||||
return ErrInvalidLengthMisc
|
||||
}
|
||||
if postIndex > l {
|
||||
return io.ErrUnexpectedEOF
|
||||
}
|
||||
m.Title = string(dAtA[iNdEx:postIndex])
|
||||
iNdEx = postIndex
|
||||
case 3:
|
||||
if wireType != 2 {
|
||||
return fmt.Errorf("proto: wrong wireType = %d for field Description", wireType)
|
||||
}
|
||||
var stringLen uint64
|
||||
for shift := uint(0); ; shift += 7 {
|
||||
if shift >= 64 {
|
||||
return ErrIntOverflowMisc
|
||||
}
|
||||
if iNdEx >= l {
|
||||
return io.ErrUnexpectedEOF
|
||||
}
|
||||
b := dAtA[iNdEx]
|
||||
iNdEx++
|
||||
stringLen |= uint64(b&0x7F) << shift
|
||||
if b < 0x80 {
|
||||
break
|
||||
}
|
||||
}
|
||||
intStringLen := int(stringLen)
|
||||
if intStringLen < 0 {
|
||||
return ErrInvalidLengthMisc
|
||||
}
|
||||
postIndex := iNdEx + intStringLen
|
||||
if postIndex < 0 {
|
||||
return ErrInvalidLengthMisc
|
||||
}
|
||||
if postIndex > l {
|
||||
return io.ErrUnexpectedEOF
|
||||
}
|
||||
m.Description = string(dAtA[iNdEx:postIndex])
|
||||
iNdEx = postIndex
|
||||
case 4:
|
||||
if wireType != 2 {
|
||||
return fmt.Errorf("proto: wrong wireType = %d for field ImageUrl", wireType)
|
||||
}
|
||||
var stringLen uint64
|
||||
for shift := uint(0); ; shift += 7 {
|
||||
if shift >= 64 {
|
||||
return ErrIntOverflowMisc
|
||||
}
|
||||
if iNdEx >= l {
|
||||
return io.ErrUnexpectedEOF
|
||||
}
|
||||
b := dAtA[iNdEx]
|
||||
iNdEx++
|
||||
stringLen |= uint64(b&0x7F) << shift
|
||||
if b < 0x80 {
|
||||
break
|
||||
}
|
||||
}
|
||||
intStringLen := int(stringLen)
|
||||
if intStringLen < 0 {
|
||||
return ErrInvalidLengthMisc
|
||||
}
|
||||
postIndex := iNdEx + intStringLen
|
||||
if postIndex < 0 {
|
||||
return ErrInvalidLengthMisc
|
||||
}
|
||||
if postIndex > l {
|
||||
return io.ErrUnexpectedEOF
|
||||
}
|
||||
m.ImageUrl = string(dAtA[iNdEx:postIndex])
|
||||
iNdEx = postIndex
|
||||
case 5:
|
||||
if wireType != 0 {
|
||||
return fmt.Errorf("proto: wrong wireType = %d for field Type", wireType)
|
||||
}
|
||||
m.Type = 0
|
||||
for shift := uint(0); ; shift += 7 {
|
||||
if shift >= 64 {
|
||||
return ErrIntOverflowMisc
|
||||
}
|
||||
if iNdEx >= l {
|
||||
return io.ErrUnexpectedEOF
|
||||
}
|
||||
b := dAtA[iNdEx]
|
||||
iNdEx++
|
||||
m.Type |= LinkPreviewResponse_Type(b&0x7F) << shift
|
||||
if b < 0x80 {
|
||||
break
|
||||
}
|
||||
}
|
||||
default:
|
||||
iNdEx = preIndex
|
||||
skippy, err := skipMisc(dAtA[iNdEx:])
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
if skippy < 0 {
|
||||
return ErrInvalidLengthMisc
|
||||
}
|
||||
if (iNdEx + skippy) < 0 {
|
||||
return ErrInvalidLengthMisc
|
||||
}
|
||||
if (iNdEx + skippy) > l {
|
||||
return io.ErrUnexpectedEOF
|
||||
}
|
||||
iNdEx += skippy
|
||||
}
|
||||
}
|
||||
|
||||
if iNdEx > l {
|
||||
return io.ErrUnexpectedEOF
|
||||
}
|
||||
return nil
|
||||
}
|
||||
func (m *LinkPreviewResponse_Error) Unmarshal(dAtA []byte) error {
|
||||
l := len(dAtA)
|
||||
iNdEx := 0
|
||||
for iNdEx < l {
|
||||
preIndex := iNdEx
|
||||
var wire uint64
|
||||
for shift := uint(0); ; shift += 7 {
|
||||
if shift >= 64 {
|
||||
return ErrIntOverflowMisc
|
||||
}
|
||||
if iNdEx >= l {
|
||||
return io.ErrUnexpectedEOF
|
||||
}
|
||||
b := dAtA[iNdEx]
|
||||
iNdEx++
|
||||
wire |= uint64(b&0x7F) << shift
|
||||
if b < 0x80 {
|
||||
break
|
||||
}
|
||||
}
|
||||
fieldNum := int32(wire >> 3)
|
||||
wireType := int(wire & 0x7)
|
||||
if wireType == 4 {
|
||||
return fmt.Errorf("proto: Error: wiretype end group for non-group")
|
||||
}
|
||||
if fieldNum <= 0 {
|
||||
return fmt.Errorf("proto: Error: illegal tag %d (wire type %d)", fieldNum, wire)
|
||||
}
|
||||
switch fieldNum {
|
||||
case 1:
|
||||
if wireType != 0 {
|
||||
return fmt.Errorf("proto: wrong wireType = %d for field Code", wireType)
|
||||
}
|
||||
m.Code = 0
|
||||
for shift := uint(0); ; shift += 7 {
|
||||
if shift >= 64 {
|
||||
return ErrIntOverflowMisc
|
||||
}
|
||||
if iNdEx >= l {
|
||||
return io.ErrUnexpectedEOF
|
||||
}
|
||||
b := dAtA[iNdEx]
|
||||
iNdEx++
|
||||
m.Code |= LinkPreviewResponse_Error_Code(b&0x7F) << shift
|
||||
if b < 0x80 {
|
||||
break
|
||||
}
|
||||
}
|
||||
case 2:
|
||||
if wireType != 2 {
|
||||
return fmt.Errorf("proto: wrong wireType = %d for field Description", wireType)
|
||||
}
|
||||
var stringLen uint64
|
||||
for shift := uint(0); ; shift += 7 {
|
||||
if shift >= 64 {
|
||||
return ErrIntOverflowMisc
|
||||
}
|
||||
if iNdEx >= l {
|
||||
return io.ErrUnexpectedEOF
|
||||
}
|
||||
b := dAtA[iNdEx]
|
||||
iNdEx++
|
||||
stringLen |= uint64(b&0x7F) << shift
|
||||
if b < 0x80 {
|
||||
break
|
||||
}
|
||||
}
|
||||
intStringLen := int(stringLen)
|
||||
if intStringLen < 0 {
|
||||
return ErrInvalidLengthMisc
|
||||
}
|
||||
postIndex := iNdEx + intStringLen
|
||||
if postIndex < 0 {
|
||||
return ErrInvalidLengthMisc
|
||||
}
|
||||
if postIndex > l {
|
||||
return io.ErrUnexpectedEOF
|
||||
}
|
||||
m.Description = string(dAtA[iNdEx:postIndex])
|
||||
iNdEx = postIndex
|
||||
default:
|
||||
iNdEx = preIndex
|
||||
skippy, err := skipMisc(dAtA[iNdEx:])
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
if skippy < 0 {
|
||||
return ErrInvalidLengthMisc
|
||||
}
|
||||
if (iNdEx + skippy) < 0 {
|
||||
return ErrInvalidLengthMisc
|
||||
}
|
||||
if (iNdEx + skippy) > l {
|
||||
return io.ErrUnexpectedEOF
|
||||
}
|
||||
iNdEx += skippy
|
||||
}
|
||||
}
|
||||
|
||||
if iNdEx > l {
|
||||
return io.ErrUnexpectedEOF
|
||||
}
|
||||
return nil
|
||||
}
|
||||
func skipMisc(dAtA []byte) (n int, err error) {
|
||||
l := len(dAtA)
|
||||
iNdEx := 0
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
syntax="proto3";
|
||||
syntax = "proto3";
|
||||
package anytype;
|
||||
option go_package = "pb";
|
||||
|
||||
|
@ -55,3 +55,35 @@ message LogSendResponse {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
message LinkPreviewRequest {
|
||||
string url = 1;
|
||||
}
|
||||
|
||||
message LinkPreviewResponse {
|
||||
Error error = 1;
|
||||
string title = 2;
|
||||
string description = 3;
|
||||
string imageUrl = 4;
|
||||
Type type = 5;
|
||||
|
||||
message Error {
|
||||
Code code = 1;
|
||||
string description = 2;
|
||||
|
||||
enum Code {
|
||||
NULL = 0;
|
||||
UNKNOWN_ERROR = 1;
|
||||
BAD_INPUT = 2;
|
||||
|
||||
TIMEOUT = 102;
|
||||
}
|
||||
}
|
||||
|
||||
enum Type {
|
||||
PAGE = 0;
|
||||
IMAGE = 1;
|
||||
TEXT = 2;
|
||||
UNEXPECTED = 3;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -22,4 +22,6 @@ service ClientCommands {
|
|||
rpc BlockOpen (BlockOpenRequest) returns (BlockOpenResponse);
|
||||
rpc BlockCreate (BlockCreateRequest) returns (BlockCreateResponse);
|
||||
rpc BlockUpdate (BlockUpdateRequest) returns (BlockUpdateResponse);
|
||||
|
||||
rpc LinkPreview (LinkPreviewRequest) returns (LinkPreviewResponse);
|
||||
}
|
||||
|
|
|
@ -6,6 +6,7 @@ import (
|
|||
"path/filepath"
|
||||
"strings"
|
||||
|
||||
"github.com/anytypeio/go-anytype-middleware/pb"
|
||||
"github.com/otiai10/opengraph"
|
||||
)
|
||||
|
||||
|
@ -16,30 +17,17 @@ func New() LinkPreview {
|
|||
type LinkType string
|
||||
|
||||
const (
|
||||
LinkTypeHtml LinkType = "html"
|
||||
LinkTypeImage LinkType = "image"
|
||||
LinkTypeVideo LinkType = "video"
|
||||
LinkTypeText LinkType = "text"
|
||||
LinkTypeUnexpected LinkType = "unexpected"
|
||||
|
||||
// read no more than 400 kb
|
||||
maxBytesToRead = 400000
|
||||
)
|
||||
|
||||
type LinkPreview interface {
|
||||
Fetch(ctx context.Context, url string) (Info, error)
|
||||
}
|
||||
|
||||
type Info struct {
|
||||
Title string
|
||||
Description string
|
||||
ImageUrl string
|
||||
Type LinkType
|
||||
Fetch(ctx context.Context, url string) (pb.LinkPreviewResponse, error)
|
||||
}
|
||||
|
||||
type linkPreview struct{}
|
||||
|
||||
func (l *linkPreview) Fetch(ctx context.Context, url string) (Info, error) {
|
||||
func (l *linkPreview) Fetch(ctx context.Context, url string) (pb.LinkPreviewResponse, error) {
|
||||
rt := &proxyRoundTripper{RoundTripper: http.DefaultTransport}
|
||||
client := &http.Client{Transport: rt}
|
||||
og, err := opengraph.FetchWithContext(ctx, url, client)
|
||||
|
@ -47,16 +35,16 @@ func (l *linkPreview) Fetch(ctx context.Context, url string) (Info, error) {
|
|||
if resp := rt.lastResponse; resp != nil && resp.StatusCode == http.StatusOK {
|
||||
return l.makeNonHtml(url, resp)
|
||||
}
|
||||
return Info{}, err
|
||||
return pb.LinkPreviewResponse{}, err
|
||||
}
|
||||
return l.convertOGToInfo(og), nil
|
||||
}
|
||||
|
||||
func (l *linkPreview) convertOGToInfo(og *opengraph.OpenGraph) (i Info) {
|
||||
i = Info{
|
||||
func (l *linkPreview) convertOGToInfo(og *opengraph.OpenGraph) (i pb.LinkPreviewResponse) {
|
||||
i = pb.LinkPreviewResponse{
|
||||
Title: og.Title,
|
||||
Description: og.Description,
|
||||
Type: LinkTypeHtml,
|
||||
Type: pb.LinkPreviewResponse_PAGE,
|
||||
}
|
||||
if len(og.Image) != 0 {
|
||||
i.ImageUrl = og.Image[0].URL
|
||||
|
@ -64,16 +52,16 @@ func (l *linkPreview) convertOGToInfo(og *opengraph.OpenGraph) (i Info) {
|
|||
return
|
||||
}
|
||||
|
||||
func (l *linkPreview) makeNonHtml(url string, resp *http.Response) (i Info, err error) {
|
||||
func (l *linkPreview) makeNonHtml(url string, resp *http.Response) (i pb.LinkPreviewResponse, err error) {
|
||||
ct := resp.Header.Get("Content-Type")
|
||||
i.Title = filepath.Base(url)
|
||||
if strings.HasPrefix(ct, "image/") {
|
||||
i.Type = LinkTypeImage
|
||||
i.Type = pb.LinkPreviewResponse_IMAGE
|
||||
i.ImageUrl = url
|
||||
} else if strings.HasPrefix(ct, "text/") {
|
||||
i.Type = LinkTypeText
|
||||
i.Type = pb.LinkPreviewResponse_TEXT
|
||||
} else {
|
||||
i.Type = LinkTypeUnexpected
|
||||
i.Type = pb.LinkPreviewResponse_UNEXPECTED
|
||||
}
|
||||
return
|
||||
}
|
||||
|
|
|
@ -8,6 +8,7 @@ import (
|
|||
"strings"
|
||||
"testing"
|
||||
|
||||
"github.com/anytypeio/go-anytype-middleware/pb"
|
||||
"github.com/stretchr/testify/assert"
|
||||
"github.com/stretchr/testify/require"
|
||||
)
|
||||
|
@ -22,11 +23,11 @@ func TestLinkPreview_Fetch(t *testing.T) {
|
|||
|
||||
info, err := lp.Fetch(ctx, ts.URL)
|
||||
require.NoError(t, err)
|
||||
assert.Equal(t, Info{
|
||||
assert.Equal(t, pb.LinkPreviewResponse{
|
||||
Title: "Title",
|
||||
Description: "Description",
|
||||
ImageUrl: "http://site.com/images/example.jpg",
|
||||
Type: LinkTypeHtml,
|
||||
Type: pb.LinkPreviewResponse_PAGE,
|
||||
}, info)
|
||||
})
|
||||
|
||||
|
@ -38,10 +39,10 @@ func TestLinkPreview_Fetch(t *testing.T) {
|
|||
lp := New()
|
||||
info, err := lp.Fetch(ctx, url)
|
||||
require.NoError(t, err)
|
||||
assert.Equal(t, Info{
|
||||
assert.Equal(t, pb.LinkPreviewResponse{
|
||||
Title: "filename.jpg",
|
||||
ImageUrl: url,
|
||||
Type: LinkTypeImage,
|
||||
Type: pb.LinkPreviewResponse_IMAGE,
|
||||
}, info)
|
||||
assert.True(t, int(tr) <= maxBytesToRead)
|
||||
})
|
||||
|
@ -54,9 +55,9 @@ func TestLinkPreview_Fetch(t *testing.T) {
|
|||
lp := New()
|
||||
info, err := lp.Fetch(ctx, url)
|
||||
require.NoError(t, err)
|
||||
assert.Equal(t, Info{
|
||||
assert.Equal(t, pb.LinkPreviewResponse{
|
||||
Title: "filename.jpg",
|
||||
Type: LinkTypeUnexpected,
|
||||
Type: pb.LinkPreviewResponse_UNEXPECTED,
|
||||
}, info)
|
||||
assert.True(t, int(tr) <= maxBytesToRead)
|
||||
})
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue