Porównaj commity

...

5 Commity

Autor SHA1 Wiadomość Data
Charles Iliya Krempeaux 175a3d6089 added Massoud Seifi name to copyright owner 2023-05-30 12:34:26 -07:00
Xeronith d0b08cf033 chore(project): ⬆️ upgrade dependencies 2023-05-30 22:49:58 +03:30
Xeronith 78ec7bf9a0 feat(components): add sort order to categories 2023-05-30 16:30:56 +03:30
Xeronith 66f1e60e66 refactor(app): 🗑️ remove validators initializer 2023-05-30 16:30:00 +03:30
Xeronith 606fa1bc55 refactor(components): 🎨 cleanup 2023-05-30 16:29:18 +03:30
80 zmienionych plików z 164 dodań i 398 usunięć

Wyświetl plik

@ -1,4 +1,4 @@
Copyright (c) 2021 Charles Iliya Krempeaux :: http://changelog.ca/
Copyright (c) 2021 Charles Iliya Krempeaux http://changelog.ca/ and Massoud Seifi
GNU AFFERO GENERAL PUBLIC LICENSE
Version 3, 19 November 2007

Wyświetl plik

@ -1,5 +0,0 @@
package validators
// noinspection GoUnusedExportedFunction
func Initialize() {
}

Wyświetl plik

@ -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) }()

Wyświetl plik

@ -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) }()

Wyświetl plik

@ -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) }()

Wyświetl plik

@ -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) }()

Wyświetl plik

@ -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) }()

Wyświetl plik

@ -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) }()

Wyświetl plik

@ -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) }()

Wyświetl plik

@ -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) }()

Wyświetl plik

@ -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) }()

Wyświetl plik

@ -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) }()

Wyświetl plik

@ -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) }()

Wyświetl plik

@ -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) }()

Wyświetl plik

@ -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) }()

Wyświetl plik

@ -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) }()

Wyświetl plik

@ -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) }()

Wyświetl plik

@ -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) }()

Wyświetl plik

@ -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) }()

Wyświetl plik

@ -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) }()

Wyświetl plik

@ -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) }()

Wyświetl plik

