Porównaj commity

...

6 Commity

Autor SHA1 Wiadomość Data
Xeronith 071028aa39 refactor(project): ♻️ update code according to dependency changes 2023-06-26 11:28:16 +03:30
Xeronith d83b595223 refactor(components): 🎨 improve code structure 2023-06-26 11:25:56 +03:30
Xeronith ff00774be2 refactor(components): 🎨 minor cleanup 2023-06-26 11:24:28 +03:30
Xeronith 79e679ac20 refactor(components): ⚰️ remove unused parameters 2023-06-26 11:21:49 +03:30
Xeronith ea5083def7 feat(components): implement multi runner operations 2023-06-26 11:20:54 +03:30
Xeronith ae874ce9db chore(project): ⬆️ upgrade dependencies 2023-06-26 11:19:16 +03:30
56 zmienionych plików z 910 dodań i 563 usunięć

Wyświetl plik

@ -325,7 +325,7 @@ func TestMain(main *testing.M) {
emailProvider := email.NewProvider(logger)
smsProvider := sms.NewProvider(logger)
if testServer, err := server.New(configuration, operationsFactory, handlersFactory, OPCODES); err != nil {
if testServer, err := server.New(configuration, operationsFactory, handlersFactory); err != nil {
logger.Fatal(err)
} else {
if err := repository.Initialize(configuration, logger); err != nil {

Wyświetl plik

@ -34,7 +34,6 @@ func (handler *authorizeInteractionHandler) HandlerFunc() HttpHandlerFunc {
}
return pipeline.Handle(x,
"authorize_interaction",
AUTHORIZE_INTERACTION_REQUEST,
AUTHORIZE_INTERACTION_RESULT,
request, result,

Wyświetl plik

@ -33,7 +33,6 @@ func (handler *checkUsernameAvailabilityHandler) HandlerFunc() HttpHandlerFunc {
}
return pipeline.Handle(x,
"check_username_availability",
CHECK_USERNAME_AVAILABILITY_REQUEST,
CHECK_USERNAME_AVAILABILITY_RESULT,
request, result,

Wyświetl plik

@ -33,7 +33,6 @@ func (handler *echoHandler) HandlerFunc() HttpHandlerFunc {
}
return pipeline.Handle(x,
"echo",
ECHO_REQUEST,
ECHO_RESULT,
request, result,

Wyświetl plik

@ -35,7 +35,6 @@ func (handler *followActorHandler) HandlerFunc() HttpHandlerFunc {
}
if err := pipeline.Handle(x,
"follow_actor",
FOLLOW_ACTOR_REQUEST,
FOLLOW_ACTOR_RESULT,
request, result,

Wyświetl plik

@ -34,7 +34,6 @@ func (handler *getActorHandler) HandlerFunc() HttpHandlerFunc {
}
return pipeline.Handle(x,
"get_actor",
GET_ACTOR_REQUEST,
GET_ACTOR_RESULT,
request, result,

Wyświetl plik

@ -34,7 +34,6 @@ func (handler *getFollowersHandler) HandlerFunc() HttpHandlerFunc {
}
return pipeline.Handle(x,
"get_followers",
GET_FOLLOWERS_REQUEST,
GET_FOLLOWERS_RESULT,
request, result,

Wyświetl plik

@ -34,7 +34,6 @@ func (handler *getFollowingHandler) HandlerFunc() HttpHandlerFunc {
}
return pipeline.Handle(x,
"get_following",
GET_FOLLOWING_REQUEST,
GET_FOLLOWING_RESULT,
request, result,

Wyświetl plik

@ -34,7 +34,6 @@ func (handler *getInboxHandler) HandlerFunc() HttpHandlerFunc {
}
return pipeline.Handle(x,
"get_inbox",
GET_INBOX_REQUEST,
GET_INBOX_RESULT,
request, result,

Wyświetl plik

@ -34,7 +34,6 @@ func (handler *getOutboxHandler) HandlerFunc() HttpHandlerFunc {
}
return pipeline.Handle(x,
"get_outbox",
GET_OUTBOX_REQUEST,
GET_OUTBOX_RESULT,
request, result,

Wyświetl plik

@ -37,7 +37,6 @@ func (handler *getPackagesHandler) HandlerFunc() HttpHandlerFunc {
}
return pipeline.Handle(x,
"get_packages",
GET_PACKAGES_REQUEST,
GET_PACKAGES_RESULT,
request, result,

Wyświetl plik

@ -33,7 +33,6 @@ func (handler *getProfileByUserHandler) HandlerFunc() HttpHandlerFunc {
}
return pipeline.Handle(x,
"get_profile_by_user",
GET_PROFILE_BY_USER_REQUEST,
GET_PROFILE_BY_USER_RESULT,
request, result,

Wyświetl plik

@ -33,7 +33,6 @@ func (handler *loginHandler) HandlerFunc() HttpHandlerFunc {
}
return pipeline.Handle(x,
"login",
LOGIN_REQUEST,
LOGIN_RESULT,
request, result,

Wyświetl plik

@ -33,7 +33,6 @@ func (handler *logoutHandler) HandlerFunc() HttpHandlerFunc {
}
return pipeline.Handle(x,
"logout",
LOGOUT_REQUEST,
LOGOUT_RESULT,
request, result,

Wyświetl plik

@ -38,7 +38,6 @@ func (handler *postToInboxHandler) HandlerFunc() HttpHandlerFunc {
}
return pipeline.Handle(x,
"post_to_inbox",
POST_TO_INBOX_REQUEST,
POST_TO_INBOX_RESULT,
request, result,

Wyświetl plik

@ -38,7 +38,6 @@ func (handler *postToOutboxHandler) HandlerFunc() HttpHandlerFunc {
}
return pipeline.Handle(x,
"post_to_outbox",
POST_TO_OUTBOX_REQUEST,
POST_TO_OUTBOX_RESULT,
request, result,

Wyświetl plik

@ -33,7 +33,6 @@ func (handler *signupHandler) HandlerFunc() HttpHandlerFunc {
}
return pipeline.Handle(x,
"signup",
SIGNUP_REQUEST,
SIGNUP_RESULT,
request, result,

Wyświetl plik

@ -33,7 +33,6 @@ func (handler *updateProfileByUserHandler) HandlerFunc() HttpHandlerFunc {
}
return pipeline.Handle(x,
"update_profile_by_user",
UPDATE_PROFILE_BY_USER_REQUEST,
UPDATE_PROFILE_BY_USER_RESULT,
request, result,

Wyświetl plik

@ -33,7 +33,6 @@ func (handler *verifyHandler) HandlerFunc() HttpHandlerFunc {
}
return pipeline.Handle(x,
"verify",
VERIFY_REQUEST,
VERIFY_RESULT,
request, result,

Wyświetl plik

@ -34,7 +34,6 @@ func (handler *webfingerHandler) HandlerFunc() HttpHandlerFunc {
}
return pipeline.Handle(x,
"webfinger",
WEBFINGER_REQUEST,
WEBFINGER_RESULT,
request, result,

Wyświetl plik

@ -3,6 +3,7 @@ package operations
import (
. "github.com/reiver/greatape/components/api/protobuf"
. "github.com/reiver/greatape/components/api/services"
. "github.com/reiver/greatape/components/constants"
. "github.com/reiver/greatape/components/contracts"
. "github.com/xeronith/diamante/contracts/operation"
. "github.com/xeronith/diamante/contracts/service"
@ -10,18 +11,29 @@ import (
. "github.com/xeronith/diamante/operation"
)
type authorizeInteractionOperation struct {
Operation
type (
AuthorizeInteractionRunner func(IContext, *AuthorizeInteractionRequest) (*AuthorizeInteractionResult, error)
AuthorizeInteractionRunners []AuthorizeInteractionRunner
run func(IContext, *AuthorizeInteractionRequest) (*AuthorizeInteractionResult, error)
}
authorizeInteractionOperation struct {
Operation
runners AuthorizeInteractionRunners
}
)
func AuthorizeInteractionOperation() IOperation {
return &authorizeInteractionOperation{
run: AuthorizeInteractionService,
runners: AuthorizeInteractionRunners{
AuthorizeInteractionService,
},
}
}
func (operation *authorizeInteractionOperation) Tag() string {
return "AUTHORIZE_INTERACTION"
}
func (operation *authorizeInteractionOperation) Id() (ID, ID) {
return AUTHORIZE_INTERACTION_REQUEST, AUTHORIZE_INTERACTION_RESULT
}
@ -35,5 +47,14 @@ func (operation *authorizeInteractionOperation) OutputContainer() Pointer {
}
func (operation *authorizeInteractionOperation) Execute(context IContext, payload Pointer) (Pointer, error) {
return operation.run(context, payload.(*AuthorizeInteractionRequest))
if len(operation.runners) <= int(operation.ActiveRunner()) {
return nil, ERROR_OPERATION_RUNNER_NOT_AVAILABLE
}
service := operation.runners[operation.ActiveRunner()]
if input, valid := payload.(*AuthorizeInteractionRequest); valid {
return service(context, input)
}
return nil, ERROR_OPERATION_PAYLOAD_NOT_SUPPORTED
}

Wyświetl plik

@ -3,6 +3,7 @@ package operations
import (
. "github.com/reiver/greatape/components/api/protobuf"
. "github.com/reiver/greatape/components/api/services"
. "github.com/reiver/greatape/components/constants"
. "github.com/reiver/greatape/components/contracts"
. "github.com/xeronith/diamante/contracts/operation"
. "github.com/xeronith/diamante/contracts/service"
@ -10,18 +11,29 @@ import (
. "github.com/xeronith/diamante/operation"
)
type changePasswordOperation struct {
SecureOperation
type (
ChangePasswordRunner func(IContext, *ChangePasswordRequest) (*ChangePasswordResult, error)
ChangePasswordRunners []ChangePasswordRunner
run func(IContext, *ChangePasswordRequest) (*ChangePasswordResult, error)
}
changePasswordOperation struct {
SecureOperation
runners ChangePasswordRunners
}
)
func ChangePasswordOperation() IOperation {
return &changePasswordOperation{
run: ChangePasswordService,
runners: ChangePasswordRunners{
ChangePasswordService,
},
}
}
func (operation *changePasswordOperation) Tag() string {
return "CHANGE_PASSWORD"
}
func (operation *changePasswordOperation) Id() (ID, ID) {
return CHANGE_PASSWORD_REQUEST, CHANGE_PASSWORD_RESULT
}
@ -35,5 +47,14 @@ func (operation *changePasswordOperation) OutputContainer() Pointer {
}
func (operation *changePasswordOperation) Execute(context IContext, payload Pointer) (Pointer, error) {
return operation.run(context, payload.(*ChangePasswordRequest))
if len(operation.runners) <= int(operation.ActiveRunner()) {
return nil, ERROR_OPERATION_RUNNER_NOT_AVAILABLE
}
service := operation.runners[operation.ActiveRunner()]
if input, valid := payload.(*ChangePasswordRequest); valid {
return service(context, input)
}
return nil, ERROR_OPERATION_PAYLOAD_NOT_SUPPORTED
}

Wyświetl plik

@ -3,6 +3,7 @@ package operations
import (
. "github.com/reiver/greatape/components/api/protobuf"
. "github.com/reiver/greatape/components/api/services"
. "github.com/reiver/greatape/components/constants"
. "github.com/reiver/greatape/components/contracts"
. "github.com/xeronith/diamante/contracts/operation"
. "github.com/xeronith/diamante/contracts/service"
@ -10,18 +11,29 @@ import (
. "github.com/xeronith/diamante/operation"
)
type checkUsernameAvailabilityOperation struct {
Operation
type (
CheckUsernameAvailabilityRunner func(IContext, *CheckUsernameAvailabilityRequest) (*CheckUsernameAvailabilityResult, error)
CheckUsernameAvailabilityRunners []CheckUsernameAvailabilityRunner
run func(IContext, *CheckUsernameAvailabilityRequest) (*CheckUsernameAvailabilityResult, error)
}
checkUsernameAvailabilityOperation struct {
Operation
runners CheckUsernameAvailabilityRunners
}
)
func CheckUsernameAvailabilityOperation() IOperation {
return &checkUsernameAvailabilityOperation{
run: CheckUsernameAvailabilityService,
runners: CheckUsernameAvailabilityRunners{
CheckUsernameAvailabilityService,
},
}
}
func (operation *checkUsernameAvailabilityOperation) Tag() string {
return "CHECK_USERNAME_AVAILABILITY"
}
func (operation *checkUsernameAvailabilityOperation) Id() (ID, ID) {
return CHECK_USERNAME_AVAILABILITY_REQUEST, CHECK_USERNAME_AVAILABILITY_RESULT
}
@ -35,5 +47,14 @@ func (operation *checkUsernameAvailabilityOperation) OutputContainer() Pointer {
}
func (operation *checkUsernameAvailabilityOperation) Execute(context IContext, payload Pointer) (Pointer, error) {
return operation.run(context, payload.(*CheckUsernameAvailabilityRequest))
if len(operation.runners) <= int(operation.ActiveRunner()) {
return nil, ERROR_OPERATION_RUNNER_NOT_AVAILABLE
}
service := operation.runners[operation.ActiveRunner()]
if input, valid := payload.(*CheckUsernameAvailabilityRequest); valid {
return service(context, input)
}
return nil, ERROR_OPERATION_PAYLOAD_NOT_SUPPORTED
}

Wyświetl plik

@ -3,6 +3,7 @@ package operations
import (
. "github.com/reiver/greatape/components/api/protobuf"
. "github.com/reiver/greatape/components/api/services"
. "github.com/reiver/greatape/components/constants"
. "github.com/reiver/greatape/components/contracts"
. "github.com/xeronith/diamante/contracts/operation"
. "github.com/xeronith/diamante/contracts/service"
@ -10,18 +11,29 @@ import (
. "github.com/xeronith/diamante/operation"
)
type echoOperation struct {
Operation
type (
EchoRunner func(IContext, *EchoRequest) (*EchoResult, error)
EchoRunners []EchoRunner
run func(IContext, *EchoRequest) (*EchoResult, error)
}
echoOperation struct {
Operation
runners EchoRunners
}
)
func EchoOperation() IOperation {
return &echoOperation{
run: EchoService,
runners: EchoRunners{
EchoService,
},
}
}
func (operation *echoOperation) Tag() string {
return "ECHO"
}
func (operation *echoOperation) Id() (ID, ID) {
return ECHO_REQUEST, ECHO_RESULT
}
@ -35,5 +47,14 @@ func (operation *echoOperation) OutputContainer() Pointer {
}
func (operation *echoOperation) Execute(context IContext, payload Pointer) (Pointer, error) {
return operation.run(context, payload.(*EchoRequest))
if len(operation.runners) <= int(operation.ActiveRunner()) {
return nil, ERROR_OPERATION_RUNNER_NOT_AVAILABLE
}
service := operation.runners[operation.ActiveRunner()]
if input, valid := payload.(*EchoRequest); valid {
return service(context, input)
}
return nil, ERROR_OPERATION_PAYLOAD_NOT_SUPPORTED
}

Wyświetl plik

@ -3,6 +3,7 @@ package operations
import (
. "github.com/reiver/greatape/components/api/protobuf"
. "github.com/reiver/greatape/components/api/services"
. "github.com/reiver/greatape/components/constants"
. "github.com/reiver/greatape/components/contracts"
. "github.com/xeronith/diamante/contracts/operation"
. "github.com/xeronith/diamante/contracts/service"
@ -10,18 +11,29 @@ import (
. "github.com/xeronith/diamante/operation"
)
type followActorOperation struct {
Operation
type (
FollowActorRunner func(IContext, *FollowActorRequest) (*FollowActorResult, error)
FollowActorRunners []FollowActorRunner
run func(IContext, *FollowActorRequest) (*FollowActorResult, error)
}
followActorOperation struct {
Operation
runners FollowActorRunners
}
)
func FollowActorOperation() IOperation {
return &followActorOperation{
run: FollowActorService,
runners: FollowActorRunners{
FollowActorService,
},
}
}
func (operation *followActorOperation) Tag() string {
return "FOLLOW_ACTOR"
}
func (operation *followActorOperation) Id() (ID, ID) {
return FOLLOW_ACTOR_REQUEST, FOLLOW_ACTOR_RESULT
}
@ -35,5 +47,14 @@ func (operation *followActorOperation) OutputContainer() Pointer {
}
func (operation *followActorOperation) Execute(context IContext, payload Pointer) (Pointer, error) {
return operation.run(context, payload.(*FollowActorRequest))
if len(operation.runners) <= int(operation.ActiveRunner()) {
return nil, ERROR_OPERATION_RUNNER_NOT_AVAILABLE
}
service := operation.runners[operation.ActiveRunner()]
if input, valid := payload.(*FollowActorRequest); valid {
return service(context, input)
}
return nil, ERROR_OPERATION_PAYLOAD_NOT_SUPPORTED
}

Wyświetl plik

@ -3,6 +3,7 @@ package operations
import (
. "github.com/reiver/greatape/components/api/protobuf"
. "github.com/reiver/greatape/components/api/services"
. "github.com/reiver/greatape/components/constants"
. "github.com/reiver/greatape/components/contracts"
. "github.com/xeronith/diamante/contracts/operation"
. "github.com/xeronith/diamante/contracts/service"
@ -10,18 +11,29 @@ import (
. "github.com/xeronith/diamante/operation"
)
type getActorOperation struct {
Operation
type (
GetActorRunner func(IContext, *GetActorRequest) (*GetActorResult, error)
GetActorRunners []GetActorRunner
run func(IContext, *GetActorRequest) (*GetActorResult, error)
}
getActorOperation struct {
Operation
runners GetActorRunners
}
)
func GetActorOperation() IOperation {
return &getActorOperation{
run: GetActorService,
runners: GetActorRunners{
GetActorService,
},
}
}
func (operation *getActorOperation) Tag() string {
return "GET_ACTOR"
}
func (operation *getActorOperation) Id() (ID, ID) {
return GET_ACTOR_REQUEST, GET_ACTOR_RESULT
}
@ -35,5 +47,14 @@ func (operation *getActorOperation) OutputContainer() Pointer {
}
func (operation *getActorOperation) Execute(context IContext, payload Pointer) (Pointer, error) {
return operation.run(context, payload.(*GetActorRequest))
if len(operation.runners) <= int(operation.ActiveRunner()) {
return nil, ERROR_OPERATION_RUNNER_NOT_AVAILABLE
}
service := operation.runners[operation.ActiveRunner()]
if input, valid := payload.(*GetActorRequest); valid {
return service(context, input)
}
return nil, ERROR_OPERATION_PAYLOAD_NOT_SUPPORTED
}

Wyświetl plik

@ -3,6 +3,7 @@ package operations
import (
. "github.com/reiver/greatape/components/api/protobuf"
. "github.com/reiver/greatape/components/api/services"
. "github.com/reiver/greatape/components/constants"
. "github.com/reiver/greatape/components/contracts"
. "github.com/xeronith/diamante/contracts/operation"
. "github.com/xeronith/diamante/contracts/service"
@ -10,18 +11,29 @@ import (
. "github.com/xeronith/diamante/operation"
)
type getFollowersOperation struct {
Operation
type (
GetFollowersRunner func(IContext, *GetFollowersRequest) (*GetFollowersResult, error)
GetFollowersRunners []GetFollowersRunner
run func(IContext, *GetFollowersRequest) (*GetFollowersResult, error)
}
getFollowersOperation struct {
Operation
runners GetFollowersRunners
}
)
func GetFollowersOperation() IOperation {
return &getFollowersOperation{
run: GetFollowersService,
runners: GetFollowersRunners{
GetFollowersService,
},
}
}
func (operation *getFollowersOperation) Tag() string {
return "GET_FOLLOWERS"
}
func (operation *getFollowersOperation) Id() (ID, ID) {
return GET_FOLLOWERS_REQUEST, GET_FOLLOWERS_RESULT
}
@ -35,5 +47,14 @@ func (operation *getFollowersOperation) OutputContainer() Pointer {
}
func (operation *getFollowersOperation) Execute(context IContext, payload Pointer) (Pointer, error) {
return operation.run(context, payload.(*GetFollowersRequest))
if len(operation.runners) <= int(operation.ActiveRunner()) {
return nil, ERROR_OPERATION_RUNNER_NOT_AVAILABLE
}
service := operation.runners[operation.ActiveRunner()]
if input, valid := payload.(*GetFollowersRequest); valid {
return service(context, input)
}
return nil, ERROR_OPERATION_PAYLOAD_NOT_SUPPORTED
}

Wyświetl plik

@ -3,6 +3,7 @@ package operations
import (
. "github.com/reiver/greatape/components/api/protobuf"
. "github.com/reiver/greatape/components/api/services"
. "github.com/reiver/greatape/components/constants"
. "github.com/reiver/greatape/components/contracts"
. "github.com/xeronith/diamante/contracts/operation"
. "github.com/xeronith/diamante/contracts/service"
@ -10,18 +11,29 @@ import (
. "github.com/xeronith/diamante/operation"
)
type getFollowingOperation struct {
Operation
type (
GetFollowingRunner func(IContext, *GetFollowingRequest) (*GetFollowingResult, error)
GetFollowingRunners []GetFollowingRunner
run func(IContext, *GetFollowingRequest) (*GetFollowingResult, error)
}
getFollowingOperation struct {
Operation
runners GetFollowingRunners
}
)
func GetFollowingOperation() IOperation {
return &getFollowingOperation{
run: GetFollowingService,
runners: GetFollowingRunners{
GetFollowingService,
},
}
}
func (operation *getFollowingOperation) Tag() string {
return "GET_FOLLOWING"
}
func (operation *getFollowingOperation) Id() (ID, ID) {
return GET_FOLLOWING_REQUEST, GET_FOLLOWING_RESULT
}
@ -35,5 +47,14 @@ func (operation *getFollowingOperation) OutputContainer() Pointer {
}
func (operation *getFollowingOperation) Execute(context IContext, payload Pointer) (Pointer, error) {
return operation.run(context, payload.(*GetFollowingRequest))
if len(operation.runners) <= int(operation.ActiveRunner()) {
return nil, ERROR_OPERATION_RUNNER_NOT_AVAILABLE
}
service := operation.runners[operation.ActiveRunner()]
if input, valid := payload.(*GetFollowingRequest); valid {
return service(context, input)
}
return nil, ERROR_OPERATION_PAYLOAD_NOT_SUPPORTED
}

Wyświetl plik

@ -3,6 +3,7 @@ package operations
import (
. "github.com/reiver/greatape/components/api/protobuf"
. "github.com/reiver/greatape/components/api/services"
. "github.com/reiver/greatape/components/constants"
. "github.com/reiver/greatape/components/contracts"
. "github.com/xeronith/diamante/contracts/operation"
. "github.com/xeronith/diamante/contracts/service"
@ -10,18 +11,29 @@ import (
. "github.com/xeronith/diamante/operation"
)
type getInboxOperation struct {
Operation
type (
GetInboxRunner func(IContext, *GetInboxRequest) (*GetInboxResult, error)
GetInboxRunners []GetInboxRunner
run func(IContext, *GetInboxRequest) (*GetInboxResult, error)
}
getInboxOperation struct {
Operation
runners GetInboxRunners
}
)
func GetInboxOperation() IOperation {
return &getInboxOperation{
run: GetInboxService,
runners: GetInboxRunners{
GetInboxService,
},
}
}
func (operation *getInboxOperation) Tag() string {
return "GET_INBOX"
}
func (operation *getInboxOperation) Id() (ID, ID) {
return GET_INBOX_REQUEST, GET_INBOX_RESULT
}
@ -35,5 +47,14 @@ func (operation *getInboxOperation) OutputContainer() Pointer {
}
func (operation *getInboxOperation) Execute(context IContext, payload Pointer) (Pointer, error) {
return operation.run(context, payload.(*GetInboxRequest))
if len(operation.runners) <= int(operation.ActiveRunner()) {
return nil, ERROR_OPERATION_RUNNER_NOT_AVAILABLE
}
service := operation.runners[operation.ActiveRunner()]
if input, valid := payload.(*GetInboxRequest); valid {
return service(context, input)
}
return nil, ERROR_OPERATION_PAYLOAD_NOT_SUPPORTED
}

Wyświetl plik

@ -3,6 +3,7 @@ package operations
import (
. "github.com/reiver/greatape/components/api/protobuf"
. "github.com/reiver/greatape/components/api/services"
. "github.com/reiver/greatape/components/constants"
. "github.com/reiver/greatape/components/contracts"
. "github.com/xeronith/diamante/contracts/operation"
. "github.com/xeronith/diamante/contracts/service"
@ -10,18 +11,29 @@ import (
. "github.com/xeronith/diamante/operation"
)
type getOutboxOperation struct {
Operation
type (
GetOutboxRunner func(IContext, *GetOutboxRequest) (*GetOutboxResult, error)
GetOutboxRunners []GetOutboxRunner
run func(IContext, *GetOutboxRequest) (*GetOutboxResult, error)
}
getOutboxOperation struct {
Operation
runners GetOutboxRunners
}
)
func GetOutboxOperation() IOperation {
return &getOutboxOperation{
run: GetOutboxService,
runners: GetOutboxRunners{
GetOutboxService,
},
}
}
func (operation *getOutboxOperation) Tag() string {
return "GET_OUTBOX"
}
func (operation *getOutboxOperation) Id() (ID, ID) {
return GET_OUTBOX_REQUEST, GET_OUTBOX_RESULT
}
@ -35,5 +47,14 @@ func (operation *getOutboxOperation) OutputContainer() Pointer {
}
func (operation *getOutboxOperation) Execute(context IContext, payload Pointer) (Pointer, error) {
return operation.run(context, payload.(*GetOutboxRequest))
if len(operation.runners) <= int(operation.ActiveRunner()) {
return nil, ERROR_OPERATION_RUNNER_NOT_AVAILABLE
}
service := operation.runners[operation.ActiveRunner()]
if input, valid := payload.(*GetOutboxRequest); valid {
return service(context, input)
}
return nil, ERROR_OPERATION_PAYLOAD_NOT_SUPPORTED
}

Wyświetl plik

@ -3,6 +3,7 @@ package operations
import (
. "github.com/reiver/greatape/components/api/protobuf"
. "github.com/reiver/greatape/components/api/services"
. "github.com/reiver/greatape/components/constants"
. "github.com/reiver/greatape/components/contracts"
. "github.com/xeronith/diamante/contracts/operation"
. "github.com/xeronith/diamante/contracts/service"
@ -10,18 +11,29 @@ import (
. "github.com/xeronith/diamante/operation"
)
type getPackagesOperation struct {
Operation
type (
GetPackagesRunner func(IContext, *GetPackagesRequest) (*GetPackagesResult, error)
GetPackagesRunners []GetPackagesRunner
run func(IContext, *GetPackagesRequest) (*GetPackagesResult, error)
}
getPackagesOperation struct {
Operation
runners GetPackagesRunners
}
)
func GetPackagesOperation() IOperation {
return &getPackagesOperation{
run: GetPackagesService,
runners: GetPackagesRunners{
GetPackagesService,
},
}
}
func (operation *getPackagesOperation) Tag() string {
return "GET_PACKAGES"
}
func (operation *getPackagesOperation) Id() (ID, ID) {
return GET_PACKAGES_REQUEST, GET_PACKAGES_RESULT
}
@ -35,5 +47,14 @@ func (operation *getPackagesOperation) OutputContainer() Pointer {
}
func (operation *getPackagesOperation) Execute(context IContext, payload Pointer) (Pointer, error) {
return operation.run(context, payload.(*GetPackagesRequest))
if len(operation.runners) <= int(operation.ActiveRunner()) {
return nil, ERROR_OPERATION_RUNNER_NOT_AVAILABLE
}
service := operation.runners[operation.ActiveRunner()]
if input, valid := payload.(*GetPackagesRequest); valid {
return service(context, input)
}
return nil, ERROR_OPERATION_PAYLOAD_NOT_SUPPORTED
}

Wyświetl plik

@ -3,6 +3,7 @@ package operations
import (
. "github.com/reiver/greatape/components/api/protobuf"
. "github.com/reiver/greatape/components/api/services"
. "github.com/reiver/greatape/components/constants"
. "github.com/reiver/greatape/components/contracts"
. "github.com/xeronith/diamante/contracts/operation"
. "github.com/xeronith/diamante/contracts/service"
@ -10,18 +11,29 @@ import (
. "github.com/xeronith/diamante/operation"
)
type getProfileByUserOperation struct {
SecureOperation
type (
GetProfileByUserRunner func(IContext, *GetProfileByUserRequest) (*GetProfileByUserResult, error)
GetProfileByUserRunners []GetProfileByUserRunner
run func(IContext, *GetProfileByUserRequest) (*GetProfileByUserResult, error)
}
getProfileByUserOperation struct {
SecureOperation
runners GetProfileByUserRunners
}
)
func GetProfileByUserOperation() IOperation {
return &getProfileByUserOperation{
run: GetProfileByUserService,
runners: GetProfileByUserRunners{
GetProfileByUserService,
},
}
}
func (operation *getProfileByUserOperation) Tag() string {
return "GET_PROFILE_BY_USER"
}
func (operation *getProfileByUserOperation) Id() (ID, ID) {
return GET_PROFILE_BY_USER_REQUEST, GET_PROFILE_BY_USER_RESULT
}
@ -35,5 +47,14 @@ func (operation *getProfileByUserOperation) OutputContainer() Pointer {
}
func (operation *getProfileByUserOperation) Execute(context IContext, payload Pointer) (Pointer, error) {
return operation.run(context, payload.(*GetProfileByUserRequest))
if len(operation.runners) <= int(operation.ActiveRunner()) {
return nil, ERROR_OPERATION_RUNNER_NOT_AVAILABLE
}
service := operation.runners[operation.ActiveRunner()]
if input, valid := payload.(*GetProfileByUserRequest); valid {
return service(context, input)
}
return nil, ERROR_OPERATION_PAYLOAD_NOT_SUPPORTED
}

Wyświetl plik

@ -3,6 +3,7 @@ package operations
import (
. "github.com/reiver/greatape/components/api/protobuf"
. "github.com/reiver/greatape/components/api/services"
. "github.com/reiver/greatape/components/constants"
. "github.com/reiver/greatape/components/contracts"
. "github.com/xeronith/diamante/contracts/operation"
. "github.com/xeronith/diamante/contracts/service"
@ -10,18 +11,29 @@ import (
. "github.com/xeronith/diamante/operation"
)
type getServerConfigurationOperation struct {
Operation
type (
GetServerConfigurationRunner func(IContext, *GetServerConfigurationRequest) (*GetServerConfigurationResult, error)
GetServerConfigurationRunners []GetServerConfigurationRunner
run func(IContext, *GetServerConfigurationRequest) (*GetServerConfigurationResult, error)
}
getServerConfigurationOperation struct {
Operation
runners GetServerConfigurationRunners
}
)
func GetServerConfigurationOperation() IOperation {
return &getServerConfigurationOperation{
run: GetServerConfigurationService,
runners: GetServerConfigurationRunners{
GetServerConfigurationService,
},
}
}
func (operation *getServerConfigurationOperation) Tag() string {
return "GET_SERVER_CONFIGURATION"
}
func (operation *getServerConfigurationOperation) Id() (ID, ID) {
return GET_SERVER_CONFIGURATION_REQUEST, GET_SERVER_CONFIGURATION_RESULT
}
@ -35,5 +47,14 @@ func (operation *getServerConfigurationOperation) OutputContainer() Pointer {
}
func (operation *getServerConfigurationOperation) Execute(context IContext, payload Pointer) (Pointer, error) {
return operation.run(context, payload.(*GetServerConfigurationRequest))
if len(operation.runners) <= int(operation.ActiveRunner()) {
return nil, ERROR_OPERATION_RUNNER_NOT_AVAILABLE
}
service := operation.runners[operation.ActiveRunner()]
if input, valid := payload.(*GetServerConfigurationRequest); valid {
return service(context, input)
}
return nil, ERROR_OPERATION_PAYLOAD_NOT_SUPPORTED
}

Wyświetl plik

@ -3,6 +3,7 @@ package operations
import (
. "github.com/reiver/greatape/components/api/protobuf"
. "github.com/reiver/greatape/components/api/services"
. "github.com/reiver/greatape/components/constants"
. "github.com/reiver/greatape/components/contracts"
. "github.com/xeronith/diamante/contracts/operation"
. "github.com/xeronith/diamante/contracts/service"
@ -10,18 +11,29 @@ import (
. "github.com/xeronith/diamante/operation"
)
type loginOperation struct {
Operation
type (
LoginRunner func(IContext, *LoginRequest) (*LoginResult, error)
LoginRunners []LoginRunner
run func(IContext, *LoginRequest) (*LoginResult, error)
}
loginOperation struct {
Operation
runners LoginRunners
}
)
func LoginOperation() IOperation {
return &loginOperation{
run: LoginService,
runners: LoginRunners{
LoginService,
},
}
}
func (operation *loginOperation) Tag() string {
return "LOGIN"
}
func (operation *loginOperation) Id() (ID, ID) {
return LOGIN_REQUEST, LOGIN_RESULT
}
@ -35,5 +47,14 @@ func (operation *loginOperation) OutputContainer() Pointer {
}
func (operation *loginOperation) Execute(context IContext, payload Pointer) (Pointer, error) {
return operation.run(context, payload.(*LoginRequest))
if len(operation.runners) <= int(operation.ActiveRunner()) {
return nil, ERROR_OPERATION_RUNNER_NOT_AVAILABLE
}
service := operation.runners[operation.ActiveRunner()]
if input, valid := payload.(*LoginRequest); valid {
return service(context, input)
}
return nil, ERROR_OPERATION_PAYLOAD_NOT_SUPPORTED
}

Wyświetl plik

@ -3,6 +3,7 @@ package operations
import (
. "github.com/reiver/greatape/components/api/protobuf"
. "github.com/reiver/greatape/components/api/services"
. "github.com/reiver/greatape/components/constants"
. "github.com/reiver/greatape/components/contracts"
. "github.com/xeronith/diamante/contracts/operation"
. "github.com/xeronith/diamante/contracts/service"
@ -10,18 +11,29 @@ import (
. "github.com/xeronith/diamante/operation"
)
type logoutOperation struct {
SecureOperation
type (
LogoutRunner func(IContext, *LogoutRequest) (*LogoutResult, error)
LogoutRunners []LogoutRunner
run func(IContext, *LogoutRequest) (*LogoutResult, error)
}
logoutOperation struct {
SecureOperation
runners LogoutRunners
}
)
func LogoutOperation() IOperation {
return &logoutOperation{
run: LogoutService,
runners: LogoutRunners{
LogoutService,
},
}
}
func (operation *logoutOperation) Tag() string {
return "LOGOUT"
}
func (operation *logoutOperation) Id() (ID, ID) {
return LOGOUT_REQUEST, LOGOUT_RESULT
}
@ -35,5 +47,14 @@ func (operation *logoutOperation) OutputContainer() Pointer {
}
func (operation *logoutOperation) Execute(context IContext, payload Pointer) (Pointer, error) {
return operation.run(context, payload.(*LogoutRequest))
if len(operation.runners) <= int(operation.ActiveRunner()) {
return nil, ERROR_OPERATION_RUNNER_NOT_AVAILABLE
}
service := operation.runners[operation.ActiveRunner()]
if input, valid := payload.(*LogoutRequest); valid {
return service(context, input)
}
return nil, ERROR_OPERATION_PAYLOAD_NOT_SUPPORTED
}

Wyświetl plik

@ -3,6 +3,7 @@ package operations
import (
. "github.com/reiver/greatape/components/api/protobuf"
. "github.com/reiver/greatape/components/api/services"
. "github.com/reiver/greatape/components/constants"
. "github.com/reiver/greatape/components/contracts"
. "github.com/xeronith/diamante/contracts/operation"
. "github.com/xeronith/diamante/contracts/service"
@ -10,18 +11,29 @@ import (
. "github.com/xeronith/diamante/operation"
)
type postToInboxOperation struct {
Operation
type (
PostToInboxRunner func(IContext, *PostToInboxRequest) (*PostToInboxResult, error)
PostToInboxRunners []PostToInboxRunner
run func(IContext, *PostToInboxRequest) (*PostToInboxResult, error)
}
postToInboxOperation struct {
Operation
runners PostToInboxRunners
}
)
func PostToInboxOperation() IOperation {
return &postToInboxOperation{
run: PostToInboxService,
runners: PostToInboxRunners{
PostToInboxService,
},
}
}
func (operation *postToInboxOperation) Tag() string {
return "POST_TO_INBOX"
}
func (operation *postToInboxOperation) Id() (ID, ID) {
return POST_TO_INBOX_REQUEST, POST_TO_INBOX_RESULT
}
@ -35,5 +47,14 @@ func (operation *postToInboxOperation) OutputContainer() Pointer {
}
func (operation *postToInboxOperation) Execute(context IContext, payload Pointer) (Pointer, error) {
return operation.run(context, payload.(*PostToInboxRequest))
if len(operation.runners) <= int(operation.ActiveRunner()) {
return nil, ERROR_OPERATION_RUNNER_NOT_AVAILABLE
}
service := operation.runners[operation.ActiveRunner()]
if input, valid := payload.(*PostToInboxRequest); valid {
return service(context, input)
}
return nil, ERROR_OPERATION_PAYLOAD_NOT_SUPPORTED
}

Wyświetl plik

@ -3,6 +3,7 @@ package operations
import (
. "github.com/reiver/greatape/components/api/protobuf"
. "github.com/reiver/greatape/components/api/services"
. "github.com/reiver/greatape/components/constants"
. "github.com/reiver/greatape/components/contracts"
. "github.com/xeronith/diamante/contracts/operation"
. "github.com/xeronith/diamante/contracts/service"
@ -10,18 +11,29 @@ import (
. "github.com/xeronith/diamante/operation"
)
type postToOutboxOperation struct {
Operation
type (
PostToOutboxRunner func(IContext, *PostToOutboxRequest) (*PostToOutboxResult, error)
PostToOutboxRunners []PostToOutboxRunner
run func(IContext, *PostToOutboxRequest) (*PostToOutboxResult, error)
}
postToOutboxOperation struct {
Operation
runners PostToOutboxRunners
}
)
func PostToOutboxOperation() IOperation {
return &postToOutboxOperation{
run: PostToOutboxService,
runners: PostToOutboxRunners{
PostToOutboxService,
},
}
}
func (operation *postToOutboxOperation) Tag() string {
return "POST_TO_OUTBOX"
}
func (operation *postToOutboxOperation) Id() (ID, ID) {
return POST_TO_OUTBOX_REQUEST, POST_TO_OUTBOX_RESULT
}
@ -35,5 +47,14 @@ func (operation *postToOutboxOperation) OutputContainer() Pointer {
}
func (operation *postToOutboxOperation) Execute(context IContext, payload Pointer) (Pointer, error) {
return operation.run(context, payload.(*PostToOutboxRequest))
if len(operation.runners) <= int(operation.ActiveRunner()) {
return nil, ERROR_OPERATION_RUNNER_NOT_AVAILABLE
}
service := operation.runners[operation.ActiveRunner()]
if input, valid := payload.(*PostToOutboxRequest); valid {
return service(context, input)
}
return nil, ERROR_OPERATION_PAYLOAD_NOT_SUPPORTED
}

Wyświetl plik

@ -3,6 +3,7 @@ package operations
import (
. "github.com/reiver/greatape/components/api/protobuf"
. "github.com/reiver/greatape/components/api/services"
. "github.com/reiver/greatape/components/constants"
. "github.com/reiver/greatape/components/contracts"
. "github.com/xeronith/diamante/contracts/operation"
. "github.com/xeronith/diamante/contracts/service"
@ -10,18 +11,29 @@ import (
. "github.com/xeronith/diamante/operation"
)
type resendVerificationCodeOperation struct {
Operation
type (
ResendVerificationCodeRunner func(IContext, *ResendVerificationCodeRequest) (*ResendVerificationCodeResult, error)
ResendVerificationCodeRunners []ResendVerificationCodeRunner
run func(IContext, *ResendVerificationCodeRequest) (*ResendVerificationCodeResult, error)
}
resendVerificationCodeOperation struct {
Operation
runners ResendVerificationCodeRunners
}
)
func ResendVerificationCodeOperation() IOperation {
return &resendVerificationCodeOperation{
run: ResendVerificationCodeService,
runners: ResendVerificationCodeRunners{
ResendVerificationCodeService,
},
}
}
func (operation *resendVerificationCodeOperation) Tag() string {
return "RESEND_VERIFICATION_CODE"
}
func (operation *resendVerificationCodeOperation) Id() (ID, ID) {
return RESEND_VERIFICATION_CODE_REQUEST, RESEND_VERIFICATION_CODE_RESULT
}
@ -35,5 +47,14 @@ func (operation *resendVerificationCodeOperation) OutputContainer() Pointer {
}
func (operation *resendVerificationCodeOperation) Execute(context IContext, payload Pointer) (Pointer, error) {
return operation.run(context, payload.(*ResendVerificationCodeRequest))
if len(operation.runners) <= int(operation.ActiveRunner()) {
return nil, ERROR_OPERATION_RUNNER_NOT_AVAILABLE
}
service := operation.runners[operation.ActiveRunner()]
if input, valid := payload.(*ResendVerificationCodeRequest); valid {
return service(context, input)
}
return nil, ERROR_OPERATION_PAYLOAD_NOT_SUPPORTED
}

Wyświetl plik

@ -3,6 +3,7 @@ package operations
import (
. "github.com/reiver/greatape/components/api/protobuf"
. "github.com/reiver/greatape/components/api/services"
. "github.com/reiver/greatape/components/constants"
. "github.com/reiver/greatape/components/contracts"
. "github.com/xeronith/diamante/contracts/operation"
. "github.com/xeronith/diamante/contracts/service"
@ -10,18 +11,29 @@ import (
. "github.com/xeronith/diamante/operation"
)
type resetPasswordOperation struct {
Operation
type (
ResetPasswordRunner func(IContext, *ResetPasswordRequest) (*ResetPasswordResult, error)
ResetPasswordRunners []ResetPasswordRunner
run func(IContext, *ResetPasswordRequest) (*ResetPasswordResult, error)
}
resetPasswordOperation struct {
Operation
runners ResetPasswordRunners
}
)
func ResetPasswordOperation() IOperation {
return &resetPasswordOperation{
run: ResetPasswordService,
runners: ResetPasswordRunners{
ResetPasswordService,
},
}
}
func (operation *resetPasswordOperation) Tag() string {
return "RESET_PASSWORD"
}
func (operation *resetPasswordOperation) Id() (ID, ID) {
return RESET_PASSWORD_REQUEST, RESET_PASSWORD_RESULT
}
@ -35,5 +47,14 @@ func (operation *resetPasswordOperation) OutputContainer() Pointer {
}
func (operation *resetPasswordOperation) Execute(context IContext, payload Pointer) (Pointer, error) {
return operation.run(context, payload.(*ResetPasswordRequest))
if len(operation.runners) <= int(operation.ActiveRunner()) {
return nil, ERROR_OPERATION_RUNNER_NOT_AVAILABLE
}
service := operation.runners[operation.ActiveRunner()]
if input, valid := payload.(*ResetPasswordRequest); valid {
return service(context, input)
}
return nil, ERROR_OPERATION_PAYLOAD_NOT_SUPPORTED
}

Wyświetl plik

@ -3,6 +3,7 @@ package operations
import (
. "github.com/reiver/greatape/components/api/protobuf"
. "github.com/reiver/greatape/components/api/services"
. "github.com/reiver/greatape/components/constants"
. "github.com/reiver/greatape/components/contracts"
. "github.com/xeronith/diamante/contracts/operation"
. "github.com/xeronith/diamante/contracts/service"
@ -10,18 +11,29 @@ import (
. "github.com/xeronith/diamante/operation"
)
type signupOperation struct {
Operation
type (
SignupRunner func(IContext, *SignupRequest) (*SignupResult, error)
SignupRunners []SignupRunner
run func(IContext, *SignupRequest) (*SignupResult, error)
}
signupOperation struct {
Operation
runners SignupRunners
}
)
func SignupOperation() IOperation {
return &signupOperation{
run: SignupService,
runners: SignupRunners{
SignupService,
},
}
}
func (operation *signupOperation) Tag() string {
return "SIGNUP"
}
func (operation *signupOperation) Id() (ID, ID) {
return SIGNUP_REQUEST, SIGNUP_RESULT
}
@ -35,5 +47,14 @@ func (operation *signupOperation) OutputContainer() Pointer {
}
func (operation *signupOperation) Execute(context IContext, payload Pointer) (Pointer, error) {
return operation.run(context, payload.(*SignupRequest))
if len(operation.runners) <= int(operation.ActiveRunner()) {
return nil, ERROR_OPERATION_RUNNER_NOT_AVAILABLE
}
service := operation.runners[operation.ActiveRunner()]
if input, valid := payload.(*SignupRequest); valid {
return service(context, input)
}
return nil, ERROR_OPERATION_PAYLOAD_NOT_SUPPORTED
}

Wyświetl plik

@ -10,18 +10,29 @@ import (
. "github.com/xeronith/diamante/operation"
)
type systemCallOperation struct {
AdminOperation
type (
SystemCallRunner func(IContext, *SystemCallRequest) (*SystemCallResult, error)
SystemCallRunners []SystemCallRunner
run func(IContext, *SystemCallRequest) (*SystemCallResult, error)
}
systemCallOperation struct {
AdminOperation
runners SystemCallRunners
}
)
func SystemCallOperation() IOperation {
return &systemCallOperation{
run: SystemCallService,
runners: SystemCallRunners{
SystemCallService,
},
}
}
func (operation *systemCallOperation) Tag() string {
return "SYSTEM_CALL"
}
func (operation *systemCallOperation) Id() (ID, ID) {
return SYSTEM_CALL_REQUEST, SYSTEM_CALL_RESULT
}
@ -35,5 +46,5 @@ func (operation *systemCallOperation) OutputContainer() Pointer {
}
func (operation *systemCallOperation) Execute(context IContext, payload Pointer) (Pointer, error) {
return operation.run(context, payload.(*SystemCallRequest))
return operation.runners[0](context, payload.(*SystemCallRequest))
}

Wyświetl plik

@ -3,6 +3,7 @@ package operations
import (
. "github.com/reiver/greatape/components/api/protobuf"
. "github.com/reiver/greatape/components/api/services"
. "github.com/reiver/greatape/components/constants"
. "github.com/reiver/greatape/components/contracts"
. "github.com/xeronith/diamante/contracts/operation"
. "github.com/xeronith/diamante/contracts/service"
@ -10,18 +11,29 @@ import (
. "github.com/xeronith/diamante/operation"
)
type updateProfileByUserOperation struct {
SecureOperation
type (
UpdateProfileByUserRunner func(IContext, *UpdateProfileByUserRequest) (*UpdateProfileByUserResult, error)
UpdateProfileByUserRunners []UpdateProfileByUserRunner
run func(IContext, *UpdateProfileByUserRequest) (*UpdateProfileByUserResult, error)
}
updateProfileByUserOperation struct {
SecureOperation
runners UpdateProfileByUserRunners
}
)
func UpdateProfileByUserOperation() IOperation {
return &updateProfileByUserOperation{
run: UpdateProfileByUserService,
runners: UpdateProfileByUserRunners{
UpdateProfileByUserService,
},
}
}
func (operation *updateProfileByUserOperation) Tag() string {
return "UPDATE_PROFILE_BY_USER"
}
func (operation *updateProfileByUserOperation) Id() (ID, ID) {
return UPDATE_PROFILE_BY_USER_REQUEST, UPDATE_PROFILE_BY_USER_RESULT
}
@ -35,5 +47,14 @@ func (operation *updateProfileByUserOperation) OutputContainer() Pointer {
}
func (operation *updateProfileByUserOperation) Execute(context IContext, payload Pointer) (Pointer, error) {
return operation.run(context, payload.(*UpdateProfileByUserRequest))
if len(operation.runners) <= int(operation.ActiveRunner()) {
return nil, ERROR_OPERATION_RUNNER_NOT_AVAILABLE
}
service := operation.runners[operation.ActiveRunner()]
if input, valid := payload.(*UpdateProfileByUserRequest); valid {
return service(context, input)
}
return nil, ERROR_OPERATION_PAYLOAD_NOT_SUPPORTED
}

Wyświetl plik

@ -3,6 +3,7 @@ package operations
import (
. "github.com/reiver/greatape/components/api/protobuf"
. "github.com/reiver/greatape/components/api/services"
. "github.com/reiver/greatape/components/constants"
. "github.com/reiver/greatape/components/contracts"
. "github.com/xeronith/diamante/contracts/operation"
. "github.com/xeronith/diamante/contracts/service"
@ -10,18 +11,29 @@ import (
. "github.com/xeronith/diamante/operation"
)
type verifyOperation struct {
Operation
type (
VerifyRunner func(IContext, *VerifyRequest) (*VerifyResult, error)
VerifyRunners []VerifyRunner
run func(IContext, *VerifyRequest) (*VerifyResult, error)
}
verifyOperation struct {
Operation
runners VerifyRunners
}
)
func VerifyOperation() IOperation {
return &verifyOperation{
run: VerifyService,
runners: VerifyRunners{
VerifyService,
},
}
}
func (operation *verifyOperation) Tag() string {
return "VERIFY"
}
func (operation *verifyOperation) Id() (ID, ID) {
return VERIFY_REQUEST, VERIFY_RESULT
}
@ -35,5 +47,14 @@ func (operation *verifyOperation) OutputContainer() Pointer {
}
func (operation *verifyOperation) Execute(context IContext, payload Pointer) (Pointer, error) {
return operation.run(context, payload.(*VerifyRequest))
if len(operation.runners) <= int(operation.ActiveRunner()) {
return nil, ERROR_OPERATION_RUNNER_NOT_AVAILABLE
}
service := operation.runners[operation.ActiveRunner()]
if input, valid := payload.(*VerifyRequest); valid {
return service(context, input)
}
return nil, ERROR_OPERATION_PAYLOAD_NOT_SUPPORTED
}

Wyświetl plik

@ -3,6 +3,7 @@ package operations
import (
. "github.com/reiver/greatape/components/api/protobuf"
. "github.com/reiver/greatape/components/api/services"
. "github.com/reiver/greatape/components/constants"
. "github.com/reiver/greatape/components/contracts"
. "github.com/xeronith/diamante/contracts/operation"
. "github.com/xeronith/diamante/contracts/service"
@ -10,18 +11,29 @@ import (
. "github.com/xeronith/diamante/operation"
)
type webfingerOperation struct {
Operation
type (
WebfingerRunner func(IContext, *WebfingerRequest) (*WebfingerResult, error)
WebfingerRunners []WebfingerRunner
run func(IContext, *WebfingerRequest) (*WebfingerResult, error)
}
webfingerOperation struct {
Operation
runners WebfingerRunners
}
)
func WebfingerOperation() IOperation {
return &webfingerOperation{
run: WebfingerService,
runners: WebfingerRunners{
WebfingerService,
},
}
}
func (operation *webfingerOperation) Tag() string {
return "WEBFINGER"
}
func (operation *webfingerOperation) Id() (ID, ID) {
return WEBFINGER_REQUEST, WEBFINGER_RESULT
}
@ -35,5 +47,14 @@ func (operation *webfingerOperation) OutputContainer() Pointer {
}
func (operation *webfingerOperation) Execute(context IContext, payload Pointer) (Pointer, error) {
return operation.run(context, payload.(*WebfingerRequest))
if len(operation.runners) <= int(operation.ActiveRunner()) {
return nil, ERROR_OPERATION_RUNNER_NOT_AVAILABLE
}
service := operation.runners[operation.ActiveRunner()]
if input, valid := payload.(*WebfingerRequest); valid {
return service(context, input)
}
return nil, ERROR_OPERATION_PAYLOAD_NOT_SUPPORTED
}

Wyświetl plik

@ -4,7 +4,7 @@
// protoc v3.11.2
// source: objects.proto
package __
package protobuf
import (
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
@ -20,61 +20,6 @@ const (
_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
)
type Error struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
Message string `protobuf:"bytes,1,opt,name=message,proto3" json:"message,omitempty"`
Description string `protobuf:"bytes,2,opt,name=description,proto3" json:"description,omitempty"`
}
func (x *Error) Reset() {
*x = Error{}
if protoimpl.UnsafeEnabled {
mi := &file_objects_proto_msgTypes[0]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *Error) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*Error) ProtoMessage() {}
func (x *Error) ProtoReflect() protoreflect.Message {
mi := &file_objects_proto_msgTypes[0]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use Error.ProtoReflect.Descriptor instead.
func (*Error) Descriptor() ([]byte, []int) {
return file_objects_proto_rawDescGZIP(), []int{0}
}
func (x *Error) GetMessage() string {
if x != nil {
return x.Message
}
return ""
}
func (x *Error) GetDescription() string {
if x != nil {
return x.Description
}
return ""
}
type Document struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
@ -87,7 +32,7 @@ type Document struct {
func (x *Document) Reset() {
*x = Document{}
if protoimpl.UnsafeEnabled {
mi := &file_objects_proto_msgTypes[1]
mi := &file_objects_proto_msgTypes[0]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@ -100,7 +45,7 @@ func (x *Document) String() string {
func (*Document) ProtoMessage() {}
func (x *Document) ProtoReflect() protoreflect.Message {
mi := &file_objects_proto_msgTypes[1]
mi := &file_objects_proto_msgTypes[0]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@ -113,7 +58,7 @@ func (x *Document) ProtoReflect() protoreflect.Message {
// Deprecated: Use Document.ProtoReflect.Descriptor instead.
func (*Document) Descriptor() ([]byte, []int) {
return file_objects_proto_rawDescGZIP(), []int{1}
return file_objects_proto_rawDescGZIP(), []int{0}
}
func (x *Document) GetId() int64 {
@ -142,7 +87,7 @@ type User struct {
func (x *User) Reset() {
*x = User{}
if protoimpl.UnsafeEnabled {
mi := &file_objects_proto_msgTypes[2]
mi := &file_objects_proto_msgTypes[1]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@ -155,7 +100,7 @@ func (x *User) String() string {
func (*User) ProtoMessage() {}
func (x *User) ProtoReflect() protoreflect.Message {
mi := &file_objects_proto_msgTypes[2]
mi := &file_objects_proto_msgTypes[1]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@ -168,7 +113,7 @@ func (x *User) ProtoReflect() protoreflect.Message {
// Deprecated: Use User.ProtoReflect.Descriptor instead.
func (*User) Descriptor() ([]byte, []int) {
return file_objects_proto_rawDescGZIP(), []int{2}
return file_objects_proto_rawDescGZIP(), []int{1}
}
func (x *User) GetId() int64 {
@ -204,7 +149,7 @@ type ActivityPubObject struct {
func (x *ActivityPubObject) Reset() {
*x = ActivityPubObject{}
if protoimpl.UnsafeEnabled {
mi := &file_objects_proto_msgTypes[3]
mi := &file_objects_proto_msgTypes[2]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@ -217,7 +162,7 @@ func (x *ActivityPubObject) String() string {
func (*ActivityPubObject) ProtoMessage() {}
func (x *ActivityPubObject) ProtoReflect() protoreflect.Message {
mi := &file_objects_proto_msgTypes[3]
mi := &file_objects_proto_msgTypes[2]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@ -230,7 +175,7 @@ func (x *ActivityPubObject) ProtoReflect() protoreflect.Message {
// Deprecated: Use ActivityPubObject.ProtoReflect.Descriptor instead.
func (*ActivityPubObject) Descriptor() ([]byte, []int) {
return file_objects_proto_rawDescGZIP(), []int{3}
return file_objects_proto_rawDescGZIP(), []int{2}
}
func (x *ActivityPubObject) GetContext() string {
@ -316,7 +261,7 @@ type ActivityPubActivity struct {
func (x *ActivityPubActivity) Reset() {
*x = ActivityPubActivity{}
if protoimpl.UnsafeEnabled {
mi := &file_objects_proto_msgTypes[4]
mi := &file_objects_proto_msgTypes[3]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@ -329,7 +274,7 @@ func (x *ActivityPubActivity) String() string {
func (*ActivityPubActivity) ProtoMessage() {}
func (x *ActivityPubActivity) ProtoReflect() protoreflect.Message {
mi := &file_objects_proto_msgTypes[4]
mi := &file_objects_proto_msgTypes[3]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@ -342,7 +287,7 @@ func (x *ActivityPubActivity) ProtoReflect() protoreflect.Message {
// Deprecated: Use ActivityPubActivity.ProtoReflect.Descriptor instead.
func (*ActivityPubActivity) Descriptor() ([]byte, []int) {
return file_objects_proto_rawDescGZIP(), []int{4}
return file_objects_proto_rawDescGZIP(), []int{3}
}
func (x *ActivityPubActivity) GetContext() string {
@ -428,7 +373,7 @@ type ActivityPubPublicKey struct {
func (x *ActivityPubPublicKey) Reset() {
*x = ActivityPubPublicKey{}
if protoimpl.UnsafeEnabled {
mi := &file_objects_proto_msgTypes[5]
mi := &file_objects_proto_msgTypes[4]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@ -441,7 +386,7 @@ func (x *ActivityPubPublicKey) String() string {
func (*ActivityPubPublicKey) ProtoMessage() {}
func (x *ActivityPubPublicKey) ProtoReflect() protoreflect.Message {
mi := &file_objects_proto_msgTypes[5]
mi := &file_objects_proto_msgTypes[4]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@ -454,7 +399,7 @@ func (x *ActivityPubPublicKey) ProtoReflect() protoreflect.Message {
// Deprecated: Use ActivityPubPublicKey.ProtoReflect.Descriptor instead.
func (*ActivityPubPublicKey) Descriptor() ([]byte, []int) {
return file_objects_proto_rawDescGZIP(), []int{5}
return file_objects_proto_rawDescGZIP(), []int{4}
}
func (x *ActivityPubPublicKey) GetId() string {
@ -492,7 +437,7 @@ type ActivityPubLink struct {
func (x *ActivityPubLink) Reset() {
*x = ActivityPubLink{}
if protoimpl.UnsafeEnabled {
mi := &file_objects_proto_msgTypes[6]
mi := &file_objects_proto_msgTypes[5]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@ -505,7 +450,7 @@ func (x *ActivityPubLink) String() string {
func (*ActivityPubLink) ProtoMessage() {}
func (x *ActivityPubLink) ProtoReflect() protoreflect.Message {
mi := &file_objects_proto_msgTypes[6]
mi := &file_objects_proto_msgTypes[5]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@ -518,7 +463,7 @@ func (x *ActivityPubLink) ProtoReflect() protoreflect.Message {
// Deprecated: Use ActivityPubLink.ProtoReflect.Descriptor instead.
func (*ActivityPubLink) Descriptor() ([]byte, []int) {
return file_objects_proto_rawDescGZIP(), []int{6}
return file_objects_proto_rawDescGZIP(), []int{5}
}
func (x *ActivityPubLink) GetHref() string {
@ -564,7 +509,7 @@ type ActivityPubMedia struct {
func (x *ActivityPubMedia) Reset() {
*x = ActivityPubMedia{}
if protoimpl.UnsafeEnabled {
mi := &file_objects_proto_msgTypes[7]
mi := &file_objects_proto_msgTypes[6]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@ -577,7 +522,7 @@ func (x *ActivityPubMedia) String() string {
func (*ActivityPubMedia) ProtoMessage() {}
func (x *ActivityPubMedia) ProtoReflect() protoreflect.Message {
mi := &file_objects_proto_msgTypes[7]
mi := &file_objects_proto_msgTypes[6]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@ -590,7 +535,7 @@ func (x *ActivityPubMedia) ProtoReflect() protoreflect.Message {
// Deprecated: Use ActivityPubMedia.ProtoReflect.Descriptor instead.
func (*ActivityPubMedia) Descriptor() ([]byte, []int) {
return file_objects_proto_rawDescGZIP(), []int{7}
return file_objects_proto_rawDescGZIP(), []int{6}
}
func (x *ActivityPubMedia) GetMediaType() string {
@ -646,7 +591,7 @@ type ActivityPubIncomingActivity struct {
func (x *ActivityPubIncomingActivity) Reset() {
*x = ActivityPubIncomingActivity{}
if protoimpl.UnsafeEnabled {
mi := &file_objects_proto_msgTypes[8]
mi := &file_objects_proto_msgTypes[7]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@ -659,7 +604,7 @@ func (x *ActivityPubIncomingActivity) String() string {
func (*ActivityPubIncomingActivity) ProtoMessage() {}
func (x *ActivityPubIncomingActivity) ProtoReflect() protoreflect.Message {
mi := &file_objects_proto_msgTypes[8]
mi := &file_objects_proto_msgTypes[7]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@ -672,7 +617,7 @@ func (x *ActivityPubIncomingActivity) ProtoReflect() protoreflect.Message {
// Deprecated: Use ActivityPubIncomingActivity.ProtoReflect.Descriptor instead.
func (*ActivityPubIncomingActivity) Descriptor() ([]byte, []int) {
return file_objects_proto_rawDescGZIP(), []int{8}
return file_objects_proto_rawDescGZIP(), []int{7}
}
func (x *ActivityPubIncomingActivity) GetId() int64 {
@ -749,7 +694,7 @@ type ActivityPubOutgoingActivity struct {
func (x *ActivityPubOutgoingActivity) Reset() {
*x = ActivityPubOutgoingActivity{}
if protoimpl.UnsafeEnabled {
mi := &file_objects_proto_msgTypes[9]
mi := &file_objects_proto_msgTypes[8]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@ -762,7 +707,7 @@ func (x *ActivityPubOutgoingActivity) String() string {
func (*ActivityPubOutgoingActivity) ProtoMessage() {}
func (x *ActivityPubOutgoingActivity) ProtoReflect() protoreflect.Message {
mi := &file_objects_proto_msgTypes[9]
mi := &file_objects_proto_msgTypes[8]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@ -775,7 +720,7 @@ func (x *ActivityPubOutgoingActivity) ProtoReflect() protoreflect.Message {
// Deprecated: Use ActivityPubOutgoingActivity.ProtoReflect.Descriptor instead.
func (*ActivityPubOutgoingActivity) Descriptor() ([]byte, []int) {
return file_objects_proto_rawDescGZIP(), []int{9}
return file_objects_proto_rawDescGZIP(), []int{8}
}
func (x *ActivityPubOutgoingActivity) GetId() int64 {
@ -850,7 +795,7 @@ type ActivityPubFollower struct {
func (x *ActivityPubFollower) Reset() {
*x = ActivityPubFollower{}
if protoimpl.UnsafeEnabled {
mi := &file_objects_proto_msgTypes[10]
mi := &file_objects_proto_msgTypes[9]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@ -863,7 +808,7 @@ func (x *ActivityPubFollower) String() string {
func (*ActivityPubFollower) ProtoMessage() {}
func (x *ActivityPubFollower) ProtoReflect() protoreflect.Message {
mi := &file_objects_proto_msgTypes[10]
mi := &file_objects_proto_msgTypes[9]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@ -876,7 +821,7 @@ func (x *ActivityPubFollower) ProtoReflect() protoreflect.Message {
// Deprecated: Use ActivityPubFollower.ProtoReflect.Descriptor instead.
func (*ActivityPubFollower) Descriptor() ([]byte, []int) {
return file_objects_proto_rawDescGZIP(), []int{10}
return file_objects_proto_rawDescGZIP(), []int{9}
}
func (x *ActivityPubFollower) GetId() int64 {
@ -925,112 +870,108 @@ var File_objects_proto protoreflect.FileDescriptor
var file_objects_proto_rawDesc = []byte{
0x0a, 0x0d, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12,
0x08, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x22, 0x43, 0x0a, 0x05, 0x45, 0x72, 0x72,
0x6f, 0x72, 0x12, 0x18, 0x0a, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x18, 0x01, 0x20,
0x01, 0x28, 0x09, 0x52, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x12, 0x20, 0x0a, 0x0b,
0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28,
0x09, 0x52, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0x34,
0x0a, 0x08, 0x44, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64,
0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x02, 0x69, 0x64, 0x12, 0x18, 0x0a, 0x07, 0x63, 0x6f,
0x6e, 0x74, 0x65, 0x6e, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x63, 0x6f, 0x6e,
0x74, 0x65, 0x6e, 0x74, 0x22, 0x2e, 0x0a, 0x04, 0x55, 0x73, 0x65, 0x72, 0x12, 0x0e, 0x0a, 0x02,
0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x02, 0x69, 0x64, 0x12, 0x16, 0x0a, 0x06,
0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x67, 0x69,
0x74, 0x68, 0x75, 0x62, 0x22, 0xe2, 0x01, 0x0a, 0x11, 0x41, 0x63, 0x74, 0x69, 0x76, 0x69, 0x74,
0x79, 0x50, 0x75, 0x62, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x12, 0x19, 0x0a, 0x07, 0x63, 0x6f,
0x6e, 0x74, 0x65, 0x78, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x40, 0x63, 0x6f,
0x6e, 0x74, 0x65, 0x78, 0x74, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28,
0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x04, 0x20,
0x01, 0x28, 0x09, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x61, 0x63, 0x74,
0x6f, 0x72, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x61, 0x63, 0x74, 0x6f, 0x72, 0x12,
0x12, 0x0a, 0x04, 0x66, 0x72, 0x6f, 0x6d, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x66,
0x72, 0x6f, 0x6d, 0x12, 0x0e, 0x0a, 0x02, 0x74, 0x6f, 0x18, 0x07, 0x20, 0x03, 0x28, 0x09, 0x52,
0x02, 0x74, 0x6f, 0x12, 0x1c, 0x0a, 0x09, 0x69, 0x6e, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x54, 0x6f,
0x18, 0x08, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x69, 0x6e, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x54,
0x6f, 0x12, 0x18, 0x0a, 0x07, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x18, 0x09, 0x20, 0x01,
0x28, 0x09, 0x52, 0x07, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x12, 0x1c, 0x0a, 0x09, 0x70,
0x75, 0x62, 0x6c, 0x69, 0x73, 0x68, 0x65, 0x64, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09,
0x70, 0x75, 0x62, 0x6c, 0x69, 0x73, 0x68, 0x65, 0x64, 0x22, 0x99, 0x02, 0x0a, 0x13, 0x41, 0x63,
0x74, 0x69, 0x76, 0x69, 0x74, 0x79, 0x50, 0x75, 0x62, 0x41, 0x63, 0x74, 0x69, 0x76, 0x69, 0x74,
0x79, 0x12, 0x19, 0x0a, 0x07, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x78, 0x74, 0x18, 0x02, 0x20, 0x01,
0x28, 0x09, 0x52, 0x08, 0x40, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x78, 0x74, 0x12, 0x0e, 0x0a, 0x02,
0x69, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x12, 0x0a, 0x04,
0x74, 0x79, 0x70, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65,
0x12, 0x14, 0x0a, 0x05, 0x61, 0x63, 0x74, 0x6f, 0x72, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52,
0x05, 0x61, 0x63, 0x74, 0x6f, 0x72, 0x12, 0x33, 0x0a, 0x06, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74,
0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75,
0x66, 0x2e, 0x41, 0x63, 0x74, 0x69, 0x76, 0x69, 0x74, 0x79, 0x50, 0x75, 0x62, 0x4f, 0x62, 0x6a,
0x65, 0x63, 0x74, 0x52, 0x06, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x66,
0x72, 0x6f, 0x6d, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x66, 0x72, 0x6f, 0x6d, 0x12,
0x0e, 0x0a, 0x02, 0x74, 0x6f, 0x18, 0x08, 0x20, 0x03, 0x28, 0x09, 0x52, 0x02, 0x74, 0x6f, 0x12,
0x1c, 0x0a, 0x09, 0x69, 0x6e, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x54, 0x6f, 0x18, 0x09, 0x20, 0x01,
0x28, 0x09, 0x52, 0x09, 0x69, 0x6e, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x54, 0x6f, 0x12, 0x18, 0x0a,
0x07, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07,
0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x12, 0x1c, 0x0a, 0x09, 0x70, 0x75, 0x62, 0x6c, 0x69,
0x73, 0x68, 0x65, 0x64, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x70, 0x75, 0x62, 0x6c,
0x69, 0x73, 0x68, 0x65, 0x64, 0x22, 0x60, 0x0a, 0x14, 0x41, 0x63, 0x74, 0x69, 0x76, 0x69, 0x74,
0x79, 0x50, 0x75, 0x62, 0x50, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x4b, 0x65, 0x79, 0x12, 0x0e, 0x0a,
0x02, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x14, 0x0a,
0x05, 0x6f, 0x77, 0x6e, 0x65, 0x72, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x6f, 0x77,
0x6e, 0x65, 0x72, 0x12, 0x22, 0x0a, 0x0c, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x4b, 0x65, 0x79,
0x50, 0x65, 0x6d, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x70, 0x75, 0x62, 0x6c, 0x69,
0x63, 0x4b, 0x65, 0x79, 0x50, 0x65, 0x6d, 0x22, 0x67, 0x0a, 0x0f, 0x41, 0x63, 0x74, 0x69, 0x76,
0x69, 0x74, 0x79, 0x50, 0x75, 0x62, 0x4c, 0x69, 0x6e, 0x6b, 0x12, 0x12, 0x0a, 0x04, 0x68, 0x72,
0x65, 0x66, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x68, 0x72, 0x65, 0x66, 0x12, 0x10,
0x0a, 0x03, 0x72, 0x65, 0x6c, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x72, 0x65, 0x6c,
0x08, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x22, 0x34, 0x0a, 0x08, 0x44, 0x6f, 0x63,
0x75, 0x6d, 0x65, 0x6e, 0x74, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28,
0x03, 0x52, 0x02, 0x69, 0x64, 0x12, 0x18, 0x0a, 0x07, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74,
0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x22,
0x2e, 0x0a, 0x04, 0x55, 0x73, 0x65, 0x72, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20,
0x01, 0x28, 0x03, 0x52, 0x02, 0x69, 0x64, 0x12, 0x16, 0x0a, 0x06, 0x67, 0x69, 0x74, 0x68, 0x75,
0x62, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x22,
0xe2, 0x01, 0x0a, 0x11, 0x41, 0x63, 0x74, 0x69, 0x76, 0x69, 0x74, 0x79, 0x50, 0x75, 0x62, 0x4f,
0x62, 0x6a, 0x65, 0x63, 0x74, 0x12, 0x19, 0x0a, 0x07, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x78, 0x74,
0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x40, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x78, 0x74,
0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64,
0x12, 0x12, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04,
0x74, 0x79, 0x70, 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x74, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65,
0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x74, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65,
0x22, 0x84, 0x01, 0x0a, 0x10, 0x41, 0x63, 0x74, 0x69, 0x76, 0x69, 0x74, 0x79, 0x50, 0x75, 0x62,
0x4d, 0x65, 0x64, 0x69, 0x61, 0x12, 0x1c, 0x0a, 0x09, 0x6d, 0x65, 0x64, 0x69, 0x61, 0x54, 0x79,
0x70, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x6d, 0x65, 0x64, 0x69, 0x61, 0x54,
0x79, 0x70, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28,
0x09, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x10, 0x0a, 0x03, 0x75, 0x72, 0x6c, 0x18, 0x04,
0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x75, 0x72, 0x6c, 0x12, 0x14, 0x0a, 0x05, 0x77, 0x69, 0x64,
0x74, 0x68, 0x18, 0x05, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x77, 0x69, 0x64, 0x74, 0x68, 0x12,
0x16, 0x0a, 0x06, 0x68, 0x65, 0x69, 0x67, 0x68, 0x74, 0x18, 0x06, 0x20, 0x01, 0x28, 0x05, 0x52,
0x06, 0x68, 0x65, 0x69, 0x67, 0x68, 0x74, 0x22, 0xe7, 0x01, 0x0a, 0x1b, 0x41, 0x63, 0x74, 0x69,
0x76, 0x69, 0x74, 0x79, 0x50, 0x75, 0x62, 0x49, 0x6e, 0x63, 0x6f, 0x6d, 0x69, 0x6e, 0x67, 0x41,
0x63, 0x74, 0x69, 0x76, 0x69, 0x74, 0x79, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20,
0x01, 0x28, 0x03, 0x52, 0x02, 0x69, 0x64, 0x12, 0x1e, 0x0a, 0x0a, 0x69, 0x64, 0x65, 0x6e, 0x74,
0x69, 0x74, 0x79, 0x49, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0a, 0x69, 0x64, 0x65,
0x6e, 0x74, 0x69, 0x74, 0x79, 0x49, 0x64, 0x12, 0x2a, 0x0a, 0x10, 0x75, 0x6e, 0x69, 0x71, 0x75,
0x65, 0x49, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x66, 0x69, 0x65, 0x72, 0x18, 0x03, 0x20, 0x01, 0x28,
0x09, 0x52, 0x10, 0x75, 0x6e, 0x69, 0x71, 0x75, 0x65, 0x49, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x66,
0x69, 0x65, 0x72, 0x12, 0x1c, 0x0a, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70,
0x18, 0x04, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d,
0x70, 0x12, 0x12, 0x0a, 0x04, 0x66, 0x72, 0x6f, 0x6d, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52,
0x04, 0x66, 0x72, 0x6f, 0x6d, 0x12, 0x0e, 0x0a, 0x02, 0x74, 0x6f, 0x18, 0x06, 0x20, 0x01, 0x28,
0x09, 0x52, 0x02, 0x74, 0x6f, 0x12, 0x18, 0x0a, 0x07, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74,
0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x12,
0x10, 0x0a, 0x03, 0x72, 0x61, 0x77, 0x18, 0x08, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x72, 0x61,
0x77, 0x22, 0xe7, 0x01, 0x0a, 0x1b, 0x41, 0x63, 0x74, 0x69, 0x76, 0x69, 0x74, 0x79, 0x50, 0x75,
0x62, 0x4f, 0x75, 0x74, 0x67, 0x6f, 0x69, 0x6e, 0x67, 0x41, 0x63, 0x74, 0x69, 0x76, 0x69, 0x74,
0x79, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x02, 0x69,
0x64, 0x12, 0x1e, 0x0a, 0x0a, 0x69, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x49, 0x64, 0x18,
0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0a, 0x69, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x49,
0x64, 0x12, 0x2a, 0x0a, 0x10, 0x75, 0x6e, 0x69, 0x71, 0x75, 0x65, 0x49, 0x64, 0x65, 0x6e, 0x74,
0x69, 0x66, 0x69, 0x65, 0x72, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x10, 0x75, 0x6e, 0x69,
0x71, 0x75, 0x65, 0x49, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x66, 0x69, 0x65, 0x72, 0x12, 0x1c, 0x0a,
0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x18, 0x04, 0x20, 0x01, 0x28, 0x03,
0x52, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x12, 0x12, 0x0a, 0x04, 0x66,
0x72, 0x6f, 0x6d, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x66, 0x72, 0x6f, 0x6d, 0x12,
0x0e, 0x0a, 0x02, 0x74, 0x6f, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x74, 0x6f, 0x12,
0x18, 0x0a, 0x07, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09,
0x52, 0x07, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x12, 0x10, 0x0a, 0x03, 0x72, 0x61, 0x77,
0x18, 0x08, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x72, 0x61, 0x77, 0x22, 0xa5, 0x01, 0x0a, 0x13,
0x41, 0x63, 0x74, 0x69, 0x76, 0x69, 0x74, 0x79, 0x50, 0x75, 0x62, 0x46, 0x6f, 0x6c, 0x6c, 0x6f,
0x77, 0x65, 0x72, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52,
0x02, 0x69, 0x64, 0x12, 0x16, 0x0a, 0x06, 0x68, 0x61, 0x6e, 0x64, 0x6c, 0x65, 0x18, 0x02, 0x20,
0x01, 0x28, 0x09, 0x52, 0x06, 0x68, 0x61, 0x6e, 0x64, 0x6c, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x69,
0x6e, 0x62, 0x6f, 0x78, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x69, 0x6e, 0x62, 0x6f,
0x78, 0x12, 0x18, 0x0a, 0x07, 0x73, 0x75, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x18, 0x04, 0x20, 0x01,
0x28, 0x09, 0x52, 0x07, 0x73, 0x75, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x12, 0x1a, 0x0a, 0x08, 0x61,
0x63, 0x74, 0x69, 0x76, 0x69, 0x74, 0x79, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x61,
0x63, 0x74, 0x69, 0x76, 0x69, 0x74, 0x79, 0x12, 0x1a, 0x0a, 0x08, 0x61, 0x63, 0x63, 0x65, 0x70,
0x74, 0x65, 0x64, 0x18, 0x06, 0x20, 0x01, 0x28, 0x08, 0x52, 0x08, 0x61, 0x63, 0x63, 0x65, 0x70,
0x74, 0x65, 0x64, 0x42, 0x04, 0x5a, 0x02, 0x2e, 0x2f, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f,
0x33,
0x74, 0x79, 0x70, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x61, 0x63, 0x74, 0x6f, 0x72, 0x18, 0x05, 0x20,
0x01, 0x28, 0x09, 0x52, 0x05, 0x61, 0x63, 0x74, 0x6f, 0x72, 0x12, 0x12, 0x0a, 0x04, 0x66, 0x72,
0x6f, 0x6d, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x66, 0x72, 0x6f, 0x6d, 0x12, 0x0e,
0x0a, 0x02, 0x74, 0x6f, 0x18, 0x07, 0x20, 0x03, 0x28, 0x09, 0x52, 0x02, 0x74, 0x6f, 0x12, 0x1c,
0x0a, 0x09, 0x69, 0x6e, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x54, 0x6f, 0x18, 0x08, 0x20, 0x01, 0x28,
0x09, 0x52, 0x09, 0x69, 0x6e, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x54, 0x6f, 0x12, 0x18, 0x0a, 0x07,
0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x18, 0x09, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x63,
0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x12, 0x1c, 0x0a, 0x09, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x73,
0x68, 0x65, 0x64, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x70, 0x75, 0x62, 0x6c, 0x69,
0x73, 0x68, 0x65, 0x64, 0x22, 0x99, 0x02, 0x0a, 0x13, 0x41, 0x63, 0x74, 0x69, 0x76, 0x69, 0x74,
0x79, 0x50, 0x75, 0x62, 0x41, 0x63, 0x74, 0x69, 0x76, 0x69, 0x74, 0x79, 0x12, 0x19, 0x0a, 0x07,
0x63, 0x6f, 0x6e, 0x74, 0x65, 0x78, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x40,
0x63, 0x6f, 0x6e, 0x74, 0x65, 0x78, 0x74, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x03, 0x20,
0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18,
0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x61,
0x63, 0x74, 0x6f, 0x72, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x61, 0x63, 0x74, 0x6f,
0x72, 0x12, 0x33, 0x0a, 0x06, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x18, 0x06, 0x20, 0x01, 0x28,
0x0b, 0x32, 0x1b, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x41, 0x63, 0x74,
0x69, 0x76, 0x69, 0x74, 0x79, 0x50, 0x75, 0x62, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x52, 0x06,
0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x66, 0x72, 0x6f, 0x6d, 0x18, 0x07,
0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x66, 0x72, 0x6f, 0x6d, 0x12, 0x0e, 0x0a, 0x02, 0x74, 0x6f,
0x18, 0x08, 0x20, 0x03, 0x28, 0x09, 0x52, 0x02, 0x74, 0x6f, 0x12, 0x1c, 0x0a, 0x09, 0x69, 0x6e,
0x52, 0x65, 0x70, 0x6c, 0x79, 0x54, 0x6f, 0x18, 0x09, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x69,
0x6e, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x54, 0x6f, 0x12, 0x18, 0x0a, 0x07, 0x63, 0x6f, 0x6e, 0x74,
0x65, 0x6e, 0x74, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x63, 0x6f, 0x6e, 0x74, 0x65,
0x6e, 0x74, 0x12, 0x1c, 0x0a, 0x09, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x73, 0x68, 0x65, 0x64, 0x18,
0x0b, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x73, 0x68, 0x65, 0x64,
0x22, 0x60, 0x0a, 0x14, 0x41, 0x63, 0x74, 0x69, 0x76, 0x69, 0x74, 0x79, 0x50, 0x75, 0x62, 0x50,
0x75, 0x62, 0x6c, 0x69, 0x63, 0x4b, 0x65, 0x79, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x02,
0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x6f, 0x77, 0x6e, 0x65,
0x72, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x6f, 0x77, 0x6e, 0x65, 0x72, 0x12, 0x22,
0x0a, 0x0c, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x4b, 0x65, 0x79, 0x50, 0x65, 0x6d, 0x18, 0x04,
0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x4b, 0x65, 0x79, 0x50,
0x65, 0x6d, 0x22, 0x67, 0x0a, 0x0f, 0x41, 0x63, 0x74, 0x69, 0x76, 0x69, 0x74, 0x79, 0x50, 0x75,
0x62, 0x4c, 0x69, 0x6e, 0x6b, 0x12, 0x12, 0x0a, 0x04, 0x68, 0x72, 0x65, 0x66, 0x18, 0x02, 0x20,
0x01, 0x28, 0x09, 0x52, 0x04, 0x68, 0x72, 0x65, 0x66, 0x12, 0x10, 0x0a, 0x03, 0x72, 0x65, 0x6c,
0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x72, 0x65, 0x6c, 0x12, 0x12, 0x0a, 0x04, 0x74,
0x79, 0x70, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12,
0x1a, 0x0a, 0x08, 0x74, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28,
0x09, 0x52, 0x08, 0x74, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x22, 0x84, 0x01, 0x0a, 0x10,
0x41, 0x63, 0x74, 0x69, 0x76, 0x69, 0x74, 0x79, 0x50, 0x75, 0x62, 0x4d, 0x65, 0x64, 0x69, 0x61,
0x12, 0x1c, 0x0a, 0x09, 0x6d, 0x65, 0x64, 0x69, 0x61, 0x54, 0x79, 0x70, 0x65, 0x18, 0x02, 0x20,
0x01, 0x28, 0x09, 0x52, 0x09, 0x6d, 0x65, 0x64, 0x69, 0x61, 0x54, 0x79, 0x70, 0x65, 0x12, 0x12,
0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x74, 0x79,
0x70, 0x65, 0x12, 0x10, 0x0a, 0x03, 0x75, 0x72, 0x6c, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52,
0x03, 0x75, 0x72, 0x6c, 0x12, 0x14, 0x0a, 0x05, 0x77, 0x69, 0x64, 0x74, 0x68, 0x18, 0x05, 0x20,
0x01, 0x28, 0x05, 0x52, 0x05, 0x77, 0x69, 0x64, 0x74, 0x68, 0x12, 0x16, 0x0a, 0x06, 0x68, 0x65,
0x69, 0x67, 0x68, 0x74, 0x18, 0x06, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x68, 0x65, 0x69, 0x67,
0x68, 0x74, 0x22, 0xe7, 0x01, 0x0a, 0x1b, 0x41, 0x63, 0x74, 0x69, 0x76, 0x69, 0x74, 0x79, 0x50,
0x75, 0x62, 0x49, 0x6e, 0x63, 0x6f, 0x6d, 0x69, 0x6e, 0x67, 0x41, 0x63, 0x74, 0x69, 0x76, 0x69,
0x74, 0x79, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x02,
0x69, 0x64, 0x12, 0x1e, 0x0a, 0x0a, 0x69, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x49, 0x64,
0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0a, 0x69, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79,
0x49, 0x64, 0x12, 0x2a, 0x0a, 0x10, 0x75, 0x6e, 0x69, 0x71, 0x75, 0x65, 0x49, 0x64, 0x65, 0x6e,
0x74, 0x69, 0x66, 0x69, 0x65, 0x72, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x10, 0x75, 0x6e,
0x69, 0x71, 0x75, 0x65, 0x49, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x66, 0x69, 0x65, 0x72, 0x12, 0x1c,
0x0a, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x18, 0x04, 0x20, 0x01, 0x28,
0x03, 0x52, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x12, 0x12, 0x0a, 0x04,
0x66, 0x72, 0x6f, 0x6d, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x66, 0x72, 0x6f, 0x6d,
0x12, 0x0e, 0x0a, 0x02, 0x74, 0x6f, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x74, 0x6f,
0x12, 0x18, 0x0a, 0x07, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x18, 0x07, 0x20, 0x01, 0x28,
0x09, 0x52, 0x07, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x12, 0x10, 0x0a, 0x03, 0x72, 0x61,
0x77, 0x18, 0x08, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x72, 0x61, 0x77, 0x22, 0xe7, 0x01, 0x0a,
0x1b, 0x41, 0x63, 0x74, 0x69, 0x76, 0x69, 0x74, 0x79, 0x50, 0x75, 0x62, 0x4f, 0x75, 0x74, 0x67,
0x6f, 0x69, 0x6e, 0x67, 0x41, 0x63, 0x74, 0x69, 0x76, 0x69, 0x74, 0x79, 0x12, 0x0e, 0x0a, 0x02,
0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x02, 0x69, 0x64, 0x12, 0x1e, 0x0a, 0x0a,
0x69, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x49, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03,
0x52, 0x0a, 0x69, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x49, 0x64, 0x12, 0x2a, 0x0a, 0x10,
0x75, 0x6e, 0x69, 0x71, 0x75, 0x65, 0x49, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x66, 0x69, 0x65, 0x72,
0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x10, 0x75, 0x6e, 0x69, 0x71, 0x75, 0x65, 0x49, 0x64,
0x65, 0x6e, 0x74, 0x69, 0x66, 0x69, 0x65, 0x72, 0x12, 0x1c, 0x0a, 0x09, 0x74, 0x69, 0x6d, 0x65,
0x73, 0x74, 0x61, 0x6d, 0x70, 0x18, 0x04, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x74, 0x69, 0x6d,
0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x12, 0x12, 0x0a, 0x04, 0x66, 0x72, 0x6f, 0x6d, 0x18, 0x05,
0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x66, 0x72, 0x6f, 0x6d, 0x12, 0x0e, 0x0a, 0x02, 0x74, 0x6f,
0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x74, 0x6f, 0x12, 0x18, 0x0a, 0x07, 0x63, 0x6f,
0x6e, 0x74, 0x65, 0x6e, 0x74, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x63, 0x6f, 0x6e,
0x74, 0x65, 0x6e, 0x74, 0x12, 0x10, 0x0a, 0x03, 0x72, 0x61, 0x77, 0x18, 0x08, 0x20, 0x01, 0x28,
0x09, 0x52, 0x03, 0x72, 0x61, 0x77, 0x22, 0xa5, 0x01, 0x0a, 0x13, 0x41, 0x63, 0x74, 0x69, 0x76,
0x69, 0x74, 0x79, 0x50, 0x75, 0x62, 0x46, 0x6f, 0x6c, 0x6c, 0x6f, 0x77, 0x65, 0x72, 0x12, 0x0e,
0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x02, 0x69, 0x64, 0x12, 0x16,
0x0a, 0x06, 0x68, 0x61, 0x6e, 0x64, 0x6c, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06,
0x68, 0x61, 0x6e, 0x64, 0x6c, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x69, 0x6e, 0x62, 0x6f, 0x78, 0x18,
0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x69, 0x6e, 0x62, 0x6f, 0x78, 0x12, 0x18, 0x0a, 0x07,
0x73, 0x75, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x73,
0x75, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x12, 0x1a, 0x0a, 0x08, 0x61, 0x63, 0x74, 0x69, 0x76, 0x69,
0x74, 0x79, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x61, 0x63, 0x74, 0x69, 0x76, 0x69,
0x74, 0x79, 0x12, 0x1a, 0x0a, 0x08, 0x61, 0x63, 0x63, 0x65, 0x70, 0x74, 0x65, 0x64, 0x18, 0x06,
0x20, 0x01, 0x28, 0x08, 0x52, 0x08, 0x61, 0x63, 0x63, 0x65, 0x70, 0x74, 0x65, 0x64, 0x42, 0x0d,
0x5a, 0x0b, 0x2e, 0x2e, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x62, 0x06, 0x70,
0x72, 0x6f, 0x74, 0x6f, 0x33,
}
var (
@ -1045,22 +986,21 @@ func file_objects_proto_rawDescGZIP() []byte {
return file_objects_proto_rawDescData
}
var file_objects_proto_msgTypes = make([]protoimpl.MessageInfo, 11)
var file_objects_proto_msgTypes = make([]protoimpl.MessageInfo, 10)
var file_objects_proto_goTypes = []interface{}{
(*Error)(nil), // 0: protobuf.Error
(*Document)(nil), // 1: protobuf.Document
(*User)(nil), // 2: protobuf.User
(*ActivityPubObject)(nil), // 3: protobuf.ActivityPubObject
(*ActivityPubActivity)(nil), // 4: protobuf.ActivityPubActivity
(*ActivityPubPublicKey)(nil), // 5: protobuf.ActivityPubPublicKey
(*ActivityPubLink)(nil), // 6: protobuf.ActivityPubLink
(*ActivityPubMedia)(nil), // 7: protobuf.ActivityPubMedia
(*ActivityPubIncomingActivity)(nil), // 8: protobuf.ActivityPubIncomingActivity
(*ActivityPubOutgoingActivity)(nil), // 9: protobuf.ActivityPubOutgoingActivity
(*ActivityPubFollower)(nil), // 10: protobuf.ActivityPubFollower
(*Document)(nil), // 0: protobuf.Document
(*User)(nil), // 1: protobuf.User
(*ActivityPubObject)(nil), // 2: protobuf.ActivityPubObject
(*ActivityPubActivity)(nil), // 3: protobuf.ActivityPubActivity
(*ActivityPubPublicKey)(nil), // 4: protobuf.ActivityPubPublicKey
(*ActivityPubLink)(nil), // 5: protobuf.ActivityPubLink
(*ActivityPubMedia)(nil), // 6: protobuf.ActivityPubMedia
(*ActivityPubIncomingActivity)(nil), // 7: protobuf.ActivityPubIncomingActivity
(*ActivityPubOutgoingActivity)(nil), // 8: protobuf.ActivityPubOutgoingActivity
(*ActivityPubFollower)(nil), // 9: protobuf.ActivityPubFollower
}
var file_objects_proto_depIdxs = []int32{
3, // 0: protobuf.ActivityPubActivity.object:type_name -> protobuf.ActivityPubObject
2, // 0: protobuf.ActivityPubActivity.object:type_name -> protobuf.ActivityPubObject
1, // [1:1] is the sub-list for method output_type
1, // [1:1] is the sub-list for method input_type
1, // [1:1] is the sub-list for extension type_name
@ -1075,18 +1015,6 @@ func file_objects_proto_init() {
}
if !protoimpl.UnsafeEnabled {
file_objects_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*Error); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_objects_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*Document); i {
case 0:
return &v.state
@ -1098,7 +1026,7 @@ func file_objects_proto_init() {
return nil
}
}
file_objects_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} {
file_objects_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*User); i {
case 0:
return &v.state
@ -1110,7 +1038,7 @@ func file_objects_proto_init() {
return nil
}
}
file_objects_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} {
file_objects_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*ActivityPubObject); i {
case 0:
return &v.state
@ -1122,7 +1050,7 @@ func file_objects_proto_init() {
return nil
}
}
file_objects_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} {
file_objects_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*ActivityPubActivity); i {
case 0:
return &v.state
@ -1134,7 +1062,7 @@ func file_objects_proto_init() {
return nil
}
}
file_objects_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} {
file_objects_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*ActivityPubPublicKey); i {
case 0:
return &v.state
@ -1146,7 +1074,7 @@ func file_objects_proto_init() {
return nil
}
}
file_objects_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} {
file_objects_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*ActivityPubLink); i {
case 0:
return &v.state
@ -1158,7 +1086,7 @@ func file_objects_proto_init() {
return nil
}
}
file_objects_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} {
file_objects_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*ActivityPubMedia); i {
case 0:
return &v.state
@ -1170,7 +1098,7 @@ func file_objects_proto_init() {
return nil
}
}
file_objects_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} {
file_objects_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*ActivityPubIncomingActivity); i {
case 0:
return &v.state
@ -1182,7 +1110,7 @@ func file_objects_proto_init() {
return nil
}
}
file_objects_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} {
file_objects_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*ActivityPubOutgoingActivity); i {
case 0:
return &v.state
@ -1194,7 +1122,7 @@ func file_objects_proto_init() {
return nil
}
}
file_objects_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} {
file_objects_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*ActivityPubFollower); i {
case 0:
return &v.state
@ -1213,7 +1141,7 @@ func file_objects_proto_init() {
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
RawDescriptor: file_objects_proto_rawDesc,
NumEnums: 0,
NumMessages: 11,
NumMessages: 10,
NumExtensions: 0,
NumServices: 0,
},

Wyświetl plik

@ -2,12 +2,7 @@ syntax = "proto3";
package protobuf;
option go_package = "./";
message Error {
string message = 0x00000001;
string description = 0x00000002;
}
option go_package = "../protobuf";
message Document {
int64 id = 0x00000001;

Wyświetl plik

@ -4,7 +4,7 @@
// protoc v3.11.2
// source: spis.proto
package __
package protobuf
import (
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
@ -3007,8 +3007,9 @@ var file_spis_proto_rawDesc = []byte{
0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x41, 0x63, 0x74, 0x69, 0x76, 0x69, 0x74, 0x79, 0x50, 0x75,
0x62, 0x41, 0x63, 0x74, 0x69, 0x76, 0x69, 0x74, 0x79, 0x52, 0x0c, 0x6f, 0x72, 0x64, 0x65, 0x72,
0x65, 0x64, 0x49, 0x74, 0x65, 0x6d, 0x73, 0x12, 0x14, 0x0a, 0x05, 0x66, 0x69, 0x72, 0x73, 0x74,
0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x66, 0x69, 0x72, 0x73, 0x74, 0x42, 0x04, 0x5a,
0x02, 0x2e, 0x2f, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x66, 0x69, 0x72, 0x73, 0x74, 0x42, 0x0d, 0x5a,
0x0b, 0x2e, 0x2e, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x62, 0x06, 0x70, 0x72,
0x6f, 0x74, 0x6f, 0x33,
}
var (

Wyświetl plik

@ -2,7 +2,7 @@ syntax = "proto3";
package protobuf;
option go_package = "./";
option go_package = "../protobuf";
import "objects.proto";

Wyświetl plik

@ -7,7 +7,6 @@ import (
"github.com/reiver/greatape/components/api/handlers"
"github.com/reiver/greatape/components/api/operations"
. "github.com/reiver/greatape/components/constants"
. "github.com/reiver/greatape/components/contracts"
"github.com/reiver/greatape/components/core"
"github.com/reiver/greatape/components/model/repository"
"github.com/reiver/greatape/providers/outbound/email"
@ -39,7 +38,7 @@ func Run() {
emailProvider := email.NewProvider(logger)
smsProvider := sms.NewProvider(logger)
if mainServer, err := server.New(configuration, operationsFactory, handlersFactory, OPCODES); err != nil {
if mainServer, err := server.New(configuration, operationsFactory, handlersFactory); err != nil {
logger.Fatal(err)
} else {
if err := repository.Initialize(configuration, logger); err != nil {

Wyświetl plik

@ -2,13 +2,13 @@ package constants
import "errors"
// noinspection GoSnakeCaseUsage
const (
// SYSTEM_ERRORS
ERROR_MESSAGE_INITIALIZE = "ERROR_MESSAGE_INITIALIZE"
ERROR_MESSAGE_NOT_IMPLEMENTED = "ERROR_MESSAGE_NOT_IMPLEMENTED"
ERROR_MESSAGE_OPERATION_FAILED = "ERROR_MESSAGE_OPERATION_FAILED"
ERROR_MESSAGE_OPERATION_NOT_SUPPORTED = "ERROR_MESSAGE_OPERATION_NOT_SUPPORTED"
ERROR_MESSAGE_OPERATION_RUNNER_NOT_AVAILABLE = "ERROR_MESSAGE_OPERATION_RUNNER_NOT_AVAILABLE"
ERROR_MESSAGE_OPERATION_PAYLOAD_NOT_SUPPORTED = "ERROR_MESSAGE_OPERATION_PAYLOAD_NOT_SUPPORTED"
ERROR_MESSAGE_UNRESOLVED_DEPENDENCIES = "ERROR_MESSAGE_UNRESOLVED_DEPENDENCIES"
ERROR_MESSAGE_SYSTEM_COMPONENT_NOT_FOUND = "ERROR_MESSAGE_SYSTEM_COMPONENT_NOT_FOUND"
ERROR_MESSAGE_DOCUMENT_NOT_FOUND = "ERROR_MESSAGE_DOCUMENT_NOT_FOUND"
@ -58,27 +58,26 @@ const (
ERROR_MESSAGE_INVALID_CURRENT_PASSWORD_FOR_CHANGE_PASSWORD = "ERROR_MESSAGE_INVALID_CURRENT_PASSWORD_FOR_CHANGE_PASSWORD"
ERROR_MESSAGE_INVALID_NEW_PASSWORD_FOR_CHANGE_PASSWORD = "ERROR_MESSAGE_INVALID_NEW_PASSWORD_FOR_CHANGE_PASSWORD"
ERROR_MESSAGE_INVALID_RESOURCE_FOR_WEBFINGER = "ERROR_MESSAGE_INVALID_RESOURCE_FOR_WEBFINGER"
// CUSTOM_ERRORS
ERROR_MESSAGE_DATA_INTEGRITY_VIOLATION = "ERROR_MESSAGE_DATA_INTEGRITY_VIOLATION"
ERROR_MESSAGE_INVALID_STATE = "ERROR_MESSAGE_INVALID_STATE"
ERROR_MESSAGE_USER_NOT_REGISTERED = "ERROR_MESSAGE_USER_NOT_REGISTERED"
ERROR_MESSAGE_USERNAME_OR_EMAIL_ALREADY_REGISTERED = "ERROR_MESSAGE_USERNAME_OR_EMAIL_ALREADY_REGISTERED"
ERROR_MESSAGE_ACCOUNT_NOT_VERIFIED = "ERROR_MESSAGE_ACCOUNT_NOT_VERIFIED"
ERROR_MESSAGE_ACCOUNT_BLOCKED = "ERROR_MESSAGE_ACCOUNT_BLOCKED"
ERROR_MESSAGE_INVALID_TOKEN = "ERROR_MESSAGE_INVALID_TOKEN"
ERROR_MESSAGE_INVALID_CONFIRMATION_CODE = "ERROR_MESSAGE_INVALID_CONFIRMATION_CODE"
ERROR_MESSAGE_PERMISSION_DENIED = "ERROR_MESSAGE_PERMISSION_DENIED"
ERROR_MESSAGE_INVALID_PERSON_KIND = "ERROR_MESSAGE_INVALID_PERSON_KIND"
ERROR_MESSAGE_INVALID_CREDENTIALS = "ERROR_MESSAGE_INVALID_CREDENTIALS"
ERROR_MESSAGE_DATA_INTEGRITY_VIOLATION = "ERROR_MESSAGE_DATA_INTEGRITY_VIOLATION"
ERROR_MESSAGE_INVALID_STATE = "ERROR_MESSAGE_INVALID_STATE"
ERROR_MESSAGE_USER_NOT_REGISTERED = "ERROR_MESSAGE_USER_NOT_REGISTERED"
ERROR_MESSAGE_USERNAME_OR_EMAIL_ALREADY_REGISTERED = "ERROR_MESSAGE_USERNAME_OR_EMAIL_ALREADY_REGISTERED"
ERROR_MESSAGE_ACCOUNT_NOT_VERIFIED = "ERROR_MESSAGE_ACCOUNT_NOT_VERIFIED"
ERROR_MESSAGE_ACCOUNT_BLOCKED = "ERROR_MESSAGE_ACCOUNT_BLOCKED"
ERROR_MESSAGE_INVALID_TOKEN = "ERROR_MESSAGE_INVALID_TOKEN"
ERROR_MESSAGE_INVALID_CONFIRMATION_CODE = "ERROR_MESSAGE_INVALID_CONFIRMATION_CODE"
ERROR_MESSAGE_PERMISSION_DENIED = "ERROR_MESSAGE_PERMISSION_DENIED"
ERROR_MESSAGE_INVALID_PERSON_KIND = "ERROR_MESSAGE_INVALID_PERSON_KIND"
ERROR_MESSAGE_INVALID_CREDENTIALS = "ERROR_MESSAGE_INVALID_CREDENTIALS"
)
// noinspection GoSnakeCaseUsage,GoUnusedGlobalVariable
var (
// SYSTEM_ERRORS
ERROR_INITIALIZE = errors.New(ERROR_MESSAGE_INITIALIZE)
ERROR_NOT_IMPLEMENTED = errors.New(ERROR_MESSAGE_NOT_IMPLEMENTED)
ERROR_OPERATION_FAILED = errors.New(ERROR_MESSAGE_OPERATION_FAILED)
ERROR_OPERATION_NOT_SUPPORTED = errors.New(ERROR_MESSAGE_OPERATION_NOT_SUPPORTED)
ERROR_OPERATION_RUNNER_NOT_AVAILABLE = errors.New(ERROR_MESSAGE_OPERATION_RUNNER_NOT_AVAILABLE)
ERROR_OPERATION_PAYLOAD_NOT_SUPPORTED = errors.New(ERROR_MESSAGE_OPERATION_PAYLOAD_NOT_SUPPORTED)
ERROR_UNRESOLVED_DEPENDENCIES = errors.New(ERROR_MESSAGE_UNRESOLVED_DEPENDENCIES)
ERROR_SYSTEM_COMPONENT_NOT_FOUND = errors.New(ERROR_MESSAGE_SYSTEM_COMPONENT_NOT_FOUND)
ERROR_DOCUMENT_NOT_FOUND = errors.New(ERROR_MESSAGE_DOCUMENT_NOT_FOUND)
@ -128,16 +127,15 @@ var (
ERROR_INVALID_CURRENT_PASSWORD_FOR_CHANGE_PASSWORD = errors.New(ERROR_MESSAGE_INVALID_CURRENT_PASSWORD_FOR_CHANGE_PASSWORD)
ERROR_INVALID_NEW_PASSWORD_FOR_CHANGE_PASSWORD = errors.New(ERROR_MESSAGE_INVALID_NEW_PASSWORD_FOR_CHANGE_PASSWORD)
ERROR_INVALID_RESOURCE_FOR_WEBFINGER = errors.New(ERROR_MESSAGE_INVALID_RESOURCE_FOR_WEBFINGER)
// CUSTOM_ERRORS
ERROR_DATA_INTEGRITY_VIOLATION = errors.New(ERROR_MESSAGE_DATA_INTEGRITY_VIOLATION)
ERROR_INVALID_STATE = errors.New(ERROR_MESSAGE_INVALID_STATE)
ERROR_USER_NOT_REGISTERED = errors.New(ERROR_MESSAGE_USER_NOT_REGISTERED)
ERROR_USERNAME_OR_EMAIL_ALREADY_REGISTERED = errors.New(ERROR_MESSAGE_USERNAME_OR_EMAIL_ALREADY_REGISTERED)
ERROR_ACCOUNT_NOT_VERIFIED = errors.New(ERROR_MESSAGE_ACCOUNT_NOT_VERIFIED)
ERROR_ACCOUNT_BLOCKED = errors.New(ERROR_MESSAGE_ACCOUNT_BLOCKED)
ERROR_INVALID_TOKEN = errors.New(ERROR_MESSAGE_INVALID_TOKEN)
ERROR_INVALID_CONFIRMATION_CODE = errors.New(ERROR_MESSAGE_INVALID_CONFIRMATION_CODE)
ERROR_PERMISSION_DENIED = errors.New(ERROR_MESSAGE_PERMISSION_DENIED)
ERROR_INVALID_PERSON_KIND = errors.New(ERROR_MESSAGE_INVALID_PERSON_KIND)
ERROR_INVALID_CREDENTIALS = errors.New(ERROR_MESSAGE_INVALID_CREDENTIALS)
ERROR_DATA_INTEGRITY_VIOLATION = errors.New(ERROR_MESSAGE_DATA_INTEGRITY_VIOLATION)
ERROR_INVALID_STATE = errors.New(ERROR_MESSAGE_INVALID_STATE)
ERROR_USER_NOT_REGISTERED = errors.New(ERROR_MESSAGE_USER_NOT_REGISTERED)
ERROR_USERNAME_OR_EMAIL_ALREADY_REGISTERED = errors.New(ERROR_MESSAGE_USERNAME_OR_EMAIL_ALREADY_REGISTERED)
ERROR_ACCOUNT_NOT_VERIFIED = errors.New(ERROR_MESSAGE_ACCOUNT_NOT_VERIFIED)
ERROR_ACCOUNT_BLOCKED = errors.New(ERROR_MESSAGE_ACCOUNT_BLOCKED)
ERROR_INVALID_TOKEN = errors.New(ERROR_MESSAGE_INVALID_TOKEN)
ERROR_INVALID_CONFIRMATION_CODE = errors.New(ERROR_MESSAGE_INVALID_CONFIRMATION_CODE)
ERROR_PERMISSION_DENIED = errors.New(ERROR_MESSAGE_PERMISSION_DENIED)
ERROR_INVALID_PERSON_KIND = errors.New(ERROR_MESSAGE_INVALID_PERSON_KIND)
ERROR_INVALID_CREDENTIALS = errors.New(ERROR_MESSAGE_INVALID_CREDENTIALS)
)

Wyświetl plik

@ -2,78 +2,77 @@ package constants
import . "github.com/xeronith/diamante/contracts/localization"
// noinspection GoUnusedGlobalVariable
var Errors = Resource{
// SYSTEM_ERRORS
ERROR_MESSAGE_INITIALIZE: "initialize",
ERROR_MESSAGE_NOT_IMPLEMENTED: "not_implemented",
ERROR_MESSAGE_OPERATION_FAILED: "operation_failed",
ERROR_MESSAGE_OPERATION_NOT_SUPPORTED: "operation_not_supported",
ERROR_MESSAGE_UNRESOLVED_DEPENDENCIES: "unresolved_dependencies",
ERROR_MESSAGE_SYSTEM_COMPONENT_NOT_FOUND: "system_component_not_found",
ERROR_MESSAGE_DOCUMENT_NOT_FOUND: "document_not_found",
ERROR_MESSAGE_SYSTEM_SCHEDULE_NOT_FOUND: "system_schedule_not_found",
ERROR_MESSAGE_IDENTITY_NOT_FOUND: "identity_not_found",
ERROR_MESSAGE_ACCESS_CONTROL_NOT_FOUND: "access_control_not_found",
ERROR_MESSAGE_REMOTE_ACTIVITY_NOT_FOUND: "remote_activity_not_found",
ERROR_MESSAGE_CATEGORY_TYPE_NOT_FOUND: "category_type_not_found",
ERROR_MESSAGE_CATEGORY_NOT_FOUND: "category_not_found",
ERROR_MESSAGE_USER_NOT_FOUND: "user_not_found",
ERROR_MESSAGE_ACTIVITY_PUB_OBJECT_NOT_FOUND: "activity_pub_object_not_found",
ERROR_MESSAGE_ACTIVITY_PUB_ACTIVITY_NOT_FOUND: "activity_pub_activity_not_found",
ERROR_MESSAGE_ACTIVITY_PUB_PUBLIC_KEY_NOT_FOUND: "activity_pub_public_key_not_found",
ERROR_MESSAGE_ACTIVITY_PUB_LINK_NOT_FOUND: "activity_pub_link_not_found",
ERROR_MESSAGE_ACTIVITY_PUB_MEDIA_NOT_FOUND: "activity_pub_media_not_found",
ERROR_MESSAGE_ACTIVITY_PUB_INCOMING_ACTIVITY_NOT_FOUND: "activity_pub_incoming_activity_not_found",
ERROR_MESSAGE_ACTIVITY_PUB_OUTGOING_ACTIVITY_NOT_FOUND: "activity_pub_outgoing_activity_not_found",
ERROR_MESSAGE_ACTIVITY_PUB_FOLLOWER_NOT_FOUND: "activity_pub_follower_not_found",
ERROR_MESSAGE_SPI_NOT_FOUND: "spi_not_found",
ERROR_MESSAGE_UNKNOWN_DOCUMENT: "unknown_document",
ERROR_MESSAGE_UNKNOWN_SYSTEM_SCHEDULE: "unknown_system_schedule",
ERROR_MESSAGE_UNKNOWN_IDENTITY: "unknown_identity",
ERROR_MESSAGE_UNKNOWN_ACCESS_CONTROL: "unknown_access_control",
ERROR_MESSAGE_UNKNOWN_REMOTE_ACTIVITY: "unknown_remote_activity",
ERROR_MESSAGE_UNKNOWN_CATEGORY_TYPE: "unknown_category_type",
ERROR_MESSAGE_UNKNOWN_CATEGORY: "unknown_category",
ERROR_MESSAGE_UNKNOWN_USER: "unknown_user",
ERROR_MESSAGE_UNKNOWN_ACTIVITY_PUB_OBJECT: "unknown_activity_pub_object",
ERROR_MESSAGE_UNKNOWN_ACTIVITY_PUB_ACTIVITY: "unknown_activity_pub_activity",
ERROR_MESSAGE_UNKNOWN_ACTIVITY_PUB_PUBLIC_KEY: "unknown_activity_pub_public_key",
ERROR_MESSAGE_UNKNOWN_ACTIVITY_PUB_LINK: "unknown_activity_pub_link",
ERROR_MESSAGE_UNKNOWN_ACTIVITY_PUB_MEDIA: "unknown_activity_pub_media",
ERROR_MESSAGE_UNKNOWN_ACTIVITY_PUB_INCOMING_ACTIVITY: "unknown_activity_pub_incoming_activity",
ERROR_MESSAGE_UNKNOWN_ACTIVITY_PUB_OUTGOING_ACTIVITY: "unknown_activity_pub_outgoing_activity",
ERROR_MESSAGE_UNKNOWN_ACTIVITY_PUB_FOLLOWER: "unknown_activity_pub_follower",
ERROR_MESSAGE_UNKNOWN_SPI: "unknown_spi",
ERROR_MESSAGE_INVALID_ID: "invalid_id",
ERROR_MESSAGE_INVALID_PARAMETERS: "invalid_parameters",
ERROR_MESSAGE_INVALID_USERNAME_FOR_CHECK_USERNAME_AVAILABILITY: "invalid_username",
ERROR_MESSAGE_INVALID_USERNAME_FOR_SIGNUP: "invalid_username",
ERROR_MESSAGE_INVALID_EMAIL_FOR_SIGNUP: "invalid_email",
ERROR_MESSAGE_INVALID_PASSWORD_FOR_SIGNUP: "invalid_password",
ERROR_MESSAGE_INVALID_EMAIL_FOR_RESEND_VERIFICATION_CODE: "invalid_email",
ERROR_MESSAGE_INVALID_EMAIL_FOR_VERIFY: "invalid_email",
ERROR_MESSAGE_INVALID_EMAIL_FOR_LOGIN: "invalid_email",
ERROR_MESSAGE_INVALID_PASSWORD_FOR_LOGIN: "invalid_password",
ERROR_MESSAGE_INVALID_CURRENT_PASSWORD_FOR_CHANGE_PASSWORD: "invalid_current_password",
ERROR_MESSAGE_INVALID_NEW_PASSWORD_FOR_CHANGE_PASSWORD: "invalid_new_password",
ERROR_MESSAGE_INVALID_RESOURCE_FOR_WEBFINGER: "invalid_resource",
// CUSTOM_ERRORS
ERROR_MESSAGE_DATA_INTEGRITY_VIOLATION: "data_integrity_violation",
ERROR_MESSAGE_INVALID_STATE: "invalid_state",
ERROR_MESSAGE_USER_NOT_REGISTERED: "user_not_registered",
ERROR_MESSAGE_USERNAME_OR_EMAIL_ALREADY_REGISTERED: "username_or_email_already_registered",
ERROR_MESSAGE_ACCOUNT_NOT_VERIFIED: "account_not_verified",
ERROR_MESSAGE_ACCOUNT_BLOCKED: "account_blocked",
ERROR_MESSAGE_INVALID_TOKEN: "invalid_token",
ERROR_MESSAGE_INVALID_CONFIRMATION_CODE: "invalid_confirmation_code",
ERROR_MESSAGE_PERMISSION_DENIED: "permission_denied",
ERROR_MESSAGE_INVALID_PERSON_KIND: "invalid_person_kind",
ERROR_MESSAGE_INVALID_CREDENTIALS: "invalid_credentials",
}
var Errors = Resource{}
func init() {
// CUSTOM_ERRORS
// Default Error Messages
Errors[ERROR_MESSAGE_INITIALIZE] = "initialize"
Errors[ERROR_MESSAGE_NOT_IMPLEMENTED] = "not_implemented"
Errors[ERROR_MESSAGE_OPERATION_FAILED] = "operation_failed"
Errors[ERROR_MESSAGE_OPERATION_NOT_SUPPORTED] = "operation_not_supported"
Errors[ERROR_MESSAGE_OPERATION_RUNNER_NOT_AVAILABLE] = "operation_runner_not_available"
Errors[ERROR_MESSAGE_OPERATION_PAYLOAD_NOT_SUPPORTED] = "operation_payload_not_supported"
Errors[ERROR_MESSAGE_UNRESOLVED_DEPENDENCIES] = "unresolved_dependencies"
Errors[ERROR_MESSAGE_SYSTEM_COMPONENT_NOT_FOUND] = "system_component_not_found"
Errors[ERROR_MESSAGE_DOCUMENT_NOT_FOUND] = "document_not_found"
Errors[ERROR_MESSAGE_SYSTEM_SCHEDULE_NOT_FOUND] = "system_schedule_not_found"
Errors[ERROR_MESSAGE_IDENTITY_NOT_FOUND] = "identity_not_found"
Errors[ERROR_MESSAGE_ACCESS_CONTROL_NOT_FOUND] = "access_control_not_found"
Errors[ERROR_MESSAGE_REMOTE_ACTIVITY_NOT_FOUND] = "remote_activity_not_found"
Errors[ERROR_MESSAGE_CATEGORY_TYPE_NOT_FOUND] = "category_type_not_found"
Errors[ERROR_MESSAGE_CATEGORY_NOT_FOUND] = "category_not_found"
Errors[ERROR_MESSAGE_USER_NOT_FOUND] = "user_not_found"
Errors[ERROR_MESSAGE_ACTIVITY_PUB_OBJECT_NOT_FOUND] = "activity_pub_object_not_found"
Errors[ERROR_MESSAGE_ACTIVITY_PUB_ACTIVITY_NOT_FOUND] = "activity_pub_activity_not_found"
Errors[ERROR_MESSAGE_ACTIVITY_PUB_PUBLIC_KEY_NOT_FOUND] = "activity_pub_public_key_not_found"
Errors[ERROR_MESSAGE_ACTIVITY_PUB_LINK_NOT_FOUND] = "activity_pub_link_not_found"
Errors[ERROR_MESSAGE_ACTIVITY_PUB_MEDIA_NOT_FOUND] = "activity_pub_media_not_found"
Errors[ERROR_MESSAGE_ACTIVITY_PUB_INCOMING_ACTIVITY_NOT_FOUND] = "activity_pub_incoming_activity_not_found"
Errors[ERROR_MESSAGE_ACTIVITY_PUB_OUTGOING_ACTIVITY_NOT_FOUND] = "activity_pub_outgoing_activity_not_found"
Errors[ERROR_MESSAGE_ACTIVITY_PUB_FOLLOWER_NOT_FOUND] = "activity_pub_follower_not_found"
Errors[ERROR_MESSAGE_SPI_NOT_FOUND] = "spi_not_found"
Errors[ERROR_MESSAGE_UNKNOWN_DOCUMENT] = "unknown_document"
Errors[ERROR_MESSAGE_UNKNOWN_SYSTEM_SCHEDULE] = "unknown_system_schedule"
Errors[ERROR_MESSAGE_UNKNOWN_IDENTITY] = "unknown_identity"
Errors[ERROR_MESSAGE_UNKNOWN_ACCESS_CONTROL] = "unknown_access_control"
Errors[ERROR_MESSAGE_UNKNOWN_REMOTE_ACTIVITY] = "unknown_remote_activity"
Errors[ERROR_MESSAGE_UNKNOWN_CATEGORY_TYPE] = "unknown_category_type"
Errors[ERROR_MESSAGE_UNKNOWN_CATEGORY] = "unknown_category"
Errors[ERROR_MESSAGE_UNKNOWN_USER] = "unknown_user"
Errors[ERROR_MESSAGE_UNKNOWN_ACTIVITY_PUB_OBJECT] = "unknown_activity_pub_object"
Errors[ERROR_MESSAGE_UNKNOWN_ACTIVITY_PUB_ACTIVITY] = "unknown_activity_pub_activity"
Errors[ERROR_MESSAGE_UNKNOWN_ACTIVITY_PUB_PUBLIC_KEY] = "unknown_activity_pub_public_key"
Errors[ERROR_MESSAGE_UNKNOWN_ACTIVITY_PUB_LINK] = "unknown_activity_pub_link"
Errors[ERROR_MESSAGE_UNKNOWN_ACTIVITY_PUB_MEDIA] = "unknown_activity_pub_media"
Errors[ERROR_MESSAGE_UNKNOWN_ACTIVITY_PUB_INCOMING_ACTIVITY] = "unknown_activity_pub_incoming_activity"
Errors[ERROR_MESSAGE_UNKNOWN_ACTIVITY_PUB_OUTGOING_ACTIVITY] = "unknown_activity_pub_outgoing_activity"
Errors[ERROR_MESSAGE_UNKNOWN_ACTIVITY_PUB_FOLLOWER] = "unknown_activity_pub_follower"
Errors[ERROR_MESSAGE_UNKNOWN_SPI] = "unknown_spi"
Errors[ERROR_MESSAGE_INVALID_ID] = "invalid_id"
Errors[ERROR_MESSAGE_INVALID_PARAMETERS] = "invalid_parameters"
Errors[ERROR_MESSAGE_INVALID_USERNAME_FOR_CHECK_USERNAME_AVAILABILITY] = "invalid_username"
Errors[ERROR_MESSAGE_INVALID_USERNAME_FOR_SIGNUP] = "invalid_username"
Errors[ERROR_MESSAGE_INVALID_EMAIL_FOR_SIGNUP] = "invalid_email"
Errors[ERROR_MESSAGE_INVALID_PASSWORD_FOR_SIGNUP] = "invalid_password"
Errors[ERROR_MESSAGE_INVALID_EMAIL_FOR_RESEND_VERIFICATION_CODE] = "invalid_email"
Errors[ERROR_MESSAGE_INVALID_EMAIL_FOR_VERIFY] = "invalid_email"
Errors[ERROR_MESSAGE_INVALID_EMAIL_FOR_LOGIN] = "invalid_email"
Errors[ERROR_MESSAGE_INVALID_PASSWORD_FOR_LOGIN] = "invalid_password"
Errors[ERROR_MESSAGE_INVALID_CURRENT_PASSWORD_FOR_CHANGE_PASSWORD] = "invalid_current_password"
Errors[ERROR_MESSAGE_INVALID_NEW_PASSWORD_FOR_CHANGE_PASSWORD] = "invalid_new_password"
Errors[ERROR_MESSAGE_INVALID_RESOURCE_FOR_WEBFINGER] = "invalid_resource"
Errors[ERROR_MESSAGE_DATA_INTEGRITY_VIOLATION] = "data_integrity_violation"
Errors[ERROR_MESSAGE_INVALID_STATE] = "invalid_state"
Errors[ERROR_MESSAGE_USER_NOT_REGISTERED] = "user_not_registered"
Errors[ERROR_MESSAGE_USERNAME_OR_EMAIL_ALREADY_REGISTERED] = "username_or_email_already_registered"
Errors[ERROR_MESSAGE_ACCOUNT_NOT_VERIFIED] = "account_not_verified"
Errors[ERROR_MESSAGE_ACCOUNT_BLOCKED] = "account_blocked"
Errors[ERROR_MESSAGE_INVALID_TOKEN] = "invalid_token"
Errors[ERROR_MESSAGE_INVALID_CONFIRMATION_CODE] = "invalid_confirmation_code"
Errors[ERROR_MESSAGE_PERMISSION_DENIED] = "permission_denied"
Errors[ERROR_MESSAGE_INVALID_PERSON_KIND] = "invalid_person_kind"
Errors[ERROR_MESSAGE_INVALID_CREDENTIALS] = "invalid_credentials"
// Overrides
Errors[ERROR_MESSAGE_DATA_INTEGRITY_VIOLATION] = "data_integrity_violation"
Errors[ERROR_MESSAGE_INVALID_PASSWORD_FOR_SIGNUP] = "Your password should be at least 7 characters long including uppercase and lowercase letters, numbers and special characters."
Errors[ERROR_MESSAGE_INVALID_PASSWORD_FOR_LOGIN] = "Your password should be at least 7 characters long including uppercase and lowercase letters, numbers and special characters."

Wyświetl plik

@ -1,7 +1,5 @@
package contracts
import . "github.com/xeronith/diamante/contracts/server"
// noinspection GoSnakeCaseUsage
const (
//SystemCallOperation
@ -100,53 +98,3 @@ const (
GET_INBOX_REQUEST = 0x4B8B9285
GET_INBOX_RESULT = 0x65835436
)
var OPCODES = Opcodes{
0x00000000: "N/A",
0x0541BD72: "ECHO",
0xAB2FF7D4: "Echo",
0xC89C311F: "GET_SERVER_CONFIGURATION",
0xA1A50921: "GetServerConfiguration",
0xA9501A55: "CHECK_USERNAME_AVAILABILITY",
0x067190FF: "CheckUsernameAvailability",
0x48DB23BF: "SIGNUP",
0x83D062B4: "Signup",
0x03373782: "RESEND_VERIFICATION_CODE",
0x6B101891: "ResendVerificationCode",
0x8B78F7F6: "VERIFY",
0x2C8A8A49: "Verify",
0xF480F151: "LOGIN",
0xBE819605: "Login",
0xEAB16E71: "GET_PROFILE_BY_USER",
0x8EECDE97: "GetProfileByUser",
0xC25AB0BA: "UPDATE_PROFILE_BY_USER",
0x678A8BAF: "UpdateProfileByUser",
0x926A5565: "CHANGE_PASSWORD",
0x521E68DF: "ChangePassword",
0xF4030036: "RESET_PASSWORD",
0x3D70F105: "ResetPassword",
0x447AFA34: "LOGOUT",
0x9412D17F: "Logout",
0x01FD357C: "WEBFINGER",
0xCC81EC52: "Webfinger",
0x157C555E: "GET_PACKAGES",
0x4CBD814E: "GetPackages",
0x5C4AC410: "GET_ACTOR",
0x136B82A8: "GetActor",
0xD30C2420: "FOLLOW_ACTOR",
0x30154D74: "FollowActor",
0x59EA7612: "AUTHORIZE_INTERACTION",
0xB38E936F: "AuthorizeInteraction",
0x3F20FD65: "GET_FOLLOWERS",
0x7F3E2EB5: "GetFollowers",
0xF9841DB9: "GET_FOLLOWING",
0xD707408F: "GetFollowing",
0x9E489553: "POST_TO_OUTBOX",
0xC6C56614: "PostToOutbox",
0x527B6997: "GET_OUTBOX",
0xF94E37A0: "GetOutbox",
0x7400C331: "POST_TO_INBOX",
0x5BD43D90: "PostToInbox",
0x4B8B9285: "GET_INBOX",
0x65835436: "GetInbox",
}

Wyświetl plik

@ -6,13 +6,14 @@ import (
"reflect"
"time"
. "github.com/reiver/greatape/components/api/protobuf"
. "github.com/reiver/greatape/components/contracts"
. "github.com/xeronith/diamante/client"
. "github.com/xeronith/diamante/contracts/client"
. "github.com/xeronith/diamante/contracts/logging"
. "github.com/xeronith/diamante/contracts/operation"
. "github.com/xeronith/diamante/contracts/system"
. "github.com/xeronith/diamante/protobuf"
. "github.com/xeronith/diamante/serialization"
. "github.com/xeronith/diamante/server"
)
@ -48,7 +49,7 @@ func NewApi(endpoint string, logger ILogger) IApi {
logger: logger,
}
api.client.SetBinaryOperationResultListener(api.handler)
api.client.SetOperationResultListener(api.handler)
return api
}
@ -63,7 +64,7 @@ func (api *api) SetDebugMode(enabled bool) {
func (api *api) call(operation uint64, payload Pointer) (Pointer, error) {
requestId := uint64(time.Now().UnixNano())
if api.debugMode {
api.logger.Debug(fmt.Sprintf("REQ { ID: %d, OP: %s }", requestId, OPCODES[operation]))
api.logger.Debug(fmt.Sprintf("REQ { ID: %d, OP: %d }", requestId, operation))
}
if err := api.client.Send(requestId, operation, payload); err != nil {
@ -72,13 +73,13 @@ func (api *api) call(operation uint64, payload Pointer) (Pointer, error) {
result := <-api.output
if result.isError {
return nil, errors.New(result.payload.(*Error).Message)
return nil, errors.New(result.payload.(*ServerError).Message)
}
return result.payload, nil
}
func (api *api) handler(bundle IBinaryOperationResult) {
func (api *api) handler(bundle IOperationResult) {
isError := false
var result Pointer
@ -89,14 +90,14 @@ func (api *api) handler(bundle IBinaryOperationResult) {
} else {
switch bundle.Type() {
case ERROR:
result = new(Error)
result = new(ServerError)
isError = true
default:
api.logger.Fatal("unregistered_result_type")
}
}
if err := DefaultBinarySerializer.Deserialize(bundle.Payload(), result); err != nil {
if err := NewProtobufSerializer().Deserialize(bundle.Payload(), result); err != nil {
api.logger.Fatal(err)
}

3
go.mod
Wyświetl plik

@ -8,7 +8,7 @@ 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.9.7
github.com/xeronith/diamante v1.15.2
google.golang.org/protobuf v1.28.1
)
@ -18,6 +18,7 @@ require (
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/go-faster/city v1.0.1 // indirect
github.com/gofrs/uuid v3.3.0+incompatible // indirect
github.com/golang-jwt/jwt v3.2.2+incompatible // indirect
github.com/gorilla/securecookie v1.1.1 // indirect

6
go.sum
Wyświetl plik

@ -13,6 +13,8 @@ github.com/go-ap/errors v0.0.0-20221205040414-01c1adfc98ea h1:ywGtLGVjJjMrq4mu35
github.com/go-ap/errors v0.0.0-20221205040414-01c1adfc98ea/go.mod h1:SaTNjEEkp0q+w3pUS1ccyEL/lUrHteORlDq/e21mCc8=
github.com/go-ap/jsonld v0.0.0-20221030091449-f2a191312c73 h1:GMKIYXyXPGIp+hYiWOhfqK4A023HdgisDT4YGgf99mw=
github.com/go-ap/jsonld v0.0.0-20221030091449-f2a191312c73/go.mod h1:jyveZeGw5LaADntW+UEsMjl3IlIwk+DxlYNsbofQkGA=
github.com/go-faster/city v1.0.1 h1:4WAxSZ3V2Ws4QRDrscLEDcibJY8uf41H6AhXDrNDcGw=
github.com/go-faster/city v1.0.1/go.mod h1:jKcUJId49qdW3L1qKHH/3wPeUstCVpVSXTM6vO3VcTw=
github.com/gofrs/uuid v3.3.0+incompatible h1:8K4tyRfvU1CYPgJsveYFQMhpFd/wXNM7iK6rR7UHz84=
github.com/gofrs/uuid v3.3.0+incompatible/go.mod h1:b2aQJv3Z4Fp6yNu3cdSllBxTCLRxnplIgP/c0N/04lM=
github.com/golang-jwt/jwt v3.2.2+incompatible h1:IfV12K8xAKAnZqdXVzCZ+TOjboZ2keLg81eXfW3O+oY=
@ -62,8 +64,8 @@ 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.9.7 h1:Z7zyJiJCE6y2GpJXw6sZ0sy6jS8tnntwbrLuyXBJhk4=
github.com/xeronith/diamante v1.9.7/go.mod h1:DSw8TsKcdU+Lg+cmgx8aDjRbu2NSOcJRQtialnKHoOU=
github.com/xeronith/diamante v1.15.2 h1:WQH6hzVEE6Rjcg3/ZepPC5LSbPXMNzYD1hHr5wEybOc=
github.com/xeronith/diamante v1.15.2/go.mod h1:7kgdoRJVrQvML7Z9BT6di3XU1o2eTeE0hbwy66dMOrA=
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=

Wyświetl plik

@ -39,7 +39,7 @@ func TestMain(main *testing.M) {
emailProvider := email.NewProvider(logger)
smsProvider := sms.NewProvider(logger)
if testServer, err := server.New(configuration, operationsFactory, handlersFactory, OPCODES); err != nil {
if testServer, err := server.New(configuration, operationsFactory, handlersFactory); err != nil {
logger.Fatal(err)
} else {
if err := repository.Initialize(configuration, logger); err != nil {