diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 0000000..aeea682 --- /dev/null +++ b/.gitmodules @@ -0,0 +1,6 @@ +[submodule "protos"] + path = protos + url = git@github.com:ShatteredRealms/protos.git +[submodule "api"] + path = api + url = git@github.com:ShatteredRealms/protos.git diff --git a/api b/api new file mode 160000 index 0000000..16ccc01 --- /dev/null +++ b/api @@ -0,0 +1 @@ +Subproject commit 16ccc0125ad7d73f999a231c74631e9b04157afc diff --git a/api/google/api/annotations.proto b/api/google/api/annotations.proto deleted file mode 100644 index 85c361b..0000000 --- a/api/google/api/annotations.proto +++ /dev/null @@ -1,31 +0,0 @@ -// Copyright (c) 2015, Google Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -syntax = "proto3"; - -package google.api; - -import "google/api/http.proto"; -import "google/protobuf/descriptor.proto"; - -option go_package = "google.golang.org/genproto/googleapis/api/annotations;annotations"; -option java_multiple_files = true; -option java_outer_classname = "AnnotationsProto"; -option java_package = "com.google.api"; -option objc_class_prefix = "GAPI"; - -extend google.protobuf.MethodOptions { - // See `HttpRule`. - HttpRule http = 72295728; -} diff --git a/api/google/api/http.proto b/api/google/api/http.proto deleted file mode 100644 index 5f8538a..0000000 --- a/api/google/api/http.proto +++ /dev/null @@ -1,291 +0,0 @@ -// Copyright 2016 Google Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -syntax = "proto3"; - -package google.api; - -option cc_enable_arenas = true; -option go_package = "google.golang.org/genproto/googleapis/api/annotations;annotations"; -option java_multiple_files = true; -option java_outer_classname = "HttpProto"; -option java_package = "com.google.api"; -option objc_class_prefix = "GAPI"; - - -// Defines the HTTP configuration for a service. It contains a list of -// [HttpRule][google.api.HttpRule], each specifying the mapping of an RPC method -// to one or more HTTP REST API methods. -message Http { - // A list of HTTP configuration rules that apply to individual API methods. - // - // **NOTE:** All service configuration rules follow "last one wins" order. - repeated HttpRule rules = 1; -} - -// `HttpRule` defines the mapping of an RPC method to one or more HTTP -// REST APIs. The mapping determines what portions of the request -// message are populated from the path, query parameters, or body of -// the HTTP request. The mapping is typically specified as an -// `google.api.http` annotation, see "google/api/annotations.proto" -// for details. -// -// The mapping consists of a field specifying the path template and -// method kind. The path template can refer to fields in the request -// message, as in the example below which describes a REST GET -// operation on a resource collection of messages: -// -// -// service Messaging { -// rpc GetMessage(GetMessageRequest) returns (Message) { -// option (google.api.http).get = "/v1/messages/{message_id}/{sub.subfield}"; -// } -// } -// message GetMessageRequest { -// message SubMessage { -// string subfield = 1; -// } -// string message_id = 1; // mapped to the URL -// SubMessage sub = 2; // `sub.subfield` is url-mapped -// } -// message Message { -// string text = 1; // content of the resource -// } -// -// The same http annotation can alternatively be expressed inside the -// `GRPC API Configuration` YAML file. -// -// http: -// rules: -// - selector: .Messaging.GetMessage -// get: /v1/messages/{message_id}/{sub.subfield} -// -// This definition enables an automatic, bidrectional mapping of HTTP -// JSON to RPC. Example: -// -// HTTP | RPC -// -----|----- -// `GET /v1/messages/123456/foo` | `GetMessage(message_id: "123456" sub: SubMessage(subfield: "foo"))` -// -// In general, not only fields but also field paths can be referenced -// from a path pattern. Fields mapped to the path pattern cannot be -// repeated and must have a primitive (non-message) type. -// -// Any fields in the request message which are not bound by the path -// pattern automatically become (optional) HTTP query -// parameters. Assume the following definition of the request message: -// -// -// message GetMessageRequest { -// message SubMessage { -// string subfield = 1; -// } -// string message_id = 1; // mapped to the URL -// int64 revision = 2; // becomes a parameter -// SubMessage sub = 3; // `sub.subfield` becomes a parameter -// } -// -// -// This enables a HTTP JSON to RPC mapping as below: -// -// HTTP | RPC -// -----|----- -// `GET /v1/messages/123456?revision=2&sub.subfield=foo` | `GetMessage(message_id: "123456" revision: 2 sub: SubMessage(subfield: "foo"))` -// -// Note that fields which are mapped to HTTP parameters must have a -// primitive type or a repeated primitive type. Message types are not -// allowed. In the case of a repeated type, the parameter can be -// repeated in the URL, as in `...?param=A¶m=B`. -// -// For HTTP method kinds which allow a request body, the `body` field -// specifies the mapping. Consider a REST update method on the -// message resource collection: -// -// -// service Messaging { -// rpc UpdateMessage(UpdateMessageRequest) returns (Message) { -// option (google.api.http) = { -// put: "/v1/messages/{message_id}" -// body: "message" -// }; -// } -// } -// message UpdateMessageRequest { -// string message_id = 1; // mapped to the URL -// Message message = 2; // mapped to the body -// } -// -// -// The following HTTP JSON to RPC mapping is enabled, where the -// representation of the JSON in the request body is determined by -// protos JSON encoding: -// -// HTTP | RPC -// -----|----- -// `PUT /v1/messages/123456 { "text": "Hi!" }` | `UpdateMessage(message_id: "123456" message { text: "Hi!" })` -// -// The special name `*` can be used in the body mapping to define that -// every field not bound by the path template should be mapped to the -// request body. This enables the following alternative definition of -// the update method: -// -// service Messaging { -// rpc UpdateMessage(Message) returns (Message) { -// option (google.api.http) = { -// put: "/v1/messages/{message_id}" -// body: "*" -// }; -// } -// } -// message Message { -// string message_id = 1; -// string text = 2; -// } -// -// -// The following HTTP JSON to RPC mapping is enabled: -// -// HTTP | RPC -// -----|----- -// `PUT /v1/messages/123456 { "text": "Hi!" }` | `UpdateMessage(message_id: "123456" text: "Hi!")` -// -// Note that when using `*` in the body mapping, it is not possible to -// have HTTP parameters, as all fields not bound by the path end in -// the body. This makes this option more rarely used in practice of -// defining REST APIs. The common usage of `*` is in custom methods -// which don't use the URL at all for transferring data. -// -// It is possible to define multiple HTTP methods for one RPC by using -// the `additional_bindings` option. Example: -// -// service Messaging { -// rpc GetMessage(GetMessageRequest) returns (Message) { -// option (google.api.http) = { -// get: "/v1/messages/{message_id}" -// additional_bindings { -// get: "/v1/users/{user_id}/messages/{message_id}" -// } -// }; -// } -// } -// message GetMessageRequest { -// string message_id = 1; -// string user_id = 2; -// } -// -// -// This enables the following two alternative HTTP JSON to RPC -// mappings: -// -// HTTP | RPC -// -----|----- -// `GET /v1/messages/123456` | `GetMessage(message_id: "123456")` -// `GET /v1/users/me/messages/123456` | `GetMessage(user_id: "me" message_id: "123456")` -// -// # Rules for HTTP mapping -// -// The rules for mapping HTTP path, query parameters, and body fields -// to the request message are as follows: -// -// 1. The `body` field specifies either `*` or a field path, or is -// omitted. If omitted, it assumes there is no HTTP body. -// 2. Leaf fields (recursive expansion of nested messages in the -// request) can be classified into three types: -// (a) Matched in the URL template. -// (b) Covered by body (if body is `*`, everything except (a) fields; -// else everything under the body field) -// (c) All other fields. -// 3. URL query parameters found in the HTTP request are mapped to (c) fields. -// 4. Any body sent with an HTTP request can contain only (b) fields. -// -// The syntax of the path template is as follows: -// -// Template = "/" Segments [ Verb ] ; -// Segments = Segment { "/" Segment } ; -// Segment = "*" | "**" | LITERAL | Variable ; -// Variable = "{" FieldPath [ "=" Segments ] "}" ; -// FieldPath = IDENT { "." IDENT } ; -// Verb = ":" LITERAL ; -// -// The syntax `*` matches a single path segment. It follows the semantics of -// [RFC 6570](https://tools.ietf.org/html/rfc6570) Section 3.2.2 Simple String -// Expansion. -// -// The syntax `**` matches zero or more path segments. It follows the semantics -// of [RFC 6570](https://tools.ietf.org/html/rfc6570) Section 3.2.3 Reserved -// Expansion. NOTE: it must be the last segment in the path except the Verb. -// -// The syntax `LITERAL` matches literal text in the URL path. -// -// The syntax `Variable` matches the entire path as specified by its template; -// this nested template must not contain further variables. If a variable -// matches a single path segment, its template may be omitted, e.g. `{var}` -// is equivalent to `{var=*}`. -// -// NOTE: the field paths in variables and in the `body` must not refer to -// repeated fields or map fields. -// -// Use CustomHttpPattern to specify any HTTP method that is not included in the -// `pattern` field, such as HEAD, or "*" to leave the HTTP method unspecified for -// a given URL path rule. The wild-card rule is useful for services that provide -// content to Web (HTML) clients. -message HttpRule { - // Selects methods to which this rule applies. - // - // Refer to [selector][google.api.DocumentationRule.selector] for syntax details. - string selector = 1; - - // Determines the URL pattern is matched by this rules. This pattern can be - // used with any of the {get|put|post|delete|patch} methods. A custom method - // can be defined using the 'custom' field. - oneof pattern { - // Used for listing and getting information about resources. - string get = 2; - - // Used for updating a resource. - string put = 3; - - // Used for creating a resource. - string post = 4; - - // Used for deleting a resource. - string delete = 5; - - // Used for updating a resource. - string patch = 6; - - // Custom pattern is used for defining custom verbs. - CustomHttpPattern custom = 8; - } - - // The name of the request field whose value is mapped to the HTTP body, or - // `*` for mapping all fields not captured by the path pattern to the HTTP - // body. NOTE: the referred field must not be a repeated field and must be - // present at the top-level of request message type. - string body = 7; - - // Additional HTTP bindings for the selector. Nested bindings must - // not contain an `additional_bindings` field themselves (that is, - // the nesting may only be one level deep). - repeated HttpRule additional_bindings = 11; -} - -// A custom pattern is used for defining custom HTTP verb. -message CustomHttpPattern { - // The name of this custom HTTP verb. - string kind = 1; - - // The path matched by this custom verb. - string path = 2; -} diff --git a/api/google/protobuf/empty.proto b/api/google/protobuf/empty.proto deleted file mode 100644 index b87c89d..0000000 --- a/api/google/protobuf/empty.proto +++ /dev/null @@ -1,51 +0,0 @@ -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// https://developers.google.com/protocol-buffers/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -syntax = "proto3"; - -package google.protobuf; - -option go_package = "google.golang.org/protobuf/types/known/emptypb"; -option java_package = "com.google.protobuf"; -option java_outer_classname = "EmptyProto"; -option java_multiple_files = true; -option objc_class_prefix = "GPB"; -option csharp_namespace = "Google.Protobuf.WellKnownTypes"; -option cc_enable_arenas = true; - -// A generic empty message that you can re-use to avoid defining duplicated -// empty messages in your APIs. A typical example is to use it as the request -// or the response type of an API method. For instance: -// -// service Foo { -// rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty); -// } -// -message Empty {} diff --git a/api/google/protobuf/wrappers.proto b/api/google/protobuf/wrappers.proto deleted file mode 100644 index 6c4b5ac..0000000 --- a/api/google/protobuf/wrappers.proto +++ /dev/null @@ -1,123 +0,0 @@ -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// https://developers.google.com/protocol-buffers/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Wrappers for primitive (non-message) types. These types are useful -// for embedding primitives in the `google.protobuf.Any` type and for places -// where we need to distinguish between the absence of a primitive -// typed field and its default value. -// -// These wrappers have no meaningful use within repeated fields as they lack -// the ability to detect presence on individual elements. -// These wrappers have no meaningful use within a map or a oneof since -// individual entries of a map or fields of a oneof can already detect presence. - -syntax = "proto3"; - -package google.protobuf; - -option cc_enable_arenas = true; -option go_package = "google.golang.org/protobuf/types/known/wrapperspb"; -option java_package = "com.google.protobuf"; -option java_outer_classname = "WrappersProto"; -option java_multiple_files = true; -option objc_class_prefix = "GPB"; -option csharp_namespace = "Google.Protobuf.WellKnownTypes"; - -// Wrapper message for `double`. -// -// The JSON representation for `DoubleValue` is JSON number. -message DoubleValue { - // The double value. - double value = 1; -} - -// Wrapper message for `float`. -// -// The JSON representation for `FloatValue` is JSON number. -message FloatValue { - // The float value. - float value = 1; -} - -// Wrapper message for `int64`. -// -// The JSON representation for `Int64Value` is JSON string. -message Int64Value { - // The int64 value. - int64 value = 1; -} - -// Wrapper message for `uint64`. -// -// The JSON representation for `UInt64Value` is JSON string. -message UInt64Value { - // The uint64 value. - uint64 value = 1; -} - -// Wrapper message for `int32`. -// -// The JSON representation for `Int32Value` is JSON number. -message Int32Value { - // The int32 value. - int32 value = 1; -} - -// Wrapper message for `uint32`. -// -// The JSON representation for `UInt32Value` is JSON number. -message UInt32Value { - // The uint32 value. - uint32 value = 1; -} - -// Wrapper message for `bool`. -// -// The JSON representation for `BoolValue` is JSON `true` and `false`. -message BoolValue { - // The bool value. - bool value = 1; -} - -// Wrapper message for `string`. -// -// The JSON representation for `StringValue` is JSON string. -message StringValue { - // The string value. - string value = 1; -} - -// Wrapper message for `bytes`. -// -// The JSON representation for `BytesValue` is JSON string. -message BytesValue { - // The bytes value. - bytes value = 1; -} \ No newline at end of file diff --git a/api/sro/bus.proto b/api/sro/bus.proto deleted file mode 100644 index cc2cb4e..0000000 --- a/api/sro/bus.proto +++ /dev/null @@ -1,23 +0,0 @@ -syntax = "proto3"; -package sro; -option go_package = "github.com/ShatteredRealms/go-common-service/pkg/pb;pb"; - -import "google/api/annotations.proto"; -import "google/protobuf/empty.proto"; - -service BusService { - rpc ResetReaderBus(BusTarget) returns (ResetBusResponse) { - option (google.api.http) = { - get : "/v1/bus/reset/reader" - }; - } - rpc ResetWriterBus(BusTarget) returns (ResetBusResponse) { - option (google.api.http) = { - get : "/v1/bus/reset/writer" - }; - } -} - -message BusTarget { string type = 1; } - -message ResetBusResponse { string message = 1; } diff --git a/api/sro/globals.proto b/api/sro/globals.proto deleted file mode 100644 index 197dd03..0000000 --- a/api/sro/globals.proto +++ /dev/null @@ -1,15 +0,0 @@ -syntax = "proto3"; -package sro; -option go_package = "github.com/ShatteredRealms/go-common-service/pkg/pb;pb"; - -message TargetId { string id = 1; } - -message Location { - string world = 1; - float x = 2; - float y = 3; - float z = 4; - float roll = 5; - float pitch = 6; - float yaw = 7; -} diff --git a/api/sro/health.proto b/api/sro/health.proto deleted file mode 100644 index 61b5ed3..0000000 --- a/api/sro/health.proto +++ /dev/null @@ -1,16 +0,0 @@ -syntax = "proto3"; -package sro; -option go_package = "github.com/ShatteredRealms/go-common-service/pkg/pb;pb"; - -import "google/api/annotations.proto"; -import "google/protobuf/empty.proto"; - -service HealthService { - rpc Health(google.protobuf.Empty) returns (HealthMessage) { - option (google.api.http) = { - get : "/v1/health" - }; - } -} - -message HealthMessage { string status = 1; } diff --git a/pkg/bus/character/characterbus/mocks/repository.go b/pkg/bus/character/characterbus/mocks/repository.go index 1122d7b..1df2a1d 100644 --- a/pkg/bus/character/characterbus/mocks/repository.go +++ b/pkg/bus/character/characterbus/mocks/repository.go @@ -1,9 +1,9 @@ // Code generated by MockGen. DO NOT EDIT. -// Source: /home/wil/dev/sro/go-common-service/pkg/bus/character/characterbus/repository.go +// Source: /home/wil/sro/go-common-service/pkg/bus/character/characterbus/repository.go // // Generated by this command: // -// mockgen -source=/home/wil/dev/sro/go-common-service/pkg/bus/character/characterbus/repository.go -destination=/home/wil/dev/sro/go-common-service/pkg/bus/character/characterbus/mocks/repository.go +// mockgen -source=/home/wil/sro/go-common-service/pkg/bus/character/characterbus/repository.go -destination=/home/wil/sro/go-common-service/pkg/bus/character/characterbus/mocks/repository.go // // Package mock_characterbus is a generated GoMock package. @@ -14,6 +14,7 @@ import ( reflect "reflect" characterbus "github.com/ShatteredRealms/go-common-service/pkg/bus/character/characterbus" + uuid "github.com/google/uuid" gomock "go.uber.org/mock/gomock" ) @@ -42,7 +43,7 @@ func (m *MockRepository) EXPECT() *MockRepositoryMockRecorder { } // Delete mocks base method. -func (m *MockRepository) Delete(ctx context.Context, id string) error { +func (m *MockRepository) Delete(ctx context.Context, id *uuid.UUID) error { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "Delete", ctx, id) ret0, _ := ret[0].(error) @@ -71,7 +72,7 @@ func (mr *MockRepositoryMockRecorder) GetAll(ctx any) *gomock.Call { } // GetById mocks base method. -func (m *MockRepository) GetById(ctx context.Context, characterId string) (*characterbus.Character, error) { +func (m *MockRepository) GetById(ctx context.Context, characterId *uuid.UUID) (*characterbus.Character, error) { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "GetById", ctx, characterId) ret0, _ := ret[0].(*characterbus.Character) @@ -86,7 +87,7 @@ func (mr *MockRepositoryMockRecorder) GetById(ctx, characterId any) *gomock.Call } // GetByOwnerId mocks base method. -func (m *MockRepository) GetByOwnerId(ctx context.Context, ownerId string) (*characterbus.Characters, error) { +func (m *MockRepository) GetByOwnerId(ctx context.Context, ownerId *uuid.UUID) (*characterbus.Characters, error) { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "GetByOwnerId", ctx, ownerId) ret0, _ := ret[0].(*characterbus.Characters) @@ -101,7 +102,7 @@ func (mr *MockRepositoryMockRecorder) GetByOwnerId(ctx, ownerId any) *gomock.Cal } // IsOwner mocks base method. -func (m *MockRepository) IsOwner(ctx context.Context, characterId, ownerId string) (bool, error) { +func (m *MockRepository) IsOwner(ctx context.Context, characterId, ownerId *uuid.UUID) (bool, error) { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "IsOwner", ctx, characterId, ownerId) ret0, _ := ret[0].(bool) diff --git a/pkg/bus/character/characterbus/mocks/service.go b/pkg/bus/character/characterbus/mocks/service.go index c6dc1dd..ddee20d 100644 --- a/pkg/bus/character/characterbus/mocks/service.go +++ b/pkg/bus/character/characterbus/mocks/service.go @@ -1,9 +1,9 @@ // Code generated by MockGen. DO NOT EDIT. -// Source: /home/wil/dev/sro/go-common-service/pkg/bus/character/characterbus/service.go +// Source: /home/wil/sro/go-common-service/pkg/bus/character/characterbus/service.go // // Generated by this command: // -// mockgen -source=/home/wil/dev/sro/go-common-service/pkg/bus/character/characterbus/service.go -destination=/home/wil/dev/sro/go-common-service/pkg/bus/character/characterbus/mocks/service.go +// mockgen -source=/home/wil/sro/go-common-service/pkg/bus/character/characterbus/service.go -destination=/home/wil/sro/go-common-service/pkg/bus/character/characterbus/mocks/service.go // // Package mock_characterbus is a generated GoMock package. diff --git a/pkg/bus/gameserver/dimensionbus/mocks/repository.go b/pkg/bus/gameserver/dimensionbus/mocks/repository.go index 0e62931..f63bc01 100644 --- a/pkg/bus/gameserver/dimensionbus/mocks/repository.go +++ b/pkg/bus/gameserver/dimensionbus/mocks/repository.go @@ -1,9 +1,9 @@ // Code generated by MockGen. DO NOT EDIT. -// Source: /home/wil/dev/sro/go-common-service/pkg/bus/gameserver/dimensionbus/repository.go +// Source: /home/wil/sro/go-common-service/pkg/bus/gameserver/dimensionbus/repository.go // // Generated by this command: // -// mockgen -source=/home/wil/dev/sro/go-common-service/pkg/bus/gameserver/dimensionbus/repository.go -destination=/home/wil/dev/sro/go-common-service/pkg/bus/gameserver/dimensionbus/mocks/repository.go +// mockgen -source=/home/wil/sro/go-common-service/pkg/bus/gameserver/dimensionbus/repository.go -destination=/home/wil/sro/go-common-service/pkg/bus/gameserver/dimensionbus/mocks/repository.go // // Package mock_dimensionbus is a generated GoMock package. @@ -14,6 +14,7 @@ import ( reflect "reflect" dimensionbus "github.com/ShatteredRealms/go-common-service/pkg/bus/gameserver/dimensionbus" + uuid "github.com/google/uuid" gomock "go.uber.org/mock/gomock" ) @@ -42,7 +43,7 @@ func (m *MockRepository) EXPECT() *MockRepositoryMockRecorder { } // Delete mocks base method. -func (m *MockRepository) Delete(ctx context.Context, id string) error { +func (m *MockRepository) Delete(ctx context.Context, id *uuid.UUID) error { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "Delete", ctx, id) ret0, _ := ret[0].(error) @@ -71,7 +72,7 @@ func (mr *MockRepositoryMockRecorder) GetAll(ctx any) *gomock.Call { } // GetById mocks base method. -func (m *MockRepository) GetById(ctx context.Context, dimensionId string) (*dimensionbus.Dimension, error) { +func (m *MockRepository) GetById(ctx context.Context, dimensionId *uuid.UUID) (*dimensionbus.Dimension, error) { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "GetById", ctx, dimensionId) ret0, _ := ret[0].(*dimensionbus.Dimension) diff --git a/pkg/bus/gameserver/dimensionbus/mocks/service.go b/pkg/bus/gameserver/dimensionbus/mocks/service.go index 509065d..2e76368 100644 --- a/pkg/bus/gameserver/dimensionbus/mocks/service.go +++ b/pkg/bus/gameserver/dimensionbus/mocks/service.go @@ -1,9 +1,9 @@ // Code generated by MockGen. DO NOT EDIT. -// Source: /home/wil/dev/sro/go-common-service/pkg/bus/gameserver/dimensionbus/service.go +// Source: /home/wil/sro/go-common-service/pkg/bus/gameserver/dimensionbus/service.go // // Generated by this command: // -// mockgen -source=/home/wil/dev/sro/go-common-service/pkg/bus/gameserver/dimensionbus/service.go -destination=/home/wil/dev/sro/go-common-service/pkg/bus/gameserver/dimensionbus/mocks/service.go +// mockgen -source=/home/wil/sro/go-common-service/pkg/bus/gameserver/dimensionbus/service.go -destination=/home/wil/sro/go-common-service/pkg/bus/gameserver/dimensionbus/mocks/service.go // // Package mock_dimensionbus is a generated GoMock package. diff --git a/pkg/bus/gameserver/mapbus/mocks/repository.go b/pkg/bus/gameserver/mapbus/mocks/repository.go index a947dcc..fad869c 100644 --- a/pkg/bus/gameserver/mapbus/mocks/repository.go +++ b/pkg/bus/gameserver/mapbus/mocks/repository.go @@ -1,9 +1,9 @@ // Code generated by MockGen. DO NOT EDIT. -// Source: /home/wil/dev/sro/go-common-service/pkg/bus/gameserver/mapbus/repository.go +// Source: /home/wil/sro/go-common-service/pkg/bus/gameserver/mapbus/repository.go // // Generated by this command: // -// mockgen -source=/home/wil/dev/sro/go-common-service/pkg/bus/gameserver/mapbus/repository.go -destination=/home/wil/dev/sro/go-common-service/pkg/bus/gameserver/mapbus/mocks/repository.go +// mockgen -source=/home/wil/sro/go-common-service/pkg/bus/gameserver/mapbus/repository.go -destination=/home/wil/sro/go-common-service/pkg/bus/gameserver/mapbus/mocks/repository.go // // Package mock_mapbus is a generated GoMock package. @@ -14,6 +14,7 @@ import ( reflect "reflect" mapbus "github.com/ShatteredRealms/go-common-service/pkg/bus/gameserver/mapbus" + uuid "github.com/google/uuid" gomock "go.uber.org/mock/gomock" ) @@ -42,7 +43,7 @@ func (m *MockRepository) EXPECT() *MockRepositoryMockRecorder { } // Delete mocks base method. -func (m *MockRepository) Delete(ctx context.Context, id string) error { +func (m *MockRepository) Delete(ctx context.Context, id *uuid.UUID) error { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "Delete", ctx, id) ret0, _ := ret[0].(error) @@ -71,7 +72,7 @@ func (mr *MockRepositoryMockRecorder) GetAll(ctx any) *gomock.Call { } // GetById mocks base method. -func (m *MockRepository) GetById(ctx context.Context, dimensionId string) (*mapbus.Map, error) { +func (m *MockRepository) GetById(ctx context.Context, dimensionId *uuid.UUID) (*mapbus.Map, error) { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "GetById", ctx, dimensionId) ret0, _ := ret[0].(*mapbus.Map) diff --git a/pkg/bus/gameserver/mapbus/mocks/service.go b/pkg/bus/gameserver/mapbus/mocks/service.go index 5253747..2a3847b 100644 --- a/pkg/bus/gameserver/mapbus/mocks/service.go +++ b/pkg/bus/gameserver/mapbus/mocks/service.go @@ -1,9 +1,9 @@ // Code generated by MockGen. DO NOT EDIT. -// Source: /home/wil/dev/sro/go-common-service/pkg/bus/gameserver/mapbus/service.go +// Source: /home/wil/sro/go-common-service/pkg/bus/gameserver/mapbus/service.go // // Generated by this command: // -// mockgen -source=/home/wil/dev/sro/go-common-service/pkg/bus/gameserver/mapbus/service.go -destination=/home/wil/dev/sro/go-common-service/pkg/bus/gameserver/mapbus/mocks/service.go +// mockgen -source=/home/wil/sro/go-common-service/pkg/bus/gameserver/mapbus/service.go -destination=/home/wil/sro/go-common-service/pkg/bus/gameserver/mapbus/mocks/service.go // // Package mock_mapbus is a generated GoMock package. diff --git a/pkg/bus/mocks/bus.go b/pkg/bus/mocks/bus.go index 52bd1f1..75ceecc 100644 --- a/pkg/bus/mocks/bus.go +++ b/pkg/bus/mocks/bus.go @@ -1,9 +1,9 @@ // Code generated by MockGen. DO NOT EDIT. -// Source: /home/wil/dev/sro/go-common-service/pkg/bus/bus.go +// Source: /home/wil/sro/go-common-service/pkg/bus/bus.go // // Generated by this command: // -// mockgen -source=/home/wil/dev/sro/go-common-service/pkg/bus/bus.go -destination=/home/wil/dev/sro/go-common-service/pkg/bus/mocks/bus.go +// mockgen -source=/home/wil/sro/go-common-service/pkg/bus/bus.go -destination=/home/wil/sro/go-common-service/pkg/bus/mocks/bus.go // // Package mock_bus is a generated GoMock package. @@ -268,6 +268,20 @@ func (mr *MockMessageBusReaderMockRecorder[T]) ProcessFailed() *gomock.Call { return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ProcessFailed", reflect.TypeOf((*MockMessageBusReader[T])(nil).ProcessFailed)) } +// ProcessSkipped mocks base method. +func (m *MockMessageBusReader[T]) ProcessSkipped(arg0 context.Context) error { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "ProcessSkipped", arg0) + ret0, _ := ret[0].(error) + return ret0 +} + +// ProcessSkipped indicates an expected call of ProcessSkipped. +func (mr *MockMessageBusReaderMockRecorder[T]) ProcessSkipped(arg0 any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ProcessSkipped", reflect.TypeOf((*MockMessageBusReader[T])(nil).ProcessSkipped), arg0) +} + // ProcessSucceeded mocks base method. func (m *MockMessageBusReader[T]) ProcessSucceeded(arg0 context.Context) error { m.ctrl.T.Helper() diff --git a/pkg/pb/bus.pb.go b/pkg/pb/bus.pb.go index 82ec845..9b17642 100644 --- a/pkg/pb/bus.pb.go +++ b/pkg/pb/bus.pb.go @@ -1,6 +1,6 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.35.2 +// protoc-gen-go v1.36.1 // protoc v3.21.12 // source: sro/bus.proto @@ -23,11 +23,10 @@ const ( ) type BusTarget struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache + state protoimpl.MessageState `protogen:"open.v1"` + Type string `protobuf:"bytes,1,opt,name=type,proto3" json:"type,omitempty"` unknownFields protoimpl.UnknownFields - - Type string `protobuf:"bytes,1,opt,name=type,proto3" json:"type,omitempty"` + sizeCache protoimpl.SizeCache } func (x *BusTarget) Reset() { @@ -68,11 +67,10 @@ func (x *BusTarget) GetType() string { } type ResetBusResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache + state protoimpl.MessageState `protogen:"open.v1"` + Message string `protobuf:"bytes,1,opt,name=message,proto3" json:"message,omitempty"` unknownFields protoimpl.UnknownFields - - Message string `protobuf:"bytes,1,opt,name=message,proto3" json:"message,omitempty"` + sizeCache protoimpl.SizeCache } func (x *ResetBusResponse) Reset() { diff --git a/pkg/pb/filter.pb.go b/pkg/pb/filter.pb.go new file mode 100644 index 0000000..27dacd9 --- /dev/null +++ b/pkg/pb/filter.pb.go @@ -0,0 +1,137 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.36.1 +// protoc v3.21.12 +// source: sro/filter.proto + +package pb + +import ( + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +type QueryFilters struct { + state protoimpl.MessageState `protogen:"open.v1"` + Count int32 `protobuf:"varint,1,opt,name=count,proto3" json:"count,omitempty"` + Offset int32 `protobuf:"varint,2,opt,name=offset,proto3" json:"offset,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *QueryFilters) Reset() { + *x = QueryFilters{} + mi := &file_sro_filter_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *QueryFilters) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*QueryFilters) ProtoMessage() {} + +func (x *QueryFilters) ProtoReflect() protoreflect.Message { + mi := &file_sro_filter_proto_msgTypes[0] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use QueryFilters.ProtoReflect.Descriptor instead. +func (*QueryFilters) Descriptor() ([]byte, []int) { + return file_sro_filter_proto_rawDescGZIP(), []int{0} +} + +func (x *QueryFilters) GetCount() int32 { + if x != nil { + return x.Count + } + return 0 +} + +func (x *QueryFilters) GetOffset() int32 { + if x != nil { + return x.Offset + } + return 0 +} + +var File_sro_filter_proto protoreflect.FileDescriptor + +var file_sro_filter_proto_rawDesc = []byte{ + 0x0a, 0x10, 0x73, 0x72, 0x6f, 0x2f, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x2e, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x12, 0x03, 0x73, 0x72, 0x6f, 0x22, 0x3c, 0x0a, 0x0c, 0x51, 0x75, 0x65, 0x72, 0x79, + 0x46, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x73, 0x12, 0x14, 0x0a, 0x05, 0x63, 0x6f, 0x75, 0x6e, 0x74, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x16, 0x0a, + 0x06, 0x6f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x6f, + 0x66, 0x66, 0x73, 0x65, 0x74, 0x42, 0x38, 0x5a, 0x36, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, + 0x63, 0x6f, 0x6d, 0x2f, 0x53, 0x68, 0x61, 0x74, 0x74, 0x65, 0x72, 0x65, 0x64, 0x52, 0x65, 0x61, + 0x6c, 0x6d, 0x73, 0x2f, 0x67, 0x6f, 0x2d, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2d, 0x73, 0x65, + 0x72, 0x76, 0x69, 0x63, 0x65, 0x2f, 0x70, 0x6b, 0x67, 0x2f, 0x70, 0x62, 0x3b, 0x70, 0x62, 0x62, + 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_sro_filter_proto_rawDescOnce sync.Once + file_sro_filter_proto_rawDescData = file_sro_filter_proto_rawDesc +) + +func file_sro_filter_proto_rawDescGZIP() []byte { + file_sro_filter_proto_rawDescOnce.Do(func() { + file_sro_filter_proto_rawDescData = protoimpl.X.CompressGZIP(file_sro_filter_proto_rawDescData) + }) + return file_sro_filter_proto_rawDescData +} + +var file_sro_filter_proto_msgTypes = make([]protoimpl.MessageInfo, 1) +var file_sro_filter_proto_goTypes = []any{ + (*QueryFilters)(nil), // 0: sro.QueryFilters +} +var file_sro_filter_proto_depIdxs = []int32{ + 0, // [0:0] is the sub-list for method output_type + 0, // [0:0] is the sub-list for method input_type + 0, // [0:0] is the sub-list for extension type_name + 0, // [0:0] is the sub-list for extension extendee + 0, // [0:0] is the sub-list for field type_name +} + +func init() { file_sro_filter_proto_init() } +func file_sro_filter_proto_init() { + if File_sro_filter_proto != nil { + return + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_sro_filter_proto_rawDesc, + NumEnums: 0, + NumMessages: 1, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_sro_filter_proto_goTypes, + DependencyIndexes: file_sro_filter_proto_depIdxs, + MessageInfos: file_sro_filter_proto_msgTypes, + }.Build() + File_sro_filter_proto = out.File + file_sro_filter_proto_rawDesc = nil + file_sro_filter_proto_goTypes = nil + file_sro_filter_proto_depIdxs = nil +} diff --git a/pkg/pb/globals.pb.go b/pkg/pb/globals.pb.go index a198286..b2337f3 100644 --- a/pkg/pb/globals.pb.go +++ b/pkg/pb/globals.pb.go @@ -1,6 +1,6 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.35.2 +// protoc-gen-go v1.36.1 // protoc v3.21.12 // source: sro/globals.proto @@ -21,11 +21,10 @@ const ( ) type TargetId struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache + state protoimpl.MessageState `protogen:"open.v1"` + Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` unknownFields protoimpl.UnknownFields - - Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` + sizeCache protoimpl.SizeCache } func (x *TargetId) Reset() { @@ -66,17 +65,16 @@ func (x *TargetId) GetId() string { } type Location struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache + state protoimpl.MessageState `protogen:"open.v1"` + World string `protobuf:"bytes,1,opt,name=world,proto3" json:"world,omitempty"` + X float32 `protobuf:"fixed32,2,opt,name=x,proto3" json:"x,omitempty"` + Y float32 `protobuf:"fixed32,3,opt,name=y,proto3" json:"y,omitempty"` + Z float32 `protobuf:"fixed32,4,opt,name=z,proto3" json:"z,omitempty"` + Roll float32 `protobuf:"fixed32,5,opt,name=roll,proto3" json:"roll,omitempty"` + Pitch float32 `protobuf:"fixed32,6,opt,name=pitch,proto3" json:"pitch,omitempty"` + Yaw float32 `protobuf:"fixed32,7,opt,name=yaw,proto3" json:"yaw,omitempty"` unknownFields protoimpl.UnknownFields - - World string `protobuf:"bytes,1,opt,name=world,proto3" json:"world,omitempty"` - X float32 `protobuf:"fixed32,2,opt,name=x,proto3" json:"x,omitempty"` - Y float32 `protobuf:"fixed32,3,opt,name=y,proto3" json:"y,omitempty"` - Z float32 `protobuf:"fixed32,4,opt,name=z,proto3" json:"z,omitempty"` - Roll float32 `protobuf:"fixed32,5,opt,name=roll,proto3" json:"roll,omitempty"` - Pitch float32 `protobuf:"fixed32,6,opt,name=pitch,proto3" json:"pitch,omitempty"` - Yaw float32 `protobuf:"fixed32,7,opt,name=yaw,proto3" json:"yaw,omitempty"` + sizeCache protoimpl.SizeCache } func (x *Location) Reset() { diff --git a/pkg/pb/health.pb.go b/pkg/pb/health.pb.go index 7ccb64d..894e619 100644 --- a/pkg/pb/health.pb.go +++ b/pkg/pb/health.pb.go @@ -1,6 +1,6 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.35.2 +// protoc-gen-go v1.36.1 // protoc v3.21.12 // source: sro/health.proto @@ -23,11 +23,10 @@ const ( ) type HealthMessage struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache + state protoimpl.MessageState `protogen:"open.v1"` + Status string `protobuf:"bytes,1,opt,name=status,proto3" json:"status,omitempty"` unknownFields protoimpl.UnknownFields - - Status string `protobuf:"bytes,1,opt,name=status,proto3" json:"status,omitempty"` + sizeCache protoimpl.SizeCache } func (x *HealthMessage) Reset() { diff --git a/pkg/pb/mocks/bus_grpc.pb.go b/pkg/pb/mocks/bus_grpc.pb.go index 9c80ae9..02312a6 100644 --- a/pkg/pb/mocks/bus_grpc.pb.go +++ b/pkg/pb/mocks/bus_grpc.pb.go @@ -1,9 +1,9 @@ // Code generated by MockGen. DO NOT EDIT. -// Source: /home/wil/dev/sro/go-common-service/pkg/pb/bus_grpc.pb.go +// Source: /home/wil/sro/go-common-service/pkg/pb/bus_grpc.pb.go // // Generated by this command: // -// mockgen -source=/home/wil/dev/sro/go-common-service/pkg/pb/bus_grpc.pb.go -destination=/home/wil/dev/sro/go-common-service/pkg/pb/mocks/bus_grpc.pb.go +// mockgen -source=/home/wil/sro/go-common-service/pkg/pb/bus_grpc.pb.go -destination=/home/wil/sro/go-common-service/pkg/pb/mocks/bus_grpc.pb.go // // Package mock_pb is a generated GoMock package. diff --git a/pkg/pb/mocks/health_grpc.pb.go b/pkg/pb/mocks/health_grpc.pb.go index 7fd4ce6..ffdfb04 100644 --- a/pkg/pb/mocks/health_grpc.pb.go +++ b/pkg/pb/mocks/health_grpc.pb.go @@ -1,9 +1,9 @@ // Code generated by MockGen. DO NOT EDIT. -// Source: /home/wil/dev/sro/go-common-service/pkg/pb/health_grpc.pb.go +// Source: /home/wil/sro/go-common-service/pkg/pb/health_grpc.pb.go // // Generated by this command: // -// mockgen -source=/home/wil/dev/sro/go-common-service/pkg/pb/health_grpc.pb.go -destination=/home/wil/dev/sro/go-common-service/pkg/pb/mocks/health_grpc.pb.go +// mockgen -source=/home/wil/sro/go-common-service/pkg/pb/health_grpc.pb.go -destination=/home/wil/sro/go-common-service/pkg/pb/mocks/health_grpc.pb.go // // Package mock_pb is a generated GoMock package. diff --git a/protos b/protos new file mode 160000 index 0000000..16ccc01 --- /dev/null +++ b/protos @@ -0,0 +1 @@ +Subproject commit 16ccc0125ad7d73f999a231c74631e9b04157afc