@ -2,9 +2,6 @@ package constants
import "errors"
// noinspection GoSnakeCaseUsage
const ENABLE_CUSTOM_ERRORS = true
// noinspection GoSnakeCaseUsage
const (
// SYSTEM_ERRORS

Wyświetl plik

@ -52,6 +52,14 @@ type (
// UpdateDescriptionAtomic updates 'Description' into persistent data store through a transaction and
// refreshes the in-memory cache after successful commit.
UpdateDescriptionAtomic(transaction ITransaction, description string, editor Identity)
// SortOrder returns 'SortOrder' of this 'Category' instance.
SortOrder() float32
// UpdateSortOrder directly updates 'SortOrder' into persistent data store and
// refreshes the in-memory cache after successful update.
UpdateSortOrder(sortOrder float32, editor Identity)
// UpdateSortOrderAtomic updates 'SortOrder' into persistent data store through a transaction and
// refreshes the in-memory cache after successful commit.
UpdateSortOrderAtomic(transaction ITransaction, sortOrder float32, editor Identity)
}
ICategoryCollection interface {

Wyświetl plik

@ -32,5 +32,7 @@ type (
UpdateTitleAtomic(transaction IRepositoryTransaction, id int64, value string, editor int64) error
UpdateDescription(id int64, value string, editor int64) error
UpdateDescriptionAtomic(transaction IRepositoryTransaction, id int64, value string, editor int64) error
UpdateSortOrder(id int64, value float32, editor int64) error
UpdateSortOrderAtomic(transaction IRepositoryTransaction, id int64, value float32, editor int64) error
}
)

Wyświetl plik

@ -13,6 +13,8 @@ type (
IEntity interface {
Stringer
Id() int64
SortOrder() float32
SetSortOrder(float32)
Payload() string
SetPayload(string)
Validate() error

Wyświetl plik

@ -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)

Wyświetl plik

@ -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.

Wyświetl plik

@ -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{

Wyświetl plik

@ -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(),

Wyświetl plik

@ -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{}

Wyświetl plik

@ -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(),

Wyświetl plik

@ -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{

Wyświetl plik

@ -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(),

Wyświetl plik

@ -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{

Wyświetl plik

@ -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(),

Wyświetl plik

@ -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{}

Wyświetl plik

@ -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(),

Wyświetl plik

@ -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{}

Wyświetl plik

@ -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(),

Wyświetl plik

@ -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{}

Wyświetl plik

@ -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(),

Wyświetl plik

@ -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{

Wyświetl plik

@ -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(),

Wyświetl plik

@ -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{}

Wyświetl plik

@ -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(),

Wyświetl plik

@ -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{
@ -48,7 +39,8 @@ func NewCategory(id int64, categoryTypeId int64, categoryId int64, title string,
func NewCategoryFromEntity(entity ICategoryEntity) (ICategory, error) {
instance := &category{
object: object{
id: entity.Id(),
id: entity.Id(),
sortOrder: entity.SortOrder(),
},
categoryTypeId: entity.CategoryTypeId(),
categoryId: entity.CategoryId(),
@ -164,6 +156,28 @@ func (category *category) UpdateDescriptionAtomic(transaction ITransaction, desc
}
}
func (category *category) SortOrder() float32 {
return category.sortOrder
}
func (category *category) UpdateSortOrder(sortOrder float32, editor Identity) {
if err := repository.Categories.UpdateSortOrder(category.id, sortOrder, editor.Id()); err != nil {
panic(err.Error())
}
category.sortOrder = sortOrder
}
func (category *category) UpdateSortOrderAtomic(transaction ITransaction, sortOrder float32, editor Identity) {
transaction.OnCommit(func() {
category.sortOrder = sortOrder
})
if err := repository.Categories.UpdateSortOrderAtomic(transaction, category.id, sortOrder, editor.Id()); err != nil {
panic(err.Error())
}
}
func (category *category) Validate() error {
return nil
}

Wyświetl plik

@ -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(),
@ -133,32 +129,32 @@ func (manager *categoryManager) GetCategory(id int64, _ Identity) (ICategory, er
}
func (manager *categoryManager) AddCategory(categoryTypeId int64, categoryId int64, title string, description string, editor Identity) (ICategory, error) {
categoryEntity := NewCategoryEntity(manager.UniqueId(), categoryTypeId, categoryId, title, description)
categoryEntity := NewCategoryEntity(manager.UniqueId(), categoryTypeId, categoryId, title, description, 0)
return manager.Apply(categoryEntity, repository.Categories.Add, manager.cache.Put, editor)
}
func (manager *categoryManager) AddCategoryWithCustomId(id int64, categoryTypeId int64, categoryId int64, title string, description string, editor Identity) (ICategory, error) {
categoryEntity := NewCategoryEntity(id, categoryTypeId, categoryId, title, description)
categoryEntity := NewCategoryEntity(id, categoryTypeId, categoryId, title, description, 0)
return manager.Apply(categoryEntity, repository.Categories.Add, manager.cache.Put, editor)
}
func (manager *categoryManager) AddCategoryObject(category ICategory, editor Identity) (ICategory, error) {
categoryEntity := NewCategoryEntity(manager.UniqueId(), category.CategoryTypeId(), category.CategoryId(), category.Title(), category.Description())
categoryEntity := NewCategoryEntity(manager.UniqueId(), category.CategoryTypeId(), category.CategoryId(), category.Title(), category.Description(), 0)
return manager.Apply(categoryEntity, repository.Categories.Add, manager.cache.Put, editor)
}
func (manager *categoryManager) AddCategoryAtomic(transaction ITransaction, categoryTypeId int64, categoryId int64, title string, description string, editor Identity) (ICategory, error) {
categoryEntity := NewCategoryEntity(manager.UniqueId(), categoryTypeId, categoryId, title, description)
categoryEntity := NewCategoryEntity(manager.UniqueId(), categoryTypeId, categoryId, title, description, 0)
return manager.ApplyAtomic(transaction, categoryEntity, repository.Categories.AddAtomic, manager.cache.Put, editor)
}
func (manager *categoryManager) AddCategoryWithCustomIdAtomic(id int64, transaction ITransaction, categoryTypeId int64, categoryId int64, title string, description string, editor Identity) (ICategory, error) {
categoryEntity := NewCategoryEntity(id, categoryTypeId, categoryId, title, description)
categoryEntity := NewCategoryEntity(id, categoryTypeId, categoryId, title, description, 0)
return manager.ApplyAtomic(transaction, categoryEntity, repository.Categories.AddAtomic, manager.cache.Put, editor)
}
func (manager *categoryManager) AddCategoryObjectAtomic(transaction ITransaction, category ICategory, editor Identity) (ICategory, error) {
categoryEntity := NewCategoryEntity(manager.UniqueId(), category.CategoryTypeId(), category.CategoryId(), category.Title(), category.Description())
categoryEntity := NewCategoryEntity(manager.UniqueId(), category.CategoryTypeId(), category.CategoryId(), category.Title(), category.Description(), 0)
return manager.ApplyAtomic(transaction, categoryEntity, repository.Categories.AddAtomic, manager.cache.Put, editor)
}
@ -175,22 +171,22 @@ func (manager *categoryManager) Log(categoryTypeId int64, categoryId int64, titl
}
func (manager *categoryManager) UpdateCategory(id int64, categoryTypeId int64, categoryId int64, title string, description string, editor Identity) (ICategory, error) {
categoryEntity := NewCategoryEntity(id, categoryTypeId, categoryId, title, description)
categoryEntity := NewCategoryEntity(id, categoryTypeId, categoryId, title, description, 0)
return manager.Apply(categoryEntity, repository.Categories.Update, manager.cache.Put, editor)
}
func (manager *categoryManager) UpdateCategoryObject(id int64, category ICategory, editor Identity) (ICategory, error) {
categoryEntity := NewCategoryEntity(id, category.Id(), category.Id(), category.Title(), category.Description())
categoryEntity := NewCategoryEntity(id, category.Id(), category.Id(), category.Title(), category.Description(), 0)
return manager.Apply(categoryEntity, repository.Categories.Update, manager.cache.Put, editor)
}
func (manager *categoryManager) UpdateCategoryAtomic(transaction ITransaction, id int64, categoryTypeId int64, categoryId int64, title string, description string, editor Identity) (ICategory, error) {
categoryEntity := NewCategoryEntity(id, categoryTypeId, categoryId, title, description)
categoryEntity := NewCategoryEntity(id, categoryTypeId, categoryId, title, description, 0)
return manager.ApplyAtomic(transaction, categoryEntity, repository.Categories.UpdateAtomic, manager.cache.Put, editor)
}
func (manager *categoryManager) UpdateCategoryObjectAtomic(transaction ITransaction, id int64, category ICategory, editor Identity) (ICategory, error) {
categoryEntity := NewCategoryEntity(id, category.Id(), category.Id(), category.Title(), category.Description())
categoryEntity := NewCategoryEntity(id, category.Id(), category.Id(), category.Title(), category.Description(), 0)
return manager.ApplyAtomic(transaction, categoryEntity, repository.Categories.UpdateAtomic, manager.cache.Put, editor)
}
@ -211,12 +207,12 @@ func (manager *categoryManager) AddOrUpdateCategoryObjectAtomic(transaction ITra
}
func (manager *categoryManager) RemoveCategory(id int64, editor Identity) (ICategory, error) {
categoryEntity := NewCategoryEntity(id, 0, 0, "", "")
categoryEntity := NewCategoryEntity(id, 0, 0, "", "", 0)
return manager.Apply(categoryEntity, repository.Categories.Remove, manager.cache.Remove, editor)
}
func (manager *categoryManager) RemoveCategoryAtomic(transaction ITransaction, id int64, editor Identity) (ICategory, error) {
categoryEntity := NewCategoryEntity(id, 0, 0, "", "")
categoryEntity := NewCategoryEntity(id, 0, 0, "", "", 0)
return manager.ApplyAtomic(transaction, categoryEntity, repository.Categories.RemoveAtomic, manager.cache.Remove, editor)
}

Wyświetl plik

@ -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{

Wyświetl plik

@ -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(),

Wyświetl plik

@ -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{

Wyświetl plik

@ -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(),

Wyświetl plik

@ -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{

Wyświetl plik

@ -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(),

Wyświetl plik

@ -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 {

Wyświetl plik

@ -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 {

Wyświetl plik

@ -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{

Wyświetl plik

@ -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(),

Wyświetl plik

@ -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{}

Wyświetl plik

@ -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(),

Wyświetl plik

@ -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)
}

Wyświetl plik

@ -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{

Wyświetl plik

@ -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(),

Wyświetl plik

@ -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{

Wyświetl plik

@ -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(),

Wyświetl plik

@ -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"`

Wyświetl plik

@ -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:"''"`

Wyświetl plik

@ -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"`

Wyświetl plik

@ -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"`

Wyświetl plik

@ -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"`
@ -26,9 +19,9 @@ type categoryEntity struct {
DescriptionField string `json:"description" storage:"VARCHAR(64)" default:"''"`
}
func NewCategoryEntity(id int64, categoryTypeId int64, categoryId int64, title string, description string) ICategoryEntity {
func NewCategoryEntity(id int64, categoryTypeId int64, categoryId int64, title string, description string, sortOrder float32) ICategoryEntity {
return &categoryEntity{
entity: entity{IdField: id},
entity: entity{IdField: id, SortOrderField: sortOrder},
CategoryTypeIdField: categoryTypeId,
CategoryIdField: categoryId,
TitleField: title,

Wyświetl plik

@ -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:"''"`

Wyświetl plik

@ -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:"'{}'"`

Wyświetl plik

@ -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 = "{}"

Wyświetl plik

@ -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:"''"`

Wyświetl plik

@ -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:"''"`

Wyświetl plik

@ -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"`

Wyświetl plik

@ -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:"''"`

Wyświetl plik

@ -44,7 +44,7 @@ func (repository *categoriesRepository) FetchById(id int64) (ICategoryEntity, er
}
// language=SQL
query := `SELECT "id", "category_type_id", "category_id", "title", "description" FROM "categories" WHERE "id" = $1 AND "status" = 0;`
query := `SELECT "id", "category_type_id", "category_id", "title", "description", "sort_order" FROM "categories" WHERE "id" = $1 AND "status" = 0;`
var categoryEntity ICategoryEntity
if err := repository.database.QuerySingle(func(cursor ICursor) error {
@ -54,13 +54,14 @@ func (repository *categoriesRepository) FetchById(id int64) (ICategoryEntity, er
categoryId int64
title string
description string
sortOrder float32
)
if err := cursor.Scan(&id, &categoryTypeId, &categoryId, &title, &description); err != nil {
if err := cursor.Scan(&id, &categoryTypeId, &categoryId, &title, &description, &sortOrder); err != nil {
return err
}
categoryEntity = NewCategoryEntity(id, categoryTypeId, categoryId, title, description)
categoryEntity = NewCategoryEntity(id, categoryTypeId, categoryId, title, description, sortOrder)
return nil
}, query, id); err != nil {
return nil, err
@ -111,7 +112,7 @@ func (repository *categoriesRepository) RemoveAtomic(transaction IRepositoryTran
func (repository *categoriesRepository) FetchAll() (CategoryEntities, error) {
// language=SQL
query := `SELECT "id", "category_type_id", "category_id", "title", "description" FROM "categories" WHERE "id" > 0 AND "status" = 0;`
query := `SELECT "id", "category_type_id", "category_id", "title", "description", "sort_order" FROM "categories" WHERE "id" > 0 AND "status" = 0;`
var categoryEntities CategoryEntities
if err := repository.database.Query(func(cursor ICursor) error {
@ -121,13 +122,14 @@ func (repository *categoriesRepository) FetchAll() (CategoryEntities, error) {
categoryId int64
title string
description string
sortOrder float32
)
if err := cursor.Scan(&id, &categoryTypeId, &categoryId, &title, &description); err != nil {
if err := cursor.Scan(&id, &categoryTypeId, &categoryId, &title, &description, &sortOrder); err != nil {
return err
}
categoryEntities = append(categoryEntities, NewCategoryEntity(id, categoryTypeId, categoryId, title, description))
categoryEntities = append(categoryEntities, NewCategoryEntity(id, categoryTypeId, categoryId, title, description, sortOrder))
return nil
}, query); err != nil {
return nil, err
@ -154,7 +156,7 @@ func (repository *categoriesRepository) FetchAllByCategory(categoryId int64) (Ca
func (repository *categoriesRepository) FetchAllByDependency(dependencyName string, dependencyId int64) (CategoryEntities, error) {
// language=SQL
query := `SELECT "id", "category_type_id", "category_id", "title", "description" FROM "categories" WHERE "id" > 0 AND "status" = 0`
query := `SELECT "id", "category_type_id", "category_id", "title", "description", "sort_order" FROM "categories" WHERE "id" > 0 AND "status" = 0`
query += ` AND "` + dependencyName + `" = $1;`
var categoryEntities CategoryEntities
@ -165,13 +167,14 @@ func (repository *categoriesRepository) FetchAllByDependency(dependencyName stri
categoryId int64
title string
description string
sortOrder float32
)
if err := cursor.Scan(&id, &categoryTypeId, &categoryId, &title, &description); err != nil {
if err := cursor.Scan(&id, &categoryTypeId, &categoryId, &title, &description, &sortOrder); err != nil {
return err
}
categoryEntities = append(categoryEntities, NewCategoryEntity(id, categoryTypeId, categoryId, title, description))
categoryEntities = append(categoryEntities, NewCategoryEntity(id, categoryTypeId, categoryId, title, description, sortOrder))
return nil
}, query, dependencyId); err != nil {
return nil, err
@ -219,3 +222,23 @@ func (repository *categoriesRepository) UpdateDescriptionAtomic(transaction IRep
query := `UPDATE "categories" SET "description" = $1, "editor" = $2 WHERE "id" = $3;`
return repository.database.UpdateSingleAtomic(transaction, query, value, editor, id)
}
func (repository *categoriesRepository) UpdateSortOrder(id int64, value float32, editor int64) error {
if id <= 0 {
return ERROR_INVALID_PARAMETERS
}
// language=SQL
query := `UPDATE "categories" SET "sort_order" = $1, "editor" = $2 WHERE "id" = $3;`
return repository.database.UpdateSingle(query, value, editor, id)
}
func (repository *categoriesRepository) UpdateSortOrderAtomic(transaction IRepositoryTransaction, id int64, value float32, editor int64) error {
if id <= 0 {
return ERROR_INVALID_PARAMETERS
}
// language=SQL
query := `UPDATE "categories" SET "sort_order" = $1, "editor" = $2 WHERE "id" = $3;`
return repository.database.UpdateSingleAtomic(transaction, query, value, editor, id)
}

Wyświetl plik

@ -14,6 +14,7 @@ func TestCategoriesRepository_Add(test *testing.T) {
categoryId int64
title string
description string
sortOrder float32
}
testCases := []struct {
@ -30,6 +31,7 @@ func TestCategoriesRepository_Add(test *testing.T) {
categoryId: 0,
title: "title",
description: "description",
sortOrder: 0,
},
},
{
@ -41,6 +43,7 @@ func TestCategoriesRepository_Add(test *testing.T) {
categoryId: 0,
title: "title",
description: "description",
sortOrder: 0,
},
},
{
@ -52,13 +55,14 @@ func TestCategoriesRepository_Add(test *testing.T) {
categoryId: 0,
title: "title",
description: "description",
sortOrder: 0,
},
},
}
for _, testCase := range testCases {
test.Run(testCase.name, func(test *testing.T) {
entity := NewCategoryEntity(testCase.arguments.id, testCase.arguments.categoryTypeId, testCase.arguments.categoryId, testCase.arguments.title, testCase.arguments.description)
entity := NewCategoryEntity(testCase.arguments.id, testCase.arguments.categoryTypeId, testCase.arguments.categoryId, testCase.arguments.title, testCase.arguments.description, testCase.arguments.sortOrder)
if result := Categories.Add(entity, -1) == nil; result != testCase.expectation {
test.Errorf("Categories.Add() = %v, expected %v", result, testCase.expectation)
}
@ -118,6 +122,7 @@ func TestCategoriesRepository_Update(test *testing.T) {
categoryId int64
title string
description string
sortOrder float32
}
testCases := []struct {
@ -134,6 +139,7 @@ func TestCategoriesRepository_Update(test *testing.T) {
categoryId: 0,
title: "title",
description: "description",
sortOrder: 0,
},
},
{
@ -145,6 +151,7 @@ func TestCategoriesRepository_Update(test *testing.T) {
categoryId: 0,
title: "title",
description: "description",
sortOrder: 0,
},
},
{
@ -156,13 +163,14 @@ func TestCategoriesRepository_Update(test *testing.T) {
categoryId: 0,
title: "title",
description: "description",
sortOrder: 0,
},
},
}
for _, testCase := range testCases {
test.Run(testCase.name, func(test *testing.T) {
entity := NewCategoryEntity(testCase.arguments.id, testCase.arguments.categoryTypeId, testCase.arguments.categoryId, testCase.arguments.title, testCase.arguments.description)
entity := NewCategoryEntity(testCase.arguments.id, testCase.arguments.categoryTypeId, testCase.arguments.categoryId, testCase.arguments.title, testCase.arguments.description, testCase.arguments.sortOrder)
if result := Categories.Update(entity, -1) == nil; result != testCase.expectation {
test.Errorf("Categories.Update() = %v, expected %v", result, testCase.expectation)
}
@ -177,6 +185,7 @@ func TestCategoriesRepository_Remove(test *testing.T) {
categoryId int64
title string
description string
sortOrder float32
}
testCases := []struct {
@ -209,7 +218,7 @@ func TestCategoriesRepository_Remove(test *testing.T) {
for _, testCase := range testCases {
test.Run(testCase.name, func(test *testing.T) {
entity := NewCategoryEntity(testCase.arguments.id, testCase.arguments.categoryTypeId, testCase.arguments.categoryId, testCase.arguments.title, testCase.arguments.description)
entity := NewCategoryEntity(testCase.arguments.id, testCase.arguments.categoryTypeId, testCase.arguments.categoryId, testCase.arguments.title, testCase.arguments.description, testCase.arguments.sortOrder)
if result := Categories.Remove(entity, -1) == nil; result != testCase.expectation {
test.Errorf("Categories.Remove() = %v, expected %v", result, testCase.expectation)
}

6
go.mod
Wyświetl plik

@ -8,13 +8,14 @@ require (
github.com/robfig/cron v1.2.0
github.com/sendgrid/sendgrid-go v3.12.0+incompatible
github.com/valyala/fastjson v1.6.4
github.com/xeronith/diamante v1.8.7
github.com/xeronith/diamante v1.9.0
google.golang.org/protobuf v1.28.1
)
require (
git.sr.ht/~mariusor/go-xsd-duration v0.0.0-20220703122237-02e73435a078 // indirect
github.com/BurntSushi/toml v0.3.1 // indirect
github.com/disintegration/imaging v1.6.2 // indirect
github.com/go-ap/errors v0.0.0-20221205040414-01c1adfc98ea // indirect
github.com/go-ap/jsonld v0.0.0-20221030091449-f2a191312c73 // indirect
github.com/gofrs/uuid v3.3.0+incompatible // indirect
@ -32,9 +33,10 @@ require (
github.com/valyala/bytebufferpool v1.0.0 // indirect
github.com/valyala/fasttemplate v1.2.2 // indirect
golang.org/x/crypto v0.7.0 // indirect
golang.org/x/image v0.7.0 // indirect
golang.org/x/net v0.8.0 // indirect
golang.org/x/sys v0.6.0 // indirect
golang.org/x/text v0.8.0 // indirect
golang.org/x/text v0.9.0 // indirect
golang.org/x/time v0.3.0 // indirect
gopkg.in/yaml.v2 v2.4.0 // indirect
)

43
go.sum
Wyświetl plik

@ -5,6 +5,8 @@ github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/disintegration/imaging v1.6.2 h1:w1LecBlG2Lnp8B3jk5zSuNqd7b4DXhcjwek1ei82L+c=
github.com/disintegration/imaging v1.6.2/go.mod h1:44/5580QXChDfwIclfc/PCwrr44amcmDAg8hxG0Ewe4=
github.com/go-ap/activitypub v0.0.0-20230331173947-f5b96d9450d4 h1:SGAGW21M92426IL1wW42rDHEkA2kqheNYrkFYVDNLvk=
github.com/go-ap/activitypub v0.0.0-20230331173947-f5b96d9450d4/go.mod h1:qw0WNf+PTG69Xu6mVqUluDuKl1VwVYdgntOZQFBZQ48=
github.com/go-ap/errors v0.0.0-20221205040414-01c1adfc98ea h1:ywGtLGVjJjMrq4mu35Qmu+NtlhlTk/gTayE6Bb4tQZk=
@ -60,22 +62,55 @@ github.com/valyala/fastjson v1.6.4/go.mod h1:CLCAqky6SMuOcxStkYQvblddUtoRxhYMGLr
github.com/valyala/fasttemplate v1.2.1/go.mod h1:KHLXt3tVN2HBp8eijSv/kGJopbvo7S+qRAEEKiv+SiQ=
github.com/valyala/fasttemplate v1.2.2 h1:lxLXG0uE3Qnshl9QyaK6XJxMXlQZELvChBOCmQD0Loo=
github.com/valyala/fasttemplate v1.2.2/go.mod h1:KHLXt3tVN2HBp8eijSv/kGJopbvo7S+qRAEEKiv+SiQ=
github.com/xeronith/diamante v1.8.7 h1:UOBdZwA+DzwPqx23LwNVJTSwAjRd6oT73uIMDOdugkE=
github.com/xeronith/diamante v1.8.7/go.mod h1:JxUM5P0q1doheczjjJHZt+mupCklFMwLSO/EgeTSmXg=
github.com/xeronith/diamante v1.9.0 h1:RuhtwLP1iCi9FdxwnLBsROecApIHlF5ompOjFO+cva4=
github.com/xeronith/diamante v1.9.0/go.mod h1:DSw8TsKcdU+Lg+cmgx8aDjRbu2NSOcJRQtialnKHoOU=
github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY=
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc=
golang.org/x/crypto v0.7.0 h1:AvwMYaRytfdeVt3u6mLaxYtErKYjxA2OXjJ1HHq6t3A=
golang.org/x/crypto v0.7.0/go.mod h1:pYwdfH91IfpZVANVyUOhSIPZaFoJGxTFbZhFTx+dXZU=
golang.org/x/image v0.0.0-20191009234506-e7c1f5e7dbb8/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0=
golang.org/x/image v0.7.0 h1:gzS29xtG1J5ybQlv0PuyfE3nmc6R4qB73m6LUUmvFuw=
golang.org/x/image v0.7.0/go.mod h1:nd/q4ef1AKKYl/4kft7g+6UyGbdiqWqTP1ZAbRoV7Rg=
golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4=
golang.org/x/mod v0.8.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs=
golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg=
golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c=
golang.org/x/net v0.6.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs=
golang.org/x/net v0.8.0 h1:Zrh2ngAOFYneWTAIAPethzeaQLuHwhuBkuV6ZiRnUaQ=
golang.org/x/net v0.8.0/go.mod h1:QVkue5JL9kW//ek3r6jTKnTFis1tRmNAW2P1shuFdJc=
golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20210927094055-39ccf1dd6fa6/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20211103235746-7861aae1554b/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.6.0 h1:MVltZSvRTcU2ljQOhs94SXPftV6DCNnZViHeQps87pQ=
golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/text v0.8.0 h1:57P1ETyNKtuIjB4SRd15iJxuhj8Gc416Y78H3qgMh68=
golang.org/x/text v0.8.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8=
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8=
golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k=
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ=
golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8=
golang.org/x/text v0.9.0 h1:2sjJmO8cDvYveuX97RDLsxlyUxLl+GHoLxBiRdHllBE=
golang.org/x/text v0.9.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8=
golang.org/x/time v0.3.0 h1:rg5rLMjNzMS1RkNLzCG38eapWhnYLFYXDXj2gOlr8j4=
golang.org/x/time v0.3.0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc=
golang.org/x/tools v0.6.0/go.mod h1:Xwgl3UAJ/d3gWutnCtw505GrjyAbvKui8lOU390QaIU=
golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
golang.org/x/xerrors v0.0.0-20220411194840-2f41105eb62f h1:GGU+dLjvlC3qDwqYgL6UgRmHXhOOgns0bZu2Ty5mm6U=
google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw=