feat(activitypub): implement inbox and outbox object model

master
Xeronith 2022-11-04 16:52:49 +03:30
rodzic 1b6d7b1c53
commit ef5c662cfe
14 zmienionych plików z 1882 dodań i 123 usunięć

Wyświetl plik

@ -628,6 +628,212 @@ func (x *ActivityPubMedia) GetHeight() int32 {
return 0
}
type ActivityPubIncomingActivity struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"`
IdentityId int64 `protobuf:"varint,2,opt,name=identityId,proto3" json:"identityId,omitempty"`
UniqueIdentifier string `protobuf:"bytes,3,opt,name=uniqueIdentifier,proto3" json:"uniqueIdentifier,omitempty"`
Timestamp int64 `protobuf:"varint,4,opt,name=timestamp,proto3" json:"timestamp,omitempty"`
From string `protobuf:"bytes,5,opt,name=from,proto3" json:"from,omitempty"`
To string `protobuf:"bytes,6,opt,name=to,proto3" json:"to,omitempty"`
Content string `protobuf:"bytes,7,opt,name=content,proto3" json:"content,omitempty"`
Raw string `protobuf:"bytes,8,opt,name=raw,proto3" json:"raw,omitempty"`
}
func (x *ActivityPubIncomingActivity) Reset() {
*x = ActivityPubIncomingActivity{}
if protoimpl.UnsafeEnabled {
mi := &file_objects_proto_msgTypes[8]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *ActivityPubIncomingActivity) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*ActivityPubIncomingActivity) ProtoMessage() {}
func (x *ActivityPubIncomingActivity) ProtoReflect() protoreflect.Message {
mi := &file_objects_proto_msgTypes[8]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use ActivityPubIncomingActivity.ProtoReflect.Descriptor instead.
func (*ActivityPubIncomingActivity) Descriptor() ([]byte, []int) {
return file_objects_proto_rawDescGZIP(), []int{8}
}
func (x *ActivityPubIncomingActivity) GetId() int64 {
if x != nil {
return x.Id
}
return 0
}
func (x *ActivityPubIncomingActivity) GetIdentityId() int64 {
if x != nil {
return x.IdentityId
}
return 0
}
func (x *ActivityPubIncomingActivity) GetUniqueIdentifier() string {
if x != nil {
return x.UniqueIdentifier
}
return ""
}
func (x *ActivityPubIncomingActivity) GetTimestamp() int64 {
if x != nil {
return x.Timestamp
}
return 0
}
func (x *ActivityPubIncomingActivity) GetFrom() string {
if x != nil {
return x.From
}
return ""
}
func (x *ActivityPubIncomingActivity) GetTo() string {
if x != nil {
return x.To
}
return ""
}
func (x *ActivityPubIncomingActivity) GetContent() string {
if x != nil {
return x.Content
}
return ""
}
func (x *ActivityPubIncomingActivity) GetRaw() string {
if x != nil {
return x.Raw
}
return ""
}
type ActivityPubOutgoingActivity struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"`
IdentityId int64 `protobuf:"varint,2,opt,name=identityId,proto3" json:"identityId,omitempty"`
UniqueIdentifier string `protobuf:"bytes,3,opt,name=uniqueIdentifier,proto3" json:"uniqueIdentifier,omitempty"`
Timestamp int64 `protobuf:"varint,4,opt,name=timestamp,proto3" json:"timestamp,omitempty"`
From string `protobuf:"bytes,5,opt,name=from,proto3" json:"from,omitempty"`
To string `protobuf:"bytes,6,opt,name=to,proto3" json:"to,omitempty"`
Content string `protobuf:"bytes,7,opt,name=content,proto3" json:"content,omitempty"`
Raw string `protobuf:"bytes,8,opt,name=raw,proto3" json:"raw,omitempty"`
}
func (x *ActivityPubOutgoingActivity) Reset() {
*x = ActivityPubOutgoingActivity{}
if protoimpl.UnsafeEnabled {
mi := &file_objects_proto_msgTypes[9]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *ActivityPubOutgoingActivity) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*ActivityPubOutgoingActivity) ProtoMessage() {}
func (x *ActivityPubOutgoingActivity) ProtoReflect() protoreflect.Message {
mi := &file_objects_proto_msgTypes[9]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use ActivityPubOutgoingActivity.ProtoReflect.Descriptor instead.
func (*ActivityPubOutgoingActivity) Descriptor() ([]byte, []int) {
return file_objects_proto_rawDescGZIP(), []int{9}
}
func (x *ActivityPubOutgoingActivity) GetId() int64 {
if x != nil {
return x.Id
}
return 0
}
func (x *ActivityPubOutgoingActivity) GetIdentityId() int64 {
if x != nil {
return x.IdentityId
}
return 0
}
func (x *ActivityPubOutgoingActivity) GetUniqueIdentifier() string {
if x != nil {
return x.UniqueIdentifier
}
return ""
}
func (x *ActivityPubOutgoingActivity) GetTimestamp() int64 {
if x != nil {
return x.Timestamp
}
return 0
}
func (x *ActivityPubOutgoingActivity) GetFrom() string {
if x != nil {
return x.From
}
return ""
}
func (x *ActivityPubOutgoingActivity) GetTo() string {
if x != nil {
return x.To
}
return ""
}
func (x *ActivityPubOutgoingActivity) GetContent() string {
if x != nil {
return x.Content
}
return ""
}
func (x *ActivityPubOutgoingActivity) GetRaw() string {
if x != nil {
return x.Raw
}
return ""
}
var File_objects_proto protoreflect.FileDescriptor
var file_objects_proto_rawDesc = []byte{
@ -696,8 +902,37 @@ var file_objects_proto_rawDesc = []byte{
0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x75, 0x72, 0x6c, 0x12, 0x14, 0x0a, 0x05, 0x77, 0x69, 0x64,
0x74, 0x68, 0x18, 0x05, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x77, 0x69, 0x64, 0x74, 0x68, 0x12,
0x16, 0x0a, 0x06, 0x68, 0x65, 0x69, 0x67, 0x68, 0x74, 0x18, 0x06, 0x20, 0x01, 0x28, 0x05, 0x52,
0x06, 0x68, 0x65, 0x69, 0x67, 0x68, 0x74, 0x42, 0x04, 0x5a, 0x02, 0x2e, 0x2f, 0x62, 0x06, 0x70,
0x72, 0x6f, 0x74, 0x6f, 0x33,
0x06, 0x68, 0x65, 0x69, 0x67, 0x68, 0x74, 0x22, 0xe7, 0x01, 0x0a, 0x1b, 0x41, 0x63, 0x74, 0x69,
0x76, 0x69, 0x74, 0x79, 0x50, 0x75, 0x62, 0x49, 0x6e, 0x63, 0x6f, 0x6d, 0x69, 0x6e, 0x67, 0x41,
0x63, 0x74, 0x69, 0x76, 0x69, 0x74, 0x79, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20,
0x01, 0x28, 0x03, 0x52, 0x02, 0x69, 0x64, 0x12, 0x1e, 0x0a, 0x0a, 0x69, 0x64, 0x65, 0x6e, 0x74,
0x69, 0x74, 0x79, 0x49, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0a, 0x69, 0x64, 0x65,
0x6e, 0x74, 0x69, 0x74, 0x79, 0x49, 0x64, 0x12, 0x2a, 0x0a, 0x10, 0x75, 0x6e, 0x69, 0x71, 0x75,
0x65, 0x49, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x66, 0x69, 0x65, 0x72, 0x18, 0x03, 0x20, 0x01, 0x28,
0x09, 0x52, 0x10, 0x75, 0x6e, 0x69, 0x71, 0x75, 0x65, 0x49, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x66,
0x69, 0x65, 0x72, 0x12, 0x1c, 0x0a, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70,
0x18, 0x04, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d,
0x70, 0x12, 0x12, 0x0a, 0x04, 0x66, 0x72, 0x6f, 0x6d, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52,
0x04, 0x66, 0x72, 0x6f, 0x6d, 0x12, 0x0e, 0x0a, 0x02, 0x74, 0x6f, 0x18, 0x06, 0x20, 0x01, 0x28,
0x09, 0x52, 0x02, 0x74, 0x6f, 0x12, 0x18, 0x0a, 0x07, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74,
0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x12,
0x10, 0x0a, 0x03, 0x72, 0x61, 0x77, 0x18, 0x08, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x72, 0x61,
0x77, 0x22, 0xe7, 0x01, 0x0a, 0x1b, 0x41, 0x63, 0x74, 0x69, 0x76, 0x69, 0x74, 0x79, 0x50, 0x75,
0x62, 0x4f, 0x75, 0x74, 0x67, 0x6f, 0x69, 0x6e, 0x67, 0x41, 0x63, 0x74, 0x69, 0x76, 0x69, 0x74,
0x79, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x02, 0x69,
0x64, 0x12, 0x1e, 0x0a, 0x0a, 0x69, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x49, 0x64, 0x18,
0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0a, 0x69, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x49,
0x64, 0x12, 0x2a, 0x0a, 0x10, 0x75, 0x6e, 0x69, 0x71, 0x75, 0x65, 0x49, 0x64, 0x65, 0x6e, 0x74,
0x69, 0x66, 0x69, 0x65, 0x72, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x10, 0x75, 0x6e, 0x69,
0x71, 0x75, 0x65, 0x49, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x66, 0x69, 0x65, 0x72, 0x12, 0x1c, 0x0a,
0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x18, 0x04, 0x20, 0x01, 0x28, 0x03,
0x52, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x12, 0x12, 0x0a, 0x04, 0x66,
0x72, 0x6f, 0x6d, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x66, 0x72, 0x6f, 0x6d, 0x12,
0x0e, 0x0a, 0x02, 0x74, 0x6f, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x74, 0x6f, 0x12,
0x18, 0x0a, 0x07, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09,
0x52, 0x07, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x12, 0x10, 0x0a, 0x03, 0x72, 0x61, 0x77,
0x18, 0x08, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x72, 0x61, 0x77, 0x42, 0x04, 0x5a, 0x02, 0x2e,
0x2f, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
}
var (
@ -712,16 +947,18 @@ func file_objects_proto_rawDescGZIP() []byte {
return file_objects_proto_rawDescData
}
var file_objects_proto_msgTypes = make([]protoimpl.MessageInfo, 8)
var file_objects_proto_msgTypes = make([]protoimpl.MessageInfo, 10)
var file_objects_proto_goTypes = []interface{}{
(*Error)(nil), // 0: protobuf.Error
(*Document)(nil), // 1: protobuf.Document
(*User)(nil), // 2: protobuf.User
(*ActivityPubObject)(nil), // 3: protobuf.ActivityPubObject
(*ActivityPubActivity)(nil), // 4: protobuf.ActivityPubActivity
(*ActivityPubPublicKey)(nil), // 5: protobuf.ActivityPubPublicKey
(*ActivityPubLink)(nil), // 6: protobuf.ActivityPubLink
(*ActivityPubMedia)(nil), // 7: protobuf.ActivityPubMedia
(*Error)(nil), // 0: protobuf.Error
(*Document)(nil), // 1: protobuf.Document
(*User)(nil), // 2: protobuf.User
(*ActivityPubObject)(nil), // 3: protobuf.ActivityPubObject
(*ActivityPubActivity)(nil), // 4: protobuf.ActivityPubActivity
(*ActivityPubPublicKey)(nil), // 5: protobuf.ActivityPubPublicKey
(*ActivityPubLink)(nil), // 6: protobuf.ActivityPubLink
(*ActivityPubMedia)(nil), // 7: protobuf.ActivityPubMedia
(*ActivityPubIncomingActivity)(nil), // 8: protobuf.ActivityPubIncomingActivity
(*ActivityPubOutgoingActivity)(nil), // 9: protobuf.ActivityPubOutgoingActivity
}
var file_objects_proto_depIdxs = []int32{
3, // 0: protobuf.ActivityPubActivity.object:type_name -> protobuf.ActivityPubObject
@ -834,6 +1071,30 @@ func file_objects_proto_init() {
return nil
}
}
file_objects_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*ActivityPubIncomingActivity); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_objects_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*ActivityPubOutgoingActivity); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
}
type x struct{}
out := protoimpl.TypeBuilder{
@ -841,7 +1102,7 @@ func file_objects_proto_init() {
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
RawDescriptor: file_objects_proto_rawDesc,
NumEnums: 0,
NumMessages: 8,
NumMessages: 10,
NumExtensions: 0,
NumServices: 0,
},

Wyświetl plik

@ -64,3 +64,25 @@ message ActivityPubMedia {
int32 width = 0x00000005;
int32 height = 0x00000006;
}
message ActivityPubIncomingActivity {
int64 id = 0x00000001;
int64 identityId = 0x00000002;
string uniqueIdentifier = 0x00000003;
int64 timestamp = 0x00000004;
string from = 0x00000005;
string to = 0x00000006;
string content = 0x00000007;
string raw = 0x00000008;
}
message ActivityPubOutgoingActivity {
int64 id = 0x00000001;
int64 identityId = 0x00000002;
string uniqueIdentifier = 0x00000003;
int64 timestamp = 0x00000004;
string from = 0x00000005;
string to = 0x00000006;
string content = 0x00000007;
string raw = 0x00000008;
}

Wyświetl plik

@ -8,42 +8,46 @@ const ENABLE_CUSTOM_ERRORS = true
// noinspection GoSnakeCaseUsage
const (
// SYSTEM_ERRORS
ERROR_MESSAGE_INITIALIZE = "ERROR_MESSAGE_INITIALIZE"
ERROR_MESSAGE_NOT_IMPLEMENTED = "ERROR_MESSAGE_NOT_IMPLEMENTED"
ERROR_MESSAGE_OPERATION_FAILED = "ERROR_MESSAGE_OPERATION_FAILED"
ERROR_MESSAGE_OPERATION_NOT_SUPPORTED = "ERROR_MESSAGE_OPERATION_NOT_SUPPORTED"
ERROR_MESSAGE_UNRESOLVED_DEPENDENCIES = "ERROR_MESSAGE_UNRESOLVED_DEPENDENCIES"
ERROR_MESSAGE_SYSTEM_COMPONENT_NOT_FOUND = "ERROR_MESSAGE_SYSTEM_COMPONENT_NOT_FOUND"
ERROR_MESSAGE_DOCUMENT_NOT_FOUND = "ERROR_MESSAGE_DOCUMENT_NOT_FOUND"
ERROR_MESSAGE_SYSTEM_SCHEDULE_NOT_FOUND = "ERROR_MESSAGE_SYSTEM_SCHEDULE_NOT_FOUND"
ERROR_MESSAGE_IDENTITY_NOT_FOUND = "ERROR_MESSAGE_IDENTITY_NOT_FOUND"
ERROR_MESSAGE_ACCESS_CONTROL_NOT_FOUND = "ERROR_MESSAGE_ACCESS_CONTROL_NOT_FOUND"
ERROR_MESSAGE_REMOTE_ACTIVITY_NOT_FOUND = "ERROR_MESSAGE_REMOTE_ACTIVITY_NOT_FOUND"
ERROR_MESSAGE_CATEGORY_TYPE_NOT_FOUND = "ERROR_MESSAGE_CATEGORY_TYPE_NOT_FOUND"
ERROR_MESSAGE_CATEGORY_NOT_FOUND = "ERROR_MESSAGE_CATEGORY_NOT_FOUND"
ERROR_MESSAGE_USER_NOT_FOUND = "ERROR_MESSAGE_USER_NOT_FOUND"
ERROR_MESSAGE_ACTIVITY_PUB_OBJECT_NOT_FOUND = "ERROR_MESSAGE_ACTIVITY_PUB_OBJECT_NOT_FOUND"
ERROR_MESSAGE_ACTIVITY_PUB_ACTIVITY_NOT_FOUND = "ERROR_MESSAGE_ACTIVITY_PUB_ACTIVITY_NOT_FOUND"
ERROR_MESSAGE_ACTIVITY_PUB_PUBLIC_KEY_NOT_FOUND = "ERROR_MESSAGE_ACTIVITY_PUB_PUBLIC_KEY_NOT_FOUND"
ERROR_MESSAGE_ACTIVITY_PUB_LINK_NOT_FOUND = "ERROR_MESSAGE_ACTIVITY_PUB_LINK_NOT_FOUND"
ERROR_MESSAGE_ACTIVITY_PUB_MEDIA_NOT_FOUND = "ERROR_MESSAGE_ACTIVITY_PUB_MEDIA_NOT_FOUND"
ERROR_MESSAGE_SPI_NOT_FOUND = "ERROR_MESSAGE_SPI_NOT_FOUND"
ERROR_MESSAGE_UNKNOWN_DOCUMENT = "ERROR_MESSAGE_UNKNOWN_DOCUMENT"
ERROR_MESSAGE_UNKNOWN_SYSTEM_SCHEDULE = "ERROR_MESSAGE_UNKNOWN_SYSTEM_SCHEDULE"
ERROR_MESSAGE_UNKNOWN_IDENTITY = "ERROR_MESSAGE_UNKNOWN_IDENTITY"
ERROR_MESSAGE_UNKNOWN_ACCESS_CONTROL = "ERROR_MESSAGE_UNKNOWN_ACCESS_CONTROL"
ERROR_MESSAGE_UNKNOWN_REMOTE_ACTIVITY = "ERROR_MESSAGE_UNKNOWN_REMOTE_ACTIVITY"
ERROR_MESSAGE_UNKNOWN_CATEGORY_TYPE = "ERROR_MESSAGE_UNKNOWN_CATEGORY_TYPE"
ERROR_MESSAGE_UNKNOWN_CATEGORY = "ERROR_MESSAGE_UNKNOWN_CATEGORY"
ERROR_MESSAGE_UNKNOWN_USER = "ERROR_MESSAGE_UNKNOWN_USER"
ERROR_MESSAGE_UNKNOWN_ACTIVITY_PUB_OBJECT = "ERROR_MESSAGE_UNKNOWN_ACTIVITY_PUB_OBJECT"
ERROR_MESSAGE_UNKNOWN_ACTIVITY_PUB_ACTIVITY = "ERROR_MESSAGE_UNKNOWN_ACTIVITY_PUB_ACTIVITY"
ERROR_MESSAGE_UNKNOWN_ACTIVITY_PUB_PUBLIC_KEY = "ERROR_MESSAGE_UNKNOWN_ACTIVITY_PUB_PUBLIC_KEY"
ERROR_MESSAGE_UNKNOWN_ACTIVITY_PUB_LINK = "ERROR_MESSAGE_UNKNOWN_ACTIVITY_PUB_LINK"
ERROR_MESSAGE_UNKNOWN_ACTIVITY_PUB_MEDIA = "ERROR_MESSAGE_UNKNOWN_ACTIVITY_PUB_MEDIA"
ERROR_MESSAGE_UNKNOWN_SPI = "ERROR_MESSAGE_UNKNOWN_SPI"
ERROR_MESSAGE_INVALID_ID = "ERROR_MESSAGE_INVALID_ID"
ERROR_MESSAGE_INVALID_PARAMETERS = "ERROR_MESSAGE_INVALID_PARAMETERS"
ERROR_MESSAGE_INITIALIZE = "ERROR_MESSAGE_INITIALIZE"
ERROR_MESSAGE_NOT_IMPLEMENTED = "ERROR_MESSAGE_NOT_IMPLEMENTED"
ERROR_MESSAGE_OPERATION_FAILED = "ERROR_MESSAGE_OPERATION_FAILED"
ERROR_MESSAGE_OPERATION_NOT_SUPPORTED = "ERROR_MESSAGE_OPERATION_NOT_SUPPORTED"
ERROR_MESSAGE_UNRESOLVED_DEPENDENCIES = "ERROR_MESSAGE_UNRESOLVED_DEPENDENCIES"
ERROR_MESSAGE_SYSTEM_COMPONENT_NOT_FOUND = "ERROR_MESSAGE_SYSTEM_COMPONENT_NOT_FOUND"
ERROR_MESSAGE_DOCUMENT_NOT_FOUND = "ERROR_MESSAGE_DOCUMENT_NOT_FOUND"
ERROR_MESSAGE_SYSTEM_SCHEDULE_NOT_FOUND = "ERROR_MESSAGE_SYSTEM_SCHEDULE_NOT_FOUND"
ERROR_MESSAGE_IDENTITY_NOT_FOUND = "ERROR_MESSAGE_IDENTITY_NOT_FOUND"
ERROR_MESSAGE_ACCESS_CONTROL_NOT_FOUND = "ERROR_MESSAGE_ACCESS_CONTROL_NOT_FOUND"
ERROR_MESSAGE_REMOTE_ACTIVITY_NOT_FOUND = "ERROR_MESSAGE_REMOTE_ACTIVITY_NOT_FOUND"
ERROR_MESSAGE_CATEGORY_TYPE_NOT_FOUND = "ERROR_MESSAGE_CATEGORY_TYPE_NOT_FOUND"
ERROR_MESSAGE_CATEGORY_NOT_FOUND = "ERROR_MESSAGE_CATEGORY_NOT_FOUND"
ERROR_MESSAGE_USER_NOT_FOUND = "ERROR_MESSAGE_USER_NOT_FOUND"
ERROR_MESSAGE_ACTIVITY_PUB_OBJECT_NOT_FOUND = "ERROR_MESSAGE_ACTIVITY_PUB_OBJECT_NOT_FOUND"
ERROR_MESSAGE_ACTIVITY_PUB_ACTIVITY_NOT_FOUND = "ERROR_MESSAGE_ACTIVITY_PUB_ACTIVITY_NOT_FOUND"
ERROR_MESSAGE_ACTIVITY_PUB_PUBLIC_KEY_NOT_FOUND = "ERROR_MESSAGE_ACTIVITY_PUB_PUBLIC_KEY_NOT_FOUND"
ERROR_MESSAGE_ACTIVITY_PUB_LINK_NOT_FOUND = "ERROR_MESSAGE_ACTIVITY_PUB_LINK_NOT_FOUND"
ERROR_MESSAGE_ACTIVITY_PUB_MEDIA_NOT_FOUND = "ERROR_MESSAGE_ACTIVITY_PUB_MEDIA_NOT_FOUND"
ERROR_MESSAGE_ACTIVITY_PUB_INCOMING_ACTIVITY_NOT_FOUND = "ERROR_MESSAGE_ACTIVITY_PUB_INCOMING_ACTIVITY_NOT_FOUND"
ERROR_MESSAGE_ACTIVITY_PUB_OUTGOING_ACTIVITY_NOT_FOUND = "ERROR_MESSAGE_ACTIVITY_PUB_OUTGOING_ACTIVITY_NOT_FOUND"
ERROR_MESSAGE_SPI_NOT_FOUND = "ERROR_MESSAGE_SPI_NOT_FOUND"
ERROR_MESSAGE_UNKNOWN_DOCUMENT = "ERROR_MESSAGE_UNKNOWN_DOCUMENT"
ERROR_MESSAGE_UNKNOWN_SYSTEM_SCHEDULE = "ERROR_MESSAGE_UNKNOWN_SYSTEM_SCHEDULE"
ERROR_MESSAGE_UNKNOWN_IDENTITY = "ERROR_MESSAGE_UNKNOWN_IDENTITY"
ERROR_MESSAGE_UNKNOWN_ACCESS_CONTROL = "ERROR_MESSAGE_UNKNOWN_ACCESS_CONTROL"
ERROR_MESSAGE_UNKNOWN_REMOTE_ACTIVITY = "ERROR_MESSAGE_UNKNOWN_REMOTE_ACTIVITY"
ERROR_MESSAGE_UNKNOWN_CATEGORY_TYPE = "ERROR_MESSAGE_UNKNOWN_CATEGORY_TYPE"
ERROR_MESSAGE_UNKNOWN_CATEGORY = "ERROR_MESSAGE_UNKNOWN_CATEGORY"
ERROR_MESSAGE_UNKNOWN_USER = "ERROR_MESSAGE_UNKNOWN_USER"
ERROR_MESSAGE_UNKNOWN_ACTIVITY_PUB_OBJECT = "ERROR_MESSAGE_UNKNOWN_ACTIVITY_PUB_OBJECT"
ERROR_MESSAGE_UNKNOWN_ACTIVITY_PUB_ACTIVITY = "ERROR_MESSAGE_UNKNOWN_ACTIVITY_PUB_ACTIVITY"
ERROR_MESSAGE_UNKNOWN_ACTIVITY_PUB_PUBLIC_KEY = "ERROR_MESSAGE_UNKNOWN_ACTIVITY_PUB_PUBLIC_KEY"
ERROR_MESSAGE_UNKNOWN_ACTIVITY_PUB_LINK = "ERROR_MESSAGE_UNKNOWN_ACTIVITY_PUB_LINK"
ERROR_MESSAGE_UNKNOWN_ACTIVITY_PUB_MEDIA = "ERROR_MESSAGE_UNKNOWN_ACTIVITY_PUB_MEDIA"
ERROR_MESSAGE_UNKNOWN_ACTIVITY_PUB_INCOMING_ACTIVITY = "ERROR_MESSAGE_UNKNOWN_ACTIVITY_PUB_INCOMING_ACTIVITY"
ERROR_MESSAGE_UNKNOWN_ACTIVITY_PUB_OUTGOING_ACTIVITY = "ERROR_MESSAGE_UNKNOWN_ACTIVITY_PUB_OUTGOING_ACTIVITY"
ERROR_MESSAGE_UNKNOWN_SPI = "ERROR_MESSAGE_UNKNOWN_SPI"
ERROR_MESSAGE_INVALID_ID = "ERROR_MESSAGE_INVALID_ID"
ERROR_MESSAGE_INVALID_PARAMETERS = "ERROR_MESSAGE_INVALID_PARAMETERS"
// CUSTOM_ERRORS
ERROR_MESSAGE_DATA_INTEGRITY_VIOLATION = "ERROR_MESSAGE_DATA_INTEGRITY_VIOLATION"
ERROR_MESSAGE_INVALID_STATE = "ERROR_MESSAGE_INVALID_STATE"
@ -61,42 +65,46 @@ const (
// noinspection GoSnakeCaseUsage,GoUnusedGlobalVariable
var (
// SYSTEM_ERRORS
ERROR_INITIALIZE = errors.New(ERROR_MESSAGE_INITIALIZE)
ERROR_NOT_IMPLEMENTED = errors.New(ERROR_MESSAGE_NOT_IMPLEMENTED)
ERROR_OPERATION_FAILED = errors.New(ERROR_MESSAGE_OPERATION_FAILED)
ERROR_OPERATION_NOT_SUPPORTED = errors.New(ERROR_MESSAGE_OPERATION_NOT_SUPPORTED)
ERROR_UNRESOLVED_DEPENDENCIES = errors.New(ERROR_MESSAGE_UNRESOLVED_DEPENDENCIES)
ERROR_SYSTEM_COMPONENT_NOT_FOUND = errors.New(ERROR_MESSAGE_SYSTEM_COMPONENT_NOT_FOUND)
ERROR_DOCUMENT_NOT_FOUND = errors.New(ERROR_MESSAGE_DOCUMENT_NOT_FOUND)
ERROR_SYSTEM_SCHEDULE_NOT_FOUND = errors.New(ERROR_MESSAGE_SYSTEM_SCHEDULE_NOT_FOUND)
ERROR_IDENTITY_NOT_FOUND = errors.New(ERROR_MESSAGE_IDENTITY_NOT_FOUND)
ERROR_ACCESS_CONTROL_NOT_FOUND = errors.New(ERROR_MESSAGE_ACCESS_CONTROL_NOT_FOUND)
ERROR_REMOTE_ACTIVITY_NOT_FOUND = errors.New(ERROR_MESSAGE_REMOTE_ACTIVITY_NOT_FOUND)
ERROR_CATEGORY_TYPE_NOT_FOUND = errors.New(ERROR_MESSAGE_CATEGORY_TYPE_NOT_FOUND)
ERROR_CATEGORY_NOT_FOUND = errors.New(ERROR_MESSAGE_CATEGORY_NOT_FOUND)
ERROR_USER_NOT_FOUND = errors.New(ERROR_MESSAGE_USER_NOT_FOUND)
ERROR_ACTIVITY_PUB_OBJECT_NOT_FOUND = errors.New(ERROR_MESSAGE_ACTIVITY_PUB_OBJECT_NOT_FOUND)
ERROR_ACTIVITY_PUB_ACTIVITY_NOT_FOUND = errors.New(ERROR_MESSAGE_ACTIVITY_PUB_ACTIVITY_NOT_FOUND)
ERROR_ACTIVITY_PUB_PUBLIC_KEY_NOT_FOUND = errors.New(ERROR_MESSAGE_ACTIVITY_PUB_PUBLIC_KEY_NOT_FOUND)
ERROR_ACTIVITY_PUB_LINK_NOT_FOUND = errors.New(ERROR_MESSAGE_ACTIVITY_PUB_LINK_NOT_FOUND)
ERROR_ACTIVITY_PUB_MEDIA_NOT_FOUND = errors.New(ERROR_MESSAGE_ACTIVITY_PUB_MEDIA_NOT_FOUND)
ERROR_SPI_NOT_FOUND = errors.New(ERROR_MESSAGE_SPI_NOT_FOUND)
ERROR_UNKNOWN_DOCUMENT = errors.New(ERROR_MESSAGE_UNKNOWN_DOCUMENT)
ERROR_UNKNOWN_SYSTEM_SCHEDULE = errors.New(ERROR_MESSAGE_UNKNOWN_SYSTEM_SCHEDULE)
ERROR_UNKNOWN_IDENTITY = errors.New(ERROR_MESSAGE_UNKNOWN_IDENTITY)
ERROR_UNKNOWN_ACCESS_CONTROL = errors.New(ERROR_MESSAGE_UNKNOWN_ACCESS_CONTROL)
ERROR_UNKNOWN_REMOTE_ACTIVITY = errors.New(ERROR_MESSAGE_UNKNOWN_REMOTE_ACTIVITY)
ERROR_UNKNOWN_CATEGORY_TYPE = errors.New(ERROR_MESSAGE_UNKNOWN_CATEGORY_TYPE)
ERROR_UNKNOWN_CATEGORY = errors.New(ERROR_MESSAGE_UNKNOWN_CATEGORY)
ERROR_UNKNOWN_USER = errors.New(ERROR_MESSAGE_UNKNOWN_USER)
ERROR_UNKNOWN_ACTIVITY_PUB_OBJECT = errors.New(ERROR_MESSAGE_UNKNOWN_ACTIVITY_PUB_OBJECT)
ERROR_UNKNOWN_ACTIVITY_PUB_ACTIVITY = errors.New(ERROR_MESSAGE_UNKNOWN_ACTIVITY_PUB_ACTIVITY)
ERROR_UNKNOWN_ACTIVITY_PUB_PUBLIC_KEY = errors.New(ERROR_MESSAGE_UNKNOWN_ACTIVITY_PUB_PUBLIC_KEY)
ERROR_UNKNOWN_ACTIVITY_PUB_LINK = errors.New(ERROR_MESSAGE_UNKNOWN_ACTIVITY_PUB_LINK)
ERROR_UNKNOWN_ACTIVITY_PUB_MEDIA = errors.New(ERROR_MESSAGE_UNKNOWN_ACTIVITY_PUB_MEDIA)
ERROR_UNKNOWN_SPI = errors.New(ERROR_MESSAGE_UNKNOWN_SPI)
ERROR_INVALID_ID = errors.New(ERROR_MESSAGE_INVALID_ID)
ERROR_INVALID_PARAMETERS = errors.New(ERROR_MESSAGE_INVALID_PARAMETERS)
ERROR_INITIALIZE = errors.New(ERROR_MESSAGE_INITIALIZE)
ERROR_NOT_IMPLEMENTED = errors.New(ERROR_MESSAGE_NOT_IMPLEMENTED)
ERROR_OPERATION_FAILED = errors.New(ERROR_MESSAGE_OPERATION_FAILED)
ERROR_OPERATION_NOT_SUPPORTED = errors.New(ERROR_MESSAGE_OPERATION_NOT_SUPPORTED)
ERROR_UNRESOLVED_DEPENDENCIES = errors.New(ERROR_MESSAGE_UNRESOLVED_DEPENDENCIES)
ERROR_SYSTEM_COMPONENT_NOT_FOUND = errors.New(ERROR_MESSAGE_SYSTEM_COMPONENT_NOT_FOUND)
ERROR_DOCUMENT_NOT_FOUND = errors.New(ERROR_MESSAGE_DOCUMENT_NOT_FOUND)
ERROR_SYSTEM_SCHEDULE_NOT_FOUND = errors.New(ERROR_MESSAGE_SYSTEM_SCHEDULE_NOT_FOUND)
ERROR_IDENTITY_NOT_FOUND = errors.New(ERROR_MESSAGE_IDENTITY_NOT_FOUND)
ERROR_ACCESS_CONTROL_NOT_FOUND = errors.New(ERROR_MESSAGE_ACCESS_CONTROL_NOT_FOUND)
ERROR_REMOTE_ACTIVITY_NOT_FOUND = errors.New(ERROR_MESSAGE_REMOTE_ACTIVITY_NOT_FOUND)
ERROR_CATEGORY_TYPE_NOT_FOUND = errors.New(ERROR_MESSAGE_CATEGORY_TYPE_NOT_FOUND)
ERROR_CATEGORY_NOT_FOUND = errors.New(ERROR_MESSAGE_CATEGORY_NOT_FOUND)
ERROR_USER_NOT_FOUND = errors.New(ERROR_MESSAGE_USER_NOT_FOUND)
ERROR_ACTIVITY_PUB_OBJECT_NOT_FOUND = errors.New(ERROR_MESSAGE_ACTIVITY_PUB_OBJECT_NOT_FOUND)
ERROR_ACTIVITY_PUB_ACTIVITY_NOT_FOUND = errors.New(ERROR_MESSAGE_ACTIVITY_PUB_ACTIVITY_NOT_FOUND)
ERROR_ACTIVITY_PUB_PUBLIC_KEY_NOT_FOUND = errors.New(ERROR_MESSAGE_ACTIVITY_PUB_PUBLIC_KEY_NOT_FOUND)
ERROR_ACTIVITY_PUB_LINK_NOT_FOUND = errors.New(ERROR_MESSAGE_ACTIVITY_PUB_LINK_NOT_FOUND)
ERROR_ACTIVITY_PUB_MEDIA_NOT_FOUND = errors.New(ERROR_MESSAGE_ACTIVITY_PUB_MEDIA_NOT_FOUND)
ERROR_ACTIVITY_PUB_INCOMING_ACTIVITY_NOT_FOUND = errors.New(ERROR_MESSAGE_ACTIVITY_PUB_INCOMING_ACTIVITY_NOT_FOUND)
ERROR_ACTIVITY_PUB_OUTGOING_ACTIVITY_NOT_FOUND = errors.New(ERROR_MESSAGE_ACTIVITY_PUB_OUTGOING_ACTIVITY_NOT_FOUND)
ERROR_SPI_NOT_FOUND = errors.New(ERROR_MESSAGE_SPI_NOT_FOUND)
ERROR_UNKNOWN_DOCUMENT = errors.New(ERROR_MESSAGE_UNKNOWN_DOCUMENT)
ERROR_UNKNOWN_SYSTEM_SCHEDULE = errors.New(ERROR_MESSAGE_UNKNOWN_SYSTEM_SCHEDULE)
ERROR_UNKNOWN_IDENTITY = errors.New(ERROR_MESSAGE_UNKNOWN_IDENTITY)
ERROR_UNKNOWN_ACCESS_CONTROL = errors.New(ERROR_MESSAGE_UNKNOWN_ACCESS_CONTROL)
ERROR_UNKNOWN_REMOTE_ACTIVITY = errors.New(ERROR_MESSAGE_UNKNOWN_REMOTE_ACTIVITY)
ERROR_UNKNOWN_CATEGORY_TYPE = errors.New(ERROR_MESSAGE_UNKNOWN_CATEGORY_TYPE)
ERROR_UNKNOWN_CATEGORY = errors.New(ERROR_MESSAGE_UNKNOWN_CATEGORY)
ERROR_UNKNOWN_USER = errors.New(ERROR_MESSAGE_UNKNOWN_USER)
ERROR_UNKNOWN_ACTIVITY_PUB_OBJECT = errors.New(ERROR_MESSAGE_UNKNOWN_ACTIVITY_PUB_OBJECT)
ERROR_UNKNOWN_ACTIVITY_PUB_ACTIVITY = errors.New(ERROR_MESSAGE_UNKNOWN_ACTIVITY_PUB_ACTIVITY)
ERROR_UNKNOWN_ACTIVITY_PUB_PUBLIC_KEY = errors.New(ERROR_MESSAGE_UNKNOWN_ACTIVITY_PUB_PUBLIC_KEY)
ERROR_UNKNOWN_ACTIVITY_PUB_LINK = errors.New(ERROR_MESSAGE_UNKNOWN_ACTIVITY_PUB_LINK)
ERROR_UNKNOWN_ACTIVITY_PUB_MEDIA = errors.New(ERROR_MESSAGE_UNKNOWN_ACTIVITY_PUB_MEDIA)
ERROR_UNKNOWN_ACTIVITY_PUB_INCOMING_ACTIVITY = errors.New(ERROR_MESSAGE_UNKNOWN_ACTIVITY_PUB_INCOMING_ACTIVITY)
ERROR_UNKNOWN_ACTIVITY_PUB_OUTGOING_ACTIVITY = errors.New(ERROR_MESSAGE_UNKNOWN_ACTIVITY_PUB_OUTGOING_ACTIVITY)
ERROR_UNKNOWN_SPI = errors.New(ERROR_MESSAGE_UNKNOWN_SPI)
ERROR_INVALID_ID = errors.New(ERROR_MESSAGE_INVALID_ID)
ERROR_INVALID_PARAMETERS = errors.New(ERROR_MESSAGE_INVALID_PARAMETERS)
// CUSTOM_ERRORS
ERROR_DATA_INTEGRITY_VIOLATION = errors.New(ERROR_MESSAGE_DATA_INTEGRITY_VIOLATION)
ERROR_INVALID_STATE = errors.New(ERROR_MESSAGE_INVALID_STATE)

Wyświetl plik

@ -5,42 +5,46 @@ import . "github.com/xeronith/diamante/contracts/localization"
// noinspection GoUnusedGlobalVariable
var Errors = Resource{
// SYSTEM_ERRORS
ERROR_MESSAGE_INITIALIZE: "initialize",
ERROR_MESSAGE_NOT_IMPLEMENTED: "not_implemented",
ERROR_MESSAGE_OPERATION_FAILED: "operation_failed",
ERROR_MESSAGE_OPERATION_NOT_SUPPORTED: "operation_not_supported",
ERROR_MESSAGE_UNRESOLVED_DEPENDENCIES: "unresolved_dependencies",
ERROR_MESSAGE_SYSTEM_COMPONENT_NOT_FOUND: "system_component_not_found",
ERROR_MESSAGE_DOCUMENT_NOT_FOUND: "document_not_found",
ERROR_MESSAGE_SYSTEM_SCHEDULE_NOT_FOUND: "system_schedule_not_found",
ERROR_MESSAGE_IDENTITY_NOT_FOUND: "identity_not_found",
ERROR_MESSAGE_ACCESS_CONTROL_NOT_FOUND: "access_control_not_found",
ERROR_MESSAGE_REMOTE_ACTIVITY_NOT_FOUND: "remote_activity_not_found",
ERROR_MESSAGE_CATEGORY_TYPE_NOT_FOUND: "category_type_not_found",
ERROR_MESSAGE_CATEGORY_NOT_FOUND: "category_not_found",
ERROR_MESSAGE_USER_NOT_FOUND: "user_not_found",
ERROR_MESSAGE_ACTIVITY_PUB_OBJECT_NOT_FOUND: "activity_pub_object_not_found",
ERROR_MESSAGE_ACTIVITY_PUB_ACTIVITY_NOT_FOUND: "activity_pub_activity_not_found",
ERROR_MESSAGE_ACTIVITY_PUB_PUBLIC_KEY_NOT_FOUND: "activity_pub_public_key_not_found",
ERROR_MESSAGE_ACTIVITY_PUB_LINK_NOT_FOUND: "activity_pub_link_not_found",
ERROR_MESSAGE_ACTIVITY_PUB_MEDIA_NOT_FOUND: "activity_pub_media_not_found",
ERROR_MESSAGE_SPI_NOT_FOUND: "spi_not_found",
ERROR_MESSAGE_UNKNOWN_DOCUMENT: "unknown_document",
ERROR_MESSAGE_UNKNOWN_SYSTEM_SCHEDULE: "unknown_system_schedule",
ERROR_MESSAGE_UNKNOWN_IDENTITY: "unknown_identity",
ERROR_MESSAGE_UNKNOWN_ACCESS_CONTROL: "unknown_access_control",
ERROR_MESSAGE_UNKNOWN_REMOTE_ACTIVITY: "unknown_remote_activity",
ERROR_MESSAGE_UNKNOWN_CATEGORY_TYPE: "unknown_category_type",
ERROR_MESSAGE_UNKNOWN_CATEGORY: "unknown_category",
ERROR_MESSAGE_UNKNOWN_USER: "unknown_user",
ERROR_MESSAGE_UNKNOWN_ACTIVITY_PUB_OBJECT: "unknown_activity_pub_object",
ERROR_MESSAGE_UNKNOWN_ACTIVITY_PUB_ACTIVITY: "unknown_activity_pub_activity",
ERROR_MESSAGE_UNKNOWN_ACTIVITY_PUB_PUBLIC_KEY: "unknown_activity_pub_public_key",
ERROR_MESSAGE_UNKNOWN_ACTIVITY_PUB_LINK: "unknown_activity_pub_link",
ERROR_MESSAGE_UNKNOWN_ACTIVITY_PUB_MEDIA: "unknown_activity_pub_media",
ERROR_MESSAGE_UNKNOWN_SPI: "unknown_spi",
ERROR_MESSAGE_INVALID_ID: "invalid_id",
ERROR_MESSAGE_INVALID_PARAMETERS: "invalid_parameters",
ERROR_MESSAGE_INITIALIZE: "initialize",
ERROR_MESSAGE_NOT_IMPLEMENTED: "not_implemented",
ERROR_MESSAGE_OPERATION_FAILED: "operation_failed",
ERROR_MESSAGE_OPERATION_NOT_SUPPORTED: "operation_not_supported",
ERROR_MESSAGE_UNRESOLVED_DEPENDENCIES: "unresolved_dependencies",
ERROR_MESSAGE_SYSTEM_COMPONENT_NOT_FOUND: "system_component_not_found",
ERROR_MESSAGE_DOCUMENT_NOT_FOUND: "document_not_found",
ERROR_MESSAGE_SYSTEM_SCHEDULE_NOT_FOUND: "system_schedule_not_found",
ERROR_MESSAGE_IDENTITY_NOT_FOUND: "identity_not_found",
ERROR_MESSAGE_ACCESS_CONTROL_NOT_FOUND: "access_control_not_found",
ERROR_MESSAGE_REMOTE_ACTIVITY_NOT_FOUND: "remote_activity_not_found",
ERROR_MESSAGE_CATEGORY_TYPE_NOT_FOUND: "category_type_not_found",
ERROR_MESSAGE_CATEGORY_NOT_FOUND: "category_not_found",
ERROR_MESSAGE_USER_NOT_FOUND: "user_not_found",
ERROR_MESSAGE_ACTIVITY_PUB_OBJECT_NOT_FOUND: "activity_pub_object_not_found",
ERROR_MESSAGE_ACTIVITY_PUB_ACTIVITY_NOT_FOUND: "activity_pub_activity_not_found",
ERROR_MESSAGE_ACTIVITY_PUB_PUBLIC_KEY_NOT_FOUND: "activity_pub_public_key_not_found",
ERROR_MESSAGE_ACTIVITY_PUB_LINK_NOT_FOUND: "activity_pub_link_not_found",
ERROR_MESSAGE_ACTIVITY_PUB_MEDIA_NOT_FOUND: "activity_pub_media_not_found",
ERROR_MESSAGE_ACTIVITY_PUB_INCOMING_ACTIVITY_NOT_FOUND: "activity_pub_incoming_activity_not_found",
ERROR_MESSAGE_ACTIVITY_PUB_OUTGOING_ACTIVITY_NOT_FOUND: "activity_pub_outgoing_activity_not_found",
ERROR_MESSAGE_SPI_NOT_FOUND: "spi_not_found",
ERROR_MESSAGE_UNKNOWN_DOCUMENT: "unknown_document",
ERROR_MESSAGE_UNKNOWN_SYSTEM_SCHEDULE: "unknown_system_schedule",
ERROR_MESSAGE_UNKNOWN_IDENTITY: "unknown_identity",
ERROR_MESSAGE_UNKNOWN_ACCESS_CONTROL: "unknown_access_control",
ERROR_MESSAGE_UNKNOWN_REMOTE_ACTIVITY: "unknown_remote_activity",
ERROR_MESSAGE_UNKNOWN_CATEGORY_TYPE: "unknown_category_type",
ERROR_MESSAGE_UNKNOWN_CATEGORY: "unknown_category",
ERROR_MESSAGE_UNKNOWN_USER: "unknown_user",
ERROR_MESSAGE_UNKNOWN_ACTIVITY_PUB_OBJECT: "unknown_activity_pub_object",
ERROR_MESSAGE_UNKNOWN_ACTIVITY_PUB_ACTIVITY: "unknown_activity_pub_activity",
ERROR_MESSAGE_UNKNOWN_ACTIVITY_PUB_PUBLIC_KEY: "unknown_activity_pub_public_key",
ERROR_MESSAGE_UNKNOWN_ACTIVITY_PUB_LINK: "unknown_activity_pub_link",
ERROR_MESSAGE_UNKNOWN_ACTIVITY_PUB_MEDIA: "unknown_activity_pub_media",
ERROR_MESSAGE_UNKNOWN_ACTIVITY_PUB_INCOMING_ACTIVITY: "unknown_activity_pub_incoming_activity",
ERROR_MESSAGE_UNKNOWN_ACTIVITY_PUB_OUTGOING_ACTIVITY: "unknown_activity_pub_outgoing_activity",
ERROR_MESSAGE_UNKNOWN_SPI: "unknown_spi",
ERROR_MESSAGE_INVALID_ID: "invalid_id",
ERROR_MESSAGE_INVALID_PARAMETERS: "invalid_parameters",
// CUSTOM_ERRORS
ERROR_MESSAGE_DATA_INTEGRITY_VIOLATION: "data_integrity_violation",
ERROR_MESSAGE_INVALID_STATE: "invalid_state",

Wyświetl plik

@ -0,0 +1,121 @@
package contracts
import . "github.com/xeronith/diamante/contracts/security"
var ActivityPubIncomingActivityPassThroughFilter = func(IActivityPubIncomingActivity) bool { return true }
type (
ActivityPubIncomingActivities []IActivityPubIncomingActivity
ActivityPubIncomingActivityIterator func(IActivityPubIncomingActivity)
ActivityPubIncomingActivityCondition func(IActivityPubIncomingActivity) bool
ActivityPubIncomingActivityFilterPredicate func(IActivityPubIncomingActivity) bool
ActivityPubIncomingActivityMapPredicate func(IActivityPubIncomingActivity) IActivityPubIncomingActivity
ActivityPubIncomingActivityCacheCallback func()
IActivityPubIncomingActivity interface {
IObject
// DependenciesAreUnknown scans all dependencies to make sure a valid parent is set for all of them.
DependenciesAreUnknown() bool
// IdentityId returns parent 'IdentityId' of this 'ActivityPubIncomingActivity' instance.
IdentityId() int64
// AssertBelongsToIdentity checks whether this 'ActivityPubIncomingActivity' instance is a child of the specified 'Identity'
AssertBelongsToIdentity(identity IIdentity)
// IdentityIsUnknown checks whether a valid parent 'IdentityId' is provided for this 'ActivityPubIncomingActivity' instance or not.
IdentityIsUnknown() bool
// AssertIdentityIsProvided asserts that a valid 'IdentityId' is provided for this 'ActivityPubIncomingActivity' instance. A panic will occur if the assertion is not valid.
AssertIdentityIsProvided()
// AssertIdentity asserts the given 'IdentityId' is in fact the parent of this 'ActivityPubIncomingActivity' instance. A panic will occur if the assertion is not valid.
AssertIdentity(identityId int64)
// UniqueIdentifier returns 'UniqueIdentifier' of this 'ActivityPubIncomingActivity' instance.
UniqueIdentifier() string
// UpdateUniqueIdentifier directly updates 'UniqueIdentifier' into persistent data store and
// refreshes the in-memory cache after successful update.
UpdateUniqueIdentifier(uniqueIdentifier string, editor Identity)
// UpdateUniqueIdentifierAtomic updates 'UniqueIdentifier' into persistent data store through a transaction and
// refreshes the in-memory cache after successful commit.
UpdateUniqueIdentifierAtomic(transaction ITransaction, uniqueIdentifier string, editor Identity)
// Timestamp returns 'Timestamp' of this 'ActivityPubIncomingActivity' instance.
Timestamp() int64
// UpdateTimestamp directly updates 'Timestamp' into persistent data store and
// refreshes the in-memory cache after successful update.
UpdateTimestamp(timestamp int64, editor Identity)
// UpdateTimestampAtomic updates 'Timestamp' into persistent data store through a transaction and
// refreshes the in-memory cache after successful commit.
UpdateTimestampAtomic(transaction ITransaction, timestamp int64, editor Identity)
// From returns 'From' of this 'ActivityPubIncomingActivity' instance.
From() string
// UpdateFrom directly updates 'From' into persistent data store and
// refreshes the in-memory cache after successful update.
UpdateFrom(from string, editor Identity)
// UpdateFromAtomic updates 'From' into persistent data store through a transaction and
// refreshes the in-memory cache after successful commit.
UpdateFromAtomic(transaction ITransaction, from string, editor Identity)
// To returns 'To' of this 'ActivityPubIncomingActivity' instance.
To() string
// UpdateTo directly updates 'To' into persistent data store and
// refreshes the in-memory cache after successful update.
UpdateTo(to string, editor Identity)
// UpdateToAtomic updates 'To' into persistent data store through a transaction and
// refreshes the in-memory cache after successful commit.
UpdateToAtomic(transaction ITransaction, to string, editor Identity)
// Content returns 'Content' of this 'ActivityPubIncomingActivity' instance.
Content() string
// UpdateContent directly updates 'Content' into persistent data store and
// refreshes the in-memory cache after successful update.
UpdateContent(content string, editor Identity)
// UpdateContentAtomic updates 'Content' into persistent data store through a transaction and
// refreshes the in-memory cache after successful commit.
UpdateContentAtomic(transaction ITransaction, content string, editor Identity)
// Raw returns 'Raw' of this 'ActivityPubIncomingActivity' instance.
Raw() string
// UpdateRaw directly updates 'Raw' into persistent data store and
// refreshes the in-memory cache after successful update.
UpdateRaw(raw string, editor Identity)
// UpdateRawAtomic updates 'Raw' into persistent data store through a transaction and
// refreshes the in-memory cache after successful commit.
UpdateRawAtomic(transaction ITransaction, raw string, editor Identity)
}
IActivityPubIncomingActivityCollection interface {
Count() int
IsEmpty() bool
IsNotEmpty() bool
HasExactlyOneItem() bool
HasAtLeastOneItem() bool
First() IActivityPubIncomingActivity
Append(activityPubIncomingActivity IActivityPubIncomingActivity)
ForEach(ActivityPubIncomingActivityIterator)
Array() ActivityPubIncomingActivities
}
IActivityPubIncomingActivityManager interface {
ISystemComponent
OnCacheChanged(ActivityPubIncomingActivityCacheCallback)
Count() int
Exists(id int64) bool
ExistsWhich(condition ActivityPubIncomingActivityCondition) bool
ListActivityPubIncomingActivities(pageIndex uint32, pageSize uint32, criteria string, editor Identity) IActivityPubIncomingActivityCollection
GetActivityPubIncomingActivity(id int64, editor Identity) (IActivityPubIncomingActivity, error)
AddActivityPubIncomingActivity(identityId int64, uniqueIdentifier string, timestamp int64, from string, to string, content string, raw string, editor Identity) (IActivityPubIncomingActivity, error)
AddActivityPubIncomingActivityWithCustomId(id int64, identityId int64, uniqueIdentifier string, timestamp int64, from string, to string, content string, raw string, editor Identity) (IActivityPubIncomingActivity, error)
AddActivityPubIncomingActivityObject(activityPubIncomingActivity IActivityPubIncomingActivity, editor Identity) (IActivityPubIncomingActivity, error)
AddActivityPubIncomingActivityAtomic(transaction ITransaction, identityId int64, uniqueIdentifier string, timestamp int64, from string, to string, content string, raw string, editor Identity) (IActivityPubIncomingActivity, error)
AddActivityPubIncomingActivityWithCustomIdAtomic(id int64, transaction ITransaction, identityId int64, uniqueIdentifier string, timestamp int64, from string, to string, content string, raw string, editor Identity) (IActivityPubIncomingActivity, error)
AddActivityPubIncomingActivityObjectAtomic(transaction ITransaction, activityPubIncomingActivity IActivityPubIncomingActivity, editor Identity) (IActivityPubIncomingActivity, error)
Log(identityId int64, uniqueIdentifier string, timestamp int64, from string, to string, content string, raw string, source string, editor Identity, payload string)
UpdateActivityPubIncomingActivity(id int64, identityId int64, uniqueIdentifier string, timestamp int64, from string, to string, content string, raw string, editor Identity) (IActivityPubIncomingActivity, error)
UpdateActivityPubIncomingActivityObject(id int64, activityPubIncomingActivity IActivityPubIncomingActivity, editor Identity) (IActivityPubIncomingActivity, error)
UpdateActivityPubIncomingActivityAtomic(transaction ITransaction, id int64, identityId int64, uniqueIdentifier string, timestamp int64, from string, to string, content string, raw string, editor Identity) (IActivityPubIncomingActivity, error)
UpdateActivityPubIncomingActivityObjectAtomic(transaction ITransaction, id int64, activityPubIncomingActivity IActivityPubIncomingActivity, editor Identity) (IActivityPubIncomingActivity, error)
AddOrUpdateActivityPubIncomingActivityObject(id int64, activityPubIncomingActivity IActivityPubIncomingActivity, editor Identity) (IActivityPubIncomingActivity, error)
AddOrUpdateActivityPubIncomingActivityObjectAtomic(transaction ITransaction, id int64, activityPubIncomingActivity IActivityPubIncomingActivity, editor Identity) (IActivityPubIncomingActivity, error)
RemoveActivityPubIncomingActivity(id int64, editor Identity) (IActivityPubIncomingActivity, error)
RemoveActivityPubIncomingActivityAtomic(transaction ITransaction, id int64, editor Identity) (IActivityPubIncomingActivity, error)
Find(id int64) IActivityPubIncomingActivity
ForEach(iterator ActivityPubIncomingActivityIterator)
Filter(predicate ActivityPubIncomingActivityFilterPredicate) IActivityPubIncomingActivityCollection
Map(predicate ActivityPubIncomingActivityMapPredicate) IActivityPubIncomingActivityCollection
ListActivityPubIncomingActivitiesByIdentity(identityId int64, pageIndex uint32, pageSize uint32, criteria string, editor Identity) IActivityPubIncomingActivityCollection
ForEachByIdentity(identityId int64, iterator ActivityPubIncomingActivityIterator)
}
)

Wyświetl plik

@ -0,0 +1,121 @@
package contracts
import . "github.com/xeronith/diamante/contracts/security"
var ActivityPubOutgoingActivityPassThroughFilter = func(IActivityPubOutgoingActivity) bool { return true }
type (
ActivityPubOutgoingActivities []IActivityPubOutgoingActivity
ActivityPubOutgoingActivityIterator func(IActivityPubOutgoingActivity)
ActivityPubOutgoingActivityCondition func(IActivityPubOutgoingActivity) bool
ActivityPubOutgoingActivityFilterPredicate func(IActivityPubOutgoingActivity) bool
ActivityPubOutgoingActivityMapPredicate func(IActivityPubOutgoingActivity) IActivityPubOutgoingActivity
ActivityPubOutgoingActivityCacheCallback func()
IActivityPubOutgoingActivity interface {
IObject
// DependenciesAreUnknown scans all dependencies to make sure a valid parent is set for all of them.
DependenciesAreUnknown() bool
// IdentityId returns parent 'IdentityId' of this 'ActivityPubOutgoingActivity' instance.
IdentityId() int64
// AssertBelongsToIdentity checks whether this 'ActivityPubOutgoingActivity' instance is a child of the specified 'Identity'
AssertBelongsToIdentity(identity IIdentity)
// IdentityIsUnknown checks whether a valid parent 'IdentityId' is provided for this 'ActivityPubOutgoingActivity' instance or not.
IdentityIsUnknown() bool
// AssertIdentityIsProvided asserts that a valid 'IdentityId' is provided for this 'ActivityPubOutgoingActivity' instance. A panic will occur if the assertion is not valid.
AssertIdentityIsProvided()
// AssertIdentity asserts the given 'IdentityId' is in fact the parent of this 'ActivityPubOutgoingActivity' instance. A panic will occur if the assertion is not valid.
AssertIdentity(identityId int64)
// UniqueIdentifier returns 'UniqueIdentifier' of this 'ActivityPubOutgoingActivity' instance.
UniqueIdentifier() string
// UpdateUniqueIdentifier directly updates 'UniqueIdentifier' into persistent data store and
// refreshes the in-memory cache after successful update.
UpdateUniqueIdentifier(uniqueIdentifier string, editor Identity)
// UpdateUniqueIdentifierAtomic updates 'UniqueIdentifier' into persistent data store through a transaction and
// refreshes the in-memory cache after successful commit.
UpdateUniqueIdentifierAtomic(transaction ITransaction, uniqueIdentifier string, editor Identity)
// Timestamp returns 'Timestamp' of this 'ActivityPubOutgoingActivity' instance.
Timestamp() int64
// UpdateTimestamp directly updates 'Timestamp' into persistent data store and
// refreshes the in-memory cache after successful update.
UpdateTimestamp(timestamp int64, editor Identity)
// UpdateTimestampAtomic updates 'Timestamp' into persistent data store through a transaction and
// refreshes the in-memory cache after successful commit.
UpdateTimestampAtomic(transaction ITransaction, timestamp int64, editor Identity)
// From returns 'From' of this 'ActivityPubOutgoingActivity' instance.
From() string
// UpdateFrom directly updates 'From' into persistent data store and
// refreshes the in-memory cache after successful update.
UpdateFrom(from string, editor Identity)
// UpdateFromAtomic updates 'From' into persistent data store through a transaction and
// refreshes the in-memory cache after successful commit.
UpdateFromAtomic(transaction ITransaction, from string, editor Identity)
// To returns 'To' of this 'ActivityPubOutgoingActivity' instance.
To() string
// UpdateTo directly updates 'To' into persistent data store and
// refreshes the in-memory cache after successful update.
UpdateTo(to string, editor Identity)
// UpdateToAtomic updates 'To' into persistent data store through a transaction and
// refreshes the in-memory cache after successful commit.
UpdateToAtomic(transaction ITransaction, to string, editor Identity)
// Content returns 'Content' of this 'ActivityPubOutgoingActivity' instance.
Content() string
// UpdateContent directly updates 'Content' into persistent data store and
// refreshes the in-memory cache after successful update.
UpdateContent(content string, editor Identity)
// UpdateContentAtomic updates 'Content' into persistent data store through a transaction and
// refreshes the in-memory cache after successful commit.
UpdateContentAtomic(transaction ITransaction, content string, editor Identity)
// Raw returns 'Raw' of this 'ActivityPubOutgoingActivity' instance.
Raw() string
// UpdateRaw directly updates 'Raw' into persistent data store and
// refreshes the in-memory cache after successful update.
UpdateRaw(raw string, editor Identity)
// UpdateRawAtomic updates 'Raw' into persistent data store through a transaction and
// refreshes the in-memory cache after successful commit.
UpdateRawAtomic(transaction ITransaction, raw string, editor Identity)
}
IActivityPubOutgoingActivityCollection interface {
Count() int
IsEmpty() bool
IsNotEmpty() bool
HasExactlyOneItem() bool
HasAtLeastOneItem() bool
First() IActivityPubOutgoingActivity
Append(activityPubOutgoingActivity IActivityPubOutgoingActivity)
ForEach(ActivityPubOutgoingActivityIterator)
Array() ActivityPubOutgoingActivities
}
IActivityPubOutgoingActivityManager interface {
ISystemComponent
OnCacheChanged(ActivityPubOutgoingActivityCacheCallback)
Count() int
Exists(id int64) bool
ExistsWhich(condition ActivityPubOutgoingActivityCondition) bool
ListActivityPubOutgoingActivities(pageIndex uint32, pageSize uint32, criteria string, editor Identity) IActivityPubOutgoingActivityCollection
GetActivityPubOutgoingActivity(id int64, editor Identity) (IActivityPubOutgoingActivity, error)
AddActivityPubOutgoingActivity(identityId int64, uniqueIdentifier string, timestamp int64, from string, to string, content string, raw string, editor Identity) (IActivityPubOutgoingActivity, error)
AddActivityPubOutgoingActivityWithCustomId(id int64, identityId int64, uniqueIdentifier string, timestamp int64, from string, to string, content string, raw string, editor Identity) (IActivityPubOutgoingActivity, error)
AddActivityPubOutgoingActivityObject(activityPubOutgoingActivity IActivityPubOutgoingActivity, editor Identity) (IActivityPubOutgoingActivity, error)
AddActivityPubOutgoingActivityAtomic(transaction ITransaction, identityId int64, uniqueIdentifier string, timestamp int64, from string, to string, content string, raw string, editor Identity) (IActivityPubOutgoingActivity, error)
AddActivityPubOutgoingActivityWithCustomIdAtomic(id int64, transaction ITransaction, identityId int64, uniqueIdentifier string, timestamp int64, from string, to string, content string, raw string, editor Identity) (IActivityPubOutgoingActivity, error)
AddActivityPubOutgoingActivityObjectAtomic(transaction ITransaction, activityPubOutgoingActivity IActivityPubOutgoingActivity, editor Identity) (IActivityPubOutgoingActivity, error)
Log(identityId int64, uniqueIdentifier string, timestamp int64, from string, to string, content string, raw string, source string, editor Identity, payload string)
UpdateActivityPubOutgoingActivity(id int64, identityId int64, uniqueIdentifier string, timestamp int64, from string, to string, content string, raw string, editor Identity) (IActivityPubOutgoingActivity, error)
UpdateActivityPubOutgoingActivityObject(id int64, activityPubOutgoingActivity IActivityPubOutgoingActivity, editor Identity) (IActivityPubOutgoingActivity, error)
UpdateActivityPubOutgoingActivityAtomic(transaction ITransaction, id int64, identityId int64, uniqueIdentifier string, timestamp int64, from string, to string, content string, raw string, editor Identity) (IActivityPubOutgoingActivity, error)
UpdateActivityPubOutgoingActivityObjectAtomic(transaction ITransaction, id int64, activityPubOutgoingActivity IActivityPubOutgoingActivity, editor Identity) (IActivityPubOutgoingActivity, error)
AddOrUpdateActivityPubOutgoingActivityObject(id int64, activityPubOutgoingActivity IActivityPubOutgoingActivity, editor Identity) (IActivityPubOutgoingActivity, error)
AddOrUpdateActivityPubOutgoingActivityObjectAtomic(transaction ITransaction, id int64, activityPubOutgoingActivity IActivityPubOutgoingActivity, editor Identity) (IActivityPubOutgoingActivity, error)
RemoveActivityPubOutgoingActivity(id int64, editor Identity) (IActivityPubOutgoingActivity, error)
RemoveActivityPubOutgoingActivityAtomic(transaction ITransaction, id int64, editor Identity) (IActivityPubOutgoingActivity, error)
Find(id int64) IActivityPubOutgoingActivity
ForEach(iterator ActivityPubOutgoingActivityIterator)
Filter(predicate ActivityPubOutgoingActivityFilterPredicate) IActivityPubOutgoingActivityCollection
Map(predicate ActivityPubOutgoingActivityMapPredicate) IActivityPubOutgoingActivityCollection
ListActivityPubOutgoingActivitiesByIdentity(identityId int64, pageIndex uint32, pageSize uint32, criteria string, editor Identity) IActivityPubOutgoingActivityCollection
ForEachByIdentity(identityId int64, iterator ActivityPubOutgoingActivityIterator)
}
)

Wyświetl plik

@ -0,0 +1,46 @@
package model
type (
ActivityPubIncomingActivityEntities []IActivityPubIncomingActivityEntity
IActivityPubIncomingActivityEntity interface {
IEntity
IdentityId() int64
UniqueIdentifier() string
Timestamp() int64
From() string
To() string
Content() string
Raw() string
}
IActivityPubIncomingActivityPipeEntity interface {
IActivityPubIncomingActivityEntity
IPipeEntity
}
IActivityPubIncomingActivitiesRepository interface {
IRepository
Add(entity IActivityPubIncomingActivityEntity, editor int64) error
AddAtomic(transaction IRepositoryTransaction, entity IActivityPubIncomingActivityEntity, editor int64) error
FetchById(editor int64) (IActivityPubIncomingActivityEntity, error)
Update(entity IActivityPubIncomingActivityEntity, editor int64) error
UpdateAtomic(transaction IRepositoryTransaction, entity IActivityPubIncomingActivityEntity, editor int64) error
Remove(entity IActivityPubIncomingActivityEntity, editor int64) error
RemoveAtomic(transaction IRepositoryTransaction, entity IActivityPubIncomingActivityEntity, editor int64) error
FetchAll() (ActivityPubIncomingActivityEntities, error)
FetchAllByIdentity(identityId int64) (ActivityPubIncomingActivityEntities, error)
UpdateUniqueIdentifier(id int64, value string, editor int64) error
UpdateUniqueIdentifierAtomic(transaction IRepositoryTransaction, id int64, value string, editor int64) error
UpdateTimestamp(id int64, value int64, editor int64) error
UpdateTimestampAtomic(transaction IRepositoryTransaction, id int64, value int64, editor int64) error
UpdateFrom(id int64, value string, editor int64) error
UpdateFromAtomic(transaction IRepositoryTransaction, id int64, value string, editor int64) error
UpdateTo(id int64, value string, editor int64) error
UpdateToAtomic(transaction IRepositoryTransaction, id int64, value string, editor int64) error
UpdateContent(id int64, value string, editor int64) error
UpdateContentAtomic(transaction IRepositoryTransaction, id int64, value string, editor int64) error
UpdateRaw(id int64, value string, editor int64) error
UpdateRawAtomic(transaction IRepositoryTransaction, id int64, value string, editor int64) error
}
)

Wyświetl plik

@ -0,0 +1,46 @@
package model
type (
ActivityPubOutgoingActivityEntities []IActivityPubOutgoingActivityEntity
IActivityPubOutgoingActivityEntity interface {
IEntity
IdentityId() int64
UniqueIdentifier() string
Timestamp() int64
From() string
To() string
Content() string
Raw() string
}
IActivityPubOutgoingActivityPipeEntity interface {
IActivityPubOutgoingActivityEntity
IPipeEntity
}
IActivityPubOutgoingActivitiesRepository interface {
IRepository
Add(entity IActivityPubOutgoingActivityEntity, editor int64) error
AddAtomic(transaction IRepositoryTransaction, entity IActivityPubOutgoingActivityEntity, editor int64) error
FetchById(editor int64) (IActivityPubOutgoingActivityEntity, error)
Update(entity IActivityPubOutgoingActivityEntity, editor int64) error
UpdateAtomic(transaction IRepositoryTransaction, entity IActivityPubOutgoingActivityEntity, editor int64) error
Remove(entity IActivityPubOutgoingActivityEntity, editor int64) error
RemoveAtomic(transaction IRepositoryTransaction, entity IActivityPubOutgoingActivityEntity, editor int64) error
FetchAll() (ActivityPubOutgoingActivityEntities, error)
FetchAllByIdentity(identityId int64) (ActivityPubOutgoingActivityEntities, error)
UpdateUniqueIdentifier(id int64, value string, editor int64) error
UpdateUniqueIdentifierAtomic(transaction IRepositoryTransaction, id int64, value string, editor int64) error
UpdateTimestamp(id int64, value int64, editor int64) error
UpdateTimestampAtomic(transaction IRepositoryTransaction, id int64, value int64, editor int64) error
UpdateFrom(id int64, value string, editor int64) error
UpdateFromAtomic(transaction IRepositoryTransaction, id int64, value string, editor int64) error
UpdateTo(id int64, value string, editor int64) error
UpdateToAtomic(transaction IRepositoryTransaction, id int64, value string, editor int64) error
UpdateContent(id int64, value string, editor int64) error
UpdateContentAtomic(transaction IRepositoryTransaction, id int64, value string, editor int64) error
UpdateRaw(id int64, value string, editor int64) error
UpdateRawAtomic(transaction IRepositoryTransaction, id int64, value string, editor int64) error
}
)

Wyświetl plik

@ -0,0 +1,456 @@
package core
import (
"fmt"
. "github.com/xeronith/diamante/contracts/security"
"rail.town/infrastructure/app/validators"
. "rail.town/infrastructure/components/constants"
. "rail.town/infrastructure/components/contracts"
. "rail.town/infrastructure/components/contracts/model"
"rail.town/infrastructure/components/model/repository"
)
type activityPubIncomingActivity struct {
object
identityId int64
uniqueIdentifier string
timestamp int64
from string
to string
content string
raw string
}
// noinspection GoUnusedExportedFunction
func InitializeActivityPubIncomingActivity() {
_ = ENABLE_SECURITY
_ = ENABLE_CUSTOM_ERRORS
_ = validators.Initialize
_ = repository.Initialize
}
func NewActivityPubIncomingActivity(id int64, identityId int64, uniqueIdentifier string, timestamp int64, from string, to string, content string, raw string) (IActivityPubIncomingActivity, error) {
instance := &activityPubIncomingActivity{
object: object{
id: id,
},
identityId: identityId,
uniqueIdentifier: uniqueIdentifier,
timestamp: timestamp,
from: from,
to: to,
content: content,
raw: raw,
}
if err := instance.Validate(); err != nil {
return nil, err
}
return instance, nil
}
func NewActivityPubIncomingActivityFromEntity(entity IActivityPubIncomingActivityEntity) (IActivityPubIncomingActivity, error) {
instance := &activityPubIncomingActivity{
object: object{
id: entity.Id(),
},
identityId: entity.IdentityId(),
uniqueIdentifier: entity.UniqueIdentifier(),
timestamp: entity.Timestamp(),
from: entity.From(),
to: entity.To(),
content: entity.Content(),
raw: entity.Raw(),
}
if err := instance.Validate(); err != nil {
return nil, err
}
return instance, nil
}
func (activityPubIncomingActivity *activityPubIncomingActivity) DependenciesAreUnknown() bool {
// noinspection GoBoolExpressions
return activityPubIncomingActivity.identityId == 0 || false
}
func (activityPubIncomingActivity *activityPubIncomingActivity) IdentityId() int64 {
return activityPubIncomingActivity.identityId
}
func (activityPubIncomingActivity *activityPubIncomingActivity) AssertBelongsToIdentity(_identity IIdentity) {
if activityPubIncomingActivity.identityId != _identity.Id() {
panic(ERROR_MESSAGE_ACTIVITY_PUB_INCOMING_ACTIVITY_NOT_FOUND)
}
}
func (activityPubIncomingActivity *activityPubIncomingActivity) IdentityIsUnknown() bool {
return activityPubIncomingActivity.identityId == 0
}
func (activityPubIncomingActivity *activityPubIncomingActivity) AssertIdentityIsProvided() {
if activityPubIncomingActivity.identityId == 0 {
panic(ERROR_MESSAGE_UNKNOWN_IDENTITY)
}
}
func (activityPubIncomingActivity *activityPubIncomingActivity) AssertIdentity(identityId int64) {
if activityPubIncomingActivity.identityId != identityId {
panic(ERROR_MESSAGE_UNKNOWN_IDENTITY)
}
}
func (activityPubIncomingActivity *activityPubIncomingActivity) UniqueIdentifier() string {
return activityPubIncomingActivity.uniqueIdentifier
}
func (activityPubIncomingActivity *activityPubIncomingActivity) UpdateUniqueIdentifier(uniqueIdentifier string, editor Identity) {
if err := repository.ActivityPubIncomingActivities.UpdateUniqueIdentifier(activityPubIncomingActivity.id, uniqueIdentifier, editor.Id()); err != nil {
panic(err.Error())
}
activityPubIncomingActivity.uniqueIdentifier = uniqueIdentifier
}
func (activityPubIncomingActivity *activityPubIncomingActivity) UpdateUniqueIdentifierAtomic(transaction ITransaction, uniqueIdentifier string, editor Identity) {
transaction.OnCommit(func() {
activityPubIncomingActivity.uniqueIdentifier = uniqueIdentifier
})
if err := repository.ActivityPubIncomingActivities.UpdateUniqueIdentifierAtomic(transaction, activityPubIncomingActivity.id, uniqueIdentifier, editor.Id()); err != nil {
panic(err.Error())
}
}
func (activityPubIncomingActivity *activityPubIncomingActivity) Timestamp() int64 {
return activityPubIncomingActivity.timestamp
}
func (activityPubIncomingActivity *activityPubIncomingActivity) UpdateTimestamp(timestamp int64, editor Identity) {
if err := repository.ActivityPubIncomingActivities.UpdateTimestamp(activityPubIncomingActivity.id, timestamp, editor.Id()); err != nil {
panic(err.Error())
}
activityPubIncomingActivity.timestamp = timestamp
}
func (activityPubIncomingActivity *activityPubIncomingActivity) UpdateTimestampAtomic(transaction ITransaction, timestamp int64, editor Identity) {
transaction.OnCommit(func() {
activityPubIncomingActivity.timestamp = timestamp
})
if err := repository.ActivityPubIncomingActivities.UpdateTimestampAtomic(transaction, activityPubIncomingActivity.id, timestamp, editor.Id()); err != nil {
panic(err.Error())
}
}
func (activityPubIncomingActivity *activityPubIncomingActivity) From() string {
return activityPubIncomingActivity.from
}
func (activityPubIncomingActivity *activityPubIncomingActivity) UpdateFrom(from string, editor Identity) {
if err := repository.ActivityPubIncomingActivities.UpdateFrom(activityPubIncomingActivity.id, from, editor.Id()); err != nil {
panic(err.Error())
}
activityPubIncomingActivity.from = from
}
func (activityPubIncomingActivity *activityPubIncomingActivity) UpdateFromAtomic(transaction ITransaction, from string, editor Identity) {
transaction.OnCommit(func() {
activityPubIncomingActivity.from = from
})
if err := repository.ActivityPubIncomingActivities.UpdateFromAtomic(transaction, activityPubIncomingActivity.id, from, editor.Id()); err != nil {
panic(err.Error())
}
}
func (activityPubIncomingActivity *activityPubIncomingActivity) To() string {
return activityPubIncomingActivity.to
}
func (activityPubIncomingActivity *activityPubIncomingActivity) UpdateTo(to string, editor Identity) {
if err := repository.ActivityPubIncomingActivities.UpdateTo(activityPubIncomingActivity.id, to, editor.Id()); err != nil {
panic(err.Error())
}
activityPubIncomingActivity.to = to
}
func (activityPubIncomingActivity *activityPubIncomingActivity) UpdateToAtomic(transaction ITransaction, to string, editor Identity) {
transaction.OnCommit(func() {
activityPubIncomingActivity.to = to
})
if err := repository.ActivityPubIncomingActivities.UpdateToAtomic(transaction, activityPubIncomingActivity.id, to, editor.Id()); err != nil {
panic(err.Error())
}
}
func (activityPubIncomingActivity *activityPubIncomingActivity) Content() string {
return activityPubIncomingActivity.content
}
func (activityPubIncomingActivity *activityPubIncomingActivity) UpdateContent(content string, editor Identity) {
if err := repository.ActivityPubIncomingActivities.UpdateContent(activityPubIncomingActivity.id, content, editor.Id()); err != nil {
panic(err.Error())
}
activityPubIncomingActivity.content = content
}
func (activityPubIncomingActivity *activityPubIncomingActivity) UpdateContentAtomic(transaction ITransaction, content string, editor Identity) {
transaction.OnCommit(func() {
activityPubIncomingActivity.content = content
})
if err := repository.ActivityPubIncomingActivities.UpdateContentAtomic(transaction, activityPubIncomingActivity.id, content, editor.Id()); err != nil {
panic(err.Error())
}
}
func (activityPubIncomingActivity *activityPubIncomingActivity) Raw() string {
return activityPubIncomingActivity.raw
}
func (activityPubIncomingActivity *activityPubIncomingActivity) UpdateRaw(raw string, editor Identity) {
if err := repository.ActivityPubIncomingActivities.UpdateRaw(activityPubIncomingActivity.id, raw, editor.Id()); err != nil {
panic(err.Error())
}
activityPubIncomingActivity.raw = raw
}
func (activityPubIncomingActivity *activityPubIncomingActivity) UpdateRawAtomic(transaction ITransaction, raw string, editor Identity) {
transaction.OnCommit(func() {
activityPubIncomingActivity.raw = raw
})
if err := repository.ActivityPubIncomingActivities.UpdateRawAtomic(transaction, activityPubIncomingActivity.id, raw, editor.Id()); err != nil {
panic(err.Error())
}
}
func (activityPubIncomingActivity *activityPubIncomingActivity) Validate() error {
return nil
}
func (activityPubIncomingActivity *activityPubIncomingActivity) String() string {
return fmt.Sprintf("ActivityPubIncomingActivity (Id: %d, IdentityId: %d, UniqueIdentifier: %v, Timestamp: %v, From: %v, To: %v, Content: %v, Raw: %v)", activityPubIncomingActivity.Id(), activityPubIncomingActivity.IdentityId(), activityPubIncomingActivity.UniqueIdentifier(), activityPubIncomingActivity.Timestamp(), activityPubIncomingActivity.From(), activityPubIncomingActivity.To(), activityPubIncomingActivity.Content(), activityPubIncomingActivity.Raw())
}
//------------------------------------------------------------------------------
type activityPubIncomingActivities struct {
collection ActivityPubIncomingActivities
}
// NewActivityPubIncomingActivities creates an empty collection of 'Activity Pub Incoming Activity' which is not thread-safe.
func NewActivityPubIncomingActivities() IActivityPubIncomingActivityCollection {
return &activityPubIncomingActivities{
collection: make(ActivityPubIncomingActivities, 0),
}
}
func (activityPubIncomingActivities *activityPubIncomingActivities) Count() int {
return len(activityPubIncomingActivities.collection)
}
func (activityPubIncomingActivities *activityPubIncomingActivities) IsEmpty() bool {
return len(activityPubIncomingActivities.collection) == 0
}
func (activityPubIncomingActivities *activityPubIncomingActivities) IsNotEmpty() bool {
return len(activityPubIncomingActivities.collection) > 0
}
func (activityPubIncomingActivities *activityPubIncomingActivities) HasExactlyOneItem() bool {
return len(activityPubIncomingActivities.collection) == 1
}
func (activityPubIncomingActivities *activityPubIncomingActivities) HasAtLeastOneItem() bool {
return len(activityPubIncomingActivities.collection) >= 1
}
func (activityPubIncomingActivities *activityPubIncomingActivities) First() IActivityPubIncomingActivity {
return activityPubIncomingActivities.collection[0]
}
func (activityPubIncomingActivities *activityPubIncomingActivities) Append(activityPubIncomingActivity IActivityPubIncomingActivity) {
activityPubIncomingActivities.collection = append(activityPubIncomingActivities.collection, activityPubIncomingActivity)
}
func (activityPubIncomingActivities *activityPubIncomingActivities) ForEach(iterator ActivityPubIncomingActivityIterator) {
if iterator == nil {
return
}
for _, value := range activityPubIncomingActivities.collection {
iterator(value)
}
}
func (activityPubIncomingActivities *activityPubIncomingActivities) Array() ActivityPubIncomingActivities {
return activityPubIncomingActivities.collection
}
//------------------------------------------------------------------------------
func (dispatcher *dispatcher) ActivityPubIncomingActivityExists(id int64) bool {
return dispatcher.conductor.ActivityPubIncomingActivityManager().Exists(id)
}
func (dispatcher *dispatcher) ActivityPubIncomingActivityExistsWhich(condition ActivityPubIncomingActivityCondition) bool {
return dispatcher.conductor.ActivityPubIncomingActivityManager().ExistsWhich(condition)
}
func (dispatcher *dispatcher) ListActivityPubIncomingActivities() IActivityPubIncomingActivityCollection {
return dispatcher.conductor.ActivityPubIncomingActivityManager().ListActivityPubIncomingActivities(0, 0, "", dispatcher.identity)
}
func (dispatcher *dispatcher) ForEachActivityPubIncomingActivity(iterator ActivityPubIncomingActivityIterator) {
dispatcher.conductor.ActivityPubIncomingActivityManager().ForEach(iterator)
}
func (dispatcher *dispatcher) FilterActivityPubIncomingActivities(predicate ActivityPubIncomingActivityFilterPredicate) IActivityPubIncomingActivityCollection {
return dispatcher.conductor.ActivityPubIncomingActivityManager().Filter(predicate)
}
func (dispatcher *dispatcher) MapActivityPubIncomingActivities(predicate ActivityPubIncomingActivityMapPredicate) IActivityPubIncomingActivityCollection {
return dispatcher.conductor.ActivityPubIncomingActivityManager().Map(predicate)
}
func (dispatcher *dispatcher) GetActivityPubIncomingActivity(id int64) IActivityPubIncomingActivity {
if activityPubIncomingActivity, err := dispatcher.conductor.ActivityPubIncomingActivityManager().GetActivityPubIncomingActivity(id, dispatcher.identity); err != nil {
panic(err.Error())
} else {
return activityPubIncomingActivity
}
}
func (dispatcher *dispatcher) AddActivityPubIncomingActivity(identityId int64, uniqueIdentifier string, timestamp int64, from string, to string, content string, raw string) IActivityPubIncomingActivity {
transaction := dispatcher.transaction
if transaction != nil {
if activityPubIncomingActivity, err := dispatcher.conductor.ActivityPubIncomingActivityManager().AddActivityPubIncomingActivityAtomic(transaction, identityId, uniqueIdentifier, timestamp, from, to, content, raw, dispatcher.identity); err != nil {
panic(err.Error())
} else {
return activityPubIncomingActivity
}
} else {
if activityPubIncomingActivity, err := dispatcher.conductor.ActivityPubIncomingActivityManager().AddActivityPubIncomingActivity(identityId, uniqueIdentifier, timestamp, from, to, content, raw, dispatcher.identity); err != nil {
panic(err.Error())
} else {
return activityPubIncomingActivity
}
}
}
func (dispatcher *dispatcher) AddActivityPubIncomingActivityWithCustomId(id int64, identityId int64, uniqueIdentifier string, timestamp int64, from string, to string, content string, raw string) IActivityPubIncomingActivity {
transaction := dispatcher.transaction
if transaction != nil {
if activityPubIncomingActivity, err := dispatcher.conductor.ActivityPubIncomingActivityManager().AddActivityPubIncomingActivityWithCustomIdAtomic(id, transaction, identityId, uniqueIdentifier, timestamp, from, to, content, raw, dispatcher.identity); err != nil {
panic(err.Error())
} else {
return activityPubIncomingActivity
}
} else {
if activityPubIncomingActivity, err := dispatcher.conductor.ActivityPubIncomingActivityManager().AddActivityPubIncomingActivityWithCustomId(id, identityId, uniqueIdentifier, timestamp, from, to, content, raw, dispatcher.identity); err != nil {
panic(err.Error())
} else {
return activityPubIncomingActivity
}
}
}
func (dispatcher *dispatcher) LogActivityPubIncomingActivity(identityId int64, uniqueIdentifier string, timestamp int64, from string, to string, content string, raw string, source string, payload string) {
dispatcher.conductor.ActivityPubIncomingActivityManager().Log(identityId, uniqueIdentifier, timestamp, from, to, content, raw, source, dispatcher.identity, payload)
}
func (dispatcher *dispatcher) UpdateActivityPubIncomingActivity(id int64, identityId int64, uniqueIdentifier string, timestamp int64, from string, to string, content string, raw string) IActivityPubIncomingActivity {
transaction := dispatcher.transaction
if transaction != nil {
if activityPubIncomingActivity, err := dispatcher.conductor.ActivityPubIncomingActivityManager().UpdateActivityPubIncomingActivityAtomic(transaction, id, identityId, uniqueIdentifier, timestamp, from, to, content, raw, dispatcher.identity); err != nil {
panic(err.Error())
} else {
return activityPubIncomingActivity
}
} else {
if activityPubIncomingActivity, err := dispatcher.conductor.ActivityPubIncomingActivityManager().UpdateActivityPubIncomingActivity(id, identityId, uniqueIdentifier, timestamp, from, to, content, raw, dispatcher.identity); err != nil {
panic(err.Error())
} else {
return activityPubIncomingActivity
}
}
}
// noinspection GoUnusedParameter
func (dispatcher *dispatcher) UpdateActivityPubIncomingActivityObject(object IObject, activityPubIncomingActivity IActivityPubIncomingActivity) IActivityPubIncomingActivity {
transaction := dispatcher.transaction
if transaction != nil {
if activityPubIncomingActivity, err := dispatcher.conductor.ActivityPubIncomingActivityManager().UpdateActivityPubIncomingActivityAtomic(transaction, object.Id(), activityPubIncomingActivity.IdentityId(), activityPubIncomingActivity.UniqueIdentifier(), activityPubIncomingActivity.Timestamp(), activityPubIncomingActivity.From(), activityPubIncomingActivity.To(), activityPubIncomingActivity.Content(), activityPubIncomingActivity.Raw(), dispatcher.identity); err != nil {
panic(err.Error())
} else {
return activityPubIncomingActivity
}
} else {
if activityPubIncomingActivity, err := dispatcher.conductor.ActivityPubIncomingActivityManager().UpdateActivityPubIncomingActivity(object.Id(), activityPubIncomingActivity.IdentityId(), activityPubIncomingActivity.UniqueIdentifier(), activityPubIncomingActivity.Timestamp(), activityPubIncomingActivity.From(), activityPubIncomingActivity.To(), activityPubIncomingActivity.Content(), activityPubIncomingActivity.Raw(), dispatcher.identity); err != nil {
panic(err.Error())
} else {
return activityPubIncomingActivity
}
}
}
func (dispatcher *dispatcher) AddOrUpdateActivityPubIncomingActivityObject(object IObject, activityPubIncomingActivity IActivityPubIncomingActivity) IActivityPubIncomingActivity {
transaction := dispatcher.transaction
if transaction != nil {
if activityPubIncomingActivity, err := dispatcher.conductor.ActivityPubIncomingActivityManager().AddOrUpdateActivityPubIncomingActivityObjectAtomic(transaction, object.Id(), activityPubIncomingActivity, dispatcher.identity); err != nil {
panic(err.Error())
} else {
return activityPubIncomingActivity
}
} else {
if activityPubIncomingActivity, err := dispatcher.conductor.ActivityPubIncomingActivityManager().AddOrUpdateActivityPubIncomingActivityObject(object.Id(), activityPubIncomingActivity, dispatcher.identity); err != nil {
panic(err.Error())
} else {
return activityPubIncomingActivity
}
}
}
func (dispatcher *dispatcher) RemoveActivityPubIncomingActivity(id int64) IActivityPubIncomingActivity {
transaction := dispatcher.transaction
if transaction != nil {
if activityPubIncomingActivity, err := dispatcher.conductor.ActivityPubIncomingActivityManager().RemoveActivityPubIncomingActivityAtomic(transaction, id, dispatcher.identity); err != nil {
panic(err.Error())
} else {
return activityPubIncomingActivity
}
} else {
if activityPubIncomingActivity, err := dispatcher.conductor.ActivityPubIncomingActivityManager().RemoveActivityPubIncomingActivity(id, dispatcher.identity); err != nil {
panic(err.Error())
} else {
return activityPubIncomingActivity
}
}
}
func (dispatcher *dispatcher) ListActivityPubIncomingActivitiesByIdentity(identity IIdentity) IActivityPubIncomingActivityCollection {
return dispatcher.conductor.ActivityPubIncomingActivityManager().ListActivityPubIncomingActivitiesByIdentity(identity.Id(), 0, 0, "", dispatcher.identity)
}
func (dispatcher *dispatcher) ListActivityPubIncomingActivitiesByIdentityId(identityId int64) IActivityPubIncomingActivityCollection {
return dispatcher.conductor.ActivityPubIncomingActivityManager().ListActivityPubIncomingActivitiesByIdentity(identityId, 0, 0, "", dispatcher.identity)
}
func (dispatcher *dispatcher) ForEachActivityPubIncomingActivityByIdentity(identity IIdentity, iterator ActivityPubIncomingActivityIterator) {
dispatcher.conductor.ActivityPubIncomingActivityManager().ForEachByIdentity(identity.Id(), iterator)
}
func (dispatcher *dispatcher) ForEachActivityPubIncomingActivityByIdentityId(identityId int64, iterator ActivityPubIncomingActivityIterator) {
dispatcher.conductor.ActivityPubIncomingActivityManager().ForEachByIdentity(identityId, iterator)
}

Wyświetl plik

@ -0,0 +1,456 @@
package core
import (
"fmt"
. "github.com/xeronith/diamante/contracts/security"
"rail.town/infrastructure/app/validators"
. "rail.town/infrastructure/components/constants"
. "rail.town/infrastructure/components/contracts"
. "rail.town/infrastructure/components/contracts/model"
"rail.town/infrastructure/components/model/repository"
)
type activityPubOutgoingActivity struct {
object
identityId int64
uniqueIdentifier string
timestamp int64
from string
to string
content string
raw string
}
// noinspection GoUnusedExportedFunction
func InitializeActivityPubOutgoingActivity() {
_ = ENABLE_SECURITY
_ = ENABLE_CUSTOM_ERRORS
_ = validators.Initialize
_ = repository.Initialize
}
func NewActivityPubOutgoingActivity(id int64, identityId int64, uniqueIdentifier string, timestamp int64, from string, to string, content string, raw string) (IActivityPubOutgoingActivity, error) {
instance := &activityPubOutgoingActivity{
object: object{
id: id,
},
identityId: identityId,
uniqueIdentifier: uniqueIdentifier,
timestamp: timestamp,
from: from,
to: to,
content: content,
raw: raw,
}
if err := instance.Validate(); err != nil {
return nil, err
}
return instance, nil
}
func NewActivityPubOutgoingActivityFromEntity(entity IActivityPubOutgoingActivityEntity) (IActivityPubOutgoingActivity, error) {
instance := &activityPubOutgoingActivity{
object: object{
id: entity.Id(),
},
identityId: entity.IdentityId(),
uniqueIdentifier: entity.UniqueIdentifier(),
timestamp: entity.Timestamp(),
from: entity.From(),
to: entity.To(),
content: entity.Content(),
raw: entity.Raw(),
}
if err := instance.Validate(); err != nil {
return nil, err
}
return instance, nil
}
func (activityPubOutgoingActivity *activityPubOutgoingActivity) DependenciesAreUnknown() bool {
// noinspection GoBoolExpressions
return activityPubOutgoingActivity.identityId == 0 || false
}
func (activityPubOutgoingActivity *activityPubOutgoingActivity) IdentityId() int64 {
return activityPubOutgoingActivity.identityId
}
func (activityPubOutgoingActivity *activityPubOutgoingActivity) AssertBelongsToIdentity(_identity IIdentity) {
if activityPubOutgoingActivity.identityId != _identity.Id() {
panic(ERROR_MESSAGE_ACTIVITY_PUB_OUTGOING_ACTIVITY_NOT_FOUND)
}
}
func (activityPubOutgoingActivity *activityPubOutgoingActivity) IdentityIsUnknown() bool {
return activityPubOutgoingActivity.identityId == 0
}
func (activityPubOutgoingActivity *activityPubOutgoingActivity) AssertIdentityIsProvided() {
if activityPubOutgoingActivity.identityId == 0 {
panic(ERROR_MESSAGE_UNKNOWN_IDENTITY)
}
}
func (activityPubOutgoingActivity *activityPubOutgoingActivity) AssertIdentity(identityId int64) {
if activityPubOutgoingActivity.identityId != identityId {
panic(ERROR_MESSAGE_UNKNOWN_IDENTITY)
}
}
func (activityPubOutgoingActivity *activityPubOutgoingActivity) UniqueIdentifier() string {
return activityPubOutgoingActivity.uniqueIdentifier
}
func (activityPubOutgoingActivity *activityPubOutgoingActivity) UpdateUniqueIdentifier(uniqueIdentifier string, editor Identity) {
if err := repository.ActivityPubOutgoingActivities.UpdateUniqueIdentifier(activityPubOutgoingActivity.id, uniqueIdentifier, editor.Id()); err != nil {
panic(err.Error())
}
activityPubOutgoingActivity.uniqueIdentifier = uniqueIdentifier
}
func (activityPubOutgoingActivity *activityPubOutgoingActivity) UpdateUniqueIdentifierAtomic(transaction ITransaction, uniqueIdentifier string, editor Identity) {
transaction.OnCommit(func() {
activityPubOutgoingActivity.uniqueIdentifier = uniqueIdentifier
})
if err := repository.ActivityPubOutgoingActivities.UpdateUniqueIdentifierAtomic(transaction, activityPubOutgoingActivity.id, uniqueIdentifier, editor.Id()); err != nil {
panic(err.Error())
}
}
func (activityPubOutgoingActivity *activityPubOutgoingActivity) Timestamp() int64 {
return activityPubOutgoingActivity.timestamp
}
func (activityPubOutgoingActivity *activityPubOutgoingActivity) UpdateTimestamp(timestamp int64, editor Identity) {
if err := repository.ActivityPubOutgoingActivities.UpdateTimestamp(activityPubOutgoingActivity.id, timestamp, editor.Id()); err != nil {
panic(err.Error())
}
activityPubOutgoingActivity.timestamp = timestamp
}
func (activityPubOutgoingActivity *activityPubOutgoingActivity) UpdateTimestampAtomic(transaction ITransaction, timestamp int64, editor Identity) {
transaction.OnCommit(func() {
activityPubOutgoingActivity.timestamp = timestamp
})
if err := repository.ActivityPubOutgoingActivities.UpdateTimestampAtomic(transaction, activityPubOutgoingActivity.id, timestamp, editor.Id()); err != nil {
panic(err.Error())
}
}
func (activityPubOutgoingActivity *activityPubOutgoingActivity) From() string {
return activityPubOutgoingActivity.from
}
func (activityPubOutgoingActivity *activityPubOutgoingActivity) UpdateFrom(from string, editor Identity) {
if err := repository.ActivityPubOutgoingActivities.UpdateFrom(activityPubOutgoingActivity.id, from, editor.Id()); err != nil {
panic(err.Error())
}
activityPubOutgoingActivity.from = from
}
func (activityPubOutgoingActivity *activityPubOutgoingActivity) UpdateFromAtomic(transaction ITransaction, from string, editor Identity) {
transaction.OnCommit(func() {
activityPubOutgoingActivity.from = from
})
if err := repository.ActivityPubOutgoingActivities.UpdateFromAtomic(transaction, activityPubOutgoingActivity.id, from, editor.Id()); err != nil {
panic(err.Error())
}
}
func (activityPubOutgoingActivity *activityPubOutgoingActivity) To() string {
return activityPubOutgoingActivity.to
}
func (activityPubOutgoingActivity *activityPubOutgoingActivity) UpdateTo(to string, editor Identity) {
if err := repository.ActivityPubOutgoingActivities.UpdateTo(activityPubOutgoingActivity.id, to, editor.Id()); err != nil {
panic(err.Error())
}
activityPubOutgoingActivity.to = to
}
func (activityPubOutgoingActivity *activityPubOutgoingActivity) UpdateToAtomic(transaction ITransaction, to string, editor Identity) {
transaction.OnCommit(func() {
activityPubOutgoingActivity.to = to
})
if err := repository.ActivityPubOutgoingActivities.UpdateToAtomic(transaction, activityPubOutgoingActivity.id, to, editor.Id()); err != nil {
panic(err.Error())
}
}
func (activityPubOutgoingActivity *activityPubOutgoingActivity) Content() string {
return activityPubOutgoingActivity.content
}
func (activityPubOutgoingActivity *activityPubOutgoingActivity) UpdateContent(content string, editor Identity) {
if err := repository.ActivityPubOutgoingActivities.UpdateContent(activityPubOutgoingActivity.id, content, editor.Id()); err != nil {
panic(err.Error())
}
activityPubOutgoingActivity.content = content
}
func (activityPubOutgoingActivity *activityPubOutgoingActivity) UpdateContentAtomic(transaction ITransaction, content string, editor Identity) {
transaction.OnCommit(func() {
activityPubOutgoingActivity.content = content
})
if err := repository.ActivityPubOutgoingActivities.UpdateContentAtomic(transaction, activityPubOutgoingActivity.id, content, editor.Id()); err != nil {
panic(err.Error())
}
}
func (activityPubOutgoingActivity *activityPubOutgoingActivity) Raw() string {
return activityPubOutgoingActivity.raw
}
func (activityPubOutgoingActivity *activityPubOutgoingActivity) UpdateRaw(raw string, editor Identity) {
if err := repository.ActivityPubOutgoingActivities.UpdateRaw(activityPubOutgoingActivity.id, raw, editor.Id()); err != nil {
panic(err.Error())
}
activityPubOutgoingActivity.raw = raw
}
func (activityPubOutgoingActivity *activityPubOutgoingActivity) UpdateRawAtomic(transaction ITransaction, raw string, editor Identity) {
transaction.OnCommit(func() {
activityPubOutgoingActivity.raw = raw
})
if err := repository.ActivityPubOutgoingActivities.UpdateRawAtomic(transaction, activityPubOutgoingActivity.id, raw, editor.Id()); err != nil {
panic(err.Error())
}
}
func (activityPubOutgoingActivity *activityPubOutgoingActivity) Validate() error {
return nil
}
func (activityPubOutgoingActivity *activityPubOutgoingActivity) String() string {
return fmt.Sprintf("ActivityPubOutgoingActivity (Id: %d, IdentityId: %d, UniqueIdentifier: %v, Timestamp: %v, From: %v, To: %v, Content: %v, Raw: %v)", activityPubOutgoingActivity.Id(), activityPubOutgoingActivity.IdentityId(), activityPubOutgoingActivity.UniqueIdentifier(), activityPubOutgoingActivity.Timestamp(), activityPubOutgoingActivity.From(), activityPubOutgoingActivity.To(), activityPubOutgoingActivity.Content(), activityPubOutgoingActivity.Raw())
}
//------------------------------------------------------------------------------
type activityPubOutgoingActivities struct {
collection ActivityPubOutgoingActivities
}
// NewActivityPubOutgoingActivities creates an empty collection of 'Activity Pub Outgoing Activity' which is not thread-safe.
func NewActivityPubOutgoingActivities() IActivityPubOutgoingActivityCollection {
return &activityPubOutgoingActivities{
collection: make(ActivityPubOutgoingActivities, 0),
}
}
func (activityPubOutgoingActivities *activityPubOutgoingActivities) Count() int {
return len(activityPubOutgoingActivities.collection)
}
func (activityPubOutgoingActivities *activityPubOutgoingActivities) IsEmpty() bool {
return len(activityPubOutgoingActivities.collection) == 0
}
func (activityPubOutgoingActivities *activityPubOutgoingActivities) IsNotEmpty() bool {
return len(activityPubOutgoingActivities.collection) > 0
}
func (activityPubOutgoingActivities *activityPubOutgoingActivities) HasExactlyOneItem() bool {
return len(activityPubOutgoingActivities.collection) == 1
}
func (activityPubOutgoingActivities *activityPubOutgoingActivities) HasAtLeastOneItem() bool {
return len(activityPubOutgoingActivities.collection) >= 1
}
func (activityPubOutgoingActivities *activityPubOutgoingActivities) First() IActivityPubOutgoingActivity {
return activityPubOutgoingActivities.collection[0]
}
func (activityPubOutgoingActivities *activityPubOutgoingActivities) Append(activityPubOutgoingActivity IActivityPubOutgoingActivity) {
activityPubOutgoingActivities.collection = append(activityPubOutgoingActivities.collection, activityPubOutgoingActivity)
}
func (activityPubOutgoingActivities *activityPubOutgoingActivities) ForEach(iterator ActivityPubOutgoingActivityIterator) {
if iterator == nil {
return
}
for _, value := range activityPubOutgoingActivities.collection {
iterator(value)
}
}
func (activityPubOutgoingActivities *activityPubOutgoingActivities) Array() ActivityPubOutgoingActivities {
return activityPubOutgoingActivities.collection
}
//------------------------------------------------------------------------------
func (dispatcher *dispatcher) ActivityPubOutgoingActivityExists(id int64) bool {
return dispatcher.conductor.ActivityPubOutgoingActivityManager().Exists(id)
}
func (dispatcher *dispatcher) ActivityPubOutgoingActivityExistsWhich(condition ActivityPubOutgoingActivityCondition) bool {
return dispatcher.conductor.ActivityPubOutgoingActivityManager().ExistsWhich(condition)
}
func (dispatcher *dispatcher) ListActivityPubOutgoingActivities() IActivityPubOutgoingActivityCollection {
return dispatcher.conductor.ActivityPubOutgoingActivityManager().ListActivityPubOutgoingActivities(0, 0, "", dispatcher.identity)
}
func (dispatcher *dispatcher) ForEachActivityPubOutgoingActivity(iterator ActivityPubOutgoingActivityIterator) {
dispatcher.conductor.ActivityPubOutgoingActivityManager().ForEach(iterator)
}
func (dispatcher *dispatcher) FilterActivityPubOutgoingActivities(predicate ActivityPubOutgoingActivityFilterPredicate) IActivityPubOutgoingActivityCollection {
return dispatcher.conductor.ActivityPubOutgoingActivityManager().Filter(predicate)
}
func (dispatcher *dispatcher) MapActivityPubOutgoingActivities(predicate ActivityPubOutgoingActivityMapPredicate) IActivityPubOutgoingActivityCollection {
return dispatcher.conductor.ActivityPubOutgoingActivityManager().Map(predicate)
}
func (dispatcher *dispatcher) GetActivityPubOutgoingActivity(id int64) IActivityPubOutgoingActivity {
if activityPubOutgoingActivity, err := dispatcher.conductor.ActivityPubOutgoingActivityManager().GetActivityPubOutgoingActivity(id, dispatcher.identity); err != nil {
panic(err.Error())
} else {
return activityPubOutgoingActivity
}
}
func (dispatcher *dispatcher) AddActivityPubOutgoingActivity(identityId int64, uniqueIdentifier string, timestamp int64, from string, to string, content string, raw string) IActivityPubOutgoingActivity {
transaction := dispatcher.transaction
if transaction != nil {
if activityPubOutgoingActivity, err := dispatcher.conductor.ActivityPubOutgoingActivityManager().AddActivityPubOutgoingActivityAtomic(transaction, identityId, uniqueIdentifier, timestamp, from, to, content, raw, dispatcher.identity); err != nil {
panic(err.Error())
} else {
return activityPubOutgoingActivity
}
} else {
if activityPubOutgoingActivity, err := dispatcher.conductor.ActivityPubOutgoingActivityManager().AddActivityPubOutgoingActivity(identityId, uniqueIdentifier, timestamp, from, to, content, raw, dispatcher.identity); err != nil {
panic(err.Error())
} else {
return activityPubOutgoingActivity
}
}
}
func (dispatcher *dispatcher) AddActivityPubOutgoingActivityWithCustomId(id int64, identityId int64, uniqueIdentifier string, timestamp int64, from string, to string, content string, raw string) IActivityPubOutgoingActivity {
transaction := dispatcher.transaction
if transaction != nil {
if activityPubOutgoingActivity, err := dispatcher.conductor.ActivityPubOutgoingActivityManager().AddActivityPubOutgoingActivityWithCustomIdAtomic(id, transaction, identityId, uniqueIdentifier, timestamp, from, to, content, raw, dispatcher.identity); err != nil {
panic(err.Error())
} else {
return activityPubOutgoingActivity
}
} else {
if activityPubOutgoingActivity, err := dispatcher.conductor.ActivityPubOutgoingActivityManager().AddActivityPubOutgoingActivityWithCustomId(id, identityId, uniqueIdentifier, timestamp, from, to, content, raw, dispatcher.identity); err != nil {
panic(err.Error())
} else {
return activityPubOutgoingActivity
}
}
}
func (dispatcher *dispatcher) LogActivityPubOutgoingActivity(identityId int64, uniqueIdentifier string, timestamp int64, from string, to string, content string, raw string, source string, payload string) {
dispatcher.conductor.ActivityPubOutgoingActivityManager().Log(identityId, uniqueIdentifier, timestamp, from, to, content, raw, source, dispatcher.identity, payload)
}
func (dispatcher *dispatcher) UpdateActivityPubOutgoingActivity(id int64, identityId int64, uniqueIdentifier string, timestamp int64, from string, to string, content string, raw string) IActivityPubOutgoingActivity {
transaction := dispatcher.transaction
if transaction != nil {
if activityPubOutgoingActivity, err := dispatcher.conductor.ActivityPubOutgoingActivityManager().UpdateActivityPubOutgoingActivityAtomic(transaction, id, identityId, uniqueIdentifier, timestamp, from, to, content, raw, dispatcher.identity); err != nil {
panic(err.Error())
} else {
return activityPubOutgoingActivity
}
} else {
if activityPubOutgoingActivity, err := dispatcher.conductor.ActivityPubOutgoingActivityManager().UpdateActivityPubOutgoingActivity(id, identityId, uniqueIdentifier, timestamp, from, to, content, raw, dispatcher.identity); err != nil {
panic(err.Error())
} else {
return activityPubOutgoingActivity
}
}
}
// noinspection GoUnusedParameter
func (dispatcher *dispatcher) UpdateActivityPubOutgoingActivityObject(object IObject, activityPubOutgoingActivity IActivityPubOutgoingActivity) IActivityPubOutgoingActivity {
transaction := dispatcher.transaction
if transaction != nil {
if activityPubOutgoingActivity, err := dispatcher.conductor.ActivityPubOutgoingActivityManager().UpdateActivityPubOutgoingActivityAtomic(transaction, object.Id(), activityPubOutgoingActivity.IdentityId(), activityPubOutgoingActivity.UniqueIdentifier(), activityPubOutgoingActivity.Timestamp(), activityPubOutgoingActivity.From(), activityPubOutgoingActivity.To(), activityPubOutgoingActivity.Content(), activityPubOutgoingActivity.Raw(), dispatcher.identity); err != nil {
panic(err.Error())
} else {
return activityPubOutgoingActivity
}
} else {
if activityPubOutgoingActivity, err := dispatcher.conductor.ActivityPubOutgoingActivityManager().UpdateActivityPubOutgoingActivity(object.Id(), activityPubOutgoingActivity.IdentityId(), activityPubOutgoingActivity.UniqueIdentifier(), activityPubOutgoingActivity.Timestamp(), activityPubOutgoingActivity.From(), activityPubOutgoingActivity.To(), activityPubOutgoingActivity.Content(), activityPubOutgoingActivity.Raw(), dispatcher.identity); err != nil {
panic(err.Error())
} else {
return activityPubOutgoingActivity
}
}
}
func (dispatcher *dispatcher) AddOrUpdateActivityPubOutgoingActivityObject(object IObject, activityPubOutgoingActivity IActivityPubOutgoingActivity) IActivityPubOutgoingActivity {
transaction := dispatcher.transaction
if transaction != nil {
if activityPubOutgoingActivity, err := dispatcher.conductor.ActivityPubOutgoingActivityManager().AddOrUpdateActivityPubOutgoingActivityObjectAtomic(transaction, object.Id(), activityPubOutgoingActivity, dispatcher.identity); err != nil {
panic(err.Error())
} else {
return activityPubOutgoingActivity
}
} else {
if activityPubOutgoingActivity, err := dispatcher.conductor.ActivityPubOutgoingActivityManager().AddOrUpdateActivityPubOutgoingActivityObject(object.Id(), activityPubOutgoingActivity, dispatcher.identity); err != nil {
panic(err.Error())
} else {
return activityPubOutgoingActivity
}
}
}
func (dispatcher *dispatcher) RemoveActivityPubOutgoingActivity(id int64) IActivityPubOutgoingActivity {
transaction := dispatcher.transaction
if transaction != nil {
if activityPubOutgoingActivity, err := dispatcher.conductor.ActivityPubOutgoingActivityManager().RemoveActivityPubOutgoingActivityAtomic(transaction, id, dispatcher.identity); err != nil {
panic(err.Error())
} else {
return activityPubOutgoingActivity
}
} else {
if activityPubOutgoingActivity, err := dispatcher.conductor.ActivityPubOutgoingActivityManager().RemoveActivityPubOutgoingActivity(id, dispatcher.identity); err != nil {
panic(err.Error())
} else {
return activityPubOutgoingActivity
}
}
}
func (dispatcher *dispatcher) ListActivityPubOutgoingActivitiesByIdentity(identity IIdentity) IActivityPubOutgoingActivityCollection {
return dispatcher.conductor.ActivityPubOutgoingActivityManager().ListActivityPubOutgoingActivitiesByIdentity(identity.Id(), 0, 0, "", dispatcher.identity)
}
func (dispatcher *dispatcher) ListActivityPubOutgoingActivitiesByIdentityId(identityId int64) IActivityPubOutgoingActivityCollection {
return dispatcher.conductor.ActivityPubOutgoingActivityManager().ListActivityPubOutgoingActivitiesByIdentity(identityId, 0, 0, "", dispatcher.identity)
}
func (dispatcher *dispatcher) ForEachActivityPubOutgoingActivityByIdentity(identity IIdentity, iterator ActivityPubOutgoingActivityIterator) {
dispatcher.conductor.ActivityPubOutgoingActivityManager().ForEachByIdentity(identity.Id(), iterator)
}
func (dispatcher *dispatcher) ForEachActivityPubOutgoingActivityByIdentityId(identityId int64, iterator ActivityPubOutgoingActivityIterator) {
dispatcher.conductor.ActivityPubOutgoingActivityManager().ForEachByIdentity(identityId, iterator)
}

Wyświetl plik

@ -0,0 +1,109 @@
package entity
import (
"fmt"
"reflect"
"time"
"rail.town/infrastructure/app/validators"
. "rail.town/infrastructure/components/constants"
. "rail.town/infrastructure/components/contracts/model"
)
var ActivityPubIncomingActivityEntityType = reflect.TypeOf(activityPubIncomingActivityEntity{})
// noinspection GoUnusedExportedFunction
func InitializeActivityPubIncomingActivityEntity() {
_ = ENABLE_CUSTOM_ERRORS
_ = validators.Initialize
}
type activityPubIncomingActivityEntity struct {
entity
IdentityIdField int64 `json:"identity_id"`
UniqueIdentifierField string `json:"unique_identifier" previous:"identity_id" storage:"VARCHAR(128)" default:"''"`
TimestampField int64 `json:"timestamp" previous:"unique_identifier" storage:"BIGINT" default:"0"`
FromField string `json:"from" previous:"timestamp" storage:"VARCHAR(256)" default:"''"`
ToField string `json:"to" previous:"from" storage:"VARCHAR(256)" default:"''"`
ContentField string `json:"content" previous:"to" storage:"VARCHAR(4096)" default:"''"`
RawField string `json:"raw" previous:"content" storage:"JSON" default:"'{}'"`
}
func NewActivityPubIncomingActivityEntity(id int64, identityId int64, uniqueIdentifier string, timestamp int64, from string, to string, content string, raw string) IActivityPubIncomingActivityEntity {
return &activityPubIncomingActivityEntity{
entity: entity{IdField: id},
IdentityIdField: identityId,
UniqueIdentifierField: uniqueIdentifier,
TimestampField: timestamp,
FromField: from,
ToField: to,
ContentField: content,
RawField: raw,
}
}
type activityPubIncomingActivityPipeEntity struct {
activityPubIncomingActivityEntity
pipeEntity
}
func NewActivityPubIncomingActivityPipeEntity(id int64, identityId int64, uniqueIdentifier string, timestamp int64, from string, to string, content string, raw string, source string, editor int64, payload string) IActivityPubIncomingActivityPipeEntity {
return &activityPubIncomingActivityPipeEntity{
activityPubIncomingActivityEntity: activityPubIncomingActivityEntity{
entity: entity{IdField: id, PayloadField: payload},
IdentityIdField: identityId,
UniqueIdentifierField: uniqueIdentifier,
TimestampField: timestamp,
FromField: from,
ToField: to,
ContentField: content,
RawField: raw,
},
pipeEntity: pipeEntity{
Pipe: PIPE_ACTIVITY_PUB_INCOMING_ACTIVITY,
Source: source,
Editor: editor,
QueueTimestamp: time.Now(),
},
}
}
func (entity *activityPubIncomingActivityEntity) IdentityId() int64 {
return entity.IdentityIdField
}
func (entity *activityPubIncomingActivityEntity) UniqueIdentifier() string {
return entity.UniqueIdentifierField
}
func (entity *activityPubIncomingActivityEntity) Timestamp() int64 {
return entity.TimestampField
}
func (entity *activityPubIncomingActivityEntity) From() string {
return entity.FromField
}
func (entity *activityPubIncomingActivityEntity) To() string {
return entity.ToField
}
func (entity *activityPubIncomingActivityEntity) Content() string {
return entity.ContentField
}
func (entity *activityPubIncomingActivityEntity) Raw() string {
return entity.RawField
}
func (entity *activityPubIncomingActivityEntity) Validate() error {
if entity.IdField <= 0 {
return ERROR_INVALID_ID
}
return nil
}
func (entity *activityPubIncomingActivityEntity) String() string {
return fmt.Sprintf("ActivityPubIncomingActivity (Id: %d, IdentityId: %d, UniqueIdentifier: %v, Timestamp: %v, From: %v, To: %v, Content: %v, Raw: %v)", entity.Id(), entity.IdentityId(), entity.UniqueIdentifier(), entity.Timestamp(), entity.From(), entity.To(), entity.Content(), entity.Raw())
}

Wyświetl plik

@ -0,0 +1,109 @@
package entity
import (
"fmt"
"reflect"
"time"
"rail.town/infrastructure/app/validators"
. "rail.town/infrastructure/components/constants"
. "rail.town/infrastructure/components/contracts/model"
)
var ActivityPubOutgoingActivityEntityType = reflect.TypeOf(activityPubOutgoingActivityEntity{})
// noinspection GoUnusedExportedFunction
func InitializeActivityPubOutgoingActivityEntity() {
_ = ENABLE_CUSTOM_ERRORS
_ = validators.Initialize
}
type activityPubOutgoingActivityEntity struct {
entity
IdentityIdField int64 `json:"identity_id"`
UniqueIdentifierField string `json:"unique_identifier" previous:"identity_id" storage:"VARCHAR(128)" default:"''"`
TimestampField int64 `json:"timestamp" previous:"unique_identifier" storage:"BIGINT" default:"0"`
FromField string `json:"from" previous:"timestamp" storage:"VARCHAR(256)" default:"''"`
ToField string `json:"to" previous:"from" storage:"VARCHAR(256)" default:"''"`
ContentField string `json:"content" previous:"to" storage:"VARCHAR(4096)" default:"''"`
RawField string `json:"raw" previous:"content" storage:"JSON" default:"'{}'"`
}
func NewActivityPubOutgoingActivityEntity(id int64, identityId int64, uniqueIdentifier string, timestamp int64, from string, to string, content string, raw string) IActivityPubOutgoingActivityEntity {
return &activityPubOutgoingActivityEntity{
entity: entity{IdField: id},
IdentityIdField: identityId,
UniqueIdentifierField: uniqueIdentifier,
TimestampField: timestamp,
FromField: from,
ToField: to,
ContentField: content,
RawField: raw,
}
}
type activityPubOutgoingActivityPipeEntity struct {
activityPubOutgoingActivityEntity
pipeEntity
}
func NewActivityPubOutgoingActivityPipeEntity(id int64, identityId int64, uniqueIdentifier string, timestamp int64, from string, to string, content string, raw string, source string, editor int64, payload string) IActivityPubOutgoingActivityPipeEntity {
return &activityPubOutgoingActivityPipeEntity{
activityPubOutgoingActivityEntity: activityPubOutgoingActivityEntity{
entity: entity{IdField: id, PayloadField: payload},
IdentityIdField: identityId,
UniqueIdentifierField: uniqueIdentifier,
TimestampField: timestamp,
FromField: from,
ToField: to,
ContentField: content,
RawField: raw,
},
pipeEntity: pipeEntity{
Pipe: PIPE_ACTIVITY_PUB_OUTGOING_ACTIVITY,
Source: source,
Editor: editor,
QueueTimestamp: time.Now(),
},
}
}
func (entity *activityPubOutgoingActivityEntity) IdentityId() int64 {
return entity.IdentityIdField
}
func (entity *activityPubOutgoingActivityEntity) UniqueIdentifier() string {
return entity.UniqueIdentifierField
}
func (entity *activityPubOutgoingActivityEntity) Timestamp() int64 {
return entity.TimestampField
}
func (entity *activityPubOutgoingActivityEntity) From() string {
return entity.FromField
}
func (entity *activityPubOutgoingActivityEntity) To() string {
return entity.ToField
}
func (entity *activityPubOutgoingActivityEntity) Content() string {
return entity.ContentField
}
func (entity *activityPubOutgoingActivityEntity) Raw() string {
return entity.RawField
}
func (entity *activityPubOutgoingActivityEntity) Validate() error {
if entity.IdField <= 0 {
return ERROR_INVALID_ID
}
return nil
}
func (entity *activityPubOutgoingActivityEntity) String() string {
return fmt.Sprintf("ActivityPubOutgoingActivity (Id: %d, IdentityId: %d, UniqueIdentifier: %v, Timestamp: %v, From: %v, To: %v, Content: %v, Raw: %v)", entity.Id(), entity.IdentityId(), entity.UniqueIdentifier(), entity.Timestamp(), entity.From(), entity.To(), entity.Content(), entity.Raw())
}

Wyświetl plik

@ -6,7 +6,7 @@ require (
github.com/google/uuid v1.3.0
github.com/robfig/cron v1.2.0
github.com/sendgrid/sendgrid-go v3.12.0+incompatible
github.com/xeronith/diamante v1.3.0
github.com/xeronith/diamante v1.4.0
google.golang.org/protobuf v1.28.1
)

Wyświetl plik

@ -66,8 +66,8 @@ github.com/valyala/fasttemplate v1.2.2 h1:lxLXG0uE3Qnshl9QyaK6XJxMXlQZELvChBOCmQ
github.com/valyala/fasttemplate v1.2.2/go.mod h1:KHLXt3tVN2HBp8eijSv/kGJopbvo7S+qRAEEKiv+SiQ=
github.com/valyala/tcplisten v1.0.0 h1:rBHj/Xf+E1tRGZyWIWwJDiRY0zc1Js+CV5DqwacVSA8=
github.com/valyala/tcplisten v1.0.0/go.mod h1:T0xQ8SeCZGxckz9qRXTfG43PvQ/mcWh7FwZEA7Ioqkc=
github.com/xeronith/diamante v1.3.0 h1:dMfWOHiq0AIxuOZCXouulOs11dT7KFjFM+swR6jykbw=
github.com/xeronith/diamante v1.3.0/go.mod h1:BoY6p2S1QFqZznKsCTufTpxIr2ZL17K9Ez2+KPkjPfs=
github.com/xeronith/diamante v1.4.0 h1:L2o6KkW7+4lE6mIC6cdkYknmegUhPUrU4W05/2NoXCA=
github.com/xeronith/diamante v1.4.0/go.mod h1:BoY6p2S1QFqZznKsCTufTpxIr2ZL17K9Ez2+KPkjPfs=
github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=