kopia lustrzana https://github.com/reiver/greatape
refactor(components): 🎨 cleanup
rodzic
29b364553f
commit
606fa1bc55
|
@ -10,7 +10,6 @@ import (
|
|||
// noinspection GoUnusedParameter
|
||||
func AuthorizeInteractionService(context IContext, input *AuthorizeInteractionRequest) (result *AuthorizeInteractionResult, err error) {
|
||||
conductor := core.Conductor
|
||||
_ = AUTHORIZE_INTERACTION_REQUEST
|
||||
|
||||
conductor.LogRemoteCall(context, INITIALIZE, "authorize_interaction", input, result, err)
|
||||
defer func() { conductor.LogRemoteCall(context, FINALIZE, "authorize_interaction", input, result, err) }()
|
||||
|
|
|
@ -10,7 +10,6 @@ import (
|
|||
// noinspection GoUnusedParameter
|
||||
func CheckUsernameAvailabilityService(context IContext, input *CheckUsernameAvailabilityRequest) (result *CheckUsernameAvailabilityResult, err error) {
|
||||
conductor := core.Conductor
|
||||
_ = CHECK_USERNAME_AVAILABILITY_REQUEST
|
||||
|
||||
conductor.LogRemoteCall(context, INITIALIZE, "check_username_availability", input, result, err)
|
||||
defer func() { conductor.LogRemoteCall(context, FINALIZE, "check_username_availability", input, result, err) }()
|
||||
|
|
|
@ -10,7 +10,6 @@ import (
|
|||
// noinspection GoUnusedParameter
|
||||
func EchoService(context IContext, input *EchoRequest) (result *EchoResult, err error) {
|
||||
conductor := core.Conductor
|
||||
_ = ECHO_REQUEST
|
||||
|
||||
conductor.LogRemoteCall(context, INITIALIZE, "echo", input, result, err)
|
||||
defer func() { conductor.LogRemoteCall(context, FINALIZE, "echo", input, result, err) }()
|
||||
|
|
|
@ -10,7 +10,6 @@ import (
|
|||
// noinspection GoUnusedParameter
|
||||
func FollowActorService(context IContext, input *FollowActorRequest) (result *FollowActorResult, err error) {
|
||||
conductor := core.Conductor
|
||||
_ = FOLLOW_ACTOR_REQUEST
|
||||
|
||||
conductor.LogRemoteCall(context, INITIALIZE, "follow_actor", input, result, err)
|
||||
defer func() { conductor.LogRemoteCall(context, FINALIZE, "follow_actor", input, result, err) }()
|
||||
|
|
|
@ -10,7 +10,6 @@ import (
|
|||
// noinspection GoUnusedParameter
|
||||
func GetActorService(context IContext, input *GetActorRequest) (result *GetActorResult, err error) {
|
||||
conductor := core.Conductor
|
||||
_ = GET_ACTOR_REQUEST
|
||||
|
||||
conductor.LogRemoteCall(context, INITIALIZE, "get_actor", input, result, err)
|
||||
defer func() { conductor.LogRemoteCall(context, FINALIZE, "get_actor", input, result, err) }()
|
||||
|
|
|
@ -10,7 +10,6 @@ import (
|
|||
// noinspection GoUnusedParameter
|
||||
func GetFollowersService(context IContext, input *GetFollowersRequest) (result *GetFollowersResult, err error) {
|
||||
conductor := core.Conductor
|
||||
_ = GET_FOLLOWERS_REQUEST
|
||||
|
||||
conductor.LogRemoteCall(context, INITIALIZE, "get_followers", input, result, err)
|
||||
defer func() { conductor.LogRemoteCall(context, FINALIZE, "get_followers", input, result, err) }()
|
||||
|
|
|
@ -10,7 +10,6 @@ import (
|
|||
// noinspection GoUnusedParameter
|
||||
func GetFollowingService(context IContext, input *GetFollowingRequest) (result *GetFollowingResult, err error) {
|
||||
conductor := core.Conductor
|
||||
_ = GET_FOLLOWING_REQUEST
|
||||
|
||||
conductor.LogRemoteCall(context, INITIALIZE, "get_following", input, result, err)
|
||||
defer func() { conductor.LogRemoteCall(context, FINALIZE, "get_following", input, result, err) }()
|
||||
|
|
|
@ -10,7 +10,6 @@ import (
|
|||
// noinspection GoUnusedParameter
|
||||
func GetInboxService(context IContext, input *GetInboxRequest) (result *GetInboxResult, err error) {
|
||||
conductor := core.Conductor
|
||||
_ = GET_INBOX_REQUEST
|
||||
|
||||
conductor.LogRemoteCall(context, INITIALIZE, "get_inbox", input, result, err)
|
||||
defer func() { conductor.LogRemoteCall(context, FINALIZE, "get_inbox", input, result, err) }()
|
||||
|
|
|
@ -10,7 +10,6 @@ import (
|
|||
// noinspection GoUnusedParameter
|
||||
func GetOutboxService(context IContext, input *GetOutboxRequest) (result *GetOutboxResult, err error) {
|
||||
conductor := core.Conductor
|
||||
_ = GET_OUTBOX_REQUEST
|
||||
|
||||
conductor.LogRemoteCall(context, INITIALIZE, "get_outbox", input, result, err)
|
||||
defer func() { conductor.LogRemoteCall(context, FINALIZE, "get_outbox", input, result, err) }()
|
||||
|
|
|
@ -10,7 +10,6 @@ import (
|
|||
// noinspection GoUnusedParameter
|
||||
func GetPackagesService(context IContext, input *GetPackagesRequest) (result *GetPackagesResult, err error) {
|
||||
conductor := core.Conductor
|
||||
_ = GET_PACKAGES_REQUEST
|
||||
|
||||
conductor.LogRemoteCall(context, INITIALIZE, "get_packages", input, result, err)
|
||||
defer func() { conductor.LogRemoteCall(context, FINALIZE, "get_packages", input, result, err) }()
|
||||
|
|
|
@ -10,7 +10,6 @@ import (
|
|||
// noinspection GoUnusedParameter
|
||||
func GetProfileByUserService(context IContext, input *GetProfileByUserRequest) (result *GetProfileByUserResult, err error) {
|
||||
conductor := core.Conductor
|
||||
_ = GET_PROFILE_BY_USER_REQUEST
|
||||
|
||||
conductor.LogRemoteCall(context, INITIALIZE, "get_profile_by_user", input, result, err)
|
||||
defer func() { conductor.LogRemoteCall(context, FINALIZE, "get_profile_by_user", input, result, err) }()
|
||||
|
|
|
@ -10,7 +10,6 @@ import (
|
|||
// noinspection GoUnusedParameter
|
||||
func LoginService(context IContext, input *LoginRequest) (result *LoginResult, err error) {
|
||||
conductor := core.Conductor
|
||||
_ = LOGIN_REQUEST
|
||||
|
||||
conductor.LogRemoteCall(context, INITIALIZE, "login", input, result, err)
|
||||
defer func() { conductor.LogRemoteCall(context, FINALIZE, "login", input, result, err) }()
|
||||
|
|
|
@ -10,7 +10,6 @@ import (
|
|||
// noinspection GoUnusedParameter
|
||||
func LogoutService(context IContext, input *LogoutRequest) (result *LogoutResult, err error) {
|
||||
conductor := core.Conductor
|
||||
_ = LOGOUT_REQUEST
|
||||
|
||||
conductor.LogRemoteCall(context, INITIALIZE, "logout", input, result, err)
|
||||
defer func() { conductor.LogRemoteCall(context, FINALIZE, "logout", input, result, err) }()
|
||||
|
|
|
@ -10,7 +10,6 @@ import (
|
|||
// noinspection GoUnusedParameter
|
||||
func PostToInboxService(context IContext, input *PostToInboxRequest) (result *PostToInboxResult, err error) {
|
||||
conductor := core.Conductor
|
||||
_ = POST_TO_INBOX_REQUEST
|
||||
|
||||
conductor.LogRemoteCall(context, INITIALIZE, "post_to_inbox", input, result, err)
|
||||
defer func() { conductor.LogRemoteCall(context, FINALIZE, "post_to_inbox", input, result, err) }()
|
||||
|
|
|
@ -10,7 +10,6 @@ import (
|
|||
// noinspection GoUnusedParameter
|
||||
func PostToOutboxService(context IContext, input *PostToOutboxRequest) (result *PostToOutboxResult, err error) {
|
||||
conductor := core.Conductor
|
||||
_ = POST_TO_OUTBOX_REQUEST
|
||||
|
||||
conductor.LogRemoteCall(context, INITIALIZE, "post_to_outbox", input, result, err)
|
||||
defer func() { conductor.LogRemoteCall(context, FINALIZE, "post_to_outbox", input, result, err) }()
|
||||
|
|
|
@ -10,7 +10,6 @@ import (
|
|||
// noinspection GoUnusedParameter
|
||||
func SignupService(context IContext, input *SignupRequest) (result *SignupResult, err error) {
|
||||
conductor := core.Conductor
|
||||
_ = SIGNUP_REQUEST
|
||||
|
||||
conductor.LogRemoteCall(context, INITIALIZE, "signup", input, result, err)
|
||||
defer func() { conductor.LogRemoteCall(context, FINALIZE, "signup", input, result, err) }()
|
||||
|
|
|
@ -10,7 +10,6 @@ import (
|
|||
// noinspection GoUnusedParameter
|
||||
func UpdateProfileByUserService(context IContext, input *UpdateProfileByUserRequest) (result *UpdateProfileByUserResult, err error) {
|
||||
conductor := core.Conductor
|
||||
_ = UPDATE_PROFILE_BY_USER_REQUEST
|
||||
|
||||
conductor.LogRemoteCall(context, INITIALIZE, "update_profile_by_user", input, result, err)
|
||||
defer func() { conductor.LogRemoteCall(context, FINALIZE, "update_profile_by_user", input, result, err) }()
|
||||
|
|
|
@ -10,7 +10,6 @@ import (
|
|||
// noinspection GoUnusedParameter
|
||||
func VerifyService(context IContext, input *VerifyRequest) (result *VerifyResult, err error) {
|
||||
conductor := core.Conductor
|
||||
_ = VERIFY_REQUEST
|
||||
|
||||
conductor.LogRemoteCall(context, INITIALIZE, "verify", input, result, err)
|
||||
defer func() { conductor.LogRemoteCall(context, FINALIZE, "verify", input, result, err) }()
|
||||
|
|
|
@ -10,7 +10,6 @@ import (
|
|||
// noinspection GoUnusedParameter
|
||||
func WebfingerService(context IContext, input *WebfingerRequest) (result *WebfingerResult, err error) {
|
||||
conductor := core.Conductor
|
||||
_ = WEBFINGER_REQUEST
|
||||
|
||||
conductor.LogRemoteCall(context, INITIALIZE, "webfinger", input, result, err)
|
||||
defer func() { conductor.LogRemoteCall(context, FINALIZE, "webfinger", input, result, err) }()
|
||||
|
|
|
@ -2,9 +2,6 @@ package constants
|
|||
|
||||
import "errors"
|
||||
|
||||
// noinspection GoSnakeCaseUsage
|
||||
const ENABLE_CUSTOM_ERRORS = true
|
||||
|
||||
// noinspection GoSnakeCaseUsage
|
||||
const (
|
||||
// SYSTEM_ERRORS
|
||||
|
|
|
@ -13,6 +13,8 @@ type (
|
|||
IEntity interface {
|
||||
Stringer
|
||||
Id() int64
|
||||
SortOrder() float32
|
||||
SetSortOrder(float32)
|
||||
Payload() string
|
||||
SetPayload(string)
|
||||
Validate() error
|
||||
|
|
|
@ -4,9 +4,10 @@ import . "fmt"
|
|||
|
||||
type IObject interface {
|
||||
Stringer
|
||||
// Returns the unique identifier or 'Id' of this object instance.
|
||||
// Id returns the unique identifier or 'Id' of this object instance.
|
||||
Id() int64
|
||||
// Checks whether the current instance contains any errors.
|
||||
SortOrder() float32
|
||||
// Validate checks whether the current instance contains any errors.
|
||||
Validate() error
|
||||
Lock(context uint64)
|
||||
Unlock(context uint64)
|
||||
|
|
|
@ -1175,7 +1175,7 @@ type IDispatcher interface {
|
|||
// Format provides a wrapper around fmt.Sprintf
|
||||
Format(format string, args ...interface{}) string
|
||||
// Sort sorts the provided slice using the provided comparator function.
|
||||
Sort(slice interface{}, less func(a, b int) bool)
|
||||
Sort(slice interface{}, less func(x, y int) bool)
|
||||
// Search searches the input for any or all of the words in criteria.
|
||||
Search(input, criteria string) bool
|
||||
// Email sends an email message asynchronously.
|
||||
|
|
|
@ -3,8 +3,6 @@ package core
|
|||
import (
|
||||
"fmt"
|
||||
|
||||
"github.com/reiver/greatape/app/validators"
|
||||
. "github.com/reiver/greatape/components/constants"
|
||||
. "github.com/reiver/greatape/components/contracts"
|
||||
. "github.com/reiver/greatape/components/contracts/model"
|
||||
"github.com/reiver/greatape/components/model/repository"
|
||||
|
@ -17,14 +15,6 @@ type accessControl struct {
|
|||
value uint64
|
||||
}
|
||||
|
||||
// noinspection GoUnusedExportedFunction
|
||||
func InitializeAccessControl() {
|
||||
_ = ENABLE_SECURITY
|
||||
_ = ENABLE_CUSTOM_ERRORS
|
||||
_ = validators.Initialize
|
||||
_ = repository.Initialize
|
||||
}
|
||||
|
||||
func NewAccessControl(id int64, key uint64, value uint64) (IAccessControl, error) {
|
||||
instance := &accessControl{
|
||||
object: object{
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
package core
|
||||
|
||||
import (
|
||||
"github.com/reiver/greatape/app/validators"
|
||||
. "github.com/reiver/greatape/components/constants"
|
||||
. "github.com/reiver/greatape/components/contracts"
|
||||
. "github.com/reiver/greatape/components/contracts/model"
|
||||
|
@ -23,9 +22,6 @@ type accessControlManager struct {
|
|||
}
|
||||
|
||||
func newAccessControlManager(configuration IConfiguration, logger ILogger, dependencies ...ISystemComponent) IAccessControlManager {
|
||||
_ = ENABLE_CUSTOM_ERRORS
|
||||
_ = validators.Initialize
|
||||
|
||||
manager := &accessControlManager{
|
||||
systemComponent: newSystemComponent(configuration, logger),
|
||||
cache: NewCache(),
|
||||
|
|
|
@ -3,11 +3,7 @@ package core
|
|||
import (
|
||||
"fmt"
|
||||
|
||||
"github.com/reiver/greatape/app/validators"
|
||||
. "github.com/reiver/greatape/components/constants"
|
||||
. "github.com/reiver/greatape/components/contracts"
|
||||
"github.com/reiver/greatape/components/model/repository"
|
||||
. "github.com/xeronith/diamante/contracts/security"
|
||||
)
|
||||
|
||||
type activityPubActivity struct {
|
||||
|
@ -23,14 +19,6 @@ type activityPubActivity struct {
|
|||
published string
|
||||
}
|
||||
|
||||
// noinspection GoUnusedExportedFunction
|
||||
func InitializeActivityPubActivity() {
|
||||
_ = ENABLE_SECURITY
|
||||
_ = ENABLE_CUSTOM_ERRORS
|
||||
_ = validators.Initialize
|
||||
_ = repository.Initialize
|
||||
}
|
||||
|
||||
func NewActivityPubActivity() (IActivityPubActivity, error) {
|
||||
instance := &activityPubActivity{}
|
||||
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
package core
|
||||
|
||||
import (
|
||||
"github.com/reiver/greatape/app/validators"
|
||||
. "github.com/reiver/greatape/components/constants"
|
||||
. "github.com/reiver/greatape/components/contracts"
|
||||
. "github.com/xeronith/diamante/contracts/logging"
|
||||
|
@ -20,9 +19,6 @@ type activityPubActivityManager struct {
|
|||
}
|
||||
|
||||
func newActivityPubActivityManager(configuration IConfiguration, logger ILogger, dependencies ...ISystemComponent) IActivityPubActivityManager {
|
||||
_ = ENABLE_CUSTOM_ERRORS
|
||||
_ = validators.Initialize
|
||||
|
||||
manager := &activityPubActivityManager{
|
||||
systemComponent: newSystemComponent(configuration, logger),
|
||||
cache: NewCache(),
|
||||
|
|
|
@ -3,8 +3,6 @@ package core
|
|||
import (
|
||||
"fmt"
|
||||
|
||||
"github.com/reiver/greatape/app/validators"
|
||||
. "github.com/reiver/greatape/components/constants"
|
||||
. "github.com/reiver/greatape/components/contracts"
|
||||
. "github.com/reiver/greatape/components/contracts/model"
|
||||
"github.com/reiver/greatape/components/model/repository"
|
||||
|
@ -20,14 +18,6 @@ type activityPubFollower struct {
|
|||
accepted bool
|
||||
}
|
||||
|
||||
// noinspection GoUnusedExportedFunction
|
||||
func InitializeActivityPubFollower() {
|
||||
_ = ENABLE_SECURITY
|
||||
_ = ENABLE_CUSTOM_ERRORS
|
||||
_ = validators.Initialize
|
||||
_ = repository.Initialize
|
||||
}
|
||||
|
||||
func NewActivityPubFollower(id int64, handle string, inbox string, subject string, activity string, accepted bool) (IActivityPubFollower, error) {
|
||||
instance := &activityPubFollower{
|
||||
object: object{
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
package core
|
||||
|
||||
import (
|
||||
"github.com/reiver/greatape/app/validators"
|
||||
. "github.com/reiver/greatape/components/constants"
|
||||
. "github.com/reiver/greatape/components/contracts"
|
||||
. "github.com/reiver/greatape/components/contracts/model"
|
||||
|
@ -23,9 +22,6 @@ type activityPubFollowerManager struct {
|
|||
}
|
||||
|
||||
func newActivityPubFollowerManager(configuration IConfiguration, logger ILogger, dependencies ...ISystemComponent) IActivityPubFollowerManager {
|
||||
_ = ENABLE_CUSTOM_ERRORS
|
||||
_ = validators.Initialize
|
||||
|
||||
manager := &activityPubFollowerManager{
|
||||
systemComponent: newSystemComponent(configuration, logger),
|
||||
cache: NewCache(),
|
||||
|
|
|
@ -3,7 +3,6 @@ package core
|
|||
import (
|
||||
"fmt"
|
||||
|
||||
"github.com/reiver/greatape/app/validators"
|
||||
. "github.com/reiver/greatape/components/constants"
|
||||
. "github.com/reiver/greatape/components/contracts"
|
||||
. "github.com/reiver/greatape/components/contracts/model"
|
||||
|
@ -22,14 +21,6 @@ type activityPubIncomingActivity struct {
|
|||
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{
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
package core
|
||||
|
||||
import (
|
||||
"github.com/reiver/greatape/app/validators"
|
||||
. "github.com/reiver/greatape/components/constants"
|
||||
. "github.com/reiver/greatape/components/contracts"
|
||||
. "github.com/reiver/greatape/components/contracts/model"
|
||||
|
@ -27,9 +26,6 @@ type activityPubIncomingActivityManager struct {
|
|||
}
|
||||
|
||||
func newActivityPubIncomingActivityManager(configuration IConfiguration, logger ILogger, dependencies ...ISystemComponent) IActivityPubIncomingActivityManager {
|
||||
_ = ENABLE_CUSTOM_ERRORS
|
||||
_ = validators.Initialize
|
||||
|
||||
manager := &activityPubIncomingActivityManager{
|
||||
systemComponent: newSystemComponent(configuration, logger),
|
||||
cache: NewCache(),
|
||||
|
|
|
@ -3,11 +3,7 @@ package core
|
|||
import (
|
||||
"fmt"
|
||||
|
||||
"github.com/reiver/greatape/app/validators"
|
||||
. "github.com/reiver/greatape/components/constants"
|
||||
. "github.com/reiver/greatape/components/contracts"
|
||||
"github.com/reiver/greatape/components/model/repository"
|
||||
. "github.com/xeronith/diamante/contracts/security"
|
||||
)
|
||||
|
||||
type activityPubLink struct {
|
||||
|
@ -17,14 +13,6 @@ type activityPubLink struct {
|
|||
template string
|
||||
}
|
||||
|
||||
// noinspection GoUnusedExportedFunction
|
||||
func InitializeActivityPubLink() {
|
||||
_ = ENABLE_SECURITY
|
||||
_ = ENABLE_CUSTOM_ERRORS
|
||||
_ = validators.Initialize
|
||||
_ = repository.Initialize
|
||||
}
|
||||
|
||||
func NewActivityPubLink() (IActivityPubLink, error) {
|
||||
instance := &activityPubLink{}
|
||||
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
package core
|
||||
|
||||
import (
|
||||
"github.com/reiver/greatape/app/validators"
|
||||
. "github.com/reiver/greatape/components/constants"
|
||||
. "github.com/reiver/greatape/components/contracts"
|
||||
. "github.com/xeronith/diamante/contracts/logging"
|
||||
|
@ -20,9 +19,6 @@ type activityPubLinkManager struct {
|
|||
}
|
||||
|
||||
func newActivityPubLinkManager(configuration IConfiguration, logger ILogger, dependencies ...ISystemComponent) IActivityPubLinkManager {
|
||||
_ = ENABLE_CUSTOM_ERRORS
|
||||
_ = validators.Initialize
|
||||
|
||||
manager := &activityPubLinkManager{
|
||||
systemComponent: newSystemComponent(configuration, logger),
|
||||
cache: NewCache(),
|
||||
|
|
|
@ -3,11 +3,7 @@ package core
|
|||
import (
|
||||
"fmt"
|
||||
|
||||
"github.com/reiver/greatape/app/validators"
|
||||
. "github.com/reiver/greatape/components/constants"
|
||||
. "github.com/reiver/greatape/components/contracts"
|
||||
"github.com/reiver/greatape/components/model/repository"
|
||||
. "github.com/xeronith/diamante/contracts/security"
|
||||
)
|
||||
|
||||
type activityPubMedia struct {
|
||||
|
@ -18,14 +14,6 @@ type activityPubMedia struct {
|
|||
height int32
|
||||
}
|
||||
|
||||
// noinspection GoUnusedExportedFunction
|
||||
func InitializeActivityPubMedia() {
|
||||
_ = ENABLE_SECURITY
|
||||
_ = ENABLE_CUSTOM_ERRORS
|
||||
_ = validators.Initialize
|
||||
_ = repository.Initialize
|
||||
}
|
||||
|
||||
func NewActivityPubMedia() (IActivityPubMedia, error) {
|
||||
instance := &activityPubMedia{}
|
||||
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
package core
|
||||
|
||||
import (
|
||||
"github.com/reiver/greatape/app/validators"
|
||||
. "github.com/reiver/greatape/components/constants"
|
||||
. "github.com/reiver/greatape/components/contracts"
|
||||
. "github.com/xeronith/diamante/contracts/logging"
|
||||
|
@ -20,9 +19,6 @@ type activityPubMediaManager struct {
|
|||
}
|
||||
|
||||
func newActivityPubMediaManager(configuration IConfiguration, logger ILogger, dependencies ...ISystemComponent) IActivityPubMediaManager {
|
||||
_ = ENABLE_CUSTOM_ERRORS
|
||||
_ = validators.Initialize
|
||||
|
||||
manager := &activityPubMediaManager{
|
||||
systemComponent: newSystemComponent(configuration, logger),
|
||||
cache: NewCache(),
|
||||
|
|
|
@ -3,11 +3,7 @@ package core
|
|||
import (
|
||||
"fmt"
|
||||
|
||||
"github.com/reiver/greatape/app/validators"
|
||||
. "github.com/reiver/greatape/components/constants"
|
||||
. "github.com/reiver/greatape/components/contracts"
|
||||
"github.com/reiver/greatape/components/model/repository"
|
||||
. "github.com/xeronith/diamante/contracts/security"
|
||||
)
|
||||
|
||||
type activityPubObject struct {
|
||||
|
@ -22,14 +18,6 @@ type activityPubObject struct {
|
|||
published string
|
||||
}
|
||||
|
||||
// noinspection GoUnusedExportedFunction
|
||||
func InitializeActivityPubObject() {
|
||||
_ = ENABLE_SECURITY
|
||||
_ = ENABLE_CUSTOM_ERRORS
|
||||
_ = validators.Initialize
|
||||
_ = repository.Initialize
|
||||
}
|
||||
|
||||
func NewActivityPubObject() (IActivityPubObject, error) {
|
||||
instance := &activityPubObject{}
|
||||
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
package core
|
||||
|
||||
import (
|
||||
"github.com/reiver/greatape/app/validators"
|
||||
. "github.com/reiver/greatape/components/constants"
|
||||
. "github.com/reiver/greatape/components/contracts"
|
||||
. "github.com/xeronith/diamante/contracts/logging"
|
||||
|
@ -20,9 +19,6 @@ type activityPubObjectManager struct {
|
|||
}
|
||||
|
||||
func newActivityPubObjectManager(configuration IConfiguration, logger ILogger, dependencies ...ISystemComponent) IActivityPubObjectManager {
|
||||
_ = ENABLE_CUSTOM_ERRORS
|
||||
_ = validators.Initialize
|
||||
|
||||
manager := &activityPubObjectManager{
|
||||
systemComponent: newSystemComponent(configuration, logger),
|
||||
cache: NewCache(),
|
||||
|
|
|
@ -3,7 +3,6 @@ package core
|
|||
import (
|
||||
"fmt"
|
||||
|
||||
"github.com/reiver/greatape/app/validators"
|
||||
. "github.com/reiver/greatape/components/constants"
|
||||
. "github.com/reiver/greatape/components/contracts"
|
||||
. "github.com/reiver/greatape/components/contracts/model"
|
||||
|
@ -22,14 +21,6 @@ type activityPubOutgoingActivity struct {
|
|||
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{
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
package core
|
||||
|
||||
import (
|
||||
"github.com/reiver/greatape/app/validators"
|
||||
. "github.com/reiver/greatape/components/constants"
|
||||
. "github.com/reiver/greatape/components/contracts"
|
||||
. "github.com/reiver/greatape/components/contracts/model"
|
||||
|
@ -27,9 +26,6 @@ type activityPubOutgoingActivityManager struct {
|
|||
}
|
||||
|
||||
func newActivityPubOutgoingActivityManager(configuration IConfiguration, logger ILogger, dependencies ...ISystemComponent) IActivityPubOutgoingActivityManager {
|
||||
_ = ENABLE_CUSTOM_ERRORS
|
||||
_ = validators.Initialize
|
||||
|
||||
manager := &activityPubOutgoingActivityManager{
|
||||
systemComponent: newSystemComponent(configuration, logger),
|
||||
cache: NewCache(),
|
||||
|
|
|
@ -3,11 +3,7 @@ package core
|
|||
import (
|
||||
"fmt"
|
||||
|
||||
"github.com/reiver/greatape/app/validators"
|
||||
. "github.com/reiver/greatape/components/constants"
|
||||
. "github.com/reiver/greatape/components/contracts"
|
||||
"github.com/reiver/greatape/components/model/repository"
|
||||
. "github.com/xeronith/diamante/contracts/security"
|
||||
)
|
||||
|
||||
type activityPubPublicKey struct {
|
||||
|
@ -16,14 +12,6 @@ type activityPubPublicKey struct {
|
|||
publicKeyPem string
|
||||
}
|
||||
|
||||
// noinspection GoUnusedExportedFunction
|
||||
func InitializeActivityPubPublicKey() {
|
||||
_ = ENABLE_SECURITY
|
||||
_ = ENABLE_CUSTOM_ERRORS
|
||||
_ = validators.Initialize
|
||||
_ = repository.Initialize
|
||||
}
|
||||
|
||||
func NewActivityPubPublicKey() (IActivityPubPublicKey, error) {
|
||||
instance := &activityPubPublicKey{}
|
||||
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
package core
|
||||
|
||||
import (
|
||||
"github.com/reiver/greatape/app/validators"
|
||||
. "github.com/reiver/greatape/components/constants"
|
||||
. "github.com/reiver/greatape/components/contracts"
|
||||
. "github.com/xeronith/diamante/contracts/logging"
|
||||
|
@ -20,9 +19,6 @@ type activityPubPublicKeyManager struct {
|
|||
}
|
||||
|
||||
func newActivityPubPublicKeyManager(configuration IConfiguration, logger ILogger, dependencies ...ISystemComponent) IActivityPubPublicKeyManager {
|
||||
_ = ENABLE_CUSTOM_ERRORS
|
||||
_ = validators.Initialize
|
||||
|
||||
manager := &activityPubPublicKeyManager{
|
||||
systemComponent: newSystemComponent(configuration, logger),
|
||||
cache: NewCache(),
|
||||
|
|
|
@ -3,7 +3,6 @@ package core
|
|||
import (
|
||||
"fmt"
|
||||
|
||||
"github.com/reiver/greatape/app/validators"
|
||||
. "github.com/reiver/greatape/components/constants"
|
||||
. "github.com/reiver/greatape/components/contracts"
|
||||
. "github.com/reiver/greatape/components/contracts/model"
|
||||
|
@ -19,14 +18,6 @@ type category struct {
|
|||
description string
|
||||
}
|
||||
|
||||
// noinspection GoUnusedExportedFunction
|
||||
func InitializeCategory() {
|
||||
_ = ENABLE_SECURITY
|
||||
_ = ENABLE_CUSTOM_ERRORS
|
||||
_ = validators.Initialize
|
||||
_ = repository.Initialize
|
||||
}
|
||||
|
||||
func NewCategory(id int64, categoryTypeId int64, categoryId int64, title string, description string) (ICategory, error) {
|
||||
instance := &category{
|
||||
object: object{
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
package core
|
||||
|
||||
import (
|
||||
"github.com/reiver/greatape/app/validators"
|
||||
. "github.com/reiver/greatape/components/constants"
|
||||
. "github.com/reiver/greatape/components/contracts"
|
||||
. "github.com/reiver/greatape/components/contracts/model"
|
||||
|
@ -28,9 +27,6 @@ type categoryManager struct {
|
|||
}
|
||||
|
||||
func newCategoryManager(configuration IConfiguration, logger ILogger, dependencies ...ISystemComponent) ICategoryManager {
|
||||
_ = ENABLE_CUSTOM_ERRORS
|
||||
_ = validators.Initialize
|
||||
|
||||
manager := &categoryManager{
|
||||
systemComponent: newSystemComponent(configuration, logger),
|
||||
cache: NewCache(),
|
||||
|
|
|
@ -3,8 +3,6 @@ package core
|
|||
import (
|
||||
"fmt"
|
||||
|
||||
"github.com/reiver/greatape/app/validators"
|
||||
. "github.com/reiver/greatape/components/constants"
|
||||
. "github.com/reiver/greatape/components/contracts"
|
||||
. "github.com/reiver/greatape/components/contracts/model"
|
||||
"github.com/reiver/greatape/components/model/repository"
|
||||
|
@ -16,14 +14,6 @@ type categoryType struct {
|
|||
description string
|
||||
}
|
||||
|
||||
// noinspection GoUnusedExportedFunction
|
||||
func InitializeCategoryType() {
|
||||
_ = ENABLE_SECURITY
|
||||
_ = ENABLE_CUSTOM_ERRORS
|
||||
_ = validators.Initialize
|
||||
_ = repository.Initialize
|
||||
}
|
||||
|
||||
func NewCategoryType(id int64, description string) (ICategoryType, error) {
|
||||
instance := &categoryType{
|
||||
object: object{
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
package core
|
||||
|
||||
import (
|
||||
"github.com/reiver/greatape/app/validators"
|
||||
. "github.com/reiver/greatape/components/constants"
|
||||
. "github.com/reiver/greatape/components/contracts"
|
||||
. "github.com/reiver/greatape/components/contracts/model"
|
||||
|
@ -23,9 +22,6 @@ type categoryTypeManager struct {
|
|||
}
|
||||
|
||||
func newCategoryTypeManager(configuration IConfiguration, logger ILogger, dependencies ...ISystemComponent) ICategoryTypeManager {
|
||||
_ = ENABLE_CUSTOM_ERRORS
|
||||
_ = validators.Initialize
|
||||
|
||||
manager := &categoryTypeManager{
|
||||
systemComponent: newSystemComponent(configuration, logger),
|
||||
cache: NewCache(),
|
||||
|
|
|
@ -3,8 +3,6 @@ package core
|
|||
import (
|
||||
"fmt"
|
||||
|
||||
"github.com/reiver/greatape/app/validators"
|
||||
. "github.com/reiver/greatape/components/constants"
|
||||
. "github.com/reiver/greatape/components/contracts"
|
||||
. "github.com/reiver/greatape/components/contracts/model"
|
||||
"github.com/reiver/greatape/components/model/repository"
|
||||
|
@ -16,14 +14,6 @@ type document struct {
|
|||
content string
|
||||
}
|
||||
|
||||
// noinspection GoUnusedExportedFunction
|
||||
func InitializeDocument() {
|
||||
_ = ENABLE_SECURITY
|
||||
_ = ENABLE_CUSTOM_ERRORS
|
||||
_ = validators.Initialize
|
||||
_ = repository.Initialize
|
||||
}
|
||||
|
||||
func NewDocument(id int64, content string) (IDocument, error) {
|
||||
instance := &document{
|
||||
object: object{
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
package core
|
||||
|
||||
import (
|
||||
"github.com/reiver/greatape/app/validators"
|
||||
. "github.com/reiver/greatape/components/constants"
|
||||
. "github.com/reiver/greatape/components/contracts"
|
||||
. "github.com/reiver/greatape/components/contracts/model"
|
||||
|
@ -23,9 +22,6 @@ type documentManager struct {
|
|||
}
|
||||
|
||||
func newDocumentManager(configuration IConfiguration, logger ILogger, dependencies ...ISystemComponent) IDocumentManager {
|
||||
_ = ENABLE_CUSTOM_ERRORS
|
||||
_ = validators.Initialize
|
||||
|
||||
manager := &documentManager{
|
||||
systemComponent: newSystemComponent(configuration, logger),
|
||||
cache: NewCache(),
|
||||
|
|
|
@ -3,7 +3,6 @@ package core
|
|||
import (
|
||||
"fmt"
|
||||
|
||||
"github.com/reiver/greatape/app/validators"
|
||||
. "github.com/reiver/greatape/components/constants"
|
||||
. "github.com/reiver/greatape/components/contracts"
|
||||
. "github.com/reiver/greatape/components/contracts/model"
|
||||
|
@ -40,14 +39,6 @@ type identity struct {
|
|||
systemCallHandler func(Identity, []string) error
|
||||
}
|
||||
|
||||
// noinspection GoUnusedExportedFunction
|
||||
func InitializeIdentity() {
|
||||
_ = ENABLE_SECURITY
|
||||
_ = ENABLE_CUSTOM_ERRORS
|
||||
_ = validators.Initialize
|
||||
_ = repository.Initialize
|
||||
}
|
||||
|
||||
func NewIdentity(id int64, username string, phoneNumber string, phoneNumberConfirmed bool, firstName string, lastName string, displayName string, email string, emailConfirmed bool, avatar string, banner string, summary string, token string, multiFactor bool, hash string, salt string, publicKey string, privateKey string, permission uint64, restriction uint32, lastLogin int64, loginCount uint32) (IIdentity, error) {
|
||||
instance := &identity{
|
||||
object: object{
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
package core
|
||||
|
||||
import (
|
||||
"github.com/reiver/greatape/app/validators"
|
||||
. "github.com/reiver/greatape/components/constants"
|
||||
. "github.com/reiver/greatape/components/contracts"
|
||||
. "github.com/reiver/greatape/components/contracts/model"
|
||||
|
@ -24,9 +23,6 @@ type identityManager struct {
|
|||
}
|
||||
|
||||
func newIdentityManager(configuration IConfiguration, logger ILogger, dependencies ...ISystemComponent) IIdentityManager {
|
||||
_ = ENABLE_CUSTOM_ERRORS
|
||||
_ = validators.Initialize
|
||||
|
||||
manager := &identityManager{
|
||||
systemComponent: newSystemComponent(configuration, logger),
|
||||
cache: NewIdentityCache(),
|
||||
|
|
|
@ -5,7 +5,6 @@ import (
|
|||
"crypto/sha256"
|
||||
"encoding/base64"
|
||||
"encoding/json"
|
||||
"errors"
|
||||
"fmt"
|
||||
"io"
|
||||
"net/http"
|
||||
|
@ -131,7 +130,7 @@ func Initialize(configuration IConfiguration, logger ILogger) error {
|
|||
start := time.Now()
|
||||
componentName := component.Name()
|
||||
if _, exists := componentsContainer[componentName]; exists {
|
||||
return errors.New(fmt.Sprintf("%s already registered", componentName))
|
||||
return fmt.Errorf("%s already registered", componentName)
|
||||
}
|
||||
|
||||
if err := component.Load(); err != nil {
|
||||
|
@ -1318,10 +1317,7 @@ func (conductor *conductor) NewGetInboxResult(context string, id string, type_ s
|
|||
func (conductor *conductor) LogRemoteCall(context IContext, eventType uint32, source string, input, result interface{}, err error) {
|
||||
errorMessage := ""
|
||||
if err != nil {
|
||||
errorMessage = err.Error()
|
||||
if strings.HasPrefix(errorMessage, "ERROR_MESSAGE_") {
|
||||
errorMessage = errorMessage[14:]
|
||||
}
|
||||
errorMessage = strings.TrimPrefix(err.Error(), "ERROR_MESSAGE_")
|
||||
}
|
||||
|
||||
if _, marshalError := json.Marshal(input); marshalError != nil {
|
||||
|
|
|
@ -9,9 +9,14 @@ import (
|
|||
)
|
||||
|
||||
type object struct {
|
||||
mutex sync.RWMutex
|
||||
id int64
|
||||
keychain map[uint64]*semaphore
|
||||
mutex sync.RWMutex
|
||||
id int64
|
||||
sortOrder float32
|
||||
keychain map[uint64]*semaphore
|
||||
}
|
||||
|
||||
func (object *object) SortOrder() float32 {
|
||||
return object.sortOrder
|
||||
}
|
||||
|
||||
func (object *object) Id() int64 {
|
||||
|
|
|
@ -3,8 +3,6 @@ package core
|
|||
import (
|
||||
"fmt"
|
||||
|
||||
"github.com/reiver/greatape/app/validators"
|
||||
. "github.com/reiver/greatape/components/constants"
|
||||
. "github.com/reiver/greatape/components/contracts"
|
||||
. "github.com/reiver/greatape/components/contracts/model"
|
||||
"github.com/reiver/greatape/components/model/repository"
|
||||
|
@ -23,14 +21,6 @@ type remoteActivity struct {
|
|||
timestamp int64
|
||||
}
|
||||
|
||||
// noinspection GoUnusedExportedFunction
|
||||
func InitializeRemoteActivity() {
|
||||
_ = ENABLE_SECURITY
|
||||
_ = ENABLE_CUSTOM_ERRORS
|
||||
_ = validators.Initialize
|
||||
_ = repository.Initialize
|
||||
}
|
||||
|
||||
func NewRemoteActivity(id int64, entryPoint string, duration int64, successful bool, errorMessage string, remoteAddress string, userAgent string, eventType uint32, timestamp int64) (IRemoteActivity, error) {
|
||||
instance := &remoteActivity{
|
||||
object: object{
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
package core
|
||||
|
||||
import (
|
||||
"github.com/reiver/greatape/app/validators"
|
||||
. "github.com/reiver/greatape/components/constants"
|
||||
. "github.com/reiver/greatape/components/contracts"
|
||||
. "github.com/reiver/greatape/components/contracts/model"
|
||||
|
@ -23,9 +22,6 @@ type remoteActivityManager struct {
|
|||
}
|
||||
|
||||
func newRemoteActivityManager(configuration IConfiguration, logger ILogger, dependencies ...ISystemComponent) IRemoteActivityManager {
|
||||
_ = ENABLE_CUSTOM_ERRORS
|
||||
_ = validators.Initialize
|
||||
|
||||
manager := &remoteActivityManager{
|
||||
systemComponent: newSystemComponent(configuration, logger),
|
||||
cache: NewCache(),
|
||||
|
|
|
@ -3,24 +3,12 @@ package core
|
|||
import (
|
||||
"fmt"
|
||||
|
||||
"github.com/reiver/greatape/app/validators"
|
||||
. "github.com/reiver/greatape/components/constants"
|
||||
. "github.com/reiver/greatape/components/contracts"
|
||||
"github.com/reiver/greatape/components/model/repository"
|
||||
. "github.com/xeronith/diamante/contracts/security"
|
||||
)
|
||||
|
||||
type spi struct {
|
||||
}
|
||||
|
||||
// noinspection GoUnusedExportedFunction
|
||||
func InitializeSpi() {
|
||||
_ = ENABLE_SECURITY
|
||||
_ = ENABLE_CUSTOM_ERRORS
|
||||
_ = validators.Initialize
|
||||
_ = repository.Initialize
|
||||
}
|
||||
|
||||
func NewSpi() (ISpi, error) {
|
||||
instance := &spi{}
|
||||
|
||||
|
|
|
@ -21,9 +21,6 @@ type spiManager struct {
|
|||
}
|
||||
|
||||
func newSpiManager(configuration IConfiguration, logger ILogger, dependencies ...ISystemComponent) ISpiManager {
|
||||
_ = ENABLE_CUSTOM_ERRORS
|
||||
_ = validators.Initialize
|
||||
|
||||
manager := &spiManager{
|
||||
systemComponent: newSystemComponent(configuration, logger),
|
||||
cache: NewCache(),
|
||||
|
|
|
@ -228,7 +228,7 @@ func (dispatcher *dispatcher) Format(format string, args ...interface{}) string
|
|||
return fmt.Sprintf(format, args...)
|
||||
}
|
||||
|
||||
func (dispatcher *dispatcher) Sort(slice interface{}, less func(a, b int) bool) {
|
||||
func (dispatcher *dispatcher) Sort(slice interface{}, less func(x, y int) bool) {
|
||||
sort.Slice(slice, less)
|
||||
}
|
||||
|
||||
|
|
|
@ -3,8 +3,6 @@ package core
|
|||
import (
|
||||
"fmt"
|
||||
|
||||
"github.com/reiver/greatape/app/validators"
|
||||
. "github.com/reiver/greatape/components/constants"
|
||||
. "github.com/reiver/greatape/components/contracts"
|
||||
. "github.com/reiver/greatape/components/contracts/model"
|
||||
"github.com/reiver/greatape/components/model/repository"
|
||||
|
@ -17,14 +15,6 @@ type systemSchedule struct {
|
|||
config string
|
||||
}
|
||||
|
||||
// noinspection GoUnusedExportedFunction
|
||||
func InitializeSystemSchedule() {
|
||||
_ = ENABLE_SECURITY
|
||||
_ = ENABLE_CUSTOM_ERRORS
|
||||
_ = validators.Initialize
|
||||
_ = repository.Initialize
|
||||
}
|
||||
|
||||
func NewSystemSchedule(id int64, enabled bool, config string) (ISystemSchedule, error) {
|
||||
instance := &systemSchedule{
|
||||
object: object{
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
package core
|
||||
|
||||
import (
|
||||
"github.com/reiver/greatape/app/validators"
|
||||
. "github.com/reiver/greatape/components/constants"
|
||||
. "github.com/reiver/greatape/components/contracts"
|
||||
. "github.com/reiver/greatape/components/contracts/model"
|
||||
|
@ -23,9 +22,6 @@ type systemScheduleManager struct {
|
|||
}
|
||||
|
||||
func newSystemScheduleManager(configuration IConfiguration, logger ILogger, dependencies ...ISystemComponent) ISystemScheduleManager {
|
||||
_ = ENABLE_CUSTOM_ERRORS
|
||||
_ = validators.Initialize
|
||||
|
||||
manager := &systemScheduleManager{
|
||||
systemComponent: newSystemComponent(configuration, logger),
|
||||
cache: NewCache(),
|
||||
|
|
|
@ -3,8 +3,6 @@ package core
|
|||
import (
|
||||
"fmt"
|
||||
|
||||
"github.com/reiver/greatape/app/validators"
|
||||
. "github.com/reiver/greatape/components/constants"
|
||||
. "github.com/reiver/greatape/components/contracts"
|
||||
. "github.com/reiver/greatape/components/contracts/model"
|
||||
"github.com/reiver/greatape/components/model/repository"
|
||||
|
@ -16,14 +14,6 @@ type user struct {
|
|||
github string
|
||||
}
|
||||
|
||||
// noinspection GoUnusedExportedFunction
|
||||
func InitializeUser() {
|
||||
_ = ENABLE_SECURITY
|
||||
_ = ENABLE_CUSTOM_ERRORS
|
||||
_ = validators.Initialize
|
||||
_ = repository.Initialize
|
||||
}
|
||||
|
||||
func NewUser(id int64, github string) (IUser, error) {
|
||||
instance := &user{
|
||||
object: object{
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
package core
|
||||
|
||||
import (
|
||||
"github.com/reiver/greatape/app/validators"
|
||||
. "github.com/reiver/greatape/components/constants"
|
||||
. "github.com/reiver/greatape/components/contracts"
|
||||
. "github.com/reiver/greatape/components/contracts/model"
|
||||
|
@ -23,9 +22,6 @@ type userManager struct {
|
|||
}
|
||||
|
||||
func newUserManager(configuration IConfiguration, logger ILogger, dependencies ...ISystemComponent) IUserManager {
|
||||
_ = ENABLE_CUSTOM_ERRORS
|
||||
_ = validators.Initialize
|
||||
|
||||
manager := &userManager{
|
||||
systemComponent: newSystemComponent(configuration, logger),
|
||||
cache: NewCache(),
|
||||
|
|
|
@ -5,19 +5,12 @@ import (
|
|||
"reflect"
|
||||
"time"
|
||||
|
||||
"github.com/reiver/greatape/app/validators"
|
||||
. "github.com/reiver/greatape/components/constants"
|
||||
. "github.com/reiver/greatape/components/contracts/model"
|
||||
)
|
||||
|
||||
var AccessControlEntityType = reflect.TypeOf(accessControlEntity{})
|
||||
|
||||
// noinspection GoUnusedExportedFunction
|
||||
func InitializeAccessControlEntity() {
|
||||
_ = ENABLE_CUSTOM_ERRORS
|
||||
_ = validators.Initialize
|
||||
}
|
||||
|
||||
type accessControlEntity struct {
|
||||
entity
|
||||
KeyField uint64 `json:"key" storage:"BIGINT" default:"0"`
|
||||
|
|
|
@ -5,19 +5,12 @@ import (
|
|||
"reflect"
|
||||
"time"
|
||||
|
||||
"github.com/reiver/greatape/app/validators"
|
||||
. "github.com/reiver/greatape/components/constants"
|
||||
. "github.com/reiver/greatape/components/contracts/model"
|
||||
)
|
||||
|
||||
var ActivityPubFollowerEntityType = reflect.TypeOf(activityPubFollowerEntity{})
|
||||
|
||||
// noinspection GoUnusedExportedFunction
|
||||
func InitializeActivityPubFollowerEntity() {
|
||||
_ = ENABLE_CUSTOM_ERRORS
|
||||
_ = validators.Initialize
|
||||
}
|
||||
|
||||
type activityPubFollowerEntity struct {
|
||||
entity
|
||||
HandleField string `json:"handle" storage:"VARCHAR(256)" default:"''"`
|
||||
|
|
|
@ -5,19 +5,12 @@ import (
|
|||
"reflect"
|
||||
"time"
|
||||
|
||||
"github.com/reiver/greatape/app/validators"
|
||||
. "github.com/reiver/greatape/components/constants"
|
||||
. "github.com/reiver/greatape/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"`
|
||||
|
|
|
@ -5,19 +5,12 @@ import (
|
|||
"reflect"
|
||||
"time"
|
||||
|
||||
"github.com/reiver/greatape/app/validators"
|
||||
. "github.com/reiver/greatape/components/constants"
|
||||
. "github.com/reiver/greatape/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"`
|
||||
|
|
|
@ -5,19 +5,12 @@ import (
|
|||
"reflect"
|
||||
"time"
|
||||
|
||||
"github.com/reiver/greatape/app/validators"
|
||||
. "github.com/reiver/greatape/components/constants"
|
||||
. "github.com/reiver/greatape/components/contracts/model"
|
||||
)
|
||||
|
||||
var CategoryEntityType = reflect.TypeOf(categoryEntity{})
|
||||
|
||||
// noinspection GoUnusedExportedFunction
|
||||
func InitializeCategoryEntity() {
|
||||
_ = ENABLE_CUSTOM_ERRORS
|
||||
_ = validators.Initialize
|
||||
}
|
||||
|
||||
type categoryEntity struct {
|
||||
entity
|
||||
CategoryTypeIdField int64 `json:"category_type_id"`
|
||||
|
|
|
@ -5,19 +5,12 @@ import (
|
|||
"reflect"
|
||||
"time"
|
||||
|
||||
"github.com/reiver/greatape/app/validators"
|
||||
. "github.com/reiver/greatape/components/constants"
|
||||
. "github.com/reiver/greatape/components/contracts/model"
|
||||
)
|
||||
|
||||
var CategoryTypeEntityType = reflect.TypeOf(categoryTypeEntity{})
|
||||
|
||||
// noinspection GoUnusedExportedFunction
|
||||
func InitializeCategoryTypeEntity() {
|
||||
_ = ENABLE_CUSTOM_ERRORS
|
||||
_ = validators.Initialize
|
||||
}
|
||||
|
||||
type categoryTypeEntity struct {
|
||||
entity
|
||||
DescriptionField string `json:"description" storage:"VARCHAR(64)" default:"''"`
|
||||
|
|
|
@ -5,19 +5,12 @@ import (
|
|||
"reflect"
|
||||
"time"
|
||||
|
||||
"github.com/reiver/greatape/app/validators"
|
||||
. "github.com/reiver/greatape/components/constants"
|
||||
. "github.com/reiver/greatape/components/contracts/model"
|
||||
)
|
||||
|
||||
var DocumentEntityType = reflect.TypeOf(documentEntity{})
|
||||
|
||||
// noinspection GoUnusedExportedFunction
|
||||
func InitializeDocumentEntity() {
|
||||
_ = ENABLE_CUSTOM_ERRORS
|
||||
_ = validators.Initialize
|
||||
}
|
||||
|
||||
type documentEntity struct {
|
||||
entity
|
||||
ContentField string `json:"content" storage:"JSONB" default:"'{}'"`
|
||||
|
|
|
@ -1,14 +1,23 @@
|
|||
package entity
|
||||
|
||||
type entity struct {
|
||||
IdField int64 `json:"id"`
|
||||
PayloadField string `json:"payload"`
|
||||
IdField int64 `json:"id"`
|
||||
SortOrderField float32 `json:"sort_order"`
|
||||
PayloadField string `json:"payload"`
|
||||
}
|
||||
|
||||
func (entity *entity) Id() int64 {
|
||||
return entity.IdField
|
||||
}
|
||||
|
||||
func (entity *entity) SortOrder() float32 {
|
||||
return entity.SortOrderField
|
||||
}
|
||||
|
||||
func (entity *entity) SetSortOrder(sortOrder float32) {
|
||||
entity.SortOrderField = sortOrder
|
||||
}
|
||||
|
||||
func (entity *entity) Payload() string {
|
||||
if entity.PayloadField == "" {
|
||||
entity.PayloadField = "{}"
|
||||
|
|
|
@ -5,19 +5,12 @@ import (
|
|||
"reflect"
|
||||
"time"
|
||||
|
||||
"github.com/reiver/greatape/app/validators"
|
||||
. "github.com/reiver/greatape/components/constants"
|
||||
. "github.com/reiver/greatape/components/contracts/model"
|
||||
)
|
||||
|
||||
var IdentityEntityType = reflect.TypeOf(identityEntity{})
|
||||
|
||||
// noinspection GoUnusedExportedFunction
|
||||
func InitializeIdentityEntity() {
|
||||
_ = ENABLE_CUSTOM_ERRORS
|
||||
_ = validators.Initialize
|
||||
}
|
||||
|
||||
type identityEntity struct {
|
||||
entity
|
||||
UsernameField string `json:"username" storage:"VARCHAR(32)" default:"''"`
|
||||
|
|
|
@ -5,19 +5,12 @@ import (
|
|||
"reflect"
|
||||
"time"
|
||||
|
||||
"github.com/reiver/greatape/app/validators"
|
||||
. "github.com/reiver/greatape/components/constants"
|
||||
. "github.com/reiver/greatape/components/contracts/model"
|
||||
)
|
||||
|
||||
var RemoteActivityEntityType = reflect.TypeOf(remoteActivityEntity{})
|
||||
|
||||
// noinspection GoUnusedExportedFunction
|
||||
func InitializeRemoteActivityEntity() {
|
||||
_ = ENABLE_CUSTOM_ERRORS
|
||||
_ = validators.Initialize
|
||||
}
|
||||
|
||||
type remoteActivityEntity struct {
|
||||
entity
|
||||
EntryPointField string `json:"entry_point" storage:"VARCHAR(256)" default:"''"`
|
||||
|
|
|
@ -5,19 +5,12 @@ import (
|
|||
"reflect"
|
||||
"time"
|
||||
|
||||
"github.com/reiver/greatape/app/validators"
|
||||
. "github.com/reiver/greatape/components/constants"
|
||||
. "github.com/reiver/greatape/components/contracts/model"
|
||||
)
|
||||
|
||||
var SystemScheduleEntityType = reflect.TypeOf(systemScheduleEntity{})
|
||||
|
||||
// noinspection GoUnusedExportedFunction
|
||||
func InitializeSystemScheduleEntity() {
|
||||
_ = ENABLE_CUSTOM_ERRORS
|
||||
_ = validators.Initialize
|
||||
}
|
||||
|
||||
type systemScheduleEntity struct {
|
||||
entity
|
||||
EnabledField bool `json:"enabled" storage:"BOOLEAN" default:"FALSE"`
|
||||
|
|
|
@ -5,19 +5,12 @@ import (
|
|||
"reflect"
|
||||
"time"
|
||||
|
||||
"github.com/reiver/greatape/app/validators"
|
||||
. "github.com/reiver/greatape/components/constants"
|
||||
. "github.com/reiver/greatape/components/contracts/model"
|
||||
)
|
||||
|
||||
var UserEntityType = reflect.TypeOf(userEntity{})
|
||||
|
||||
// noinspection GoUnusedExportedFunction
|
||||
func InitializeUserEntity() {
|
||||
_ = ENABLE_CUSTOM_ERRORS
|
||||
_ = validators.Initialize
|
||||
}
|
||||
|
||||
type userEntity struct {
|
||||
entity
|
||||
GithubField string `json:"github" storage:"VARCHAR(512)" default:"''"`
|
||||
|
|
Ładowanie…
Reference in New Issue