diff --git a/proto/Proto/Common.cs b/proto/Proto/Common.cs new file mode 100644 index 0000000..e5a1226 --- /dev/null +++ b/proto/Proto/Common.cs @@ -0,0 +1,2196 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: common.proto +#pragma warning disable 1591, 0612, 3021 +#region Designer generated code + +using pb = global::Google.Protobuf; +using pbc = global::Google.Protobuf.Collections; +using pbr = global::Google.Protobuf.Reflection; +using scg = global::System.Collections.Generic; +namespace Message { + + /// Holder for reflection information generated from common.proto + public static partial class CommonReflection { + + #region Descriptor + /// File descriptor for common.proto + public static pbr::FileDescriptor Descriptor { + get { return descriptor; } + } + private static pbr::FileDescriptor descriptor; + + static CommonReflection() { + byte[] descriptorData = global::System.Convert.FromBase64String( + string.Concat( + "Cgxjb21tb24ucHJvdG8SB21lc3NhZ2UaDW1zZ3R5cGUucHJvdG8iJQoFTG9n", + "aW4SDQoFQXBwSWQYASABKAkSDQoFVG9rZW4YAiABKAkiYQoLTG9naW5SZXN1", + "bHQSIwoGUmVzdWx0GAEgASgOMhMubWVzc2FnZS5FUlJPUl9DT0RFEg4KBlJv", + "b21JZBgCIAEoCRILCgNVSUQYAyABKAkSEAoITmlja05hbWUYBCABKAkiCwoJ", + "UGxheVN0YXJ0IjYKD1BsYXlTdGFydFJlc3VsdBIjCgZSZXN1bHQYASABKA4y", + "Ey5tZXNzYWdlLkVSUk9SX0NPREUiCQoHUGxheUVuZCI0Cg1QbGF5RW5kUmVz", + "dWx0EiMKBlJlc3VsdBgBIAEoDjITLm1lc3NhZ2UuRVJST1JfQ09ERSIrCgZS", + "ZXBvcnQSIQoESW5mbxgBIAMoCzITLm1lc3NhZ2UuUmVwb3J0SW5mbyIzCgxS", + "ZXBvcnRSZXN1bHQSIwoGUmVzdWx0GAEgASgOMhMubWVzc2FnZS5FUlJPUl9D", + "T0RFIhsKB0dldFJhbmsSEAoIVG9wQ291bnQYASABKAUiVwoNR2V0UmFua1Jl", + "c3VsdBIjCgZSZXN1bHQYASABKA4yEy5tZXNzYWdlLkVSUk9SX0NPREUSIQoE", + "SW5mbxgCIAMoCzITLm1lc3NhZ2UuUmVwb3J0SW5mbyI4ChFOb3RpZnlOZXdB", + "dWRpZW5jZRIjCghBdWRpZW5jZRgBIAEoCzIRLm1lc3NhZ2UuQXVkaWVuY2Ui", + "aQoUTm90aWZ5QXVkaWVuY2VBY3Rpb24SDgoGT3BlbklkGAEgASgJEg8KB0Nv", + "bnRlbnQYAiABKAkSDwoHTGlrZU51bRgDIAEoBRIOCgZHaWZ0SWQYBCABKAkS", + "DwoHR2lmdE51bRgFIAEoBSIrCgpSZXBvcnRJbmZvEg4KBk9wZW5JZBgBIAEo", + "CRINCgVTY29yZRgCIAEoBSI/CghBdWRpZW5jZRIOCgZPcGVuSWQYASABKAkS", + "EAoITmlja05hbWUYAiABKAkSEQoJQXZhdGFyVXJsGAMgASgJIkwKCFJhbmtJ", + "bmZvEiMKCEF1ZGllbmNlGAEgASgLMhEubWVzc2FnZS5BdWRpZW5jZRIMCgRS", + "YW5rGAIgASgFEg0KBVNjb3JlGAMgASgFQgVaA3BiL2IGcHJvdG8z")); + descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData, + new pbr::FileDescriptor[] { global::Message.MsgtypeReflection.Descriptor, }, + new pbr::GeneratedClrTypeInfo(null, new pbr::GeneratedClrTypeInfo[] { + new pbr::GeneratedClrTypeInfo(typeof(global::Message.Login), global::Message.Login.Parser, new[]{ "AppId", "Token" }, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::Message.LoginResult), global::Message.LoginResult.Parser, new[]{ "Result", "RoomId", "UID", "NickName" }, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::Message.PlayStart), global::Message.PlayStart.Parser, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::Message.PlayStartResult), global::Message.PlayStartResult.Parser, new[]{ "Result" }, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::Message.PlayEnd), global::Message.PlayEnd.Parser, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::Message.PlayEndResult), global::Message.PlayEndResult.Parser, new[]{ "Result" }, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::Message.Report), global::Message.Report.Parser, new[]{ "Info" }, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::Message.ReportResult), global::Message.ReportResult.Parser, new[]{ "Result" }, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::Message.GetRank), global::Message.GetRank.Parser, new[]{ "TopCount" }, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::Message.GetRankResult), global::Message.GetRankResult.Parser, new[]{ "Result", "Info" }, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::Message.NotifyNewAudience), global::Message.NotifyNewAudience.Parser, new[]{ "Audience" }, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::Message.NotifyAudienceAction), global::Message.NotifyAudienceAction.Parser, new[]{ "OpenId", "Content", "LikeNum", "GiftId", "GiftNum" }, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::Message.ReportInfo), global::Message.ReportInfo.Parser, new[]{ "OpenId", "Score" }, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::Message.Audience), global::Message.Audience.Parser, new[]{ "OpenId", "NickName", "AvatarUrl" }, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::Message.RankInfo), global::Message.RankInfo.Parser, new[]{ "Audience", "Rank", "Score" }, null, null, null) + })); + } + #endregion + + } + #region Messages + public sealed partial class Login : pb::IMessage { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new Login()); + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pbr::MessageDescriptor Descriptor { + get { return global::Message.CommonReflection.Descriptor.MessageTypes[0]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public Login() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public Login(Login other) : this() { + appId_ = other.appId_; + token_ = other.token_; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public Login Clone() { + return new Login(this); + } + + /// Field number for the "AppId" field. + public const int AppIdFieldNumber = 1; + private string appId_ = ""; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public string AppId { + get { return appId_; } + set { + appId_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + } + } + + /// Field number for the "Token" field. + public const int TokenFieldNumber = 2; + private string token_ = ""; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public string Token { + get { return token_; } + set { + token_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override bool Equals(object other) { + return Equals(other as Login); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public bool Equals(Login other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (AppId != other.AppId) return false; + if (Token != other.Token) return false; + return true; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override int GetHashCode() { + int hash = 1; + if (AppId.Length != 0) hash ^= AppId.GetHashCode(); + if (Token.Length != 0) hash ^= Token.GetHashCode(); + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void WriteTo(pb::CodedOutputStream output) { + if (AppId.Length != 0) { + output.WriteRawTag(10); + output.WriteString(AppId); + } + if (Token.Length != 0) { + output.WriteRawTag(18); + output.WriteString(Token); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int CalculateSize() { + int size = 0; + if (AppId.Length != 0) { + size += 1 + pb::CodedOutputStream.ComputeStringSize(AppId); + } + if (Token.Length != 0) { + size += 1 + pb::CodedOutputStream.ComputeStringSize(Token); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(Login other) { + if (other == null) { + return; + } + if (other.AppId.Length != 0) { + AppId = other.AppId; + } + if (other.Token.Length != 0) { + Token = other.Token; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(pb::CodedInputStream input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + input.SkipLastField(); + break; + case 10: { + AppId = input.ReadString(); + break; + } + case 18: { + Token = input.ReadString(); + break; + } + } + } + } + + } + + public sealed partial class LoginResult : pb::IMessage { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new LoginResult()); + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pbr::MessageDescriptor Descriptor { + get { return global::Message.CommonReflection.Descriptor.MessageTypes[1]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public LoginResult() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public LoginResult(LoginResult other) : this() { + result_ = other.result_; + roomId_ = other.roomId_; + uID_ = other.uID_; + nickName_ = other.nickName_; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public LoginResult Clone() { + return new LoginResult(this); + } + + /// Field number for the "Result" field. + public const int ResultFieldNumber = 1; + private global::Message.ERROR_CODE result_ = 0; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public global::Message.ERROR_CODE Result { + get { return result_; } + set { + result_ = value; + } + } + + /// Field number for the "RoomId" field. + public const int RoomIdFieldNumber = 2; + private string roomId_ = ""; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public string RoomId { + get { return roomId_; } + set { + roomId_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + } + } + + /// Field number for the "UID" field. + public const int UIDFieldNumber = 3; + private string uID_ = ""; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public string UID { + get { return uID_; } + set { + uID_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + } + } + + /// Field number for the "NickName" field. + public const int NickNameFieldNumber = 4; + private string nickName_ = ""; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public string NickName { + get { return nickName_; } + set { + nickName_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override bool Equals(object other) { + return Equals(other as LoginResult); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public bool Equals(LoginResult other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (Result != other.Result) return false; + if (RoomId != other.RoomId) return false; + if (UID != other.UID) return false; + if (NickName != other.NickName) return false; + return true; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override int GetHashCode() { + int hash = 1; + if (Result != 0) hash ^= Result.GetHashCode(); + if (RoomId.Length != 0) hash ^= RoomId.GetHashCode(); + if (UID.Length != 0) hash ^= UID.GetHashCode(); + if (NickName.Length != 0) hash ^= NickName.GetHashCode(); + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void WriteTo(pb::CodedOutputStream output) { + if (Result != 0) { + output.WriteRawTag(8); + output.WriteEnum((int) Result); + } + if (RoomId.Length != 0) { + output.WriteRawTag(18); + output.WriteString(RoomId); + } + if (UID.Length != 0) { + output.WriteRawTag(26); + output.WriteString(UID); + } + if (NickName.Length != 0) { + output.WriteRawTag(34); + output.WriteString(NickName); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int CalculateSize() { + int size = 0; + if (Result != 0) { + size += 1 + pb::CodedOutputStream.ComputeEnumSize((int) Result); + } + if (RoomId.Length != 0) { + size += 1 + pb::CodedOutputStream.ComputeStringSize(RoomId); + } + if (UID.Length != 0) { + size += 1 + pb::CodedOutputStream.ComputeStringSize(UID); + } + if (NickName.Length != 0) { + size += 1 + pb::CodedOutputStream.ComputeStringSize(NickName); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(LoginResult other) { + if (other == null) { + return; + } + if (other.Result != 0) { + Result = other.Result; + } + if (other.RoomId.Length != 0) { + RoomId = other.RoomId; + } + if (other.UID.Length != 0) { + UID = other.UID; + } + if (other.NickName.Length != 0) { + NickName = other.NickName; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(pb::CodedInputStream input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + input.SkipLastField(); + break; + case 8: { + result_ = (global::Message.ERROR_CODE) input.ReadEnum(); + break; + } + case 18: { + RoomId = input.ReadString(); + break; + } + case 26: { + UID = input.ReadString(); + break; + } + case 34: { + NickName = input.ReadString(); + break; + } + } + } + } + + } + + public sealed partial class PlayStart : pb::IMessage { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new PlayStart()); + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pbr::MessageDescriptor Descriptor { + get { return global::Message.CommonReflection.Descriptor.MessageTypes[2]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public PlayStart() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public PlayStart(PlayStart other) : this() { + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public PlayStart Clone() { + return new PlayStart(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override bool Equals(object other) { + return Equals(other as PlayStart); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public bool Equals(PlayStart other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + return true; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override int GetHashCode() { + int hash = 1; + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void WriteTo(pb::CodedOutputStream output) { + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int CalculateSize() { + int size = 0; + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(PlayStart other) { + if (other == null) { + return; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(pb::CodedInputStream input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + input.SkipLastField(); + break; + } + } + } + + } + + public sealed partial class PlayStartResult : pb::IMessage { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new PlayStartResult()); + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pbr::MessageDescriptor Descriptor { + get { return global::Message.CommonReflection.Descriptor.MessageTypes[3]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public PlayStartResult() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public PlayStartResult(PlayStartResult other) : this() { + result_ = other.result_; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public PlayStartResult Clone() { + return new PlayStartResult(this); + } + + /// Field number for the "Result" field. + public const int ResultFieldNumber = 1; + private global::Message.ERROR_CODE result_ = 0; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public global::Message.ERROR_CODE Result { + get { return result_; } + set { + result_ = value; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override bool Equals(object other) { + return Equals(other as PlayStartResult); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public bool Equals(PlayStartResult other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (Result != other.Result) return false; + return true; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override int GetHashCode() { + int hash = 1; + if (Result != 0) hash ^= Result.GetHashCode(); + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void WriteTo(pb::CodedOutputStream output) { + if (Result != 0) { + output.WriteRawTag(8); + output.WriteEnum((int) Result); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int CalculateSize() { + int size = 0; + if (Result != 0) { + size += 1 + pb::CodedOutputStream.ComputeEnumSize((int) Result); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(PlayStartResult other) { + if (other == null) { + return; + } + if (other.Result != 0) { + Result = other.Result; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(pb::CodedInputStream input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + input.SkipLastField(); + break; + case 8: { + result_ = (global::Message.ERROR_CODE) input.ReadEnum(); + break; + } + } + } + } + + } + + public sealed partial class PlayEnd : pb::IMessage { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new PlayEnd()); + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pbr::MessageDescriptor Descriptor { + get { return global::Message.CommonReflection.Descriptor.MessageTypes[4]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public PlayEnd() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public PlayEnd(PlayEnd other) : this() { + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public PlayEnd Clone() { + return new PlayEnd(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override bool Equals(object other) { + return Equals(other as PlayEnd); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public bool Equals(PlayEnd other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + return true; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override int GetHashCode() { + int hash = 1; + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void WriteTo(pb::CodedOutputStream output) { + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int CalculateSize() { + int size = 0; + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(PlayEnd other) { + if (other == null) { + return; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(pb::CodedInputStream input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + input.SkipLastField(); + break; + } + } + } + + } + + public sealed partial class PlayEndResult : pb::IMessage { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new PlayEndResult()); + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pbr::MessageDescriptor Descriptor { + get { return global::Message.CommonReflection.Descriptor.MessageTypes[5]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public PlayEndResult() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public PlayEndResult(PlayEndResult other) : this() { + result_ = other.result_; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public PlayEndResult Clone() { + return new PlayEndResult(this); + } + + /// Field number for the "Result" field. + public const int ResultFieldNumber = 1; + private global::Message.ERROR_CODE result_ = 0; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public global::Message.ERROR_CODE Result { + get { return result_; } + set { + result_ = value; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override bool Equals(object other) { + return Equals(other as PlayEndResult); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public bool Equals(PlayEndResult other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (Result != other.Result) return false; + return true; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override int GetHashCode() { + int hash = 1; + if (Result != 0) hash ^= Result.GetHashCode(); + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void WriteTo(pb::CodedOutputStream output) { + if (Result != 0) { + output.WriteRawTag(8); + output.WriteEnum((int) Result); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int CalculateSize() { + int size = 0; + if (Result != 0) { + size += 1 + pb::CodedOutputStream.ComputeEnumSize((int) Result); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(PlayEndResult other) { + if (other == null) { + return; + } + if (other.Result != 0) { + Result = other.Result; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(pb::CodedInputStream input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + input.SkipLastField(); + break; + case 8: { + result_ = (global::Message.ERROR_CODE) input.ReadEnum(); + break; + } + } + } + } + + } + + public sealed partial class Report : pb::IMessage { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new Report()); + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pbr::MessageDescriptor Descriptor { + get { return global::Message.CommonReflection.Descriptor.MessageTypes[6]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public Report() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public Report(Report other) : this() { + info_ = other.info_.Clone(); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public Report Clone() { + return new Report(this); + } + + /// Field number for the "Info" field. + public const int InfoFieldNumber = 1; + private static readonly pb::FieldCodec _repeated_info_codec + = pb::FieldCodec.ForMessage(10, global::Message.ReportInfo.Parser); + private readonly pbc::RepeatedField info_ = new pbc::RepeatedField(); + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public pbc::RepeatedField Info { + get { return info_; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override bool Equals(object other) { + return Equals(other as Report); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public bool Equals(Report other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if(!info_.Equals(other.info_)) return false; + return true; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override int GetHashCode() { + int hash = 1; + hash ^= info_.GetHashCode(); + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void WriteTo(pb::CodedOutputStream output) { + info_.WriteTo(output, _repeated_info_codec); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int CalculateSize() { + int size = 0; + size += info_.CalculateSize(_repeated_info_codec); + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(Report other) { + if (other == null) { + return; + } + info_.Add(other.info_); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(pb::CodedInputStream input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + input.SkipLastField(); + break; + case 10: { + info_.AddEntriesFrom(input, _repeated_info_codec); + break; + } + } + } + } + + } + + public sealed partial class ReportResult : pb::IMessage { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new ReportResult()); + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pbr::MessageDescriptor Descriptor { + get { return global::Message.CommonReflection.Descriptor.MessageTypes[7]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public ReportResult() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public ReportResult(ReportResult other) : this() { + result_ = other.result_; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public ReportResult Clone() { + return new ReportResult(this); + } + + /// Field number for the "Result" field. + public const int ResultFieldNumber = 1; + private global::Message.ERROR_CODE result_ = 0; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public global::Message.ERROR_CODE Result { + get { return result_; } + set { + result_ = value; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override bool Equals(object other) { + return Equals(other as ReportResult); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public bool Equals(ReportResult other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (Result != other.Result) return false; + return true; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override int GetHashCode() { + int hash = 1; + if (Result != 0) hash ^= Result.GetHashCode(); + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void WriteTo(pb::CodedOutputStream output) { + if (Result != 0) { + output.WriteRawTag(8); + output.WriteEnum((int) Result); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int CalculateSize() { + int size = 0; + if (Result != 0) { + size += 1 + pb::CodedOutputStream.ComputeEnumSize((int) Result); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(ReportResult other) { + if (other == null) { + return; + } + if (other.Result != 0) { + Result = other.Result; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(pb::CodedInputStream input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + input.SkipLastField(); + break; + case 8: { + result_ = (global::Message.ERROR_CODE) input.ReadEnum(); + break; + } + } + } + } + + } + + public sealed partial class GetRank : pb::IMessage { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new GetRank()); + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pbr::MessageDescriptor Descriptor { + get { return global::Message.CommonReflection.Descriptor.MessageTypes[8]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public GetRank() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public GetRank(GetRank other) : this() { + topCount_ = other.topCount_; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public GetRank Clone() { + return new GetRank(this); + } + + /// Field number for the "TopCount" field. + public const int TopCountFieldNumber = 1; + private int topCount_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int TopCount { + get { return topCount_; } + set { + topCount_ = value; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override bool Equals(object other) { + return Equals(other as GetRank); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public bool Equals(GetRank other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (TopCount != other.TopCount) return false; + return true; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override int GetHashCode() { + int hash = 1; + if (TopCount != 0) hash ^= TopCount.GetHashCode(); + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void WriteTo(pb::CodedOutputStream output) { + if (TopCount != 0) { + output.WriteRawTag(8); + output.WriteInt32(TopCount); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int CalculateSize() { + int size = 0; + if (TopCount != 0) { + size += 1 + pb::CodedOutputStream.ComputeInt32Size(TopCount); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(GetRank other) { + if (other == null) { + return; + } + if (other.TopCount != 0) { + TopCount = other.TopCount; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(pb::CodedInputStream input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + input.SkipLastField(); + break; + case 8: { + TopCount = input.ReadInt32(); + break; + } + } + } + } + + } + + public sealed partial class GetRankResult : pb::IMessage { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new GetRankResult()); + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pbr::MessageDescriptor Descriptor { + get { return global::Message.CommonReflection.Descriptor.MessageTypes[9]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public GetRankResult() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public GetRankResult(GetRankResult other) : this() { + result_ = other.result_; + info_ = other.info_.Clone(); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public GetRankResult Clone() { + return new GetRankResult(this); + } + + /// Field number for the "Result" field. + public const int ResultFieldNumber = 1; + private global::Message.ERROR_CODE result_ = 0; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public global::Message.ERROR_CODE Result { + get { return result_; } + set { + result_ = value; + } + } + + /// Field number for the "Info" field. + public const int InfoFieldNumber = 2; + private static readonly pb::FieldCodec _repeated_info_codec + = pb::FieldCodec.ForMessage(18, global::Message.ReportInfo.Parser); + private readonly pbc::RepeatedField info_ = new pbc::RepeatedField(); + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public pbc::RepeatedField Info { + get { return info_; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override bool Equals(object other) { + return Equals(other as GetRankResult); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public bool Equals(GetRankResult other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (Result != other.Result) return false; + if(!info_.Equals(other.info_)) return false; + return true; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override int GetHashCode() { + int hash = 1; + if (Result != 0) hash ^= Result.GetHashCode(); + hash ^= info_.GetHashCode(); + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void WriteTo(pb::CodedOutputStream output) { + if (Result != 0) { + output.WriteRawTag(8); + output.WriteEnum((int) Result); + } + info_.WriteTo(output, _repeated_info_codec); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int CalculateSize() { + int size = 0; + if (Result != 0) { + size += 1 + pb::CodedOutputStream.ComputeEnumSize((int) Result); + } + size += info_.CalculateSize(_repeated_info_codec); + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(GetRankResult other) { + if (other == null) { + return; + } + if (other.Result != 0) { + Result = other.Result; + } + info_.Add(other.info_); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(pb::CodedInputStream input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + input.SkipLastField(); + break; + case 8: { + result_ = (global::Message.ERROR_CODE) input.ReadEnum(); + break; + } + case 18: { + info_.AddEntriesFrom(input, _repeated_info_codec); + break; + } + } + } + } + + } + + /// + /// 新用户推送 + /// + public sealed partial class NotifyNewAudience : pb::IMessage { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new NotifyNewAudience()); + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pbr::MessageDescriptor Descriptor { + get { return global::Message.CommonReflection.Descriptor.MessageTypes[10]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public NotifyNewAudience() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public NotifyNewAudience(NotifyNewAudience other) : this() { + Audience = other.audience_ != null ? other.Audience.Clone() : null; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public NotifyNewAudience Clone() { + return new NotifyNewAudience(this); + } + + /// Field number for the "Audience" field. + public const int AudienceFieldNumber = 1; + private global::Message.Audience audience_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public global::Message.Audience Audience { + get { return audience_; } + set { + audience_ = value; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override bool Equals(object other) { + return Equals(other as NotifyNewAudience); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public bool Equals(NotifyNewAudience other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (!object.Equals(Audience, other.Audience)) return false; + return true; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override int GetHashCode() { + int hash = 1; + if (audience_ != null) hash ^= Audience.GetHashCode(); + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void WriteTo(pb::CodedOutputStream output) { + if (audience_ != null) { + output.WriteRawTag(10); + output.WriteMessage(Audience); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int CalculateSize() { + int size = 0; + if (audience_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(Audience); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(NotifyNewAudience other) { + if (other == null) { + return; + } + if (other.audience_ != null) { + if (audience_ == null) { + audience_ = new global::Message.Audience(); + } + Audience.MergeFrom(other.Audience); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(pb::CodedInputStream input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + input.SkipLastField(); + break; + case 10: { + if (audience_ == null) { + audience_ = new global::Message.Audience(); + } + input.ReadMessage(audience_); + break; + } + } + } + } + + } + + /// + /// 用户行为推送 + /// + public sealed partial class NotifyAudienceAction : pb::IMessage { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new NotifyAudienceAction()); + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pbr::MessageDescriptor Descriptor { + get { return global::Message.CommonReflection.Descriptor.MessageTypes[11]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public NotifyAudienceAction() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public NotifyAudienceAction(NotifyAudienceAction other) : this() { + openId_ = other.openId_; + content_ = other.content_; + likeNum_ = other.likeNum_; + giftId_ = other.giftId_; + giftNum_ = other.giftNum_; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public NotifyAudienceAction Clone() { + return new NotifyAudienceAction(this); + } + + /// Field number for the "OpenId" field. + public const int OpenIdFieldNumber = 1; + private string openId_ = ""; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public string OpenId { + get { return openId_; } + set { + openId_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + } + } + + /// Field number for the "Content" field. + public const int ContentFieldNumber = 2; + private string content_ = ""; + /// + /// 评论 + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public string Content { + get { return content_; } + set { + content_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + } + } + + /// Field number for the "LikeNum" field. + public const int LikeNumFieldNumber = 3; + private int likeNum_; + /// + /// 点赞数量 + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int LikeNum { + get { return likeNum_; } + set { + likeNum_ = value; + } + } + + /// Field number for the "GiftId" field. + public const int GiftIdFieldNumber = 4; + private string giftId_ = ""; + /// + /// 礼物ID + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public string GiftId { + get { return giftId_; } + set { + giftId_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + } + } + + /// Field number for the "GiftNum" field. + public const int GiftNumFieldNumber = 5; + private int giftNum_; + /// + /// 礼物数量 + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int GiftNum { + get { return giftNum_; } + set { + giftNum_ = value; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override bool Equals(object other) { + return Equals(other as NotifyAudienceAction); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public bool Equals(NotifyAudienceAction other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (OpenId != other.OpenId) return false; + if (Content != other.Content) return false; + if (LikeNum != other.LikeNum) return false; + if (GiftId != other.GiftId) return false; + if (GiftNum != other.GiftNum) return false; + return true; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override int GetHashCode() { + int hash = 1; + if (OpenId.Length != 0) hash ^= OpenId.GetHashCode(); + if (Content.Length != 0) hash ^= Content.GetHashCode(); + if (LikeNum != 0) hash ^= LikeNum.GetHashCode(); + if (GiftId.Length != 0) hash ^= GiftId.GetHashCode(); + if (GiftNum != 0) hash ^= GiftNum.GetHashCode(); + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void WriteTo(pb::CodedOutputStream output) { + if (OpenId.Length != 0) { + output.WriteRawTag(10); + output.WriteString(OpenId); + } + if (Content.Length != 0) { + output.WriteRawTag(18); + output.WriteString(Content); + } + if (LikeNum != 0) { + output.WriteRawTag(24); + output.WriteInt32(LikeNum); + } + if (GiftId.Length != 0) { + output.WriteRawTag(34); + output.WriteString(GiftId); + } + if (GiftNum != 0) { + output.WriteRawTag(40); + output.WriteInt32(GiftNum); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int CalculateSize() { + int size = 0; + if (OpenId.Length != 0) { + size += 1 + pb::CodedOutputStream.ComputeStringSize(OpenId); + } + if (Content.Length != 0) { + size += 1 + pb::CodedOutputStream.ComputeStringSize(Content); + } + if (LikeNum != 0) { + size += 1 + pb::CodedOutputStream.ComputeInt32Size(LikeNum); + } + if (GiftId.Length != 0) { + size += 1 + pb::CodedOutputStream.ComputeStringSize(GiftId); + } + if (GiftNum != 0) { + size += 1 + pb::CodedOutputStream.ComputeInt32Size(GiftNum); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(NotifyAudienceAction other) { + if (other == null) { + return; + } + if (other.OpenId.Length != 0) { + OpenId = other.OpenId; + } + if (other.Content.Length != 0) { + Content = other.Content; + } + if (other.LikeNum != 0) { + LikeNum = other.LikeNum; + } + if (other.GiftId.Length != 0) { + GiftId = other.GiftId; + } + if (other.GiftNum != 0) { + GiftNum = other.GiftNum; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(pb::CodedInputStream input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + input.SkipLastField(); + break; + case 10: { + OpenId = input.ReadString(); + break; + } + case 18: { + Content = input.ReadString(); + break; + } + case 24: { + LikeNum = input.ReadInt32(); + break; + } + case 34: { + GiftId = input.ReadString(); + break; + } + case 40: { + GiftNum = input.ReadInt32(); + break; + } + } + } + } + + } + + /// + /// 分数信息 + /// + public sealed partial class ReportInfo : pb::IMessage { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new ReportInfo()); + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pbr::MessageDescriptor Descriptor { + get { return global::Message.CommonReflection.Descriptor.MessageTypes[12]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public ReportInfo() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public ReportInfo(ReportInfo other) : this() { + openId_ = other.openId_; + score_ = other.score_; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public ReportInfo Clone() { + return new ReportInfo(this); + } + + /// Field number for the "OpenId" field. + public const int OpenIdFieldNumber = 1; + private string openId_ = ""; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public string OpenId { + get { return openId_; } + set { + openId_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + } + } + + /// Field number for the "Score" field. + public const int ScoreFieldNumber = 2; + private int score_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int Score { + get { return score_; } + set { + score_ = value; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override bool Equals(object other) { + return Equals(other as ReportInfo); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public bool Equals(ReportInfo other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (OpenId != other.OpenId) return false; + if (Score != other.Score) return false; + return true; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override int GetHashCode() { + int hash = 1; + if (OpenId.Length != 0) hash ^= OpenId.GetHashCode(); + if (Score != 0) hash ^= Score.GetHashCode(); + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void WriteTo(pb::CodedOutputStream output) { + if (OpenId.Length != 0) { + output.WriteRawTag(10); + output.WriteString(OpenId); + } + if (Score != 0) { + output.WriteRawTag(16); + output.WriteInt32(Score); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int CalculateSize() { + int size = 0; + if (OpenId.Length != 0) { + size += 1 + pb::CodedOutputStream.ComputeStringSize(OpenId); + } + if (Score != 0) { + size += 1 + pb::CodedOutputStream.ComputeInt32Size(Score); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(ReportInfo other) { + if (other == null) { + return; + } + if (other.OpenId.Length != 0) { + OpenId = other.OpenId; + } + if (other.Score != 0) { + Score = other.Score; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(pb::CodedInputStream input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + input.SkipLastField(); + break; + case 10: { + OpenId = input.ReadString(); + break; + } + case 16: { + Score = input.ReadInt32(); + break; + } + } + } + } + + } + + /// + /// 观众信息 + /// + public sealed partial class Audience : pb::IMessage { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new Audience()); + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pbr::MessageDescriptor Descriptor { + get { return global::Message.CommonReflection.Descriptor.MessageTypes[13]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public Audience() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public Audience(Audience other) : this() { + openId_ = other.openId_; + nickName_ = other.nickName_; + avatarUrl_ = other.avatarUrl_; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public Audience Clone() { + return new Audience(this); + } + + /// Field number for the "OpenId" field. + public const int OpenIdFieldNumber = 1; + private string openId_ = ""; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public string OpenId { + get { return openId_; } + set { + openId_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + } + } + + /// Field number for the "NickName" field. + public const int NickNameFieldNumber = 2; + private string nickName_ = ""; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public string NickName { + get { return nickName_; } + set { + nickName_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + } + } + + /// Field number for the "AvatarUrl" field. + public const int AvatarUrlFieldNumber = 3; + private string avatarUrl_ = ""; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public string AvatarUrl { + get { return avatarUrl_; } + set { + avatarUrl_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override bool Equals(object other) { + return Equals(other as Audience); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public bool Equals(Audience other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (OpenId != other.OpenId) return false; + if (NickName != other.NickName) return false; + if (AvatarUrl != other.AvatarUrl) return false; + return true; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override int GetHashCode() { + int hash = 1; + if (OpenId.Length != 0) hash ^= OpenId.GetHashCode(); + if (NickName.Length != 0) hash ^= NickName.GetHashCode(); + if (AvatarUrl.Length != 0) hash ^= AvatarUrl.GetHashCode(); + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void WriteTo(pb::CodedOutputStream output) { + if (OpenId.Length != 0) { + output.WriteRawTag(10); + output.WriteString(OpenId); + } + if (NickName.Length != 0) { + output.WriteRawTag(18); + output.WriteString(NickName); + } + if (AvatarUrl.Length != 0) { + output.WriteRawTag(26); + output.WriteString(AvatarUrl); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int CalculateSize() { + int size = 0; + if (OpenId.Length != 0) { + size += 1 + pb::CodedOutputStream.ComputeStringSize(OpenId); + } + if (NickName.Length != 0) { + size += 1 + pb::CodedOutputStream.ComputeStringSize(NickName); + } + if (AvatarUrl.Length != 0) { + size += 1 + pb::CodedOutputStream.ComputeStringSize(AvatarUrl); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(Audience other) { + if (other == null) { + return; + } + if (other.OpenId.Length != 0) { + OpenId = other.OpenId; + } + if (other.NickName.Length != 0) { + NickName = other.NickName; + } + if (other.AvatarUrl.Length != 0) { + AvatarUrl = other.AvatarUrl; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(pb::CodedInputStream input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + input.SkipLastField(); + break; + case 10: { + OpenId = input.ReadString(); + break; + } + case 18: { + NickName = input.ReadString(); + break; + } + case 26: { + AvatarUrl = input.ReadString(); + break; + } + } + } + } + + } + + /// + /// 排名信息 + /// + public sealed partial class RankInfo : pb::IMessage { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new RankInfo()); + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pbr::MessageDescriptor Descriptor { + get { return global::Message.CommonReflection.Descriptor.MessageTypes[14]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public RankInfo() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public RankInfo(RankInfo other) : this() { + Audience = other.audience_ != null ? other.Audience.Clone() : null; + rank_ = other.rank_; + score_ = other.score_; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public RankInfo Clone() { + return new RankInfo(this); + } + + /// Field number for the "Audience" field. + public const int AudienceFieldNumber = 1; + private global::Message.Audience audience_; + /// + /// 观众信息 + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public global::Message.Audience Audience { + get { return audience_; } + set { + audience_ = value; + } + } + + /// Field number for the "Rank" field. + public const int RankFieldNumber = 2; + private int rank_; + /// + /// 排名 + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int Rank { + get { return rank_; } + set { + rank_ = value; + } + } + + /// Field number for the "Score" field. + public const int ScoreFieldNumber = 3; + private int score_; + /// + /// 用户分数 + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int Score { + get { return score_; } + set { + score_ = value; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override bool Equals(object other) { + return Equals(other as RankInfo); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public bool Equals(RankInfo other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (!object.Equals(Audience, other.Audience)) return false; + if (Rank != other.Rank) return false; + if (Score != other.Score) return false; + return true; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override int GetHashCode() { + int hash = 1; + if (audience_ != null) hash ^= Audience.GetHashCode(); + if (Rank != 0) hash ^= Rank.GetHashCode(); + if (Score != 0) hash ^= Score.GetHashCode(); + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void WriteTo(pb::CodedOutputStream output) { + if (audience_ != null) { + output.WriteRawTag(10); + output.WriteMessage(Audience); + } + if (Rank != 0) { + output.WriteRawTag(16); + output.WriteInt32(Rank); + } + if (Score != 0) { + output.WriteRawTag(24); + output.WriteInt32(Score); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int CalculateSize() { + int size = 0; + if (audience_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(Audience); + } + if (Rank != 0) { + size += 1 + pb::CodedOutputStream.ComputeInt32Size(Rank); + } + if (Score != 0) { + size += 1 + pb::CodedOutputStream.ComputeInt32Size(Score); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(RankInfo other) { + if (other == null) { + return; + } + if (other.audience_ != null) { + if (audience_ == null) { + audience_ = new global::Message.Audience(); + } + Audience.MergeFrom(other.Audience); + } + if (other.Rank != 0) { + Rank = other.Rank; + } + if (other.Score != 0) { + Score = other.Score; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(pb::CodedInputStream input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + input.SkipLastField(); + break; + case 10: { + if (audience_ == null) { + audience_ = new global::Message.Audience(); + } + input.ReadMessage(audience_); + break; + } + case 16: { + Rank = input.ReadInt32(); + break; + } + case 24: { + Score = input.ReadInt32(); + break; + } + } + } + } + + } + + #endregion + +} + +#endregion Designer generated code diff --git a/proto/Proto/Msgtype.cs b/proto/Proto/Msgtype.cs new file mode 100644 index 0000000..770ce67 --- /dev/null +++ b/proto/Proto/Msgtype.cs @@ -0,0 +1,205 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: msgtype.proto +#pragma warning disable 1591, 0612, 3021 +#region Designer generated code + +using pb = global::Google.Protobuf; +using pbc = global::Google.Protobuf.Collections; +using pbr = global::Google.Protobuf.Reflection; +using scg = global::System.Collections.Generic; +namespace Message { + + /// Holder for reflection information generated from msgtype.proto + public static partial class MsgtypeReflection { + + #region Descriptor + /// File descriptor for msgtype.proto + public static pbr::FileDescriptor Descriptor { + get { return descriptor; } + } + private static pbr::FileDescriptor descriptor; + + static MsgtypeReflection() { + byte[] descriptorData = global::System.Convert.FromBase64String( + string.Concat( + "Cg1tc2d0eXBlLnByb3RvEgdtZXNzYWdlIgcKBUVycm9yKvEBCghNU0dfVFlQ", + "RRIKCgZfRVJST1IQABIKCgZfTG9naW4QARIQCgxfTG9naW5SZXN1bHQQAhIO", + "CgpfUGxheVN0YXJ0EAMSFAoQX1BsYXlTdGFydFJlc3VsdBAEEgwKCF9QbGF5", + "RW5kEAUSEgoOX1BsYXlFbmRSZXN1bHQQBhILCgdfUmVwb3J0EAcSEQoNX1Jl", + "cG9ydFJlc3VsdBAIEgwKCF9HZXRSYW5rEAkSEgoOX0dldFJhbmtSZXN1bHQQ", + "ChIWChJfTm90aWZ5TmV3QXVkaWVuY2UQCxIZChVfTm90aWZ5QXVkaWVuY2VB", + "Y3Rpb24QDCpzCgpFUlJPUl9DT0RFEgsKB1NVQ0NFU1MQABIICgRGQUlMEAES", + "EQoNSU5WQUxJRF9BUFBJRBACEhEKDUlOVkFMSURfVE9LRU4QAxITCg9HQU1F", + "X0lTX1JVTk5JTkcQBBITCg9HQU1FX0lTX1NUT1BQRUQQBUIFWgNwYi9iBnBy", + "b3RvMw==")); + descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData, + new pbr::FileDescriptor[] { }, + new pbr::GeneratedClrTypeInfo(new[] {typeof(global::Message.MSG_TYPE), typeof(global::Message.ERROR_CODE), }, new pbr::GeneratedClrTypeInfo[] { + new pbr::GeneratedClrTypeInfo(typeof(global::Message.Error), global::Message.Error.Parser, null, null, null, null) + })); + } + #endregion + + } + #region Enums + public enum MSG_TYPE { + /// + /// Error + /// + [pbr::OriginalName("_ERROR")] Error = 0, + /// + /// Login + /// + [pbr::OriginalName("_Login")] Login = 1, + /// + /// LoginResult + /// + [pbr::OriginalName("_LoginResult")] LoginResult = 2, + /// + /// PlayStart + /// + [pbr::OriginalName("_PlayStart")] PlayStart = 3, + /// + /// PlayStartResult + /// + [pbr::OriginalName("_PlayStartResult")] PlayStartResult = 4, + /// + /// PlayEnd + /// + [pbr::OriginalName("_PlayEnd")] PlayEnd = 5, + /// + /// PlayEndResult + /// + [pbr::OriginalName("_PlayEndResult")] PlayEndResult = 6, + /// + /// Report + /// + [pbr::OriginalName("_Report")] Report = 7, + /// + /// ReportResult + /// + [pbr::OriginalName("_ReportResult")] ReportResult = 8, + /// + /// GetRank + /// + [pbr::OriginalName("_GetRank")] GetRank = 9, + /// + /// GetRankResult + /// + [pbr::OriginalName("_GetRankResult")] GetRankResult = 10, + /// + /// NotifyNewAudience + /// + [pbr::OriginalName("_NotifyNewAudience")] NotifyNewAudience = 11, + /// + /// NotifyAudienceAction + /// + [pbr::OriginalName("_NotifyAudienceAction")] NotifyAudienceAction = 12, + } + + public enum ERROR_CODE { + [pbr::OriginalName("SUCCESS")] Success = 0, + [pbr::OriginalName("FAIL")] Fail = 1, + [pbr::OriginalName("INVALID_APPID")] InvalidAppid = 2, + [pbr::OriginalName("INVALID_TOKEN")] InvalidToken = 3, + [pbr::OriginalName("GAME_IS_RUNNING")] GameIsRunning = 4, + [pbr::OriginalName("GAME_IS_STOPPED")] GameIsStopped = 5, + } + + #endregion + + #region Messages + public sealed partial class Error : pb::IMessage { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new Error()); + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pbr::MessageDescriptor Descriptor { + get { return global::Message.MsgtypeReflection.Descriptor.MessageTypes[0]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public Error() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public Error(Error other) : this() { + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public Error Clone() { + return new Error(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override bool Equals(object other) { + return Equals(other as Error); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public bool Equals(Error other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + return true; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override int GetHashCode() { + int hash = 1; + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void WriteTo(pb::CodedOutputStream output) { + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int CalculateSize() { + int size = 0; + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(Error other) { + if (other == null) { + return; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(pb::CodedInputStream input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + input.SkipLastField(); + break; + } + } + } + + } + + #endregion + +} + +#endregion Designer generated code diff --git a/proto/common.proto b/proto/common.proto new file mode 100644 index 0000000..26ebcff --- /dev/null +++ b/proto/common.proto @@ -0,0 +1,98 @@ +syntax = "proto3"; +package message; +option go_package = "pb/"; + +import "msgtype.proto"; + +message Login +{ + string AppId = 1; + string Token = 2; +} + +message LoginResult +{ + ERROR_CODE Result = 1; + string RoomId = 2; + string UID = 3; + string NickName = 4; +} + +message PlayStart +{ +} + +message PlayStartResult +{ + ERROR_CODE Result = 1; +} + +message PlayEnd +{ +} + +message PlayEndResult +{ + ERROR_CODE Result = 1; +} + +message Report +{ + repeated ReportInfo Info = 1; +} + +message ReportResult +{ + ERROR_CODE Result = 1; +} + +message GetRank +{ + int32 TopCount = 1; +} + +message GetRankResult +{ + ERROR_CODE Result = 1; + repeated ReportInfo Info = 2; +} + +//新用户推送 +message NotifyNewAudience +{ + Audience Audience = 1; +} +//用户行为推送 +message NotifyAudienceAction +{ + string OpenId = 1; + string Content = 2; //评论 + int32 LikeNum = 3; //点赞数量 + string GiftId = 4; //礼物ID + int32 GiftNum = 5; //礼物数量 +} + +//============结构============ + +//分数信息 +message ReportInfo +{ + string OpenId = 1; + int32 Score = 2; +} + +//观众信息 +message Audience +{ + string OpenId = 1; + string NickName = 2; + string AvatarUrl = 3; +} + +//排名信息 +message RankInfo +{ + Audience Audience = 1; //观众信息 + int32 Rank = 2; //排名 + int32 Score = 3; //用户分数 +} \ No newline at end of file diff --git a/proto/msgtype.proto b/proto/msgtype.proto new file mode 100644 index 0000000..46d5297 --- /dev/null +++ b/proto/msgtype.proto @@ -0,0 +1,34 @@ +syntax = "proto3"; +package message; +option go_package = "pb/"; + +enum MSG_TYPE +{ + _ERROR = 0; //Error + _Login = 1; //Login + _LoginResult = 2; //LoginResult + _PlayStart = 3; //PlayStart + _PlayStartResult = 4; //PlayStartResult + _PlayEnd = 5; //PlayEnd + _PlayEndResult = 6; //PlayEndResult + _Report = 7; //Report + _ReportResult = 8; //ReportResult + _GetRank = 9; //GetRank + _GetRankResult = 10; //GetRankResult + _NotifyNewAudience = 11; //NotifyNewAudience + _NotifyAudienceAction = 12; //NotifyAudienceAction +} + +enum ERROR_CODE +{ + SUCCESS = 0; + FAIL = 1; + INVALID_APPID = 2; + INVALID_TOKEN = 3; + GAME_IS_RUNNING = 4; + GAME_IS_STOPPED = 5; +} + +message Error +{ +} \ No newline at end of file diff --git a/proto/protoGen.bat b/proto/protoGen.bat new file mode 100644 index 0000000..cb5c8d5 --- /dev/null +++ b/proto/protoGen.bat @@ -0,0 +1,8 @@ +@ echo off +cd ./protoc/bin +set protoPath="../../" +set clientPath="../../Proto" +set serverPath="../../../src/app/message" +protoc.exe -I=%protoPath% --csharp_out=%clientPath% --go_out=%serverPath% %protoPath%/*.proto +clang-format.exe -i -style="{AlignConsecutiveAssignments: true,AlignConsecutiveDeclarations: true,AllowShortFunctionsOnASingleLine: None,BreakBeforeBraces: GNU,ColumnLimit: 0,IndentWidth: 4,Language: Proto}" %protoPath%/*.proto +pause \ No newline at end of file diff --git a/proto/protoc/bin/clang-format.exe b/proto/protoc/bin/clang-format.exe new file mode 100644 index 0000000..fd44be4 Binary files /dev/null and b/proto/protoc/bin/clang-format.exe differ diff --git a/proto/protoc/bin/protoc-gen-go.exe b/proto/protoc/bin/protoc-gen-go.exe new file mode 100644 index 0000000..465d94d Binary files /dev/null and b/proto/protoc/bin/protoc-gen-go.exe differ diff --git a/proto/protoc/bin/protoc.exe b/proto/protoc/bin/protoc.exe new file mode 100644 index 0000000..9285f90 Binary files /dev/null and b/proto/protoc/bin/protoc.exe differ diff --git a/proto/protoc/include/google/protobuf/any.proto b/proto/protoc/include/google/protobuf/any.proto new file mode 100644 index 0000000..6ed8a23 --- /dev/null +++ b/proto/protoc/include/google/protobuf/any.proto @@ -0,0 +1,158 @@ +// 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 csharp_namespace = "Google.Protobuf.WellKnownTypes"; +option go_package = "google.golang.org/protobuf/types/known/anypb"; +option java_package = "com.google.protobuf"; +option java_outer_classname = "AnyProto"; +option java_multiple_files = true; +option objc_class_prefix = "GPB"; + +// `Any` contains an arbitrary serialized protocol buffer message along with a +// URL that describes the type of the serialized message. +// +// Protobuf library provides support to pack/unpack Any values in the form +// of utility functions or additional generated methods of the Any type. +// +// Example 1: Pack and unpack a message in C++. +// +// Foo foo = ...; +// Any any; +// any.PackFrom(foo); +// ... +// if (any.UnpackTo(&foo)) { +// ... +// } +// +// Example 2: Pack and unpack a message in Java. +// +// Foo foo = ...; +// Any any = Any.pack(foo); +// ... +// if (any.is(Foo.class)) { +// foo = any.unpack(Foo.class); +// } +// +// Example 3: Pack and unpack a message in Python. +// +// foo = Foo(...) +// any = Any() +// any.Pack(foo) +// ... +// if any.Is(Foo.DESCRIPTOR): +// any.Unpack(foo) +// ... +// +// Example 4: Pack and unpack a message in Go +// +// foo := &pb.Foo{...} +// any, err := anypb.New(foo) +// if err != nil { +// ... +// } +// ... +// foo := &pb.Foo{} +// if err := any.UnmarshalTo(foo); err != nil { +// ... +// } +// +// The pack methods provided by protobuf library will by default use +// 'type.googleapis.com/full.type.name' as the type URL and the unpack +// methods only use the fully qualified type name after the last '/' +// in the type URL, for example "foo.bar.com/x/y.z" will yield type +// name "y.z". +// +// +// JSON +// ==== +// The JSON representation of an `Any` value uses the regular +// representation of the deserialized, embedded message, with an +// additional field `@type` which contains the type URL. Example: +// +// package google.profile; +// message Person { +// string first_name = 1; +// string last_name = 2; +// } +// +// { +// "@type": "type.googleapis.com/google.profile.Person", +// "firstName": , +// "lastName": +// } +// +// If the embedded message type is well-known and has a custom JSON +// representation, that representation will be embedded adding a field +// `value` which holds the custom JSON in addition to the `@type` +// field. Example (for message [google.protobuf.Duration][]): +// +// { +// "@type": "type.googleapis.com/google.protobuf.Duration", +// "value": "1.212s" +// } +// +message Any { + // A URL/resource name that uniquely identifies the type of the serialized + // protocol buffer message. This string must contain at least + // one "/" character. The last segment of the URL's path must represent + // the fully qualified name of the type (as in + // `path/google.protobuf.Duration`). The name should be in a canonical form + // (e.g., leading "." is not accepted). + // + // In practice, teams usually precompile into the binary all types that they + // expect it to use in the context of Any. However, for URLs which use the + // scheme `http`, `https`, or no scheme, one can optionally set up a type + // server that maps type URLs to message definitions as follows: + // + // * If no scheme is provided, `https` is assumed. + // * An HTTP GET on the URL must yield a [google.protobuf.Type][] + // value in binary format, or produce an error. + // * Applications are allowed to cache lookup results based on the + // URL, or have them precompiled into a binary to avoid any + // lookup. Therefore, binary compatibility needs to be preserved + // on changes to types. (Use versioned type names to manage + // breaking changes.) + // + // Note: this functionality is not currently available in the official + // protobuf release, and it is not used for type URLs beginning with + // type.googleapis.com. + // + // Schemes other than `http`, `https` (or the empty scheme) might be + // used with implementation specific semantics. + // + string type_url = 1; + + // Must be a valid serialized protocol buffer of the above specified type. + bytes value = 2; +} diff --git a/proto/protoc/include/google/protobuf/api.proto b/proto/protoc/include/google/protobuf/api.proto new file mode 100644 index 0000000..3d598fc --- /dev/null +++ b/proto/protoc/include/google/protobuf/api.proto @@ -0,0 +1,208 @@ +// 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; + +import "google/protobuf/source_context.proto"; +import "google/protobuf/type.proto"; + +option csharp_namespace = "Google.Protobuf.WellKnownTypes"; +option java_package = "com.google.protobuf"; +option java_outer_classname = "ApiProto"; +option java_multiple_files = true; +option objc_class_prefix = "GPB"; +option go_package = "google.golang.org/protobuf/types/known/apipb"; + +// Api is a light-weight descriptor for an API Interface. +// +// Interfaces are also described as "protocol buffer services" in some contexts, +// such as by the "service" keyword in a .proto file, but they are different +// from API Services, which represent a concrete implementation of an interface +// as opposed to simply a description of methods and bindings. They are also +// sometimes simply referred to as "APIs" in other contexts, such as the name of +// this message itself. See https://cloud.google.com/apis/design/glossary for +// detailed terminology. +message Api { + // The fully qualified name of this interface, including package name + // followed by the interface's simple name. + string name = 1; + + // The methods of this interface, in unspecified order. + repeated Method methods = 2; + + // Any metadata attached to the interface. + repeated Option options = 3; + + // A version string for this interface. If specified, must have the form + // `major-version.minor-version`, as in `1.10`. If the minor version is + // omitted, it defaults to zero. If the entire version field is empty, the + // major version is derived from the package name, as outlined below. If the + // field is not empty, the version in the package name will be verified to be + // consistent with what is provided here. + // + // The versioning schema uses [semantic + // versioning](http://semver.org) where the major version number + // indicates a breaking change and the minor version an additive, + // non-breaking change. Both version numbers are signals to users + // what to expect from different versions, and should be carefully + // chosen based on the product plan. + // + // The major version is also reflected in the package name of the + // interface, which must end in `v`, as in + // `google.feature.v1`. For major versions 0 and 1, the suffix can + // be omitted. Zero major versions must only be used for + // experimental, non-GA interfaces. + // + // + string version = 4; + + // Source context for the protocol buffer service represented by this + // message. + SourceContext source_context = 5; + + // Included interfaces. See [Mixin][]. + repeated Mixin mixins = 6; + + // The source syntax of the service. + Syntax syntax = 7; +} + +// Method represents a method of an API interface. +message Method { + // The simple name of this method. + string name = 1; + + // A URL of the input message type. + string request_type_url = 2; + + // If true, the request is streamed. + bool request_streaming = 3; + + // The URL of the output message type. + string response_type_url = 4; + + // If true, the response is streamed. + bool response_streaming = 5; + + // Any metadata attached to the method. + repeated Option options = 6; + + // The source syntax of this method. + Syntax syntax = 7; +} + +// Declares an API Interface to be included in this interface. The including +// interface must redeclare all the methods from the included interface, but +// documentation and options are inherited as follows: +// +// - If after comment and whitespace stripping, the documentation +// string of the redeclared method is empty, it will be inherited +// from the original method. +// +// - Each annotation belonging to the service config (http, +// visibility) which is not set in the redeclared method will be +// inherited. +// +// - If an http annotation is inherited, the path pattern will be +// modified as follows. Any version prefix will be replaced by the +// version of the including interface plus the [root][] path if +// specified. +// +// Example of a simple mixin: +// +// package google.acl.v1; +// service AccessControl { +// // Get the underlying ACL object. +// rpc GetAcl(GetAclRequest) returns (Acl) { +// option (google.api.http).get = "/v1/{resource=**}:getAcl"; +// } +// } +// +// package google.storage.v2; +// service Storage { +// rpc GetAcl(GetAclRequest) returns (Acl); +// +// // Get a data record. +// rpc GetData(GetDataRequest) returns (Data) { +// option (google.api.http).get = "/v2/{resource=**}"; +// } +// } +// +// Example of a mixin configuration: +// +// apis: +// - name: google.storage.v2.Storage +// mixins: +// - name: google.acl.v1.AccessControl +// +// The mixin construct implies that all methods in `AccessControl` are +// also declared with same name and request/response types in +// `Storage`. A documentation generator or annotation processor will +// see the effective `Storage.GetAcl` method after inheriting +// documentation and annotations as follows: +// +// service Storage { +// // Get the underlying ACL object. +// rpc GetAcl(GetAclRequest) returns (Acl) { +// option (google.api.http).get = "/v2/{resource=**}:getAcl"; +// } +// ... +// } +// +// Note how the version in the path pattern changed from `v1` to `v2`. +// +// If the `root` field in the mixin is specified, it should be a +// relative path under which inherited HTTP paths are placed. Example: +// +// apis: +// - name: google.storage.v2.Storage +// mixins: +// - name: google.acl.v1.AccessControl +// root: acls +// +// This implies the following inherited HTTP annotation: +// +// service Storage { +// // Get the underlying ACL object. +// rpc GetAcl(GetAclRequest) returns (Acl) { +// option (google.api.http).get = "/v2/acls/{resource=**}:getAcl"; +// } +// ... +// } +message Mixin { + // The fully qualified name of the interface which is included. + string name = 1; + + // If non-empty specifies a path under which inherited HTTP paths + // are rooted. + string root = 2; +} diff --git a/proto/protoc/include/google/protobuf/compiler/plugin.proto b/proto/protoc/include/google/protobuf/compiler/plugin.proto new file mode 100644 index 0000000..9242aac --- /dev/null +++ b/proto/protoc/include/google/protobuf/compiler/plugin.proto @@ -0,0 +1,183 @@ +// 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. + +// Author: kenton@google.com (Kenton Varda) +// +// WARNING: The plugin interface is currently EXPERIMENTAL and is subject to +// change. +// +// protoc (aka the Protocol Compiler) can be extended via plugins. A plugin is +// just a program that reads a CodeGeneratorRequest from stdin and writes a +// CodeGeneratorResponse to stdout. +// +// Plugins written using C++ can use google/protobuf/compiler/plugin.h instead +// of dealing with the raw protocol defined here. +// +// A plugin executable needs only to be placed somewhere in the path. The +// plugin should be named "protoc-gen-$NAME", and will then be used when the +// flag "--${NAME}_out" is passed to protoc. + +syntax = "proto2"; + +package google.protobuf.compiler; +option java_package = "com.google.protobuf.compiler"; +option java_outer_classname = "PluginProtos"; + +option go_package = "google.golang.org/protobuf/types/pluginpb"; + +import "google/protobuf/descriptor.proto"; + +// The version number of protocol compiler. +message Version { + optional int32 major = 1; + optional int32 minor = 2; + optional int32 patch = 3; + // A suffix for alpha, beta or rc release, e.g., "alpha-1", "rc2". It should + // be empty for mainline stable releases. + optional string suffix = 4; +} + +// An encoded CodeGeneratorRequest is written to the plugin's stdin. +message CodeGeneratorRequest { + // The .proto files that were explicitly listed on the command-line. The + // code generator should generate code only for these files. Each file's + // descriptor will be included in proto_file, below. + repeated string file_to_generate = 1; + + // The generator parameter passed on the command-line. + optional string parameter = 2; + + // FileDescriptorProtos for all files in files_to_generate and everything + // they import. The files will appear in topological order, so each file + // appears before any file that imports it. + // + // protoc guarantees that all proto_files will be written after + // the fields above, even though this is not technically guaranteed by the + // protobuf wire format. This theoretically could allow a plugin to stream + // in the FileDescriptorProtos and handle them one by one rather than read + // the entire set into memory at once. However, as of this writing, this + // is not similarly optimized on protoc's end -- it will store all fields in + // memory at once before sending them to the plugin. + // + // Type names of fields and extensions in the FileDescriptorProto are always + // fully qualified. + repeated FileDescriptorProto proto_file = 15; + + // The version number of protocol compiler. + optional Version compiler_version = 3; + +} + +// The plugin writes an encoded CodeGeneratorResponse to stdout. +message CodeGeneratorResponse { + // Error message. If non-empty, code generation failed. The plugin process + // should exit with status code zero even if it reports an error in this way. + // + // This should be used to indicate errors in .proto files which prevent the + // code generator from generating correct code. Errors which indicate a + // problem in protoc itself -- such as the input CodeGeneratorRequest being + // unparseable -- should be reported by writing a message to stderr and + // exiting with a non-zero status code. + optional string error = 1; + + // A bitmask of supported features that the code generator supports. + // This is a bitwise "or" of values from the Feature enum. + optional uint64 supported_features = 2; + + // Sync with code_generator.h. + enum Feature { + FEATURE_NONE = 0; + FEATURE_PROTO3_OPTIONAL = 1; + } + + // Represents a single generated file. + message File { + // The file name, relative to the output directory. The name must not + // contain "." or ".." components and must be relative, not be absolute (so, + // the file cannot lie outside the output directory). "/" must be used as + // the path separator, not "\". + // + // If the name is omitted, the content will be appended to the previous + // file. This allows the generator to break large files into small chunks, + // and allows the generated text to be streamed back to protoc so that large + // files need not reside completely in memory at one time. Note that as of + // this writing protoc does not optimize for this -- it will read the entire + // CodeGeneratorResponse before writing files to disk. + optional string name = 1; + + // If non-empty, indicates that the named file should already exist, and the + // content here is to be inserted into that file at a defined insertion + // point. This feature allows a code generator to extend the output + // produced by another code generator. The original generator may provide + // insertion points by placing special annotations in the file that look + // like: + // @@protoc_insertion_point(NAME) + // The annotation can have arbitrary text before and after it on the line, + // which allows it to be placed in a comment. NAME should be replaced with + // an identifier naming the point -- this is what other generators will use + // as the insertion_point. Code inserted at this point will be placed + // immediately above the line containing the insertion point (thus multiple + // insertions to the same point will come out in the order they were added). + // The double-@ is intended to make it unlikely that the generated code + // could contain things that look like insertion points by accident. + // + // For example, the C++ code generator places the following line in the + // .pb.h files that it generates: + // // @@protoc_insertion_point(namespace_scope) + // This line appears within the scope of the file's package namespace, but + // outside of any particular class. Another plugin can then specify the + // insertion_point "namespace_scope" to generate additional classes or + // other declarations that should be placed in this scope. + // + // Note that if the line containing the insertion point begins with + // whitespace, the same whitespace will be added to every line of the + // inserted text. This is useful for languages like Python, where + // indentation matters. In these languages, the insertion point comment + // should be indented the same amount as any inserted code will need to be + // in order to work correctly in that context. + // + // The code generator that generates the initial file and the one which + // inserts into it must both run as part of a single invocation of protoc. + // Code generators are executed in the order in which they appear on the + // command line. + // + // If |insertion_point| is present, |name| must also be present. + optional string insertion_point = 2; + + // The file contents. + optional string content = 15; + + // Information describing the file content being inserted. If an insertion + // point is used, this information will be appropriately offset and inserted + // into the code generation metadata for the generated files. + optional GeneratedCodeInfo generated_code_info = 16; + } + repeated File file = 15; +} diff --git a/proto/protoc/include/google/protobuf/descriptor.proto b/proto/protoc/include/google/protobuf/descriptor.proto new file mode 100644 index 0000000..156e410 --- /dev/null +++ b/proto/protoc/include/google/protobuf/descriptor.proto @@ -0,0 +1,911 @@ +// 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. + +// Author: kenton@google.com (Kenton Varda) +// Based on original Protocol Buffers design by +// Sanjay Ghemawat, Jeff Dean, and others. +// +// The messages in this file describe the definitions found in .proto files. +// A valid .proto file can be translated directly to a FileDescriptorProto +// without any other information (e.g. without reading its imports). + + +syntax = "proto2"; + +package google.protobuf; + +option go_package = "google.golang.org/protobuf/types/descriptorpb"; +option java_package = "com.google.protobuf"; +option java_outer_classname = "DescriptorProtos"; +option csharp_namespace = "Google.Protobuf.Reflection"; +option objc_class_prefix = "GPB"; +option cc_enable_arenas = true; + +// descriptor.proto must be optimized for speed because reflection-based +// algorithms don't work during bootstrapping. +option optimize_for = SPEED; + +// The protocol compiler can output a FileDescriptorSet containing the .proto +// files it parses. +message FileDescriptorSet { + repeated FileDescriptorProto file = 1; +} + +// Describes a complete .proto file. +message FileDescriptorProto { + optional string name = 1; // file name, relative to root of source tree + optional string package = 2; // e.g. "foo", "foo.bar", etc. + + // Names of files imported by this file. + repeated string dependency = 3; + // Indexes of the public imported files in the dependency list above. + repeated int32 public_dependency = 10; + // Indexes of the weak imported files in the dependency list. + // For Google-internal migration only. Do not use. + repeated int32 weak_dependency = 11; + + // All top-level definitions in this file. + repeated DescriptorProto message_type = 4; + repeated EnumDescriptorProto enum_type = 5; + repeated ServiceDescriptorProto service = 6; + repeated FieldDescriptorProto extension = 7; + + optional FileOptions options = 8; + + // This field contains optional information about the original source code. + // You may safely remove this entire field without harming runtime + // functionality of the descriptors -- the information is needed only by + // development tools. + optional SourceCodeInfo source_code_info = 9; + + // The syntax of the proto file. + // The supported values are "proto2" and "proto3". + optional string syntax = 12; +} + +// Describes a message type. +message DescriptorProto { + optional string name = 1; + + repeated FieldDescriptorProto field = 2; + repeated FieldDescriptorProto extension = 6; + + repeated DescriptorProto nested_type = 3; + repeated EnumDescriptorProto enum_type = 4; + + message ExtensionRange { + optional int32 start = 1; // Inclusive. + optional int32 end = 2; // Exclusive. + + optional ExtensionRangeOptions options = 3; + } + repeated ExtensionRange extension_range = 5; + + repeated OneofDescriptorProto oneof_decl = 8; + + optional MessageOptions options = 7; + + // Range of reserved tag numbers. Reserved tag numbers may not be used by + // fields or extension ranges in the same message. Reserved ranges may + // not overlap. + message ReservedRange { + optional int32 start = 1; // Inclusive. + optional int32 end = 2; // Exclusive. + } + repeated ReservedRange reserved_range = 9; + // Reserved field names, which may not be used by fields in the same message. + // A given name may only be reserved once. + repeated string reserved_name = 10; +} + +message ExtensionRangeOptions { + // The parser stores options it doesn't recognize here. See above. + repeated UninterpretedOption uninterpreted_option = 999; + + + // Clients can define custom options in extensions of this message. See above. + extensions 1000 to max; +} + +// Describes a field within a message. +message FieldDescriptorProto { + enum Type { + // 0 is reserved for errors. + // Order is weird for historical reasons. + TYPE_DOUBLE = 1; + TYPE_FLOAT = 2; + // Not ZigZag encoded. Negative numbers take 10 bytes. Use TYPE_SINT64 if + // negative values are likely. + TYPE_INT64 = 3; + TYPE_UINT64 = 4; + // Not ZigZag encoded. Negative numbers take 10 bytes. Use TYPE_SINT32 if + // negative values are likely. + TYPE_INT32 = 5; + TYPE_FIXED64 = 6; + TYPE_FIXED32 = 7; + TYPE_BOOL = 8; + TYPE_STRING = 9; + // Tag-delimited aggregate. + // Group type is deprecated and not supported in proto3. However, Proto3 + // implementations should still be able to parse the group wire format and + // treat group fields as unknown fields. + TYPE_GROUP = 10; + TYPE_MESSAGE = 11; // Length-delimited aggregate. + + // New in version 2. + TYPE_BYTES = 12; + TYPE_UINT32 = 13; + TYPE_ENUM = 14; + TYPE_SFIXED32 = 15; + TYPE_SFIXED64 = 16; + TYPE_SINT32 = 17; // Uses ZigZag encoding. + TYPE_SINT64 = 18; // Uses ZigZag encoding. + } + + enum Label { + // 0 is reserved for errors + LABEL_OPTIONAL = 1; + LABEL_REQUIRED = 2; + LABEL_REPEATED = 3; + } + + optional string name = 1; + optional int32 number = 3; + optional Label label = 4; + + // If type_name is set, this need not be set. If both this and type_name + // are set, this must be one of TYPE_ENUM, TYPE_MESSAGE or TYPE_GROUP. + optional Type type = 5; + + // For message and enum types, this is the name of the type. If the name + // starts with a '.', it is fully-qualified. Otherwise, C++-like scoping + // rules are used to find the type (i.e. first the nested types within this + // message are searched, then within the parent, on up to the root + // namespace). + optional string type_name = 6; + + // For extensions, this is the name of the type being extended. It is + // resolved in the same manner as type_name. + optional string extendee = 2; + + // For numeric types, contains the original text representation of the value. + // For booleans, "true" or "false". + // For strings, contains the default text contents (not escaped in any way). + // For bytes, contains the C escaped value. All bytes >= 128 are escaped. + // TODO(kenton): Base-64 encode? + optional string default_value = 7; + + // If set, gives the index of a oneof in the containing type's oneof_decl + // list. This field is a member of that oneof. + optional int32 oneof_index = 9; + + // JSON name of this field. The value is set by protocol compiler. If the + // user has set a "json_name" option on this field, that option's value + // will be used. Otherwise, it's deduced from the field's name by converting + // it to camelCase. + optional string json_name = 10; + + optional FieldOptions options = 8; + + // If true, this is a proto3 "optional". When a proto3 field is optional, it + // tracks presence regardless of field type. + // + // When proto3_optional is true, this field must be belong to a oneof to + // signal to old proto3 clients that presence is tracked for this field. This + // oneof is known as a "synthetic" oneof, and this field must be its sole + // member (each proto3 optional field gets its own synthetic oneof). Synthetic + // oneofs exist in the descriptor only, and do not generate any API. Synthetic + // oneofs must be ordered after all "real" oneofs. + // + // For message fields, proto3_optional doesn't create any semantic change, + // since non-repeated message fields always track presence. However it still + // indicates the semantic detail of whether the user wrote "optional" or not. + // This can be useful for round-tripping the .proto file. For consistency we + // give message fields a synthetic oneof also, even though it is not required + // to track presence. This is especially important because the parser can't + // tell if a field is a message or an enum, so it must always create a + // synthetic oneof. + // + // Proto2 optional fields do not set this flag, because they already indicate + // optional with `LABEL_OPTIONAL`. + optional bool proto3_optional = 17; +} + +// Describes a oneof. +message OneofDescriptorProto { + optional string name = 1; + optional OneofOptions options = 2; +} + +// Describes an enum type. +message EnumDescriptorProto { + optional string name = 1; + + repeated EnumValueDescriptorProto value = 2; + + optional EnumOptions options = 3; + + // Range of reserved numeric values. Reserved values may not be used by + // entries in the same enum. Reserved ranges may not overlap. + // + // Note that this is distinct from DescriptorProto.ReservedRange in that it + // is inclusive such that it can appropriately represent the entire int32 + // domain. + message EnumReservedRange { + optional int32 start = 1; // Inclusive. + optional int32 end = 2; // Inclusive. + } + + // Range of reserved numeric values. Reserved numeric values may not be used + // by enum values in the same enum declaration. Reserved ranges may not + // overlap. + repeated EnumReservedRange reserved_range = 4; + + // Reserved enum value names, which may not be reused. A given name may only + // be reserved once. + repeated string reserved_name = 5; +} + +// Describes a value within an enum. +message EnumValueDescriptorProto { + optional string name = 1; + optional int32 number = 2; + + optional EnumValueOptions options = 3; +} + +// Describes a service. +message ServiceDescriptorProto { + optional string name = 1; + repeated MethodDescriptorProto method = 2; + + optional ServiceOptions options = 3; +} + +// Describes a method of a service. +message MethodDescriptorProto { + optional string name = 1; + + // Input and output type names. These are resolved in the same way as + // FieldDescriptorProto.type_name, but must refer to a message type. + optional string input_type = 2; + optional string output_type = 3; + + optional MethodOptions options = 4; + + // Identifies if client streams multiple client messages + optional bool client_streaming = 5 [default = false]; + // Identifies if server streams multiple server messages + optional bool server_streaming = 6 [default = false]; +} + + +// =================================================================== +// Options + +// Each of the definitions above may have "options" attached. These are +// just annotations which may cause code to be generated slightly differently +// or may contain hints for code that manipulates protocol messages. +// +// Clients may define custom options as extensions of the *Options messages. +// These extensions may not yet be known at parsing time, so the parser cannot +// store the values in them. Instead it stores them in a field in the *Options +// message called uninterpreted_option. This field must have the same name +// across all *Options messages. We then use this field to populate the +// extensions when we build a descriptor, at which point all protos have been +// parsed and so all extensions are known. +// +// Extension numbers for custom options may be chosen as follows: +// * For options which will only be used within a single application or +// organization, or for experimental options, use field numbers 50000 +// through 99999. It is up to you to ensure that you do not use the +// same number for multiple options. +// * For options which will be published and used publicly by multiple +// independent entities, e-mail protobuf-global-extension-registry@google.com +// to reserve extension numbers. Simply provide your project name (e.g. +// Objective-C plugin) and your project website (if available) -- there's no +// need to explain how you intend to use them. Usually you only need one +// extension number. You can declare multiple options with only one extension +// number by putting them in a sub-message. See the Custom Options section of +// the docs for examples: +// https://developers.google.com/protocol-buffers/docs/proto#options +// If this turns out to be popular, a web service will be set up +// to automatically assign option numbers. + +message FileOptions { + + // Sets the Java package where classes generated from this .proto will be + // placed. By default, the proto package is used, but this is often + // inappropriate because proto packages do not normally start with backwards + // domain names. + optional string java_package = 1; + + + // Controls the name of the wrapper Java class generated for the .proto file. + // That class will always contain the .proto file's getDescriptor() method as + // well as any top-level extensions defined in the .proto file. + // If java_multiple_files is disabled, then all the other classes from the + // .proto file will be nested inside the single wrapper outer class. + optional string java_outer_classname = 8; + + // If enabled, then the Java code generator will generate a separate .java + // file for each top-level message, enum, and service defined in the .proto + // file. Thus, these types will *not* be nested inside the wrapper class + // named by java_outer_classname. However, the wrapper class will still be + // generated to contain the file's getDescriptor() method as well as any + // top-level extensions defined in the file. + optional bool java_multiple_files = 10 [default = false]; + + // This option does nothing. + optional bool java_generate_equals_and_hash = 20 [deprecated=true]; + + // If set true, then the Java2 code generator will generate code that + // throws an exception whenever an attempt is made to assign a non-UTF-8 + // byte sequence to a string field. + // Message reflection will do the same. + // However, an extension field still accepts non-UTF-8 byte sequences. + // This option has no effect on when used with the lite runtime. + optional bool java_string_check_utf8 = 27 [default = false]; + + + // Generated classes can be optimized for speed or code size. + enum OptimizeMode { + SPEED = 1; // Generate complete code for parsing, serialization, + // etc. + CODE_SIZE = 2; // Use ReflectionOps to implement these methods. + LITE_RUNTIME = 3; // Generate code using MessageLite and the lite runtime. + } + optional OptimizeMode optimize_for = 9 [default = SPEED]; + + // Sets the Go package where structs generated from this .proto will be + // placed. If omitted, the Go package will be derived from the following: + // - The basename of the package import path, if provided. + // - Otherwise, the package statement in the .proto file, if present. + // - Otherwise, the basename of the .proto file, without extension. + optional string go_package = 11; + + + + + // Should generic services be generated in each language? "Generic" services + // are not specific to any particular RPC system. They are generated by the + // main code generators in each language (without additional plugins). + // Generic services were the only kind of service generation supported by + // early versions of google.protobuf. + // + // Generic services are now considered deprecated in favor of using plugins + // that generate code specific to your particular RPC system. Therefore, + // these default to false. Old code which depends on generic services should + // explicitly set them to true. + optional bool cc_generic_services = 16 [default = false]; + optional bool java_generic_services = 17 [default = false]; + optional bool py_generic_services = 18 [default = false]; + optional bool php_generic_services = 42 [default = false]; + + // Is this file deprecated? + // Depending on the target platform, this can emit Deprecated annotations + // for everything in the file, or it will be completely ignored; in the very + // least, this is a formalization for deprecating files. + optional bool deprecated = 23 [default = false]; + + // Enables the use of arenas for the proto messages in this file. This applies + // only to generated classes for C++. + optional bool cc_enable_arenas = 31 [default = true]; + + + // Sets the objective c class prefix which is prepended to all objective c + // generated classes from this .proto. There is no default. + optional string objc_class_prefix = 36; + + // Namespace for generated classes; defaults to the package. + optional string csharp_namespace = 37; + + // By default Swift generators will take the proto package and CamelCase it + // replacing '.' with underscore and use that to prefix the types/symbols + // defined. When this options is provided, they will use this value instead + // to prefix the types/symbols defined. + optional string swift_prefix = 39; + + // Sets the php class prefix which is prepended to all php generated classes + // from this .proto. Default is empty. + optional string php_class_prefix = 40; + + // Use this option to change the namespace of php generated classes. Default + // is empty. When this option is empty, the package name will be used for + // determining the namespace. + optional string php_namespace = 41; + + // Use this option to change the namespace of php generated metadata classes. + // Default is empty. When this option is empty, the proto file name will be + // used for determining the namespace. + optional string php_metadata_namespace = 44; + + // Use this option to change the package of ruby generated classes. Default + // is empty. When this option is not set, the package name will be used for + // determining the ruby package. + optional string ruby_package = 45; + + + // The parser stores options it doesn't recognize here. + // See the documentation for the "Options" section above. + repeated UninterpretedOption uninterpreted_option = 999; + + // Clients can define custom options in extensions of this message. + // See the documentation for the "Options" section above. + extensions 1000 to max; + + reserved 38; +} + +message MessageOptions { + // Set true to use the old proto1 MessageSet wire format for extensions. + // This is provided for backwards-compatibility with the MessageSet wire + // format. You should not use this for any other reason: It's less + // efficient, has fewer features, and is more complicated. + // + // The message must be defined exactly as follows: + // message Foo { + // option message_set_wire_format = true; + // extensions 4 to max; + // } + // Note that the message cannot have any defined fields; MessageSets only + // have extensions. + // + // All extensions of your type must be singular messages; e.g. they cannot + // be int32s, enums, or repeated messages. + // + // Because this is an option, the above two restrictions are not enforced by + // the protocol compiler. + optional bool message_set_wire_format = 1 [default = false]; + + // Disables the generation of the standard "descriptor()" accessor, which can + // conflict with a field of the same name. This is meant to make migration + // from proto1 easier; new code should avoid fields named "descriptor". + optional bool no_standard_descriptor_accessor = 2 [default = false]; + + // Is this message deprecated? + // Depending on the target platform, this can emit Deprecated annotations + // for the message, or it will be completely ignored; in the very least, + // this is a formalization for deprecating messages. + optional bool deprecated = 3 [default = false]; + + reserved 4, 5, 6; + + // Whether the message is an automatically generated map entry type for the + // maps field. + // + // For maps fields: + // map map_field = 1; + // The parsed descriptor looks like: + // message MapFieldEntry { + // option map_entry = true; + // optional KeyType key = 1; + // optional ValueType value = 2; + // } + // repeated MapFieldEntry map_field = 1; + // + // Implementations may choose not to generate the map_entry=true message, but + // use a native map in the target language to hold the keys and values. + // The reflection APIs in such implementations still need to work as + // if the field is a repeated message field. + // + // NOTE: Do not set the option in .proto files. Always use the maps syntax + // instead. The option should only be implicitly set by the proto compiler + // parser. + optional bool map_entry = 7; + + reserved 8; // javalite_serializable + reserved 9; // javanano_as_lite + + + // The parser stores options it doesn't recognize here. See above. + repeated UninterpretedOption uninterpreted_option = 999; + + // Clients can define custom options in extensions of this message. See above. + extensions 1000 to max; +} + +message FieldOptions { + // The ctype option instructs the C++ code generator to use a different + // representation of the field than it normally would. See the specific + // options below. This option is not yet implemented in the open source + // release -- sorry, we'll try to include it in a future version! + optional CType ctype = 1 [default = STRING]; + enum CType { + // Default mode. + STRING = 0; + + CORD = 1; + + STRING_PIECE = 2; + } + // The packed option can be enabled for repeated primitive fields to enable + // a more efficient representation on the wire. Rather than repeatedly + // writing the tag and type for each element, the entire array is encoded as + // a single length-delimited blob. In proto3, only explicit setting it to + // false will avoid using packed encoding. + optional bool packed = 2; + + // The jstype option determines the JavaScript type used for values of the + // field. The option is permitted only for 64 bit integral and fixed types + // (int64, uint64, sint64, fixed64, sfixed64). A field with jstype JS_STRING + // is represented as JavaScript string, which avoids loss of precision that + // can happen when a large value is converted to a floating point JavaScript. + // Specifying JS_NUMBER for the jstype causes the generated JavaScript code to + // use the JavaScript "number" type. The behavior of the default option + // JS_NORMAL is implementation dependent. + // + // This option is an enum to permit additional types to be added, e.g. + // goog.math.Integer. + optional JSType jstype = 6 [default = JS_NORMAL]; + enum JSType { + // Use the default type. + JS_NORMAL = 0; + + // Use JavaScript strings. + JS_STRING = 1; + + // Use JavaScript numbers. + JS_NUMBER = 2; + } + + // Should this field be parsed lazily? Lazy applies only to message-type + // fields. It means that when the outer message is initially parsed, the + // inner message's contents will not be parsed but instead stored in encoded + // form. The inner message will actually be parsed when it is first accessed. + // + // This is only a hint. Implementations are free to choose whether to use + // eager or lazy parsing regardless of the value of this option. However, + // setting this option true suggests that the protocol author believes that + // using lazy parsing on this field is worth the additional bookkeeping + // overhead typically needed to implement it. + // + // This option does not affect the public interface of any generated code; + // all method signatures remain the same. Furthermore, thread-safety of the + // interface is not affected by this option; const methods remain safe to + // call from multiple threads concurrently, while non-const methods continue + // to require exclusive access. + // + // + // Note that implementations may choose not to check required fields within + // a lazy sub-message. That is, calling IsInitialized() on the outer message + // may return true even if the inner message has missing required fields. + // This is necessary because otherwise the inner message would have to be + // parsed in order to perform the check, defeating the purpose of lazy + // parsing. An implementation which chooses not to check required fields + // must be consistent about it. That is, for any particular sub-message, the + // implementation must either *always* check its required fields, or *never* + // check its required fields, regardless of whether or not the message has + // been parsed. + optional bool lazy = 5 [default = false]; + + // Is this field deprecated? + // Depending on the target platform, this can emit Deprecated annotations + // for accessors, or it will be completely ignored; in the very least, this + // is a formalization for deprecating fields. + optional bool deprecated = 3 [default = false]; + + // For Google-internal migration only. Do not use. + optional bool weak = 10 [default = false]; + + + // The parser stores options it doesn't recognize here. See above. + repeated UninterpretedOption uninterpreted_option = 999; + + // Clients can define custom options in extensions of this message. See above. + extensions 1000 to max; + + reserved 4; // removed jtype +} + +message OneofOptions { + // The parser stores options it doesn't recognize here. See above. + repeated UninterpretedOption uninterpreted_option = 999; + + // Clients can define custom options in extensions of this message. See above. + extensions 1000 to max; +} + +message EnumOptions { + + // Set this option to true to allow mapping different tag names to the same + // value. + optional bool allow_alias = 2; + + // Is this enum deprecated? + // Depending on the target platform, this can emit Deprecated annotations + // for the enum, or it will be completely ignored; in the very least, this + // is a formalization for deprecating enums. + optional bool deprecated = 3 [default = false]; + + reserved 5; // javanano_as_lite + + // The parser stores options it doesn't recognize here. See above. + repeated UninterpretedOption uninterpreted_option = 999; + + // Clients can define custom options in extensions of this message. See above. + extensions 1000 to max; +} + +message EnumValueOptions { + // Is this enum value deprecated? + // Depending on the target platform, this can emit Deprecated annotations + // for the enum value, or it will be completely ignored; in the very least, + // this is a formalization for deprecating enum values. + optional bool deprecated = 1 [default = false]; + + // The parser stores options it doesn't recognize here. See above. + repeated UninterpretedOption uninterpreted_option = 999; + + // Clients can define custom options in extensions of this message. See above. + extensions 1000 to max; +} + +message ServiceOptions { + + // Note: Field numbers 1 through 32 are reserved for Google's internal RPC + // framework. We apologize for hoarding these numbers to ourselves, but + // we were already using them long before we decided to release Protocol + // Buffers. + + // Is this service deprecated? + // Depending on the target platform, this can emit Deprecated annotations + // for the service, or it will be completely ignored; in the very least, + // this is a formalization for deprecating services. + optional bool deprecated = 33 [default = false]; + + // The parser stores options it doesn't recognize here. See above. + repeated UninterpretedOption uninterpreted_option = 999; + + // Clients can define custom options in extensions of this message. See above. + extensions 1000 to max; +} + +message MethodOptions { + + // Note: Field numbers 1 through 32 are reserved for Google's internal RPC + // framework. We apologize for hoarding these numbers to ourselves, but + // we were already using them long before we decided to release Protocol + // Buffers. + + // Is this method deprecated? + // Depending on the target platform, this can emit Deprecated annotations + // for the method, or it will be completely ignored; in the very least, + // this is a formalization for deprecating methods. + optional bool deprecated = 33 [default = false]; + + // Is this method side-effect-free (or safe in HTTP parlance), or idempotent, + // or neither? HTTP based RPC implementation may choose GET verb for safe + // methods, and PUT verb for idempotent methods instead of the default POST. + enum IdempotencyLevel { + IDEMPOTENCY_UNKNOWN = 0; + NO_SIDE_EFFECTS = 1; // implies idempotent + IDEMPOTENT = 2; // idempotent, but may have side effects + } + optional IdempotencyLevel idempotency_level = 34 + [default = IDEMPOTENCY_UNKNOWN]; + + // The parser stores options it doesn't recognize here. See above. + repeated UninterpretedOption uninterpreted_option = 999; + + // Clients can define custom options in extensions of this message. See above. + extensions 1000 to max; +} + + +// A message representing a option the parser does not recognize. This only +// appears in options protos created by the compiler::Parser class. +// DescriptorPool resolves these when building Descriptor objects. Therefore, +// options protos in descriptor objects (e.g. returned by Descriptor::options(), +// or produced by Descriptor::CopyTo()) will never have UninterpretedOptions +// in them. +message UninterpretedOption { + // The name of the uninterpreted option. Each string represents a segment in + // a dot-separated name. is_extension is true iff a segment represents an + // extension (denoted with parentheses in options specs in .proto files). + // E.g.,{ ["foo", false], ["bar.baz", true], ["qux", false] } represents + // "foo.(bar.baz).qux". + message NamePart { + required string name_part = 1; + required bool is_extension = 2; + } + repeated NamePart name = 2; + + // The value of the uninterpreted option, in whatever type the tokenizer + // identified it as during parsing. Exactly one of these should be set. + optional string identifier_value = 3; + optional uint64 positive_int_value = 4; + optional int64 negative_int_value = 5; + optional double double_value = 6; + optional bytes string_value = 7; + optional string aggregate_value = 8; +} + +// =================================================================== +// Optional source code info + +// Encapsulates information about the original source file from which a +// FileDescriptorProto was generated. +message SourceCodeInfo { + // A Location identifies a piece of source code in a .proto file which + // corresponds to a particular definition. This information is intended + // to be useful to IDEs, code indexers, documentation generators, and similar + // tools. + // + // For example, say we have a file like: + // message Foo { + // optional string foo = 1; + // } + // Let's look at just the field definition: + // optional string foo = 1; + // ^ ^^ ^^ ^ ^^^ + // a bc de f ghi + // We have the following locations: + // span path represents + // [a,i) [ 4, 0, 2, 0 ] The whole field definition. + // [a,b) [ 4, 0, 2, 0, 4 ] The label (optional). + // [c,d) [ 4, 0, 2, 0, 5 ] The type (string). + // [e,f) [ 4, 0, 2, 0, 1 ] The name (foo). + // [g,h) [ 4, 0, 2, 0, 3 ] The number (1). + // + // Notes: + // - A location may refer to a repeated field itself (i.e. not to any + // particular index within it). This is used whenever a set of elements are + // logically enclosed in a single code segment. For example, an entire + // extend block (possibly containing multiple extension definitions) will + // have an outer location whose path refers to the "extensions" repeated + // field without an index. + // - Multiple locations may have the same path. This happens when a single + // logical declaration is spread out across multiple places. The most + // obvious example is the "extend" block again -- there may be multiple + // extend blocks in the same scope, each of which will have the same path. + // - A location's span is not always a subset of its parent's span. For + // example, the "extendee" of an extension declaration appears at the + // beginning of the "extend" block and is shared by all extensions within + // the block. + // - Just because a location's span is a subset of some other location's span + // does not mean that it is a descendant. For example, a "group" defines + // both a type and a field in a single declaration. Thus, the locations + // corresponding to the type and field and their components will overlap. + // - Code which tries to interpret locations should probably be designed to + // ignore those that it doesn't understand, as more types of locations could + // be recorded in the future. + repeated Location location = 1; + message Location { + // Identifies which part of the FileDescriptorProto was defined at this + // location. + // + // Each element is a field number or an index. They form a path from + // the root FileDescriptorProto to the place where the definition. For + // example, this path: + // [ 4, 3, 2, 7, 1 ] + // refers to: + // file.message_type(3) // 4, 3 + // .field(7) // 2, 7 + // .name() // 1 + // This is because FileDescriptorProto.message_type has field number 4: + // repeated DescriptorProto message_type = 4; + // and DescriptorProto.field has field number 2: + // repeated FieldDescriptorProto field = 2; + // and FieldDescriptorProto.name has field number 1: + // optional string name = 1; + // + // Thus, the above path gives the location of a field name. If we removed + // the last element: + // [ 4, 3, 2, 7 ] + // this path refers to the whole field declaration (from the beginning + // of the label to the terminating semicolon). + repeated int32 path = 1 [packed = true]; + + // Always has exactly three or four elements: start line, start column, + // end line (optional, otherwise assumed same as start line), end column. + // These are packed into a single field for efficiency. Note that line + // and column numbers are zero-based -- typically you will want to add + // 1 to each before displaying to a user. + repeated int32 span = 2 [packed = true]; + + // If this SourceCodeInfo represents a complete declaration, these are any + // comments appearing before and after the declaration which appear to be + // attached to the declaration. + // + // A series of line comments appearing on consecutive lines, with no other + // tokens appearing on those lines, will be treated as a single comment. + // + // leading_detached_comments will keep paragraphs of comments that appear + // before (but not connected to) the current element. Each paragraph, + // separated by empty lines, will be one comment element in the repeated + // field. + // + // Only the comment content is provided; comment markers (e.g. //) are + // stripped out. For block comments, leading whitespace and an asterisk + // will be stripped from the beginning of each line other than the first. + // Newlines are included in the output. + // + // Examples: + // + // optional int32 foo = 1; // Comment attached to foo. + // // Comment attached to bar. + // optional int32 bar = 2; + // + // optional string baz = 3; + // // Comment attached to baz. + // // Another line attached to baz. + // + // // Comment attached to qux. + // // + // // Another line attached to qux. + // optional double qux = 4; + // + // // Detached comment for corge. This is not leading or trailing comments + // // to qux or corge because there are blank lines separating it from + // // both. + // + // // Detached comment for corge paragraph 2. + // + // optional string corge = 5; + // /* Block comment attached + // * to corge. Leading asterisks + // * will be removed. */ + // /* Block comment attached to + // * grault. */ + // optional int32 grault = 6; + // + // // ignored detached comments. + optional string leading_comments = 3; + optional string trailing_comments = 4; + repeated string leading_detached_comments = 6; + } +} + +// Describes the relationship between generated code and its original source +// file. A GeneratedCodeInfo message is associated with only one generated +// source file, but may contain references to different source .proto files. +message GeneratedCodeInfo { + // An Annotation connects some span of text in generated code to an element + // of its generating .proto file. + repeated Annotation annotation = 1; + message Annotation { + // Identifies the element in the original source .proto file. This field + // is formatted the same as SourceCodeInfo.Location.path. + repeated int32 path = 1 [packed = true]; + + // Identifies the filesystem path to the original source .proto. + optional string source_file = 2; + + // Identifies the starting offset in bytes in the generated code + // that relates to the identified object. + optional int32 begin = 3; + + // Identifies the ending offset in bytes in the generated code that + // relates to the identified offset. The end offset should be one past + // the last relevant byte (so the length of the text = end - begin). + optional int32 end = 4; + } +} diff --git a/proto/protoc/include/google/protobuf/duration.proto b/proto/protoc/include/google/protobuf/duration.proto new file mode 100644 index 0000000..81c3e36 --- /dev/null +++ b/proto/protoc/include/google/protobuf/duration.proto @@ -0,0 +1,116 @@ +// 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 csharp_namespace = "Google.Protobuf.WellKnownTypes"; +option cc_enable_arenas = true; +option go_package = "google.golang.org/protobuf/types/known/durationpb"; +option java_package = "com.google.protobuf"; +option java_outer_classname = "DurationProto"; +option java_multiple_files = true; +option objc_class_prefix = "GPB"; + +// A Duration represents a signed, fixed-length span of time represented +// as a count of seconds and fractions of seconds at nanosecond +// resolution. It is independent of any calendar and concepts like "day" +// or "month". It is related to Timestamp in that the difference between +// two Timestamp values is a Duration and it can be added or subtracted +// from a Timestamp. Range is approximately +-10,000 years. +// +// # Examples +// +// Example 1: Compute Duration from two Timestamps in pseudo code. +// +// Timestamp start = ...; +// Timestamp end = ...; +// Duration duration = ...; +// +// duration.seconds = end.seconds - start.seconds; +// duration.nanos = end.nanos - start.nanos; +// +// if (duration.seconds < 0 && duration.nanos > 0) { +// duration.seconds += 1; +// duration.nanos -= 1000000000; +// } else if (duration.seconds > 0 && duration.nanos < 0) { +// duration.seconds -= 1; +// duration.nanos += 1000000000; +// } +// +// Example 2: Compute Timestamp from Timestamp + Duration in pseudo code. +// +// Timestamp start = ...; +// Duration duration = ...; +// Timestamp end = ...; +// +// end.seconds = start.seconds + duration.seconds; +// end.nanos = start.nanos + duration.nanos; +// +// if (end.nanos < 0) { +// end.seconds -= 1; +// end.nanos += 1000000000; +// } else if (end.nanos >= 1000000000) { +// end.seconds += 1; +// end.nanos -= 1000000000; +// } +// +// Example 3: Compute Duration from datetime.timedelta in Python. +// +// td = datetime.timedelta(days=3, minutes=10) +// duration = Duration() +// duration.FromTimedelta(td) +// +// # JSON Mapping +// +// In JSON format, the Duration type is encoded as a string rather than an +// object, where the string ends in the suffix "s" (indicating seconds) and +// is preceded by the number of seconds, with nanoseconds expressed as +// fractional seconds. For example, 3 seconds with 0 nanoseconds should be +// encoded in JSON format as "3s", while 3 seconds and 1 nanosecond should +// be expressed in JSON format as "3.000000001s", and 3 seconds and 1 +// microsecond should be expressed in JSON format as "3.000001s". +// +// +message Duration { + // Signed seconds of the span of time. Must be from -315,576,000,000 + // to +315,576,000,000 inclusive. Note: these bounds are computed from: + // 60 sec/min * 60 min/hr * 24 hr/day * 365.25 days/year * 10000 years + int64 seconds = 1; + + // Signed fractions of a second at nanosecond resolution of the span + // of time. Durations less than one second are represented with a 0 + // `seconds` field and a positive or negative `nanos` field. For durations + // of one second or more, a non-zero value for the `nanos` field must be + // of the same sign as the `seconds` field. Must be from -999,999,999 + // to +999,999,999 inclusive. + int32 nanos = 2; +} diff --git a/proto/protoc/include/google/protobuf/empty.proto b/proto/protoc/include/google/protobuf/empty.proto new file mode 100644 index 0000000..5f992de --- /dev/null +++ b/proto/protoc/include/google/protobuf/empty.proto @@ -0,0 +1,52 @@ +// 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 csharp_namespace = "Google.Protobuf.WellKnownTypes"; +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 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); +// } +// +// The JSON representation for `Empty` is empty JSON object `{}`. +message Empty {} diff --git a/proto/protoc/include/google/protobuf/field_mask.proto b/proto/protoc/include/google/protobuf/field_mask.proto new file mode 100644 index 0000000..6b5104f --- /dev/null +++ b/proto/protoc/include/google/protobuf/field_mask.proto @@ -0,0 +1,245 @@ +// 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 csharp_namespace = "Google.Protobuf.WellKnownTypes"; +option java_package = "com.google.protobuf"; +option java_outer_classname = "FieldMaskProto"; +option java_multiple_files = true; +option objc_class_prefix = "GPB"; +option go_package = "google.golang.org/protobuf/types/known/fieldmaskpb"; +option cc_enable_arenas = true; + +// `FieldMask` represents a set of symbolic field paths, for example: +// +// paths: "f.a" +// paths: "f.b.d" +// +// Here `f` represents a field in some root message, `a` and `b` +// fields in the message found in `f`, and `d` a field found in the +// message in `f.b`. +// +// Field masks are used to specify a subset of fields that should be +// returned by a get operation or modified by an update operation. +// Field masks also have a custom JSON encoding (see below). +// +// # Field Masks in Projections +// +// When used in the context of a projection, a response message or +// sub-message is filtered by the API to only contain those fields as +// specified in the mask. For example, if the mask in the previous +// example is applied to a response message as follows: +// +// f { +// a : 22 +// b { +// d : 1 +// x : 2 +// } +// y : 13 +// } +// z: 8 +// +// The result will not contain specific values for fields x,y and z +// (their value will be set to the default, and omitted in proto text +// output): +// +// +// f { +// a : 22 +// b { +// d : 1 +// } +// } +// +// A repeated field is not allowed except at the last position of a +// paths string. +// +// If a FieldMask object is not present in a get operation, the +// operation applies to all fields (as if a FieldMask of all fields +// had been specified). +// +// Note that a field mask does not necessarily apply to the +// top-level response message. In case of a REST get operation, the +// field mask applies directly to the response, but in case of a REST +// list operation, the mask instead applies to each individual message +// in the returned resource list. In case of a REST custom method, +// other definitions may be used. Where the mask applies will be +// clearly documented together with its declaration in the API. In +// any case, the effect on the returned resource/resources is required +// behavior for APIs. +// +// # Field Masks in Update Operations +// +// A field mask in update operations specifies which fields of the +// targeted resource are going to be updated. The API is required +// to only change the values of the fields as specified in the mask +// and leave the others untouched. If a resource is passed in to +// describe the updated values, the API ignores the values of all +// fields not covered by the mask. +// +// If a repeated field is specified for an update operation, new values will +// be appended to the existing repeated field in the target resource. Note that +// a repeated field is only allowed in the last position of a `paths` string. +// +// If a sub-message is specified in the last position of the field mask for an +// update operation, then new value will be merged into the existing sub-message +// in the target resource. +// +// For example, given the target message: +// +// f { +// b { +// d: 1 +// x: 2 +// } +// c: [1] +// } +// +// And an update message: +// +// f { +// b { +// d: 10 +// } +// c: [2] +// } +// +// then if the field mask is: +// +// paths: ["f.b", "f.c"] +// +// then the result will be: +// +// f { +// b { +// d: 10 +// x: 2 +// } +// c: [1, 2] +// } +// +// An implementation may provide options to override this default behavior for +// repeated and message fields. +// +// In order to reset a field's value to the default, the field must +// be in the mask and set to the default value in the provided resource. +// Hence, in order to reset all fields of a resource, provide a default +// instance of the resource and set all fields in the mask, or do +// not provide a mask as described below. +// +// If a field mask is not present on update, the operation applies to +// all fields (as if a field mask of all fields has been specified). +// Note that in the presence of schema evolution, this may mean that +// fields the client does not know and has therefore not filled into +// the request will be reset to their default. If this is unwanted +// behavior, a specific service may require a client to always specify +// a field mask, producing an error if not. +// +// As with get operations, the location of the resource which +// describes the updated values in the request message depends on the +// operation kind. In any case, the effect of the field mask is +// required to be honored by the API. +// +// ## Considerations for HTTP REST +// +// The HTTP kind of an update operation which uses a field mask must +// be set to PATCH instead of PUT in order to satisfy HTTP semantics +// (PUT must only be used for full updates). +// +// # JSON Encoding of Field Masks +// +// In JSON, a field mask is encoded as a single string where paths are +// separated by a comma. Fields name in each path are converted +// to/from lower-camel naming conventions. +// +// As an example, consider the following message declarations: +// +// message Profile { +// User user = 1; +// Photo photo = 2; +// } +// message User { +// string display_name = 1; +// string address = 2; +// } +// +// In proto a field mask for `Profile` may look as such: +// +// mask { +// paths: "user.display_name" +// paths: "photo" +// } +// +// In JSON, the same mask is represented as below: +// +// { +// mask: "user.displayName,photo" +// } +// +// # Field Masks and Oneof Fields +// +// Field masks treat fields in oneofs just as regular fields. Consider the +// following message: +// +// message SampleMessage { +// oneof test_oneof { +// string name = 4; +// SubMessage sub_message = 9; +// } +// } +// +// The field mask can be: +// +// mask { +// paths: "name" +// } +// +// Or: +// +// mask { +// paths: "sub_message" +// } +// +// Note that oneof type names ("test_oneof" in this case) cannot be used in +// paths. +// +// ## Field Mask Verification +// +// The implementation of any API method which has a FieldMask type field in the +// request should verify the included field paths, and return an +// `INVALID_ARGUMENT` error if any path is unmappable. +message FieldMask { + // The set of field mask paths. + repeated string paths = 1; +} diff --git a/proto/protoc/include/google/protobuf/source_context.proto b/proto/protoc/include/google/protobuf/source_context.proto new file mode 100644 index 0000000..06bfc43 --- /dev/null +++ b/proto/protoc/include/google/protobuf/source_context.proto @@ -0,0 +1,48 @@ +// 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 csharp_namespace = "Google.Protobuf.WellKnownTypes"; +option java_package = "com.google.protobuf"; +option java_outer_classname = "SourceContextProto"; +option java_multiple_files = true; +option objc_class_prefix = "GPB"; +option go_package = "google.golang.org/protobuf/types/known/sourcecontextpb"; + +// `SourceContext` represents information about the source of a +// protobuf element, like the file in which it is defined. +message SourceContext { + // The path-qualified name of the .proto file that contained the associated + // protobuf element. For example: `"google/protobuf/source_context.proto"`. + string file_name = 1; +} diff --git a/proto/protoc/include/google/protobuf/struct.proto b/proto/protoc/include/google/protobuf/struct.proto new file mode 100644 index 0000000..545215c --- /dev/null +++ b/proto/protoc/include/google/protobuf/struct.proto @@ -0,0 +1,95 @@ +// 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 csharp_namespace = "Google.Protobuf.WellKnownTypes"; +option cc_enable_arenas = true; +option go_package = "google.golang.org/protobuf/types/known/structpb"; +option java_package = "com.google.protobuf"; +option java_outer_classname = "StructProto"; +option java_multiple_files = true; +option objc_class_prefix = "GPB"; + +// `Struct` represents a structured data value, consisting of fields +// which map to dynamically typed values. In some languages, `Struct` +// might be supported by a native representation. For example, in +// scripting languages like JS a struct is represented as an +// object. The details of that representation are described together +// with the proto support for the language. +// +// The JSON representation for `Struct` is JSON object. +message Struct { + // Unordered map of dynamically typed values. + map fields = 1; +} + +// `Value` represents a dynamically typed value which can be either +// null, a number, a string, a boolean, a recursive struct value, or a +// list of values. A producer of value is expected to set one of that +// variants, absence of any variant indicates an error. +// +// The JSON representation for `Value` is JSON value. +message Value { + // The kind of value. + oneof kind { + // Represents a null value. + NullValue null_value = 1; + // Represents a double value. + double number_value = 2; + // Represents a string value. + string string_value = 3; + // Represents a boolean value. + bool bool_value = 4; + // Represents a structured value. + Struct struct_value = 5; + // Represents a repeated `Value`. + ListValue list_value = 6; + } +} + +// `NullValue` is a singleton enumeration to represent the null value for the +// `Value` type union. +// +// The JSON representation for `NullValue` is JSON `null`. +enum NullValue { + // Null value. + NULL_VALUE = 0; +} + +// `ListValue` is a wrapper around a repeated field of values. +// +// The JSON representation for `ListValue` is JSON array. +message ListValue { + // Repeated field of dynamically typed values. + repeated Value values = 1; +} diff --git a/proto/protoc/include/google/protobuf/timestamp.proto b/proto/protoc/include/google/protobuf/timestamp.proto new file mode 100644 index 0000000..3b2df6d --- /dev/null +++ b/proto/protoc/include/google/protobuf/timestamp.proto @@ -0,0 +1,147 @@ +// 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 csharp_namespace = "Google.Protobuf.WellKnownTypes"; +option cc_enable_arenas = true; +option go_package = "google.golang.org/protobuf/types/known/timestamppb"; +option java_package = "com.google.protobuf"; +option java_outer_classname = "TimestampProto"; +option java_multiple_files = true; +option objc_class_prefix = "GPB"; + +// A Timestamp represents a point in time independent of any time zone or local +// calendar, encoded as a count of seconds and fractions of seconds at +// nanosecond resolution. The count is relative to an epoch at UTC midnight on +// January 1, 1970, in the proleptic Gregorian calendar which extends the +// Gregorian calendar backwards to year one. +// +// All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap +// second table is needed for interpretation, using a [24-hour linear +// smear](https://developers.google.com/time/smear). +// +// The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By +// restricting to that range, we ensure that we can convert to and from [RFC +// 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. +// +// # Examples +// +// Example 1: Compute Timestamp from POSIX `time()`. +// +// Timestamp timestamp; +// timestamp.set_seconds(time(NULL)); +// timestamp.set_nanos(0); +// +// Example 2: Compute Timestamp from POSIX `gettimeofday()`. +// +// struct timeval tv; +// gettimeofday(&tv, NULL); +// +// Timestamp timestamp; +// timestamp.set_seconds(tv.tv_sec); +// timestamp.set_nanos(tv.tv_usec * 1000); +// +// Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. +// +// FILETIME ft; +// GetSystemTimeAsFileTime(&ft); +// UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; +// +// // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z +// // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. +// Timestamp timestamp; +// timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); +// timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); +// +// Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. +// +// long millis = System.currentTimeMillis(); +// +// Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) +// .setNanos((int) ((millis % 1000) * 1000000)).build(); +// +// +// Example 5: Compute Timestamp from Java `Instant.now()`. +// +// Instant now = Instant.now(); +// +// Timestamp timestamp = +// Timestamp.newBuilder().setSeconds(now.getEpochSecond()) +// .setNanos(now.getNano()).build(); +// +// +// Example 6: Compute Timestamp from current time in Python. +// +// timestamp = Timestamp() +// timestamp.GetCurrentTime() +// +// # JSON Mapping +// +// In JSON format, the Timestamp type is encoded as a string in the +// [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the +// format is "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" +// where {year} is always expressed using four digits while {month}, {day}, +// {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional +// seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), +// are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone +// is required. A proto3 JSON serializer should always use UTC (as indicated by +// "Z") when printing the Timestamp type and a proto3 JSON parser should be +// able to accept both UTC and other timezones (as indicated by an offset). +// +// For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past +// 01:30 UTC on January 15, 2017. +// +// In JavaScript, one can convert a Date object to this format using the +// standard +// [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) +// method. In Python, a standard `datetime.datetime` object can be converted +// to this format using +// [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with +// the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use +// the Joda Time's [`ISODateTimeFormat.dateTime()`]( +// http://www.joda.org/joda-time/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime%2D%2D +// ) to obtain a formatter capable of generating timestamps in this format. +// +// +message Timestamp { + // Represents seconds of UTC time since Unix epoch + // 1970-01-01T00:00:00Z. Must be from 0001-01-01T00:00:00Z to + // 9999-12-31T23:59:59Z inclusive. + int64 seconds = 1; + + // Non-negative fractions of a second at nanosecond resolution. Negative + // second values with fractions must still have non-negative nanos values + // that count forward in time. Must be from 0 to 999,999,999 + // inclusive. + int32 nanos = 2; +} diff --git a/proto/protoc/include/google/protobuf/type.proto b/proto/protoc/include/google/protobuf/type.proto new file mode 100644 index 0000000..d3f6a68 --- /dev/null +++ b/proto/protoc/include/google/protobuf/type.proto @@ -0,0 +1,187 @@ +// 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; + +import "google/protobuf/any.proto"; +import "google/protobuf/source_context.proto"; + +option csharp_namespace = "Google.Protobuf.WellKnownTypes"; +option cc_enable_arenas = true; +option java_package = "com.google.protobuf"; +option java_outer_classname = "TypeProto"; +option java_multiple_files = true; +option objc_class_prefix = "GPB"; +option go_package = "google.golang.org/protobuf/types/known/typepb"; + +// A protocol buffer message type. +message Type { + // The fully qualified message name. + string name = 1; + // The list of fields. + repeated Field fields = 2; + // The list of types appearing in `oneof` definitions in this type. + repeated string oneofs = 3; + // The protocol buffer options. + repeated Option options = 4; + // The source context. + SourceContext source_context = 5; + // The source syntax. + Syntax syntax = 6; +} + +// A single field of a message type. +message Field { + // Basic field types. + enum Kind { + // Field type unknown. + TYPE_UNKNOWN = 0; + // Field type double. + TYPE_DOUBLE = 1; + // Field type float. + TYPE_FLOAT = 2; + // Field type int64. + TYPE_INT64 = 3; + // Field type uint64. + TYPE_UINT64 = 4; + // Field type int32. + TYPE_INT32 = 5; + // Field type fixed64. + TYPE_FIXED64 = 6; + // Field type fixed32. + TYPE_FIXED32 = 7; + // Field type bool. + TYPE_BOOL = 8; + // Field type string. + TYPE_STRING = 9; + // Field type group. Proto2 syntax only, and deprecated. + TYPE_GROUP = 10; + // Field type message. + TYPE_MESSAGE = 11; + // Field type bytes. + TYPE_BYTES = 12; + // Field type uint32. + TYPE_UINT32 = 13; + // Field type enum. + TYPE_ENUM = 14; + // Field type sfixed32. + TYPE_SFIXED32 = 15; + // Field type sfixed64. + TYPE_SFIXED64 = 16; + // Field type sint32. + TYPE_SINT32 = 17; + // Field type sint64. + TYPE_SINT64 = 18; + } + + // Whether a field is optional, required, or repeated. + enum Cardinality { + // For fields with unknown cardinality. + CARDINALITY_UNKNOWN = 0; + // For optional fields. + CARDINALITY_OPTIONAL = 1; + // For required fields. Proto2 syntax only. + CARDINALITY_REQUIRED = 2; + // For repeated fields. + CARDINALITY_REPEATED = 3; + } + + // The field type. + Kind kind = 1; + // The field cardinality. + Cardinality cardinality = 2; + // The field number. + int32 number = 3; + // The field name. + string name = 4; + // The field type URL, without the scheme, for message or enumeration + // types. Example: `"type.googleapis.com/google.protobuf.Timestamp"`. + string type_url = 6; + // The index of the field type in `Type.oneofs`, for message or enumeration + // types. The first type has index 1; zero means the type is not in the list. + int32 oneof_index = 7; + // Whether to use alternative packed wire representation. + bool packed = 8; + // The protocol buffer options. + repeated Option options = 9; + // The field JSON name. + string json_name = 10; + // The string value of the default value of this field. Proto2 syntax only. + string default_value = 11; +} + +// Enum type definition. +message Enum { + // Enum type name. + string name = 1; + // Enum value definitions. + repeated EnumValue enumvalue = 2; + // Protocol buffer options. + repeated Option options = 3; + // The source context. + SourceContext source_context = 4; + // The source syntax. + Syntax syntax = 5; +} + +// Enum value definition. +message EnumValue { + // Enum value name. + string name = 1; + // Enum value number. + int32 number = 2; + // Protocol buffer options. + repeated Option options = 3; +} + +// A protocol buffer option, which can be attached to a message, field, +// enumeration, etc. +message Option { + // The option's name. For protobuf built-in options (options defined in + // descriptor.proto), this is the short name. For example, `"map_entry"`. + // For custom options, it should be the fully-qualified name. For example, + // `"google.api.http"`. + string name = 1; + // The option's value packed in an Any message. If the value is a primitive, + // the corresponding wrapper type defined in google/protobuf/wrappers.proto + // should be used. If the value is an enum, it should be stored as an int32 + // value using the google.protobuf.Int32Value type. + Any value = 2; +} + +// The syntax in which a protocol buffer element is defined. +enum Syntax { + // Syntax `proto2`. + SYNTAX_PROTO2 = 0; + // Syntax `proto3`. + SYNTAX_PROTO3 = 1; +} diff --git a/proto/protoc/include/google/protobuf/wrappers.proto b/proto/protoc/include/google/protobuf/wrappers.proto new file mode 100644 index 0000000..d49dd53 --- /dev/null +++ b/proto/protoc/include/google/protobuf/wrappers.proto @@ -0,0 +1,123 @@ +// 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 csharp_namespace = "Google.Protobuf.WellKnownTypes"; +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"; + +// 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; +} diff --git a/proto/protoc/readme.txt b/proto/protoc/readme.txt new file mode 100644 index 0000000..b6c9f9b --- /dev/null +++ b/proto/protoc/readme.txt @@ -0,0 +1,15 @@ +Protocol Buffers - Google's data interchange format +Copyright 2008 Google Inc. +https://developers.google.com/protocol-buffers/ + +This package contains a precompiled binary version of the protocol buffer +compiler (protoc). This binary is intended for users who want to use Protocol +Buffers in languages other than C++ but do not want to compile protoc +themselves. To install, simply place this binary somewhere in your PATH. + +If you intend to use the included well known types then don't forget to +copy the contents of the 'include' directory somewhere as well, for example +into '/usr/local/include/'. + +Please refer to our official github site for more installation instructions: + https://github.com/protocolbuffers/protobuf diff --git a/src/app/cmd/main/main.go b/src/app/cmd/main/main.go new file mode 100644 index 0000000..a3a9f86 --- /dev/null +++ b/src/app/cmd/main/main.go @@ -0,0 +1,10 @@ +package main + +import "app/service/main/game_mgr" + +func main() { + err := game_mgr.NewGameMgr().Run() + if err != nil { + panic(err) + } +} diff --git a/src/app/cmd/robot/main.go b/src/app/cmd/robot/main.go new file mode 100644 index 0000000..6a1d854 --- /dev/null +++ b/src/app/cmd/robot/main.go @@ -0,0 +1,49 @@ +package main + +import ( + "app/service/main/message/pb" + "app/service/main/msg_util" + "app/service/robot/user" + "core/network" + "sync" +) + +func main() { + client := network.NewTcpClient( + ":8888", + newParser, + newHandler) + err := client.Connect(false) + if err != nil { + return + } + if err != nil { + panic(err) + } + err = client.SendMsg(&pb.Report{ + Info: []*pb.ReportInfo{ + { + OpenId: "1", + Score: 123, + }, + { + OpenId: "2", + Score: 456, + }, + }, + }) + if err != nil { + panic(err) + } + wg := &sync.WaitGroup{} + wg.Add(1) + wg.Wait() +} + +func newParser() network.ICodec { + return msg_util.NewProtoCodec(msg_util.NewProtoParser("message", "MSG_TYPE"), 1024*64, false) +} + +func newHandler() network.INetHandler { + return user.NewUser() +} diff --git a/src/app/cmd/service/main.go b/src/app/cmd/service/main.go deleted file mode 100644 index 57a6f20..0000000 --- a/src/app/cmd/service/main.go +++ /dev/null @@ -1,167 +0,0 @@ -package main - -import ( - "app/internal/config" - "app/servers/gate" - "app/servers/robot" - "app/servers/role" - "fmt" - "math/rand" - "os" - "path" - "runtime/debug" - "time" - - "app/internal/flags" - "app/internal/iniconfig" - "app/internal/service" - "app/servers/game" - "app/servers/login" - "core/abtime" - "core/actor" - "core/actor/cluster/mesh_provider/etcd" - "core/actor/cluster/remote_provider/nats" - "core/actor/cluster/remote_provider/prs" - "core/goroutine" - "core/log" - "core/prometheus" - "core/tools" -) - -var opts struct { - Conf string `long:"conf" required:"true" description:"ini file path"` - AppType string `long:"app" required:"true" choice:"game" choice:"chat" choice:"login" choice:"payment" choice:"webconsole" choice:"battle" choice:"robot" choice:"dbupdate" choice:"all" description:"app type"` - AppId int32 `long:"id" required:"true" description:"app id"` - LogFile string `long:"lfile" description:"Log file, the default output is stdout"` - LogLevel string `long:"llevel" default:"debug" choice:"debug" choice:"info" choice:"warn" choice:"error" choice:"fatal" description:"Log level"` -} - -func main() { - flags.Parse(&opts) - log.Init(opts.LogFile, opts.LogLevel) - defer log.Stop() - - freeOSMemory() - goroutine.Try(func() { - rand.Seed(abtime.Now().UnixNano()) //设置随机数种子 - - tools.PProfInit() - iniconfig.Init(opts.Conf) //服务器基础配置加载 - tools.InitSnowflake(int64(opts.AppId)) - - systemConf := iniconfig.NewAppConf(opts.AppType, opts.AppId) - system := initActorSystem(opts.AppType, opts.AppId, systemConf) - - //策划配置档加载 - tools.AssertNil(config.Reload(systemConf.String("csv_dir"))) - system.Actor().RegistCmd("cfg_reload", func(param string) ([]byte, error) { - err := config.Reload(systemConf.String("csv_dir")) - return []byte("cfg_reload"), err - }) - - switch opts.AppType { - case service.All: - newActor(system, service.Login, 1) - newActor(system, service.Gate, 1) - newActor(system, service.Gate, 2) - newActor(system, service.Game, 1) - newActor(system, service.GameMap, 1) - newActor(system, service.RoleGate, 1) - newActor(system, service.Role, 1) - newActor(system, service.Role, 2) - default: - newActor(system, opts.AppType, opts.AppId) - } - - system.WaitStop() - }, nil) -} - -func newActor(system *actor.ActorSystem, appType string, appId int32) { - s := newService(appType, appId) - tools.AssertNotNil(s) - serviceId := service.ServiceId(appType, appId) - system.NewActor(appType, serviceId, s, actorTimerAccuracy(appType), actorSetInitErrExit(appType)) -} - -func newService(appType string, appId int32) (ret actor.IActorHandler) { - switch appType { - case service.Login: - ret = login.NewLogin(appId) - case service.Gate: - ret = gate.NewGate(appId) - case service.Game: - ret = game.NewGame(appId) - case service.Role: - ret = role.NewRole(appId) - case service.Robot: - ret = robot.NewRobot(appId) - default: - log.KV("appType", appType).Error("invalid appType") - } - return -} - -// 设置定时器精度 -func actorTimerAccuracy(appType string) actor.ActorOption { - switch appType { - case service.Game, service.GameMap: - return actor.SetTimerAccuracy(time.Second/20, time.Hour*24) - case service.Role: - return actor.SetTimerAccuracy(time.Second, time.Hour*24) - case service.Robot: - return actor.SetTimerAccuracy(time.Second/20, time.Hour*24) - default: - return actor.NilActorOption() - } -} - -// 设置Init失败是否退出system -func actorSetInitErrExit(appType string) actor.ActorOption { - //目前只有robot不退出 - switch appType { - case service.Robot: - return actor.NilActorOption() - default: - return actor.SetInitErrExit() - } -} - -func initActorSystem(appType string, appId int32, conf *iniconfig.Config) *actor.ActorSystem { - ops := []actor.SystemOption{} - - if nats_addr := conf.MustString("nats_addr", ""); nats_addr != "" { - ops = append(ops, actor.WithRemote(nats.NewRemote(nats_addr, fmt.Sprintf("%v%v", appType, appId)))) - } else if actor_addr := conf.MustString("actor_addr", ""); actor_addr != "" { - ops = append(ops, actor.WithRemote(prs.NewRemote(actor_addr))) - } - - if etcd_addr := conf.MustString("etcd_addr", ""); etcd_addr != "" { - ops = append(ops, actor.WithMesh(etcd.NewMesh(etcd_addr, conf.String("etcd_prefix")))) - } - - if prometheus_addr := conf.MustString("prometheus_addr", ""); prometheus_addr != "" { - prom := prometheus.Default().Start(prometheus_addr) - ops = append(ops, actor.WithPrometheus(prom)) - } - - if ipcDir := conf.MustString("ipc_dir", "./tmp/prs/socks/"); len(ipcDir) > 0 { - err := os.MkdirAll(ipcDir, os.ModePerm) - tools.AssertNil(err) - ipcFilename := path.Join(ipcDir, fmt.Sprintf("%v_%v.sock", appType, appId)) - ops = append(ops, actor.WithCMD(ipcFilename)) - } - - ops = append(ops, actor.WithStopSignal()) - return actor.NewActorSystem(ops...) -} - -func freeOSMemory() { - goroutine.GoLogic(func() { - ticker := time.NewTicker(time.Minute * 10) - select { - case <-ticker.C: - debug.FreeOSMemory() - } - }, nil) -} diff --git a/src/app/go.mod b/src/app/go.mod index e706f5d..c22c56b 100644 --- a/src/app/go.mod +++ b/src/app/go.mod @@ -4,60 +4,18 @@ go 1.22.1 require ( core v0.0.0-00010101000000-000000000000 - github.com/go-ini/ini v1.62.0 - github.com/jessevdk/go-flags v1.5.0 - github.com/orcaman/concurrent-map v1.0.0 - github.com/tealeg/xlsx v1.0.5 - golang.org/x/exp v0.0.0-20220916125017-b168a2c6b86b + github.com/redis/go-redis/v9 v9.5.1 google.golang.org/protobuf v1.33.0 - xorm.io/xorm v1.3.1 ) require ( - github.com/beorn7/perks v1.0.1 // indirect - github.com/bwmarrin/snowflake v0.3.0 // indirect - github.com/cespare/xxhash/v2 v2.1.2 // indirect - github.com/coreos/go-semver v0.3.0 // indirect - github.com/coreos/go-systemd/v22 v22.3.2 // indirect - github.com/go-sql-driver/mysql v1.6.0 // indirect - github.com/goccy/go-json v0.8.1 // indirect - github.com/gogo/protobuf v1.3.2 // indirect - github.com/golang/protobuf v1.5.2 // indirect - github.com/golang/snappy v0.0.4 // indirect - github.com/google/uuid v1.3.0 // indirect - github.com/jonboulle/clockwork v0.2.2 // indirect - github.com/json-iterator/go v1.1.12 // indirect - github.com/kr/pretty v0.3.0 // indirect - github.com/lestrrat-go/file-rotatelogs v2.4.0+incompatible // indirect - github.com/lestrrat-go/strftime v1.0.6 // indirect - github.com/mattn/go-isatty v0.0.16 // indirect - github.com/matttproud/golang_protobuf_extensions v1.0.1 // indirect - github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect - github.com/modern-go/reflect2 v1.0.2 // indirect - github.com/onsi/ginkgo v1.10.1 // indirect - github.com/onsi/gomega v1.7.0 // indirect + github.com/cespare/xxhash/v2 v2.2.0 // indirect + github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f // indirect github.com/panjf2000/ants/v2 v2.5.0 // indirect - github.com/pkg/errors v0.9.1 // indirect - github.com/prometheus/client_golang v1.12.2 // indirect - github.com/prometheus/client_model v0.2.0 // indirect - github.com/prometheus/common v0.32.1 // indirect - github.com/prometheus/procfs v0.7.3 // indirect + github.com/sirupsen/logrus v1.9.3 // indirect github.com/stretchr/testify v1.8.0 // indirect - github.com/syndtr/goleveldb v1.0.0 // indirect - github.com/yuin/gopher-lua v0.0.0-20220504180219-658193537a64 // indirect - go.etcd.io/etcd/api/v3 v3.5.4 // indirect - go.etcd.io/etcd/client/pkg/v3 v3.5.4 // indirect - go.etcd.io/etcd/client/v3 v3.5.4 // indirect go.uber.org/atomic v1.9.0 // indirect - go.uber.org/multierr v1.6.0 // indirect - go.uber.org/zap v1.21.0 // indirect - golang.org/x/net v0.0.0-20220722155237-a158d28d115b // indirect golang.org/x/sys v0.0.0-20220829200755-d48e67d00261 // indirect - golang.org/x/text v0.3.7 // indirect - google.golang.org/genproto v0.0.0-20210608205507-b6d2f5bf0d7d // indirect - google.golang.org/grpc v1.39.0 // indirect - gopkg.in/ini.v1 v1.51.0 // indirect - xorm.io/builder v0.3.11-0.20220531020008-1bd24a7dc978 // indirect ) diff --git a/src/app/go.sum b/src/app/go.sum index e020dc3..1fed43a 100644 --- a/src/app/go.sum +++ b/src/app/go.sum @@ -1,1056 +1,41 @@ -cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= -cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= -cloud.google.com/go v0.38.0/go.mod h1:990N+gfupTy94rShfmMCWGDn0LpTmnzTp2qbd1dvSRU= -cloud.google.com/go v0.44.1/go.mod h1:iSa0KzasP4Uvy3f1mN/7PiObzGgflwredwwASm/v6AU= -cloud.google.com/go v0.44.2/go.mod h1:60680Gw3Yr4ikxnPRS/oxxkBccT6SA1yMk63TGekxKY= -cloud.google.com/go v0.45.1/go.mod h1:RpBamKRgapWJb87xiFSdk4g1CME7QZg3uwTez+TSTjc= -cloud.google.com/go v0.46.3/go.mod h1:a6bKKbmY7er1mI7TEI4lsAkts/mkhTSZK8w33B4RAg0= -cloud.google.com/go v0.50.0/go.mod h1:r9sluTvynVuxRIOHXQEHMFffphuXHOMZMycpNR5e6To= -cloud.google.com/go v0.52.0/go.mod h1:pXajvRH/6o3+F9jDHZWQ5PbGhn+o8w9qiu/CffaVdO4= -cloud.google.com/go v0.53.0/go.mod h1:fp/UouUEsRkN6ryDKNW/Upv/JBKnv6WDthjR6+vze6M= -cloud.google.com/go v0.54.0/go.mod h1:1rq2OEkV3YMf6n/9ZvGWI3GWw0VoqH/1x2nd8Is/bPc= -cloud.google.com/go v0.56.0/go.mod h1:jr7tqZxxKOVYizybht9+26Z/gUq7tiRzu+ACVAMbKVk= -cloud.google.com/go v0.57.0/go.mod h1:oXiQ6Rzq3RAkkY7N6t3TcE6jE+CIBBbA36lwQ1JyzZs= -cloud.google.com/go v0.62.0/go.mod h1:jmCYTdRCQuc1PHIIJ/maLInMho30T/Y0M4hTdTShOYc= -cloud.google.com/go v0.65.0/go.mod h1:O5N8zS7uWy9vkA9vayVHs65eM1ubvY4h553ofrNHObY= -cloud.google.com/go/bigquery v1.0.1/go.mod h1:i/xbL2UlR5RvWAURpBYZTtm/cXjCha9lbfbpx4poX+o= -cloud.google.com/go/bigquery v1.3.0/go.mod h1:PjpwJnslEMmckchkHFfq+HTD2DmtT67aNFKH1/VBDHE= -cloud.google.com/go/bigquery v1.4.0/go.mod h1:S8dzgnTigyfTmLBfrtrhyYhwRxG72rYxvftPBK2Dvzc= -cloud.google.com/go/bigquery v1.5.0/go.mod h1:snEHRnqQbz117VIFhE8bmtwIDY80NLUZUMb4Nv6dBIg= -cloud.google.com/go/bigquery v1.7.0/go.mod h1://okPTzCYNXSlb24MZs83e2Do+h+VXtc4gLoIoXIAPc= -cloud.google.com/go/bigquery v1.8.0/go.mod h1:J5hqkt3O0uAFnINi6JXValWIb1v0goeZM77hZzJN/fQ= -cloud.google.com/go/datastore v1.0.0/go.mod h1:LXYbyblFSglQ5pkeyhO+Qmw7ukd3C+pD7TKLgZqpHYE= -cloud.google.com/go/datastore v1.1.0/go.mod h1:umbIZjpQpHh4hmRpGhH4tLFup+FVzqBi1b3c64qFpCk= -cloud.google.com/go/pubsub v1.0.1/go.mod h1:R0Gpsv3s54REJCy4fxDixWD93lHJMoZTyQ2kNxGRt3I= -cloud.google.com/go/pubsub v1.1.0/go.mod h1:EwwdRX2sKPjnvnqCa270oGRyludottCI76h+R3AArQw= -cloud.google.com/go/pubsub v1.2.0/go.mod h1:jhfEVHT8odbXTkndysNHCcx0awwzvfOlguIAii9o8iA= -cloud.google.com/go/pubsub v1.3.1/go.mod h1:i+ucay31+CNRpDW4Lu78I4xXG+O1r/MAHgjpRVR+TSU= -cloud.google.com/go/storage v1.0.0/go.mod h1:IhtSnM/ZTZV8YYJWCY8RULGVqBDmpoyjwiyrjsg+URw= -cloud.google.com/go/storage v1.5.0/go.mod h1:tpKbwo567HUNpVclU5sGELwQWBDZ8gh0ZeosJ0Rtdos= -cloud.google.com/go/storage v1.6.0/go.mod h1:N7U0C8pVQ/+NIKOBQyamJIeKQKkZ+mxpohlUTyfDhBk= -cloud.google.com/go/storage v1.8.0/go.mod h1:Wv1Oy7z6Yz3DshWRJFhqM/UCfaWIRTdp0RXyy7KQOVs= -cloud.google.com/go/storage v1.10.0/go.mod h1:FLPqc6j+Ki4BU591ie1oL6qBQGu2Bl/tZ9ullr3+Kg0= -dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= -gitea.com/xorm/sqlfiddle v0.0.0-20180821085327-62ce714f951a h1:lSA0F4e9A2NcQSqGqTOXqu2aRi/XEQxDCBwM8yJtE6s= -gitea.com/xorm/sqlfiddle v0.0.0-20180821085327-62ce714f951a/go.mod h1:EXuID2Zs0pAQhH8yz+DNjUbjppKQzKFAn28TMYPB6IU= -gitee.com/travelliu/dm v1.8.11192/go.mod h1:DHTzyhCrM843x9VdKVbZ+GKXGRbKM2sJ4LxihRxShkE= -github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= -github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= -github.com/Knetic/govaluate v3.0.1-0.20171022003610-9aa49832a739+incompatible/go.mod h1:r7JcOSlj0wfOMncg0iLm8Leh48TZaKVeNIfJntJ2wa0= -github.com/Masterminds/semver/v3 v3.1.1/go.mod h1:VPu/7SZ7ePZ3QOrcuXROw5FAcLl4a0cBrbBpGY/8hQs= -github.com/Shopify/sarama v1.19.0/go.mod h1:FVkBWblsNy7DGZRfXLU0O9RCGt5g3g3yEuWXgklEdEo= -github.com/Shopify/toxiproxy v2.1.4+incompatible/go.mod h1:OXgGpZ6Cli1/URJOF1DMxUHB2q5Ap20/P/eIdh4G0pI= -github.com/VividCortex/gohistogram v1.0.0/go.mod h1:Pf5mBqqDxYaXu3hDrrU+w6nw50o/4+TcAqDqk/vUH7g= -github.com/afex/hystrix-go v0.0.0-20180502004556-fa1af6a1f4f5/go.mod h1:SkGFH1ia65gfNATL8TAiHDNxPzPdmEL5uirI2Uyuz6c= -github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= -github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= -github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= -github.com/alecthomas/units v0.0.0-20190717042225-c3de453c63f4/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= -github.com/alecthomas/units v0.0.0-20190924025748-f65c72e2690d/go.mod h1:rBZYJk541a8SKzHPHnH3zbiI+7dagKZ0cgpgrD7Fyho= -github.com/antihax/optional v1.0.0/go.mod h1:uupD/76wgC+ih3iEmQUL+0Ugr19nfwCT1kdvxnR2qWY= -github.com/apache/thrift v0.12.0/go.mod h1:cp2SuWMxlEZw2r+iP2GNCdIi4C1qmUzdZFSVb+bacwQ= -github.com/apache/thrift v0.13.0/go.mod h1:cp2SuWMxlEZw2r+iP2GNCdIi4C1qmUzdZFSVb+bacwQ= -github.com/armon/circbuf v0.0.0-20150827004946-bbbad097214e/go.mod h1:3U/XgcO3hCbHZ8TKRvWD2dDTCfh9M9ya+I9JpbB7O8o= -github.com/armon/go-metrics v0.0.0-20180917152333-f0300d1749da/go.mod h1:Q73ZrmVTwzkszR9V5SSuryQ31EELlFMUz1kKyl939pY= -github.com/armon/go-radix v0.0.0-20180808171621-7fddfc383310/go.mod h1:ufUuZ+zHj4x4TnLV4JWEpy2hxWSpsRywHrMgIH9cCH8= -github.com/aryann/difflib v0.0.0-20170710044230-e206f873d14a/go.mod h1:DAHtR1m6lCRdSC2Tm3DSWRPvIPr6xNKyeHdqDQSQT+A= -github.com/aws/aws-lambda-go v1.13.3/go.mod h1:4UKl9IzQMoD+QF79YdCuzCwp8VbmG4VAQwij/eHl5CU= -github.com/aws/aws-sdk-go v1.27.0/go.mod h1:KmX6BPdI08NWTb3/sm4ZGu5ShLoqVDhKgpiN924inxo= -github.com/aws/aws-sdk-go-v2 v0.18.0/go.mod h1:JWVYvqSMppoMJC0x5wdwiImzgXTI9FuZwxzkQq9wy+g= -github.com/benbjohnson/clock v1.1.0 h1:Q92kusRqC1XV2MjkWETPvjJVqKetz1OzxZB7mHJLju8= -github.com/benbjohnson/clock v1.1.0/go.mod h1:J11/hYXuz8f4ySSvYwY0FKfm+ezbsZBKZxNJlLklBHA= -github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q= -github.com/beorn7/perks v1.0.0/go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+CedLV8= -github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM= -github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw= -github.com/bgentry/speakeasy v0.1.0/go.mod h1:+zsyZBPWlz7T6j88CTgSN5bM796AkVf0kBD4zp0CCIs= -github.com/bwmarrin/snowflake v0.3.0 h1:xm67bEhkKh6ij1790JB83OujPR5CzNe8QuQqAgISZN0= -github.com/bwmarrin/snowflake v0.3.0/go.mod h1:NdZxfVWX+oR6y2K0o6qAYv6gIOP9rjG0/E9WsDpxqwE= -github.com/casbin/casbin/v2 v2.1.2/go.mod h1:YcPU1XXisHhLzuxH9coDNf2FbKpjGlbCg3n9yuLkIJQ= -github.com/cenkalti/backoff v2.2.1+incompatible/go.mod h1:90ReRw6GdpyfrHakVjL/QHaoyV4aDUVVkXQJJJ3NXXM= -github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= -github.com/cespare/xxhash/v2 v2.1.1/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= -github.com/cespare/xxhash/v2 v2.1.2 h1:YRXhKfTDauu4ajMg1TPgFO5jnlC2HCbmLXMcTG5cbYE= -github.com/cespare/xxhash/v2 v2.1.2/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= -github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI= -github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e/go.mod h1:nSuG5e5PlCu98SY8svDHJxuZscDgtXS6KTTbou5AhLI= -github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1/go.mod h1:Q3SI9o4m/ZMnBNeIyt5eFwwo7qiLfzFZmjNmxjkiQlU= -github.com/clbanning/x2j v0.0.0-20191024224557-825249438eec/go.mod h1:jMjuTZXRI4dUb/I5gc9Hdhagfvm9+RyrPryS/auMzxE= -github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= -github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc= -github.com/cncf/udpa/go v0.0.0-20201120205902-5459f2c99403/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk= -github.com/cncf/xds/go v0.0.0-20210312221358-fbca930ec8ed/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= -github.com/cockroachdb/apd v1.1.0/go.mod h1:8Sl8LxpKi29FqWXR16WEFZRNSz3SoPzUzeMeY4+DwBQ= -github.com/cockroachdb/datadriven v0.0.0-20190809214429-80d97fb3cbaa/go.mod h1:zn76sxSg3SzpJ0PPJaLDCu+Bu0Lg3sKTORVIj19EIF8= -github.com/codahale/hdrhistogram v0.0.0-20161010025455-3a0bb77429bd/go.mod h1:sE/e/2PUdi/liOCUjSTXgM1o87ZssimdTWN964YiIeI= -github.com/coreos/go-semver v0.2.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk= -github.com/coreos/go-semver v0.3.0 h1:wkHLiw0WNATZnSG7epLsujiMCgPAc9xhjJ4tgnAxmfM= -github.com/coreos/go-semver v0.3.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk= -github.com/coreos/go-systemd v0.0.0-20180511133405-39ca1b05acc7/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4= -github.com/coreos/go-systemd v0.0.0-20190321100706-95778dfbb74e/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4= -github.com/coreos/go-systemd v0.0.0-20190719114852-fd7a80b32e1f/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4= -github.com/coreos/go-systemd/v22 v22.3.2 h1:D9/bQk5vlXQFZ6Kwuu6zaiXJ9oTPe68++AzAJc1DzSI= -github.com/coreos/go-systemd/v22 v22.3.2/go.mod h1:Y58oyj3AT4RCenI/lSvhwexgC+NSVTIJ3seZv2GcEnc= -github.com/coreos/pkg v0.0.0-20160727233714-3ac0863d7acf/go.mod h1:E3G3o1h8I7cfcXa63jLwjI0eiQQMgzzUDFVpN/nH/eA= -github.com/cpuguy83/go-md2man/v2 v2.0.0-20190314233015-f79a8a8ca69d/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU= -github.com/creack/pty v1.1.7/go.mod h1:lj5s0c3V2DBrqTV7llrYr5NG6My20zk30Fl46Y7DoTY= -github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= +github.com/bsm/ginkgo/v2 v2.12.0 h1:Ny8MWAHyOepLGlLKYmXG4IEkioBysk6GpaRTLC8zwWs= +github.com/bsm/ginkgo/v2 v2.12.0/go.mod h1:SwYbGRRDovPVboqFv0tPTcG1sN61LM1Z4ARdbAV9g4c= +github.com/bsm/gomega v1.27.10 h1:yeMWxP2pV2fG3FgAODIY8EiRE3dy0aeFYt4l7wh6yKA= +github.com/bsm/gomega v1.27.10/go.mod h1:JyEr/xRbxbtgWNi8tIEVPUYZ5Dzef52k01W3YH0H+O0= +github.com/cespare/xxhash/v2 v2.2.0 h1:DC2CZ1Ep5Y4k3ZQ899DldepgrayRUGE6BBZ/cd9Cj44= +github.com/cespare/xxhash/v2 v2.2.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/denisenkom/go-mssqldb v0.10.0/go.mod h1:xbL0rPBG9cCiLr28tMa8zpbdarY27NDyej4t/EjAShU= -github.com/dgrijalva/jwt-go v3.2.0+incompatible/go.mod h1:E3ru+11k8xSBh+hMPgOLZmtrrCbhqsmaPHjLKYnJCaQ= -github.com/dustin/go-humanize v0.0.0-20171111073723-bb3d318650d4/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk= -github.com/dustin/go-humanize v1.0.0/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk= -github.com/eapache/go-resiliency v1.1.0/go.mod h1:kFI+JgMyC7bLPUVY133qvEBtVayf5mFgVsvEsIPBvNs= -github.com/eapache/go-xerial-snappy v0.0.0-20180814174437-776d5712da21/go.mod h1:+020luEh2TKB4/GOp8oxxtq0Daoen/Cii55CzbTV6DU= -github.com/eapache/queue v1.1.0/go.mod h1:6eCeP0CKFpHLu8blIFXhExK/dRa7WDZfr6jVFPTqq+I= -github.com/edsrzf/mmap-go v1.0.0/go.mod h1:YO35OhQPt3KJa3ryjFM5Bs14WD66h8eGKpfaBNrHW5M= -github.com/envoyproxy/go-control-plane v0.6.9/go.mod h1:SBwIajubJHhxtWwsL9s8ss4safvEdbitLhGGK48rN6g= -github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= -github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= -github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1mIlRU8Am5FuJP05cCM98= -github.com/envoyproxy/go-control-plane v0.9.9-0.20201210154907-fd9021fe5dad/go.mod h1:cXg6YxExXjJnVBQHBLXeUAgxn2UodCpnH306RInaBQk= -github.com/envoyproxy/go-control-plane v0.9.9-0.20210217033140-668b12f5399d/go.mod h1:cXg6YxExXjJnVBQHBLXeUAgxn2UodCpnH306RInaBQk= -github.com/envoyproxy/go-control-plane v0.9.9-0.20210512163311-63b5d3c536b0/go.mod h1:hliV/p42l8fGbc6Y9bQ70uLwIvmJyVE5k4iMKlh8wCQ= -github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= -github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4= -github.com/franela/goblin v0.0.0-20200105215937-c9ffbefa60db/go.mod h1:7dvUGVsVBjqR7JHJk0brhHOZYGmfBYOrK0ZhYMEtBr4= -github.com/franela/goreq v0.0.0-20171204163338-bcd34c9993f8/go.mod h1:ZhphrRTfi2rbfLwlschooIH4+wKKDR4Pdxhh+TRoA20= -github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= -github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= -github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1/go.mod h1:vR7hzQXu2zJy9AVAgeJqvqgH9Q5CA+iKCZ2gyEVpxRU= -github.com/go-gl/glfw/v3.3/glfw v0.0.0-20191125211704-12ad95a8df72/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= -github.com/go-gl/glfw/v3.3/glfw v0.0.0-20200222043503-6f7a984d4dc4/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= -github.com/go-ini/ini v1.62.0 h1:7VJT/ZXjzqSrvtraFp4ONq80hTcRQth1c9ZnQ3uNQvU= -github.com/go-ini/ini v1.62.0/go.mod h1:ByCAeIL28uOIIG0E3PJtZPDL8WnHpFKFOtgjp+3Ies8= -github.com/go-kit/kit v0.8.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= -github.com/go-kit/kit v0.9.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= -github.com/go-kit/kit v0.10.0/go.mod h1:xUsJbQ/Fp4kEt7AFgCuvyX4a71u8h9jB8tj/ORgOZ7o= -github.com/go-kit/log v0.1.0/go.mod h1:zbhenjAZHb184qTLMA9ZjW7ThYL0H2mk7Q6pNt4vbaY= -github.com/go-logfmt/logfmt v0.3.0/go.mod h1:Qt1PoO58o5twSAckw1HlFXLmHsOX5/0LbT9GBnD5lWE= -github.com/go-logfmt/logfmt v0.4.0/go.mod h1:3RMwSq7FuexP4Kalkev3ejPJsZTpXXBr9+V4qmtdjCk= -github.com/go-logfmt/logfmt v0.5.0/go.mod h1:wCYkCAKZfumFQihp8CzCvQ3paCTfi41vtzG1KdI/P7A= -github.com/go-sql-driver/mysql v1.4.0/go.mod h1:zAC/RDZ24gD3HViQzih4MyKcchzm+sOG5ZlKdlhCg5w= -github.com/go-sql-driver/mysql v1.6.0 h1:BCTh4TKNUYmOmMUcQ3IipzF5prigylS7XXjEkfCHuOE= -github.com/go-sql-driver/mysql v1.6.0/go.mod h1:DCzpHaOWr8IXmIStZouvnhqoel9Qv2LBy8hT2VhHyBg= -github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= -github.com/goccy/go-json v0.8.1 h1:4/Wjm0JIJaTDm8K1KcGrLHJoa8EsJ13YWeX+6Kfq6uI= -github.com/goccy/go-json v0.8.1/go.mod h1:6MelG93GURQebXPDq3khkgXZkazVtN9CRI+MGFi0w8I= -github.com/godbus/dbus/v5 v5.0.4/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA= -github.com/gofrs/uuid v3.2.0+incompatible/go.mod h1:b2aQJv3Z4Fp6yNu3cdSllBxTCLRxnplIgP/c0N/04lM= -github.com/gofrs/uuid v4.0.0+incompatible/go.mod h1:b2aQJv3Z4Fp6yNu3cdSllBxTCLRxnplIgP/c0N/04lM= -github.com/gogo/googleapis v1.1.0/go.mod h1:gf4bu3Q80BeJ6H1S1vYPm8/ELATdvryBaNFGgqEef3s= -github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= -github.com/gogo/protobuf v1.2.0/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= -github.com/gogo/protobuf v1.2.1/go.mod h1:hp+jE20tsWTFYpLwKvXlhS1hjn+gTNwPg2I6zVXpSg4= -github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q= -github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q= -github.com/golang-sql/civil v0.0.0-20190719163853-cb61b32ac6fe/go.mod h1:8vg3r2VgvsThLBIFL93Qb5yWzgyZWhEmBwUJWevAkK0= -github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= -github.com/golang/groupcache v0.0.0-20160516000752-02826c3e7903/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= -github.com/golang/groupcache v0.0.0-20190702054246-869f871628b6/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= -github.com/golang/groupcache v0.0.0-20191227052852-215e87163ea7/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= -github.com/golang/groupcache v0.0.0-20200121045136-8c9f03a8e57e/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= -github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= -github.com/golang/mock v1.2.0/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= -github.com/golang/mock v1.3.1/go.mod h1:sBzyDLLjw3U8JLTeZvSv8jJB+tU5PVekmnlKIyFUx0Y= -github.com/golang/mock v1.4.0/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= -github.com/golang/mock v1.4.1/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= -github.com/golang/mock v1.4.3/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= -github.com/golang/mock v1.4.4/go.mod h1:l3mdAwkq5BuhzHwde/uurv3sEJeZMXNpwsxVWU71h+4= -github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= -github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= -github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= -github.com/golang/protobuf v1.3.3/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw= -github.com/golang/protobuf v1.3.4/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw= -github.com/golang/protobuf v1.3.5/go.mod h1:6O5/vntMXwX2lRkT1hjjk0nAC1IDOTvTlVgjlRvqsdk= -github.com/golang/protobuf v1.4.0-rc.1/go.mod h1:ceaxUfeHdC40wWswd/P6IGgMaK3YpKi5j83Wpe3EHw8= -github.com/golang/protobuf v1.4.0-rc.1.0.20200221234624-67d41d38c208/go.mod h1:xKAWHe0F5eneWXFV3EuXVDTCmh+JuBKY0li0aMyXATA= -github.com/golang/protobuf v1.4.0-rc.2/go.mod h1:LlEzMj4AhA7rCAGe4KMBDvJI+AwstrUpVNzEA03Pprs= -github.com/golang/protobuf v1.4.0-rc.4.0.20200313231945-b860323f09d0/go.mod h1:WU3c8KckQ9AFe+yFwt9sWVRKCVIyN9cPHBJSNnbL67w= -github.com/golang/protobuf v1.4.0/go.mod h1:jodUvKwWbYaEsadDk5Fwe5c77LiNKVO9IDvqG2KuDX0= -github.com/golang/protobuf v1.4.1/go.mod h1:U8fpvMrcmy5pZrNK1lt4xCsGvpyWQ/VVv6QDs8UjoX8= -github.com/golang/protobuf v1.4.2/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= -github.com/golang/protobuf v1.4.3/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= -github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk= -github.com/golang/protobuf v1.5.2 h1:ROPKBNFfQgOUMifHyP+KYbvpjbdoFNs+aK7DXlji0Tw= -github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= -github.com/golang/snappy v0.0.0-20180518054509-2e65f85255db/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= -github.com/golang/snappy v0.0.1/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= -github.com/golang/snappy v0.0.4 h1:yAGX7huGHXlcLOEtBnF4w7FQwA26wojNCwOYAEhLjQM= -github.com/golang/snappy v0.0.4/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= -github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= -github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= -github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= -github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= -github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= -github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.4.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.5.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.5.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.5.3/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.5.4/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f h1:lO4WD4F/rVNCu3HqELle0jiPLLBs70cWOduZpkS1E78= +github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f/go.mod h1:cuUVRXasLTGF7a8hSLbxyZXjz+1KgoB3wDUb6vlszIc= +github.com/google/go-cmp v0.5.5 h1:Khx7svrCpmxxtHBq5j2mp/xVjsi8hQMfNLvJFAlrGgU= github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.5.8 h1:e6P7q2lk1O+qJJb4BtCQXlK8vWEO8V1ZeuEdJNOqZyg= -github.com/google/go-cmp v0.5.8/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= -github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= -github.com/google/martian v2.1.0+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXiIaQGbYVAs8BPL6v8lEs= -github.com/google/martian/v3 v3.0.0/go.mod h1:y5Zk1BBys9G+gd6Jrk0W3cC1+ELVxBWuIGO+w/tUAp0= -github.com/google/pprof v0.0.0-20181206194817-3ea8567a2e57/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= -github.com/google/pprof v0.0.0-20190515194954-54271f7e092f/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= -github.com/google/pprof v0.0.0-20191218002539-d4f498aebedc/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= -github.com/google/pprof v0.0.0-20200212024743-f11f1df84d12/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= -github.com/google/pprof v0.0.0-20200229191704-1ebb73c60ed3/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= -github.com/google/pprof v0.0.0-20200430221834-fc25d7d30c6d/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= -github.com/google/pprof v0.0.0-20200708004538-1a94d8640e99/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= -github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI= -github.com/google/uuid v1.0.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/google/uuid v1.3.0 h1:t6JiXgmwXMjEs8VusXIJk2BXHsn+wx8BZdTaoZ5fu7I= -github.com/google/uuid v1.3.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg= -github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5mhpdKc/us6bOk= -github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1 h1:EGx4pi6eqNxGaHF6qqu48+N2wcFQ5qg5FXgOdqsJ5d8= -github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY= -github.com/gorilla/context v1.1.1/go.mod h1:kBGZzfjB9CEq2AlWe17Uuf7NDRt0dE0s8S51q0aT7Yg= -github.com/gorilla/mux v1.6.2/go.mod h1:1lud6UwP+6orDFRuTfBEV8e9/aOM/c4fVVCaMa2zaAs= -github.com/gorilla/mux v1.7.3/go.mod h1:1lud6UwP+6orDFRuTfBEV8e9/aOM/c4fVVCaMa2zaAs= -github.com/gorilla/websocket v0.0.0-20170926233335-4201258b820c/go.mod h1:E7qHFY5m1UJ88s3WnNqhKjPHQ0heANvMoAMk2YaljkQ= -github.com/grpc-ecosystem/go-grpc-middleware v1.0.1-0.20190118093823-f849b5445de4/go.mod h1:FiyG127CGDf3tlThmgyCl78X/SZQqEOJBCDaAfeWzPs= -github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0/go.mod h1:8NvIoxWQoOIhqOTXgfV/d3M/q6VIi02HzZEHgUlZvzk= -github.com/grpc-ecosystem/grpc-gateway v1.9.5/go.mod h1:vNeuVxBJEsws4ogUvrchl83t/GYV9WGTSLVdBhOQFDY= -github.com/grpc-ecosystem/grpc-gateway v1.16.0/go.mod h1:BDjrQk3hbvj6Nolgz8mAMFbcEtjT1g+wF4CSlocrBnw= -github.com/hashicorp/consul/api v1.3.0/go.mod h1:MmDNSzIMUjNpY/mQ398R4bk2FnqQLoPndWW5VkKPlCE= -github.com/hashicorp/consul/sdk v0.3.0/go.mod h1:VKf9jXwCTEY1QZP2MOLRhb5i/I/ssyNV1vwHyQBF0x8= -github.com/hashicorp/errwrap v1.0.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4= -github.com/hashicorp/go-cleanhttp v0.5.1/go.mod h1:JpRdi6/HCYpAwUzNwuwqhbovhLtngrth3wmdIIUrZ80= -github.com/hashicorp/go-immutable-radix v1.0.0/go.mod h1:0y9vanUI8NX6FsYoO3zeMjhV/C5i9g4Q3DwcSNZ4P60= -github.com/hashicorp/go-msgpack v0.5.3/go.mod h1:ahLV/dePpqEmjfWmKiqvPkv/twdG7iPBM1vqhUKIvfM= -github.com/hashicorp/go-multierror v1.0.0/go.mod h1:dHtQlpGsu+cZNNAkkCN/P3hoUDHhCYQXV3UM06sGGrk= -github.com/hashicorp/go-rootcerts v1.0.0/go.mod h1:K6zTfqpRlCUIjkwsN4Z+hiSfzSTQa6eBIzfwKfwNnHU= -github.com/hashicorp/go-sockaddr v1.0.0/go.mod h1:7Xibr9yA9JjQq1JpNB2Vw7kxv8xerXegt+ozgdvDeDU= -github.com/hashicorp/go-syslog v1.0.0/go.mod h1:qPfqrKkXGihmCqbJM2mZgkZGvKG1dFdvsLplgctolz4= -github.com/hashicorp/go-uuid v1.0.0/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= -github.com/hashicorp/go-uuid v1.0.1/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= -github.com/hashicorp/go-version v1.2.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA= -github.com/hashicorp/go.net v0.0.1/go.mod h1:hjKkEWcCURg++eb33jQU7oqQcI9XDCnUzHA0oac0k90= -github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= -github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= -github.com/hashicorp/logutils v1.0.0/go.mod h1:QIAnNjmIWmVIIkWDTG1z5v++HQmx9WQRO+LraFDTW64= -github.com/hashicorp/mdns v1.0.0/go.mod h1:tL+uN++7HEJ6SQLQ2/p+z2pH24WQKWjBPkE0mNTz8vQ= -github.com/hashicorp/memberlist v0.1.3/go.mod h1:ajVTdAv/9Im8oMAAj5G31PhhMCZJV2pPBoIllUwCN7I= -github.com/hashicorp/serf v0.8.2/go.mod h1:6hOLApaqBFA1NXqRQAsxw9QxuDEvNxSQRwA/JwenrHc= -github.com/hpcloud/tail v1.0.0 h1:nfCOvKYfkgYP8hkirhJocXT2+zOD8yUNjXaWfTlyFKI= -github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU= -github.com/hudl/fargo v1.3.0/go.mod h1:y3CKSmjA+wD2gak7sUSXTAoopbhU08POFhmITJgmKTg= -github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= -github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8= -github.com/influxdata/influxdb1-client v0.0.0-20191209144304-8bf82d3c094d/go.mod h1:qj24IKcXYK6Iy9ceXlo3Tc+vtHo9lIhSX5JddghvEPo= -github.com/jackc/chunkreader v1.0.0/go.mod h1:RT6O25fNZIuasFJRyZ4R/Y2BbhasbmZXF9QQ7T3kePo= -github.com/jackc/chunkreader/v2 v2.0.0/go.mod h1:odVSm741yZoC3dpHEUXIqA9tQRhFrgOHwnPIn9lDKlk= -github.com/jackc/chunkreader/v2 v2.0.1/go.mod h1:odVSm741yZoC3dpHEUXIqA9tQRhFrgOHwnPIn9lDKlk= -github.com/jackc/pgconn v0.0.0-20190420214824-7e0022ef6ba3/go.mod h1:jkELnwuX+w9qN5YIfX0fl88Ehu4XC3keFuOJJk9pcnA= -github.com/jackc/pgconn v0.0.0-20190824142844-760dd75542eb/go.mod h1:lLjNuW/+OfW9/pnVKPazfWOgNfH2aPem8YQ7ilXGvJE= -github.com/jackc/pgconn v0.0.0-20190831204454-2fabfa3c18b7/go.mod h1:ZJKsE/KZfsUgOEh9hBm+xYTstcNHg7UPMVJqRfQxq4s= -github.com/jackc/pgconn v1.4.0/go.mod h1:Y2O3ZDF0q4mMacyWV3AstPJpeHXWGEetiFttmq5lahk= -github.com/jackc/pgconn v1.5.0/go.mod h1:QeD3lBfpTFe8WUnPZWN5KY/mB8FGMIYRdd8P8Jr0fAI= -github.com/jackc/pgconn v1.5.1-0.20200601181101-fa742c524853/go.mod h1:QeD3lBfpTFe8WUnPZWN5KY/mB8FGMIYRdd8P8Jr0fAI= -github.com/jackc/pgconn v1.8.0/go.mod h1:1C2Pb36bGIP9QHGBYCjnyhqu7Rv3sGshaQUvmfGIB/o= -github.com/jackc/pgconn v1.8.1/go.mod h1:JV6m6b6jhjdmzchES0drzCcYcAHS1OPD5xu3OZ/lE2g= -github.com/jackc/pgconn v1.9.0/go.mod h1:YctiPyvzfU11JFxoXokUOOKQXQmDMoJL9vJzHH8/2JY= -github.com/jackc/pgio v1.0.0/go.mod h1:oP+2QK2wFfUWgr+gxjoBH9KGBb31Eio69xUb0w5bYf8= -github.com/jackc/pgmock v0.0.0-20190831213851-13a1b77aafa2/go.mod h1:fGZlG77KXmcq05nJLRkk0+p82V8B8Dw8KN2/V9c/OAE= -github.com/jackc/pgmock v0.0.0-20201204152224-4fe30f7445fd/go.mod h1:hrBW0Enj2AZTNpt/7Y5rr2xe/9Mn757Wtb2xeBzPv2c= -github.com/jackc/pgpassfile v1.0.0/go.mod h1:CEx0iS5ambNFdcRtxPj5JhEz+xB6uRky5eyVu/W2HEg= -github.com/jackc/pgproto3 v1.1.0/go.mod h1:eR5FA3leWg7p9aeAqi37XOTgTIbkABlvcPB3E5rlc78= -github.com/jackc/pgproto3/v2 v2.0.0-alpha1.0.20190420180111-c116219b62db/go.mod h1:bhq50y+xrl9n5mRYyCBFKkpRVTLYJVWeCc+mEAI3yXA= -github.com/jackc/pgproto3/v2 v2.0.0-alpha1.0.20190609003834-432c2951c711/go.mod h1:uH0AWtUmuShn0bcesswc4aBTWGvw0cAxIJp+6OB//Wg= -github.com/jackc/pgproto3/v2 v2.0.0-rc3/go.mod h1:ryONWYqW6dqSg1Lw6vXNMXoBJhpzvWKnT95C46ckYeM= -github.com/jackc/pgproto3/v2 v2.0.0-rc3.0.20190831210041-4c03ce451f29/go.mod h1:ryONWYqW6dqSg1Lw6vXNMXoBJhpzvWKnT95C46ckYeM= -github.com/jackc/pgproto3/v2 v2.0.1/go.mod h1:WfJCnwN3HIg9Ish/j3sgWXnAfK8A9Y0bwXYU5xKaEdA= -github.com/jackc/pgproto3/v2 v2.0.6/go.mod h1:WfJCnwN3HIg9Ish/j3sgWXnAfK8A9Y0bwXYU5xKaEdA= -github.com/jackc/pgproto3/v2 v2.1.1/go.mod h1:WfJCnwN3HIg9Ish/j3sgWXnAfK8A9Y0bwXYU5xKaEdA= -github.com/jackc/pgservicefile v0.0.0-20200307190119-3430c5407db8/go.mod h1:vsD4gTJCa9TptPL8sPkXrLZ+hDuNrZCnj29CQpr4X1E= -github.com/jackc/pgservicefile v0.0.0-20200714003250-2b9c44734f2b/go.mod h1:vsD4gTJCa9TptPL8sPkXrLZ+hDuNrZCnj29CQpr4X1E= -github.com/jackc/pgtype v0.0.0-20190421001408-4ed0de4755e0/go.mod h1:hdSHsc1V01CGwFsrv11mJRHWJ6aifDLfdV3aVjFF0zg= -github.com/jackc/pgtype v0.0.0-20190824184912-ab885b375b90/go.mod h1:KcahbBH1nCMSo2DXpzsoWOAfFkdEtEJpPbVLq8eE+mc= -github.com/jackc/pgtype v0.0.0-20190828014616-a8802b16cc59/go.mod h1:MWlu30kVJrUS8lot6TQqcg7mtthZ9T0EoIBFiJcmcyw= -github.com/jackc/pgtype v1.2.0/go.mod h1:5m2OfMh1wTK7x+Fk952IDmI4nw3nPrvtQdM0ZT4WpC0= -github.com/jackc/pgtype v1.3.1-0.20200510190516-8cd94a14c75a/go.mod h1:vaogEUkALtxZMCH411K+tKzNpwzCKU+AnPzBKZ+I+Po= -github.com/jackc/pgtype v1.3.1-0.20200606141011-f6355165a91c/go.mod h1:cvk9Bgu/VzJ9/lxTO5R5sf80p0DiucVtN7ZxvaC4GmQ= -github.com/jackc/pgtype v1.7.0/go.mod h1:ZnHF+rMePVqDKaOfJVI4Q8IVvAQMryDlDkZnKOI75BE= -github.com/jackc/pgtype v1.8.0/go.mod h1:PqDKcEBtllAtk/2p6z6SHdXW5UB+MhE75tUol2OKexE= -github.com/jackc/pgx/v4 v4.0.0-20190420224344-cc3461e65d96/go.mod h1:mdxmSJJuR08CZQyj1PVQBHy9XOp5p8/SHH6a0psbY9Y= -github.com/jackc/pgx/v4 v4.0.0-20190421002000-1b8f0016e912/go.mod h1:no/Y67Jkk/9WuGR0JG/JseM9irFbnEPbuWV2EELPNuM= -github.com/jackc/pgx/v4 v4.0.0-pre1.0.20190824185557-6972a5742186/go.mod h1:X+GQnOEnf1dqHGpw7JmHqHc1NxDoalibchSk9/RWuDc= -github.com/jackc/pgx/v4 v4.5.0/go.mod h1:EpAKPLdnTorwmPUUsqrPxy5fphV18j9q3wrfRXgo+kA= -github.com/jackc/pgx/v4 v4.6.1-0.20200510190926-94ba730bb1e9/go.mod h1:t3/cdRQl6fOLDxqtlyhe9UWgfIi9R8+8v8GKV5TRA/o= -github.com/jackc/pgx/v4 v4.6.1-0.20200606145419-4e5062306904/go.mod h1:ZDaNWkt9sW1JMiNn0kdYBaLelIhw7Pg4qd+Vk6tw7Hg= -github.com/jackc/pgx/v4 v4.11.0/go.mod h1:i62xJgdrtVDsnL3U8ekyrQXEwGNTRoG7/8r+CIdYfcc= -github.com/jackc/pgx/v4 v4.12.0/go.mod h1:fE547h6VulLPA3kySjfnSG/e2D861g/50JlVUa/ub60= -github.com/jackc/puddle v0.0.0-20190413234325-e4ced69a3a2b/go.mod h1:m4B5Dj62Y0fbyuIc15OsIqK0+JU8nkqQjsgx7dvjSWk= -github.com/jackc/puddle v0.0.0-20190608224051-11cab39313c9/go.mod h1:m4B5Dj62Y0fbyuIc15OsIqK0+JU8nkqQjsgx7dvjSWk= -github.com/jackc/puddle v1.1.0/go.mod h1:m4B5Dj62Y0fbyuIc15OsIqK0+JU8nkqQjsgx7dvjSWk= -github.com/jackc/puddle v1.1.1/go.mod h1:m4B5Dj62Y0fbyuIc15OsIqK0+JU8nkqQjsgx7dvjSWk= -github.com/jackc/puddle v1.1.3/go.mod h1:m4B5Dj62Y0fbyuIc15OsIqK0+JU8nkqQjsgx7dvjSWk= -github.com/jessevdk/go-flags v1.5.0 h1:1jKYvbxEjfUl0fmqTCOfonvskHHXMjBySTLW4y9LFvc= -github.com/jessevdk/go-flags v1.5.0/go.mod h1:Fw0T6WPc1dYxT4mKEZRfG5kJhaTDP9pj1c2EWnYs/m4= -github.com/jmespath/go-jmespath v0.0.0-20180206201540-c2b33e8439af/go.mod h1:Nht3zPeWKUH0NzdCt2Blrr5ys8VGpn0CEB0cQHVjt7k= -github.com/jonboulle/clockwork v0.1.0/go.mod h1:Ii8DK3G1RaLaWxj9trq07+26W01tbo22gdxWY5EU2bo= -github.com/jonboulle/clockwork v0.2.2 h1:UOGuzwb1PwsrDAObMuhUnj0p5ULPj8V/xJ7Kx9qUBdQ= -github.com/jonboulle/clockwork v0.2.2/go.mod h1:Pkfl5aHPm1nk2H9h0bjmnJD/BcgbGXUBGnn1kMkgxc8= -github.com/jpillora/backoff v1.0.0/go.mod h1:J/6gKK9jxlEcS3zixgDgUAsiuZ7yrSoa/FX5e0EB2j4= -github.com/json-iterator/go v1.1.6/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU= -github.com/json-iterator/go v1.1.7/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= -github.com/json-iterator/go v1.1.8/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= -github.com/json-iterator/go v1.1.10/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= -github.com/json-iterator/go v1.1.11/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= -github.com/json-iterator/go v1.1.12 h1:PV8peI4a0ysnczrg+LtxykD8LfKY9ML6u2jnxaEnrnM= -github.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHmT4TnhNGBo= -github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1:6v2b51hI/fHJwM22ozAgKL4VKDeJcHhJFhtBdhmNjmU= -github.com/jstemmer/go-junit-report v0.9.1/go.mod h1:Brl9GWCQeLvo8nXZwPNNblvFj/XSXhF0NWZEnDohbsk= -github.com/jtolds/gls v4.20.0+incompatible h1:xdiiI2gbIgH/gLH7ADydsJ1uDOEzR8yvV7C0MuV77Wo= -github.com/jtolds/gls v4.20.0+incompatible/go.mod h1:QJZ7F/aHp+rZTRtaJ1ow/lLfFfVYBRgL+9YlvaHOwJU= -github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w= -github.com/julienschmidt/httprouter v1.3.0/go.mod h1:JR6WtHb+2LUe8TCKY3cZOxFyyO8IZAc4RVcycCCAKdM= -github.com/kballard/go-shellquote v0.0.0-20180428030007-95032a82bc51 h1:Z9n2FFNUXsshfwJMBgNA0RU6/i7WVaAegv3PtuIHPMs= -github.com/kballard/go-shellquote v0.0.0-20180428030007-95032a82bc51/go.mod h1:CzGEWj7cYgsdH8dAjBGEr58BoE7ScuLd+fwFZ44+/x8= -github.com/kisielk/errcheck v1.1.0/go.mod h1:EZBBE59ingxPouuu3KfxchcWSUPOHkagtvWXihfKN4Q= -github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8= -github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= -github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= -github.com/konsorten/go-windows-terminal-sequences v1.0.2/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= -github.com/konsorten/go-windows-terminal-sequences v1.0.3/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= -github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc= -github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= -github.com/kr/pretty v0.3.0 h1:WgNl7dwNpEZ6jJ9k1snq4pZsg7DOEN8hP9Xw0Tsjwk0= -github.com/kr/pretty v0.3.0/go.mod h1:640gp4NfQd8pI5XOwp5fnNeVWj67G7CFk/SaSQn7NBk= -github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= -github.com/kr/pty v1.1.8/go.mod h1:O1sed60cT9XZ5uDucP5qwvh+TE3NnUj51EiZO/lmSfw= -github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= -github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= -github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= -github.com/lestrrat-go/envload v0.0.0-20180220234015-a3eb8ddeffcc h1:RKf14vYWi2ttpEmkA4aQ3j4u9dStX2t4M8UM6qqNsG8= -github.com/lestrrat-go/envload v0.0.0-20180220234015-a3eb8ddeffcc/go.mod h1:kopuH9ugFRkIXf3YoqHKyrJ9YfUFsckUU9S7B+XP+is= -github.com/lestrrat-go/file-rotatelogs v2.4.0+incompatible h1:Y6sqxHMyB1D2YSzWkLibYKgg+SwmyFU9dF2hn6MdTj4= -github.com/lestrrat-go/file-rotatelogs v2.4.0+incompatible/go.mod h1:ZQnN8lSECaebrkQytbHj4xNgtg8CR7RYXnPok8e0EHA= -github.com/lestrrat-go/strftime v1.0.6 h1:CFGsDEt1pOpFNU+TJB0nhz9jl+K0hZSLE205AhTIGQQ= -github.com/lestrrat-go/strftime v1.0.6/go.mod h1:f7jQKgV5nnJpYgdEasS+/y7EsTb8ykN2z68n3TtcTaw= -github.com/lib/pq v1.0.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo= -github.com/lib/pq v1.1.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo= -github.com/lib/pq v1.2.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo= -github.com/lib/pq v1.3.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo= -github.com/lib/pq v1.10.2/go.mod h1:AlVN5x4E4T544tWzH6hKfbfQvm3HdbOxrmggDNAPY9o= -github.com/lightstep/lightstep-tracer-common/golang/gogo v0.0.0-20190605223551-bc2310a04743/go.mod h1:qklhhLq1aX+mtWk9cPHPzaBjWImj5ULL6C7HFJtXQMM= -github.com/lightstep/lightstep-tracer-go v0.18.1/go.mod h1:jlF1pusYV4pidLvZ+XD0UBX0ZE6WURAspgAczcDHrL4= -github.com/lyft/protoc-gen-validate v0.0.13/go.mod h1:XbGvPuh87YZc5TdIa2/I4pLk0QoUACkjt2znoq26NVQ= -github.com/mattn/go-colorable v0.0.9/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaOChaDxuIBZU= -github.com/mattn/go-colorable v0.1.1/go.mod h1:FuOcm+DKB9mbwrcAfNl7/TZVBZ6rcnceauSikq3lYCQ= -github.com/mattn/go-colorable v0.1.2/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVcfRqFIhoBtE= -github.com/mattn/go-colorable v0.1.6/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc= -github.com/mattn/go-isatty v0.0.3/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4= -github.com/mattn/go-isatty v0.0.4/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4= -github.com/mattn/go-isatty v0.0.5/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s= -github.com/mattn/go-isatty v0.0.7/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s= -github.com/mattn/go-isatty v0.0.8/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s= -github.com/mattn/go-isatty v0.0.9/go.mod h1:YNRxwqDuOph6SZLI9vUUz6OYw3QyUt7WiY2yME+cCiQ= -github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU= -github.com/mattn/go-isatty v0.0.16 h1:bq3VjFmv/sOjHtdEhmkEV4x1AJtvUvOJ2PFAZ5+peKQ= -github.com/mattn/go-isatty v0.0.16/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM= -github.com/mattn/go-runewidth v0.0.2/go.mod h1:LwmH8dsx7+W8Uxz3IHJYH5QSwggIsqBzpuz5H//U1FU= -github.com/mattn/go-sqlite3 v1.14.9 h1:10HX2Td0ocZpYEjhilsuo6WWtUqttj2Kb0KtD86/KYA= -github.com/mattn/go-sqlite3 v1.14.9/go.mod h1:NyWgC/yNuGj7Q9rpYnZvas74GogHl5/Z4A/KQRfk6bU= -github.com/matttproud/golang_protobuf_extensions v1.0.1 h1:4hp9jkHxhMHkqkrB3Ix0jegS5sx/RkqARlsWZ6pIwiU= -github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0= -github.com/miekg/dns v1.0.14/go.mod h1:W1PPwlIAgtquWBMBEV9nkV9Cazfe8ScdGz/Lj7v3Nrg= -github.com/mitchellh/cli v1.0.0/go.mod h1:hNIlj7HEI86fIcpObd7a0FcrxTWetlwJDGcceTlRvqc= -github.com/mitchellh/go-homedir v1.0.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= -github.com/mitchellh/go-testing-interface v1.0.0/go.mod h1:kRemZodwjscx+RGhAo8eIhFbs2+BFgRtFPeD/KE+zxI= -github.com/mitchellh/gox v0.4.0/go.mod h1:Sd9lOJ0+aimLBi73mGofS1ycjY8lL3uZM3JPS42BGNg= -github.com/mitchellh/iochan v1.0.0/go.mod h1:JwYml1nuB7xOzsp52dPpHFffvOCDupsG0QubkSMEySY= -github.com/mitchellh/mapstructure v0.0.0-20160808181253-ca63d7c062ee/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= -github.com/mitchellh/mapstructure v1.1.2/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= -github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= -github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd h1:TRLaZ9cD/w8PVh93nsPXa1VrQ6jlwL5oN8l14QlcNfg= -github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= -github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= -github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= -github.com/modern-go/reflect2 v1.0.2 h1:xBagoLtFs94CBntxluKeaWgTMpvLxC4ur3nMaC9Gz0M= -github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk= -github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= -github.com/mwitkow/go-conntrack v0.0.0-20190716064945-2f068394615f/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= -github.com/nats-io/jwt v0.3.0/go.mod h1:fRYCDE99xlTsqUzISS1Bi75UBJ6ljOJQOAAu5VglpSg= -github.com/nats-io/jwt v0.3.2/go.mod h1:/euKqTS1ZD+zzjYrY7pseZrTtWQSjujC7xjPc8wL6eU= -github.com/nats-io/nats-server/v2 v2.1.2/go.mod h1:Afk+wRZqkMQs/p45uXdrVLuab3gwv3Z8C4HTBu8GD/k= -github.com/nats-io/nats.go v1.9.1/go.mod h1:ZjDU1L/7fJ09jvUSRVBR2e7+RnLiiIQyqyzEE/Zbp4w= -github.com/nats-io/nkeys v0.1.0/go.mod h1:xpnFELMwJABBLVhffcfd1MZx6VsNRFpEugbxziKVo7w= -github.com/nats-io/nkeys v0.1.3/go.mod h1:xpnFELMwJABBLVhffcfd1MZx6VsNRFpEugbxziKVo7w= -github.com/nats-io/nuid v1.0.1/go.mod h1:19wcPz3Ph3q0Jbyiqsd0kePYG7A95tJPxeL+1OSON2c= -github.com/oklog/oklog v0.3.2/go.mod h1:FCV+B7mhrz4o+ueLpx+KqkyXRGMWOYEvfiXtdGtbWGs= -github.com/oklog/run v1.0.0/go.mod h1:dlhp/R75TPv97u0XWUtDeV/lRKWPKSdTuV0TZvrmrQA= -github.com/olekukonko/tablewriter v0.0.0-20170122224234-a0225b3f23b5/go.mod h1:vsDQFd/mU46D+Z4whnwzcISnGGzXWMclvtLoiIKAKIo= -github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= -github.com/onsi/ginkgo v1.7.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= -github.com/onsi/ginkgo v1.10.1 h1:q/mM8GF/n0shIN8SaAZ0V+jnLPzen6WIVZdiwrRlMlo= -github.com/onsi/ginkgo v1.10.1/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= -github.com/onsi/gomega v1.4.3/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY= -github.com/onsi/gomega v1.7.0 h1:XPnZz8VVBHjVsy1vzJmRwIcSwiUO+JFfrv/xGiigmME= -github.com/onsi/gomega v1.7.0/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY= -github.com/op/go-logging v0.0.0-20160315200505-970db520ece7/go.mod h1:HzydrMdWErDVzsI23lYNej1Htcns9BCg93Dk0bBINWk= -github.com/opentracing-contrib/go-observer v0.0.0-20170622124052-a52f23424492/go.mod h1:Ngi6UdF0k5OKD5t5wlmGhe/EDKPoUM3BXZSSfIuJbis= -github.com/opentracing/basictracer-go v1.0.0/go.mod h1:QfBfYuafItcjQuMwinw9GhYKwFXS9KnPs5lxoYwgW74= -github.com/opentracing/opentracing-go v1.0.2/go.mod h1:UkNAQd3GIcIGf0SeVgPpRdFStlNbqXla1AfSYxPUl2o= -github.com/opentracing/opentracing-go v1.1.0/go.mod h1:UkNAQd3GIcIGf0SeVgPpRdFStlNbqXla1AfSYxPUl2o= -github.com/openzipkin-contrib/zipkin-go-opentracing v0.4.5/go.mod h1:/wsWhb9smxSfWAKL3wpBW7V8scJMt8N8gnaMCS9E/cA= -github.com/openzipkin/zipkin-go v0.1.6/go.mod h1:QgAqvLzwWbR/WpD4A3cGpPtJrZXNIiJc5AZX7/PBEpw= -github.com/openzipkin/zipkin-go v0.2.1/go.mod h1:NaW6tEwdmWMaCDZzg8sh+IBNOxHMPnhQw8ySjnjRyN4= -github.com/openzipkin/zipkin-go v0.2.2/go.mod h1:NaW6tEwdmWMaCDZzg8sh+IBNOxHMPnhQw8ySjnjRyN4= -github.com/orcaman/concurrent-map v1.0.0 h1:I/2A2XPCb4IuQWcQhBhSwGfiuybl/J0ev9HDbW65HOY= -github.com/orcaman/concurrent-map v1.0.0/go.mod h1:Lu3tH6HLW3feq74c2GC+jIMS/K2CFcDWnWD9XkenwhI= -github.com/pact-foundation/pact-go v1.0.4/go.mod h1:uExwJY4kCzNPcHRj+hCR/HBbOOIwwtUjcrb0b5/5kLM= github.com/panjf2000/ants/v2 v2.5.0 h1:1rWGWSnxCsQBga+nQbA4/iY6VMeNoOIAM0ZWh9u3q2Q= github.com/panjf2000/ants/v2 v2.5.0/go.mod h1:cU93usDlihJZ5CfRGNDYsiBYvoilLvBF5Qp/BT2GNRE= -github.com/pascaldekloe/goe v0.0.0-20180627143212-57f6aae5913c/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc= -github.com/pborman/uuid v1.2.0/go.mod h1:X/NO0urCmaxf9VXbdlT7C2Yzkj2IKimNn4k+gtPdI/k= -github.com/performancecopilot/speed v3.0.0+incompatible/go.mod h1:/CLtqpZ5gBg1M9iaPbIdPPGyKcA8hKdoy6hAWba7Yac= -github.com/pierrec/lz4 v1.0.2-0.20190131084431-473cd7ce01a1/go.mod h1:3/3N9NVKO0jef7pBehbT1qWhCMrIgbYNnFAZCqQ5LRc= -github.com/pierrec/lz4 v2.0.5+incompatible/go.mod h1:pdkljMzZIN41W+lC3N2tnIh5sFi+IEE17M5jbnwPHcY= -github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= -github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= -github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= -github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= -github.com/pkg/profile v1.2.1/go.mod h1:hJw3o1OdXxsrSjjVksARp5W95eeEaEfptyVZyv6JUPA= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= -github.com/posener/complete v1.1.1/go.mod h1:em0nMJCgc9GFtwrmVmEMR/ZL6WyhyjMBndrE9hABlRI= -github.com/prometheus/client_golang v0.9.1/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw= -github.com/prometheus/client_golang v0.9.3-0.20190127221311-3c4408c8b829/go.mod h1:p2iRAGwDERtqlqzRXnrOVns+ignqQo//hLXqYxZYVNs= -github.com/prometheus/client_golang v1.0.0/go.mod h1:db9x61etRT2tGnBNRi70OPL5FsnadC4Ky3P0J6CfImo= -github.com/prometheus/client_golang v1.3.0/go.mod h1:hJaj2vgQTGQmVCsAACORcieXFeDPbaTKGT+JTgUa3og= -github.com/prometheus/client_golang v1.7.1/go.mod h1:PY5Wy2awLA44sXw4AOSfFBetzPP4j5+D6mVACh+pe2M= -github.com/prometheus/client_golang v1.11.0/go.mod h1:Z6t4BnS23TR94PD6BsDNk8yVqroYurpAkEiz0P2BEV0= -github.com/prometheus/client_golang v1.11.1/go.mod h1:Z6t4BnS23TR94PD6BsDNk8yVqroYurpAkEiz0P2BEV0= -github.com/prometheus/client_golang v1.12.2 h1:51L9cDoUHVrXx4zWYlcLQIZ+d+VXHgqnYKkIuq4g/34= -github.com/prometheus/client_golang v1.12.2/go.mod h1:3Z9XVyYiZYEO+YQWt3RD2R3jrbd179Rt297l4aS6nDY= -github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= -github.com/prometheus/client_model v0.0.0-20190115171406-56726106282f/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= -github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= -github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= -github.com/prometheus/client_model v0.1.0/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= -github.com/prometheus/client_model v0.2.0 h1:uq5h0d+GuxiXLJLNABMgp2qUWDPiLvgCzz2dUR+/W/M= -github.com/prometheus/client_model v0.2.0/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= -github.com/prometheus/common v0.2.0/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= -github.com/prometheus/common v0.4.1/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= -github.com/prometheus/common v0.7.0/go.mod h1:DjGbpBbp5NYNiECxcL/VnbXCCaQpKd3tt26CguLLsqA= -github.com/prometheus/common v0.10.0/go.mod h1:Tlit/dnDKsSWFlCLTWaA1cyBgKHSMdTB80sz/V91rCo= -github.com/prometheus/common v0.26.0/go.mod h1:M7rCNAaPfAosfx8veZJCuw84e35h3Cfd9VFqTh1DIvc= -github.com/prometheus/common v0.32.1 h1:hWIdL3N2HoUx3B8j3YN9mWor0qhY/NlEKZEaXxuIRh4= -github.com/prometheus/common v0.32.1/go.mod h1:vu+V0TpY+O6vW9J44gczi3Ap/oXXR10b+M/gUGO4Hls= -github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= -github.com/prometheus/procfs v0.0.0-20190117184657-bf6a532e95b1/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= -github.com/prometheus/procfs v0.0.2/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= -github.com/prometheus/procfs v0.0.8/go.mod h1:7Qr8sr6344vo1JqZ6HhLceV9o3AJ1Ff+GxbHq6oeK9A= -github.com/prometheus/procfs v0.1.3/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4OA4YeYWdaU= -github.com/prometheus/procfs v0.6.0/go.mod h1:cz+aTbrPOrUb4q7XlbU9ygM+/jj0fzG6c1xBZuNvfVA= -github.com/prometheus/procfs v0.7.3 h1:4jVXhlkAyzOScmCkXBTOLRLTz8EeU+eyjrwB/EPq0VU= -github.com/prometheus/procfs v0.7.3/go.mod h1:cz+aTbrPOrUb4q7XlbU9ygM+/jj0fzG6c1xBZuNvfVA= -github.com/rcrowley/go-metrics v0.0.0-20181016184325-3113b8401b8a/go.mod h1:bCqnVzQkZxMG4s8nGwiZ5l3QUCyqpo9Y+/ZMZ9VjZe4= -github.com/remyoudompheng/bigfft v0.0.0-20200410134404-eec4a21b6bb0 h1:OdAsTTz6OkFY5QxjkYwrChwuRruF69c169dPK26NUlk= -github.com/remyoudompheng/bigfft v0.0.0-20200410134404-eec4a21b6bb0/go.mod h1:qqbHyh8v60DhA7CoWK5oRCqLrMHRGoxYCSS9EjAz6Eo= -github.com/rogpeppe/fastuuid v0.0.0-20150106093220-6724a57986af/go.mod h1:XWv6SoW27p1b0cqNHllgS5HIMJraePCO15w5zCzIWYg= -github.com/rogpeppe/fastuuid v1.2.0/go.mod h1:jVj6XXZzXRy/MSR5jhDC/2q6DgLz+nrA6LYCDYWNEvQ= -github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= -github.com/rogpeppe/go-internal v1.6.1 h1:/FiVV8dS/e+YqF2JvO3yXRFbBLTIuSDkuC7aBOAvL+k= -github.com/rogpeppe/go-internal v1.6.1/go.mod h1:xXDCJY+GAPziupqXw64V24skbSoqbTEfhy4qGm1nDQc= -github.com/rs/xid v1.2.1/go.mod h1:+uKXf+4Djp6Md1KODXJxgGQPKngRmWyn10oCKFzNHOQ= -github.com/rs/zerolog v1.13.0/go.mod h1:YbFCdg8HfsridGWAh22vktObvhZbQsZXe4/zB0OKkWU= -github.com/rs/zerolog v1.15.0/go.mod h1:xYTKnLHcpfU2225ny5qZjxnj9NvkumZYjJHlAThCjNc= -github.com/russross/blackfriday/v2 v2.0.1/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= -github.com/ryanuber/columnize v0.0.0-20160712163229-9b3edd62028f/go.mod h1:sm1tb6uqfes/u+d4ooFouqFdy9/2g9QGwK3SQygK0Ts= -github.com/samuel/go-zookeeper v0.0.0-20190923202752-2cc03de413da/go.mod h1:gi+0XIa01GRL2eRQVjQkKGqKF3SF9vZR/HnPullcV2E= -github.com/satori/go.uuid v1.2.0/go.mod h1:dA0hQrYB0VpLJoorglMZABFdXlWrHn1NEOzdhQKdks0= -github.com/sean-/seed v0.0.0-20170313163322-e2103e2c3529/go.mod h1:DxrIzT+xaE7yg65j358z/aeFdxmN0P9QXhEzd20vsDc= -github.com/shopspring/decimal v0.0.0-20180709203117-cd690d0c9e24/go.mod h1:M+9NzErvs504Cn4c5DxATwIqPbtswREoFCre64PpcG4= -github.com/shopspring/decimal v0.0.0-20200227202807-02e2044944cc/go.mod h1:DKyhrW/HYNuLGql+MJL6WCR6knT2jwCFRcu2hWCYk4o= -github.com/shopspring/decimal v1.2.0/go.mod h1:DKyhrW/HYNuLGql+MJL6WCR6knT2jwCFRcu2hWCYk4o= -github.com/shurcooL/sanitized_anchor_name v1.0.0/go.mod h1:1NzhyTcUVG4SuEtjjoZeVRXNmyL/1OwPU0+IJeTBvfc= -github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= -github.com/sirupsen/logrus v1.4.1/go.mod h1:ni0Sbl8bgC9z8RoU9G6nDWqqs/fq4eDPysMBDgk/93Q= -github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE= -github.com/sirupsen/logrus v1.6.0/go.mod h1:7uNnSEd1DgxDLC74fIahvMZmmYsHGZGEOFrfsX/uA88= -github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d h1:zE9ykElWQ6/NYmHa3jpm/yHnI4xSofP+UP6SpjHcSeM= -github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d/go.mod h1:OnSkiWE9lh6wB0YB77sQom3nweQdgAjqCqsofrRNTgc= -github.com/smartystreets/goconvey v1.6.4 h1:fv0U8FUIMPNf1L9lnHLvLhgicrIVChEkdzIKYqbNC9s= -github.com/smartystreets/goconvey v1.6.4/go.mod h1:syvi0/a8iFYH4r/RixwvyeAJjdLS9QV7WQ/tjFTllLA= -github.com/soheilhy/cmux v0.1.4/go.mod h1:IM3LyeVVIOuxMH7sFAkER9+bJ4dT7Ms6E4xg4kGIyLM= -github.com/sony/gobreaker v0.4.1/go.mod h1:ZKptC7FHNvhBz7dN2LGjPVBz2sZJmc0/PkyDJOjmxWY= -github.com/spf13/cobra v0.0.3/go.mod h1:1l0Ry5zgKvJasoi3XT1TypsSe7PqH0Sj9dhYf7v3XqQ= -github.com/spf13/pflag v1.0.1/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= -github.com/streadway/amqp v0.0.0-20190404075320-75d898a42a94/go.mod h1:AZpEONHx3DKn8O/DFsRAY58/XVQiIPMTMB1SddzLXVw= -github.com/streadway/amqp v0.0.0-20190827072141-edfb9018d271/go.mod h1:AZpEONHx3DKn8O/DFsRAY58/XVQiIPMTMB1SddzLXVw= -github.com/streadway/handy v0.0.0-20190108123426-d5acb3125c2a/go.mod h1:qNTQ5P5JnDBl6z3cMAg/SywNDC5ABu5ApDIw6lUbRmI= +github.com/redis/go-redis/v9 v9.5.1 h1:H1X4D3yHPaYrkL5X06Wh6xNVM/pX0Ft4RV0vMGvLBh8= +github.com/redis/go-redis/v9 v9.5.1/go.mod h1:hdY0cQFCN4fnSYT6TkisLufl/4W5UIXyv0b/CLO2V2M= +github.com/sirupsen/logrus v1.9.3 h1:dueUQJ1C2q9oE3F7wvmSGAaVtTmUizReu6fjN8uqzbQ= +github.com/sirupsen/logrus v1.9.3/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= -github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= -github.com/stretchr/objx v0.2.0/go.mod h1:qt09Ya8vawLte6SNmTgCsAVtYtaKzEcn8ATUoHMkEqE= github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw= -github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= -github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= -github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA= github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.8.0 h1:pSgiaMZlXftHpm5L7V1+rVB+AZJydKsMxsQBIJw4PKk= github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= -github.com/syndtr/goleveldb v1.0.0 h1:fBdIW9lB4Iz0n9khmH8w27SJ3QEJ7+IgjPEwGSZiFdE= -github.com/syndtr/goleveldb v1.0.0/go.mod h1:ZVVdQEZoIme9iO1Ch2Jdy24qqXrMMOU6lpPAyBWyWuQ= -github.com/tealeg/xlsx v1.0.5 h1:+f8oFmvY8Gw1iUXzPk+kz+4GpbDZPK1FhPiQRd+ypgE= -github.com/tealeg/xlsx v1.0.5/go.mod h1:btRS8dz54TDnvKNosuAqxrM1QgN1udgk9O34bDCnORM= -github.com/tmc/grpc-websocket-proxy v0.0.0-20170815181823-89b8d40f7ca8/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U= -github.com/urfave/cli v1.20.0/go.mod h1:70zkFmudgCuE/ngEzBv17Jvp/497gISqfk5gWijbERA= -github.com/urfave/cli v1.22.1/go.mod h1:Gos4lmkARVdJ6EkW0WaNv/tZAAMe9V7XWyB60NtXRu0= -github.com/xiang90/probing v0.0.0-20190116061207-43a291ad63a2/go.mod h1:UETIi67q53MR2AWcXfiuqkDkRtnGDLqkBTpCHuJHxtU= -github.com/yuin/goldmark v1.1.25/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= -github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= -github.com/yuin/goldmark v1.1.32/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= -github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= -github.com/yuin/goldmark v1.3.5/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k= -github.com/yuin/gopher-lua v0.0.0-20220504180219-658193537a64 h1:5mLPGnFdSsevFRFc9q3yYbBkB6tsm4aCwwQV/j1JQAQ= -github.com/yuin/gopher-lua v0.0.0-20220504180219-658193537a64/go.mod h1:GBR0iDaNXjAgGg9zfCvksxSRnQx76gclCIb7kdAd1Pw= -github.com/zenazn/goji v0.9.0/go.mod h1:7S9M489iMyHBNxwZnk9/EHS098H4/F6TATF2mIxtB1Q= -github.com/ziutek/mymysql v1.5.4/go.mod h1:LMSpPZ6DbqWFxNCHW77HeMg9I646SAhApZ/wKdgO/C0= -go.etcd.io/bbolt v1.3.3/go.mod h1:IbVyRI1SCnLcuJnV2u8VeU0CEYM7e686BmAb1XKL+uU= -go.etcd.io/etcd v0.0.0-20191023171146-3cf2f69b5738/go.mod h1:dnLIgRNXwCJa5e+c6mIZCrds/GIG4ncV9HhK5PX7jPg= -go.etcd.io/etcd/api/v3 v3.5.4 h1:OHVyt3TopwtUQ2GKdd5wu3PmmipR4FTwCqoEjSyRdIc= -go.etcd.io/etcd/api/v3 v3.5.4/go.mod h1:5GB2vv4A4AOn3yk7MftYGHkUfGtDHnEraIjym4dYz5A= -go.etcd.io/etcd/client/pkg/v3 v3.5.4 h1:lrneYvz923dvC14R54XcA7FXoZ3mlGZAgmwhfm7HqOg= -go.etcd.io/etcd/client/pkg/v3 v3.5.4/go.mod h1:IJHfcCEKxYu1Os13ZdwCwIUTUVGYTSAM3YSwc9/Ac1g= -go.etcd.io/etcd/client/v3 v3.5.4 h1:p83BUL3tAYS0OT/r0qglgc3M1JjhM0diV8DSWAhVXv4= -go.etcd.io/etcd/client/v3 v3.5.4/go.mod h1:ZaRkVgBZC+L+dLCjTcF1hRXpgZXQPOvnA/Ak/gq3kiY= -go.opencensus.io v0.20.1/go.mod h1:6WKK9ahsWS3RSO+PY9ZHZUfv2irvY6gN279GOPZjmmk= -go.opencensus.io v0.20.2/go.mod h1:6WKK9ahsWS3RSO+PY9ZHZUfv2irvY6gN279GOPZjmmk= -go.opencensus.io v0.21.0/go.mod h1:mSImk1erAIZhrmZN+AvHh14ztQfjbGwt4TtuofqLduU= -go.opencensus.io v0.22.0/go.mod h1:+kGneAE2xo2IficOXnaByMWTGM9T73dGwxeWcUqIpI8= -go.opencensus.io v0.22.2/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= -go.opencensus.io v0.22.3/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= -go.opencensus.io v0.22.4/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= -go.opentelemetry.io/proto/otlp v0.7.0/go.mod h1:PqfVotwruBrMGOCsRd/89rSnXhoiJIqeYNgFYFoEGnI= -go.uber.org/atomic v1.3.2/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= -go.uber.org/atomic v1.4.0/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= -go.uber.org/atomic v1.5.0/go.mod h1:sABNBOSYdrvTF6hTgEIbc7YasKWGhgEQZyfxyTvoXHQ= -go.uber.org/atomic v1.6.0/go.mod h1:sABNBOSYdrvTF6hTgEIbc7YasKWGhgEQZyfxyTvoXHQ= -go.uber.org/atomic v1.7.0/go.mod h1:fEN4uk6kAWBTFdckzkM89CLk9XfWZrxpCo0nPH17wJc= go.uber.org/atomic v1.9.0 h1:ECmE8Bn/WFTYwEW/bpKD3M8VtR/zQVbavAoalC1PYyE= go.uber.org/atomic v1.9.0/go.mod h1:fEN4uk6kAWBTFdckzkM89CLk9XfWZrxpCo0nPH17wJc= -go.uber.org/goleak v1.1.11 h1:wy28qYRKZgnJTxGxvye5/wgWr1EKjmUDGYox5mGlRlI= -go.uber.org/goleak v1.1.11/go.mod h1:cwTWslyiVhfpKIDGSZEM2HlOvcqm+tG4zioyIeLoqMQ= -go.uber.org/multierr v1.1.0/go.mod h1:wR5kodmAFQ0UK8QlbwjlSNy0Z68gJhDJUG5sjR94q/0= -go.uber.org/multierr v1.3.0/go.mod h1:VgVr7evmIr6uPjLBxg28wmKNXyqE9akIJ5XnfpiKl+4= -go.uber.org/multierr v1.5.0/go.mod h1:FeouvMocqHpRaaGuG9EjoKcStLC43Zu/fmqdUMPcKYU= -go.uber.org/multierr v1.6.0 h1:y6IPFStTAIT5Ytl7/XYmHvzXQ7S3g/IeZW9hyZ5thw4= -go.uber.org/multierr v1.6.0/go.mod h1:cdWPpRnG4AhwMwsgIHip0KRBQjJy5kYEpYjJxpXp9iU= -go.uber.org/tools v0.0.0-20190618225709-2cfd321de3ee/go.mod h1:vJERXedbb3MVM5f9Ejo0C68/HhF8uaILCdgjnY+goOA= -go.uber.org/zap v1.9.1/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q= -go.uber.org/zap v1.10.0/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q= -go.uber.org/zap v1.13.0/go.mod h1:zwrFLgMcdUuIBviXEYEH1YKNaOBnKXsx2IPda5bBwHM= -go.uber.org/zap v1.17.0/go.mod h1:MXVU+bhUf/A7Xi2HNOnopQOrmycQ5Ih87HtOu4q5SSo= -go.uber.org/zap v1.21.0 h1:WefMeulhovoZ2sYXz7st6K0sLj7bBhpiFaud4r4zST8= -go.uber.org/zap v1.21.0/go.mod h1:wjWOCqI0f2ZZrJF/UufIOkiC8ii6tm1iqIsLo76RfJw= -golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= -golang.org/x/crypto v0.0.0-20181029021203-45a5f77698d3/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= -golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= -golang.org/x/crypto v0.0.0-20190325154230-a5d413f7728c/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= -golang.org/x/crypto v0.0.0-20190411191339-88737f569e3a/go.mod h1:WFFai1msRO1wXaEeE5yQxYXgSfI8pQAWXbQop6sCtWE= -golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= -golang.org/x/crypto v0.0.0-20190605123033-f99c8df09eb5/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= -golang.org/x/crypto v0.0.0-20190701094942-4def268fd1a4/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= -golang.org/x/crypto v0.0.0-20190820162420-60c769a6c586/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= -golang.org/x/crypto v0.0.0-20190911031432-227b76d455e7/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= -golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= -golang.org/x/crypto v0.0.0-20200323165209-0ec3e9974c59/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= -golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= -golang.org/x/crypto v0.0.0-20201203163018-be400aefbc4c/go.mod h1:jdWPYTVW3xRLrWPugEBEK3UY2ZEsg3UU495nc5E+M+I= -golang.org/x/crypto v0.0.0-20210322153248-0c34fe9e7dc2/go.mod h1:T9bdIzuCu7OtxOm1hfPfRQxPLYneinmdGuTeoZ9dtd4= -golang.org/x/crypto v0.0.0-20210616213533-5ff15b29337e/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= -golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= -golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= -golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8= -golang.org/x/exp v0.0.0-20190829153037-c13cbed26979/go.mod h1:86+5VVa7VpoJ4kLfm080zCjGlMRFzhUhsZKEZO7MGek= -golang.org/x/exp v0.0.0-20191030013958-a1ab85dbe136/go.mod h1:JXzH8nQsPlswgeRAPE3MuO9GYsAcnJvJ4vnMwN/5qkY= -golang.org/x/exp v0.0.0-20191129062945-2f5052295587/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= -golang.org/x/exp v0.0.0-20191227195350-da58074b4299/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= -golang.org/x/exp v0.0.0-20200119233911-0405dc783f0a/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= -golang.org/x/exp v0.0.0-20200207192155-f17229e696bd/go.mod h1:J/WKrq2StrnmMY6+EHIKF9dgMWnmCNThgcyBT1FY9mM= -golang.org/x/exp v0.0.0-20200224162631-6cc2880d07d6/go.mod h1:3jZMyOhIsHpP37uCMkUooju7aAi5cS1Q23tOzKc+0MU= -golang.org/x/exp v0.0.0-20220916125017-b168a2c6b86b h1:SCE/18RnFsLrjydh/R/s5EVvHoZprqEQUuoxK8q2Pc4= -golang.org/x/exp v0.0.0-20220916125017-b168a2c6b86b/go.mod h1:cyybsKvd6eL0RnXn6p/Grxp8F5bW7iYuBgsNCOHpMYE= -golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js= -golang.org/x/image v0.0.0-20190802002840-cff245a6509b/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= -golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= -golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU= -golang.org/x/lint v0.0.0-20190301231843-5614ed5bae6f/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= -golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= -golang.org/x/lint v0.0.0-20190409202823-959b441ac422/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= -golang.org/x/lint v0.0.0-20190909230951-414d861bb4ac/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= -golang.org/x/lint v0.0.0-20190930215403-16217165b5de/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= -golang.org/x/lint v0.0.0-20191125180803-fdd1cda4f05f/go.mod h1:5qLYkcX4OjUUV8bRuDixDT3tpyyb+LUpUlRWLxfhWrs= -golang.org/x/lint v0.0.0-20200130185559-910be7a94367/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= -golang.org/x/lint v0.0.0-20200302205851-738671d3881b/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= -golang.org/x/lint v0.0.0-20210508222113-6edffad5e616/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= -golang.org/x/mobile v0.0.0-20190312151609-d3739f865fa6/go.mod h1:z+o9i4GpDbdi3rU15maQ/Ox0txvL9dWGYEHz965HBQE= -golang.org/x/mobile v0.0.0-20190719004257-d2bd2a29d028/go.mod h1:E/iHnbuqvinMTCcRqshq8CkpyQDoeVncDDYHnLhea+o= -golang.org/x/mod v0.0.0-20190513183733-4bf6d317e70e/go.mod h1:mXi4GBBbnImb6dmsKGUJ2LatrhH/nqhxcFungHvyanc= -golang.org/x/mod v0.1.0/go.mod h1:0QHyrYULN0/3qlju5TqG8bIK38QM8yzMo5ekMj3DlcY= -golang.org/x/mod v0.1.1-0.20191105210325-c90efee705ee/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg= -golang.org/x/mod v0.1.1-0.20191107180719-034126e5016b/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg= -golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= -golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= -golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= -golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4 h1:6zppjxzCulZykYSLyVDYbneBfbaBIQPYMevg0bEwv2s= -golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= -golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20181023162649-9b4f9f5ad519/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20181114220301-adae6a3d119a/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20181201002055-351d144fa1fc/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20181220203305-927f97764cc3/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20190125091013-d26f9f9a57f3/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= -golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= -golang.org/x/net v0.0.0-20190501004415-9ce7a6920f09/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= -golang.org/x/net v0.0.0-20190503192946-f4e77d36d62c/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= -golang.org/x/net v0.0.0-20190603091049-60506f45cf65/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks= -golang.org/x/net v0.0.0-20190613194153-d28f0bde5980/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20190628185345-da137c7871d7/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20190724013045-ca1201d0de80/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20190813141303-74dc4d7220e7/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20191209160850-c0dbc17a3553/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20200114155413-6afb5195e5aa/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20200202094626-16171245cfb2/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20200222125558-5a598a2470a0/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20200301022130-244492dfa37a/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20200324143707-d3edc9973b7e/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= -golang.org/x/net v0.0.0-20200501053045-e0ff5e5a1de5/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= -golang.org/x/net v0.0.0-20200506145744-7e3656a0809f/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= -golang.org/x/net v0.0.0-20200513185701-a91f0712d120/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= -golang.org/x/net v0.0.0-20200520182314-0ba52f642ac2/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= -golang.org/x/net v0.0.0-20200625001655-4c5254603344/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= -golang.org/x/net v0.0.0-20200707034311-ab3426394381/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= -golang.org/x/net v0.0.0-20200822124328-c89045814202/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= -golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= -golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= -golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96bSt6lcn1PtDYWL6XObtHCRCNQM= -golang.org/x/net v0.0.0-20210525063256-abc453219eb5/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= -golang.org/x/net v0.0.0-20220722155237-a158d28d115b h1:PxfKdU9lEEDYjdIzOtC4qFWgkU2rGHdKlKowJSMN9h0= -golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= -golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= -golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= -golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= -golang.org/x/oauth2 v0.0.0-20191202225959-858c2ad4c8b6/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= -golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= -golang.org/x/oauth2 v0.0.0-20210514164344-f6687ab2804c/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= -golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20190227155943-e225da77a7e6/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20200317015054-43a5402ce75a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20200625203802-6e8e738ad208/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20201207232520-09787c993a3a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sys v0.0.0-20180823144017-11551d06cbcc/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20181026203630-95b1ffbd15a5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20181107165924-66b7b1311ac8/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20181116152217-5ac8a444bdc5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20181122145206-62eef0e2fa9b/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20190222072716-a9d3bda3a223/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20190312061237-fead79001313/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190403152447-81d4e9dc473e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190422165155-953cdadca894/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190502145724-3ef323f4f1fd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190507160741-ecd444e8653b/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190606165138-5da285871e9c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190624142023-c5567b49c5d0/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190726091711-fc99dfbffb4e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190813064441-fde4db37ae7a/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190826190057-c7b8b68b1456/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20191001151750-bb3f8db39f24/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20191026070338-33540a1f6037/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20191204072324-ce4227a45e2e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20191220142924-d4481acd189f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20191228213918-04cbcbbfeed8/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200106162015-b016eb3dc98e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200113162924-86b910548bc1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200116001909-b77594299b42/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200122134326-e047566fdf82/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200202164722-d101bd2416d5/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200212091648-12a6c2dcc1e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200223170610-d5e6a3e2c0ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200302150141-5c8b2ff67527/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200331124033-c3d80250170d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200501052902-10377860bb8e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200511232937-7e40ca221e25/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200515095857-1151b9dac4a9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200523222454-059865788121/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200615200032-f1bc736245b1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200625212154-ddb9806d33ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200803210538-64077c9b5642/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20201126233918-771906719818/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210124154548-22da62e12c0c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210320140829-1e4c9ba3b0c4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210330210617-4fbd30eecc44/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210403161142-5e06dd20ab57/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210510120138-977fb7262007/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20210603081109-ebe580a85c40/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20210902050250-f475640dd07b/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20211007075335-d3039528d8ac/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220114195835-da31bd327af9/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220829200755-d48e67d00261 h1:v6hYoSR9T5oet+pMXwUWkbiVqx/63mlHjefrHmxwfeY= golang.org/x/sys v0.0.0-20220829200755-d48e67d00261/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/term v0.0.0-20201117132131-f5c789dd3221/go.mod h1:Nr5EML6q2oocZ2LXRh80K7BxOlk5/8JxuGnuhpl+muw= -golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= -golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= -golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= -golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= -golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= -golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= -golang.org/x/text v0.3.4/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= -golang.org/x/text v0.3.5/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= -golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= -golang.org/x/text v0.3.7 h1:olpwvP2KacW1ZWvsR7uQhoyTYvKAupfQrRGBFM352Gk= -golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= -golang.org/x/time v0.0.0-20180412165947-fbb02b2291d2/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= -golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= -golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= -golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= -golang.org/x/tools v0.0.0-20180221164845-07fd8470d635/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= -golang.org/x/tools v0.0.0-20180828015842-6cd1fcedba52/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= -golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= -golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= -golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY= -golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= -golang.org/x/tools v0.0.0-20190312151545-0bb0c0a6e846/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= -golang.org/x/tools v0.0.0-20190312170243-e65039ee4138/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= -golang.org/x/tools v0.0.0-20190328211700-ab21143f2384/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= -golang.org/x/tools v0.0.0-20190425150028-36563e24a262/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= -golang.org/x/tools v0.0.0-20190425163242-31fd60d6bfdc/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= -golang.org/x/tools v0.0.0-20190506145303-2d16b83fe98c/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= -golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= -golang.org/x/tools v0.0.0-20190606124116-d0a3d012864b/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= -golang.org/x/tools v0.0.0-20190621195816-6e04913cbbac/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= -golang.org/x/tools v0.0.0-20190628153133-6cdbf07be9d0/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= -golang.org/x/tools v0.0.0-20190816200558-6889da9d5479/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20190823170909-c4a336ef6a2f/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20190911174233-4f2ddba30aff/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20191012152004-8de300cfc20a/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20191029041327-9cc4af7d6b2c/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20191029190741-b9c20aec41a5/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20191113191852-77e3bb0ad9e7/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20191115202509-3a792d9c32b2/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20191125144606-a911d9008d1f/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20191130070609-6e064ea0cf2d/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20191216173652-a0e659d51361/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20191227053925-7b8e75db28f4/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20200103221440-774c71fcf114/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20200117161641-43d50277825c/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20200122220014-bf1340f18c4a/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20200130002326-2f3ba24bd6e7/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20200204074204-1cc6d1ef6c74/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20200207183749-b753a1ba74fa/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20200212150539-ea181f53ac56/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20200224181240-023911ca70b2/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20200227222343-706bc42d1f0d/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20200304193943-95d2e580d8eb/go.mod h1:o4KQGtdN14AW+yjsvvwRTJJuXz8XRtIHtEnmAXLyFUw= -golang.org/x/tools v0.0.0-20200312045724-11d5b4c81c7d/go.mod h1:o4KQGtdN14AW+yjsvvwRTJJuXz8XRtIHtEnmAXLyFUw= -golang.org/x/tools v0.0.0-20200331025713-a30bf2db82d4/go.mod h1:Sl4aGygMT6LrqrWclx+PTx3U+LnKx/seiNR+3G19Ar8= -golang.org/x/tools v0.0.0-20200501065659-ab2804fb9c9d/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= -golang.org/x/tools v0.0.0-20200512131952-2bc93b1c0c88/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= -golang.org/x/tools v0.0.0-20200515010526-7d3b6ebf133d/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= -golang.org/x/tools v0.0.0-20200618134242-20370b0cb4b2/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= -golang.org/x/tools v0.0.0-20200619180055-7c47624df98f/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= -golang.org/x/tools v0.0.0-20200729194436-6467de6f59a7/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= -golang.org/x/tools v0.0.0-20200804011535-6c149bb5ef0d/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= -golang.org/x/tools v0.0.0-20200825202427-b303f430e36d/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= -golang.org/x/tools v0.0.0-20201124115921-2c860bdd6e78/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= -golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= -golang.org/x/tools v0.1.2/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= -golang.org/x/tools v0.1.5/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= -golang.org/x/tools v0.1.12 h1:VveCTK38A2rkS8ZqFY25HIDFscX5X9OoEhJd3quQmXU= -golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= -golang.org/x/xerrors v0.0.0-20190410155217-1f06c39b4373/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -golang.org/x/xerrors v0.0.0-20190513163551-3ee3066db522/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543 h1:E7g+9GITq07hpfrRu66IVDexMakfv52eLZ2CXBWiKr4= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -google.golang.org/api v0.3.1/go.mod h1:6wY9I6uQWHQ8EM57III9mq/AjF+i8G65rmVagqKMtkk= -google.golang.org/api v0.4.0/go.mod h1:8k5glujaEP+g9n7WNsDg8QP6cUVNI86fCNMcbazEtwE= -google.golang.org/api v0.7.0/go.mod h1:WtwebWUNSVBH/HAw79HIFXZNqEvBhG+Ra+ax0hx3E3M= -google.golang.org/api v0.8.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEnKg= -google.golang.org/api v0.9.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEnKg= -google.golang.org/api v0.13.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI= -google.golang.org/api v0.14.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI= -google.golang.org/api v0.15.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI= -google.golang.org/api v0.17.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= -google.golang.org/api v0.18.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= -google.golang.org/api v0.19.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= -google.golang.org/api v0.20.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= -google.golang.org/api v0.22.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= -google.golang.org/api v0.24.0/go.mod h1:lIXQywCXRcnZPGlsd8NbLnOjtAoL6em04bJ9+z0MncE= -google.golang.org/api v0.28.0/go.mod h1:lIXQywCXRcnZPGlsd8NbLnOjtAoL6em04bJ9+z0MncE= -google.golang.org/api v0.29.0/go.mod h1:Lcubydp8VUV7KeIHD9z2Bys/sm/vGKnG1UHuDBSrHWM= -google.golang.org/api v0.30.0/go.mod h1:QGmEvQ87FHZNiUVJkT14jQNYJ4ZJjdRF23ZXz5138Fc= -google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= -google.golang.org/appengine v1.2.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= -google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= -google.golang.org/appengine v1.5.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= -google.golang.org/appengine v1.6.1/go.mod h1:i06prIuMbXzDqacNJfV5OdTW448YApPu5ww/cMBSeb0= -google.golang.org/appengine v1.6.5/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= -google.golang.org/appengine v1.6.6/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= -google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= -google.golang.org/genproto v0.0.0-20190307195333-5fe7a883aa19/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= -google.golang.org/genproto v0.0.0-20190418145605-e7d98fc518a7/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= -google.golang.org/genproto v0.0.0-20190425155659-357c62f0e4bb/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= -google.golang.org/genproto v0.0.0-20190502173448-54afdca5d873/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= -google.golang.org/genproto v0.0.0-20190530194941-fb225487d101/go.mod h1:z3L6/3dTEVtUr6QSP8miRzeRqwQOioJ9I66odjN4I7s= -google.golang.org/genproto v0.0.0-20190801165951-fa694d86fc64/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= -google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= -google.golang.org/genproto v0.0.0-20190911173649-1774047e7e51/go.mod h1:IbNlFCBrqXvoKpeg0TB2l7cyZUmoaFKYIwrEpbDKLA8= -google.golang.org/genproto v0.0.0-20191108220845-16a3f7862a1a/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= -google.golang.org/genproto v0.0.0-20191115194625-c23dd37a84c9/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= -google.golang.org/genproto v0.0.0-20191216164720-4f79533eabd1/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= -google.golang.org/genproto v0.0.0-20191230161307-f3c370f40bfb/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= -google.golang.org/genproto v0.0.0-20200115191322-ca5a22157cba/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= -google.golang.org/genproto v0.0.0-20200122232147-0452cf42e150/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= -google.golang.org/genproto v0.0.0-20200204135345-fa8e72b47b90/go.mod h1:GmwEX6Z4W5gMy59cAlVYjN9JhxgbQH6Gn+gFDQe2lzA= -google.golang.org/genproto v0.0.0-20200212174721-66ed5ce911ce/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= -google.golang.org/genproto v0.0.0-20200224152610-e50cd9704f63/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= -google.golang.org/genproto v0.0.0-20200228133532-8c2c7df3a383/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= -google.golang.org/genproto v0.0.0-20200305110556-506484158171/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= -google.golang.org/genproto v0.0.0-20200312145019-da6875a35672/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= -google.golang.org/genproto v0.0.0-20200331122359-1ee6d9798940/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= -google.golang.org/genproto v0.0.0-20200430143042-b979b6f78d84/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= -google.golang.org/genproto v0.0.0-20200511104702-f5ebc3bea380/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= -google.golang.org/genproto v0.0.0-20200513103714-09dca8ec2884/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= -google.golang.org/genproto v0.0.0-20200515170657-fc4c6c6a6587/go.mod h1:YsZOwe1myG/8QRHRsmBRE1LrgQY60beZKjly0O1fX9U= -google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013/go.mod h1:NbSheEEYHJ7i3ixzK3sjbqSGDJWnxyFXZblF3eUsNvo= -google.golang.org/genproto v0.0.0-20200618031413-b414f8b61790/go.mod h1:jDfRM7FcilCzHH/e9qn6dsT145K34l5v+OpcnNgKAAA= -google.golang.org/genproto v0.0.0-20200729003335-053ba62fc06f/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20200804131852-c06518451d9c/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20200825200019-8632dd797987/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20210602131652-f16073e35f0c/go.mod h1:UODoCrxHCcBojKKwX1terBiRUaqAsFqJiF615XL43r0= -google.golang.org/genproto v0.0.0-20210608205507-b6d2f5bf0d7d h1:KzwjikDymrEmYYbdyfievTwjEeGlu+OM6oiKBkF3Jfg= -google.golang.org/genproto v0.0.0-20210608205507-b6d2f5bf0d7d/go.mod h1:UODoCrxHCcBojKKwX1terBiRUaqAsFqJiF615XL43r0= -google.golang.org/grpc v1.17.0/go.mod h1:6QZJwpn2B+Zp71q/5VxRsJ6NXXVCE5NRUHRo+f3cWCs= -google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= -google.golang.org/grpc v1.20.0/go.mod h1:chYK+tFQF0nDUGJgXMSgLCQk3phJEuONr2DCgLDdAQM= -google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38= -google.golang.org/grpc v1.21.0/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM= -google.golang.org/grpc v1.21.1/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM= -google.golang.org/grpc v1.22.1/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= -google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= -google.golang.org/grpc v1.23.1/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= -google.golang.org/grpc v1.25.1/go.mod h1:c3i+UQWmh7LiEpx4sFZnkU36qjEYZ0imhYfXVyQciAY= -google.golang.org/grpc v1.26.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= -google.golang.org/grpc v1.27.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= -google.golang.org/grpc v1.27.1/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= -google.golang.org/grpc v1.28.0/go.mod h1:rpkK4SK4GF4Ach/+MFLZUBavHOvF2JJB5uozKKal+60= -google.golang.org/grpc v1.29.1/go.mod h1:itym6AZVZYACWQqET3MqgPpjcuV5QH3BxFS3IjizoKk= -google.golang.org/grpc v1.30.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= -google.golang.org/grpc v1.31.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= -google.golang.org/grpc v1.33.1/go.mod h1:fr5YgcSWrqhRRxogOsw7RzIpsmvOZ6IcH4kBYTpR3n0= -google.golang.org/grpc v1.36.0/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU= -google.golang.org/grpc v1.38.0/go.mod h1:NREThFqKR1f3iQ6oBuvc5LadQuXVGo9rkm5ZGrQdJfM= -google.golang.org/grpc v1.39.0 h1:Klz8I9kdtkIN6EpHHUOMLCYhTn/2WAe5a0s1hcBkdTI= -google.golang.org/grpc v1.39.0/go.mod h1:PImNr+rS9TWYb2O4/emRugxiyHZ5JyHW5F+RPnDzfrE= -google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= -google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= -google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM= -google.golang.org/protobuf v1.20.1-0.20200309200217-e05f789c0967/go.mod h1:A+miEFZTKqfCUM6K7xSMQL9OKL/b6hQv+e19PK+JZNE= -google.golang.org/protobuf v1.21.0/go.mod h1:47Nbq4nVaFHyn7ilMalzfO3qCViNmqZ2kzikPIcrTAo= -google.golang.org/protobuf v1.22.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= -google.golang.org/protobuf v1.23.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= -google.golang.org/protobuf v1.23.1-0.20200526195155-81db48ad09cc/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= -google.golang.org/protobuf v1.24.0/go.mod h1:r/3tXBNzIEhYS9I1OUVjXDlt8tc493IdKGjtUeSXeh4= -google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c= -google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= -google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= google.golang.org/protobuf v1.33.0 h1:uNO2rsAINq/JlFpSdYEKIZ0uKD/R9cpdv0T+yoGwGmI= google.golang.org/protobuf v1.33.0/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos= -gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15 h1:YR8cESwS4TdDjEe65xsg0ogRM/Nc3DYOhEAlW+xobZo= -gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/cheggaaa/pb.v1 v1.0.25/go.mod h1:V/YB90LKu/1FcN3WVnfiiE5oMCibMjukxqG/qStrOgw= -gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI= -gopkg.in/fsnotify.v1 v1.4.7 h1:xOHLXZwVvI9hhs+cLKq5+I5onOuwQLhQwiu63xxlHs4= -gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys= -gopkg.in/gcfg.v1 v1.2.3/go.mod h1:yesOnuUOFQAhST5vPY4nbZsb/huCgGGXlipJsBn0b3o= -gopkg.in/inconshreveable/log15.v2 v2.0.0-20180818164646-67afb5ed74ec/go.mod h1:aPpfJ7XW+gOuirDoZ8gHhLh3kZ1B08FtV2bbmy7Jv3s= -gopkg.in/ini.v1 v1.51.0 h1:AQvPpx3LzTDM0AjnIRlVFwFFGC+npRopjZxLJj6gdno= -gopkg.in/ini.v1 v1.51.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= -gopkg.in/resty.v1 v1.12.0/go.mod h1:mDo4pnntr5jdWRML875a/NmxYqAlA73dVijT2AXvQQo= -gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 h1:uRGJdciOHaEIrze2W8Q3AKkepLTh2hOroT7a+7czfdQ= -gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw= -gopkg.in/warnings.v0 v0.1.2/go.mod h1:jksf8JmL6Qr/oQM2OXTHunEvvTAsrWBLb6OOjuVWRNI= -gopkg.in/yaml.v2 v2.0.0-20170812160011-eb3733d160e7/go.mod h1:JAlM8MvJe8wmxCU4Bli9HhUf9+ttbYbLASfIpnQbh74= -gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -gopkg.in/yaml.v2 v2.2.3/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -gopkg.in/yaml.v2 v2.2.5/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -gopkg.in/yaml.v2 v2.3.0/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= -gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= -gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= -honnef.co/go/tools v0.0.0-20180728063816-88497007e858/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= -honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= -honnef.co/go/tools v0.0.0-20190106161140-3f1c8253044a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= -honnef.co/go/tools v0.0.0-20190418001031-e561f6794a2a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= -honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= -honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt0JzvZhAg= -honnef.co/go/tools v0.0.1-2020.1.3/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= -honnef.co/go/tools v0.0.1-2020.1.4/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= -lukechampine.com/uint128 v1.1.1 h1:pnxCASz787iMf+02ssImqk6OLt+Z5QHMoZyUXR4z6JU= -lukechampine.com/uint128 v1.1.1/go.mod h1:c4eWIwlEGaxC/+H1VguhU4PHXNWDCDMUlWdIWl2j1gk= -modernc.org/cc/v3 v3.33.6/go.mod h1:iPJg1pkwXqAV16SNgFBVYmggfMg6xhs+2oiO0vclK3g= -modernc.org/cc/v3 v3.33.9/go.mod h1:iPJg1pkwXqAV16SNgFBVYmggfMg6xhs+2oiO0vclK3g= -modernc.org/cc/v3 v3.33.11/go.mod h1:iPJg1pkwXqAV16SNgFBVYmggfMg6xhs+2oiO0vclK3g= -modernc.org/cc/v3 v3.34.0/go.mod h1:iPJg1pkwXqAV16SNgFBVYmggfMg6xhs+2oiO0vclK3g= -modernc.org/cc/v3 v3.35.0/go.mod h1:iPJg1pkwXqAV16SNgFBVYmggfMg6xhs+2oiO0vclK3g= -modernc.org/cc/v3 v3.35.4/go.mod h1:iPJg1pkwXqAV16SNgFBVYmggfMg6xhs+2oiO0vclK3g= -modernc.org/cc/v3 v3.35.5/go.mod h1:iPJg1pkwXqAV16SNgFBVYmggfMg6xhs+2oiO0vclK3g= -modernc.org/cc/v3 v3.35.7/go.mod h1:iPJg1pkwXqAV16SNgFBVYmggfMg6xhs+2oiO0vclK3g= -modernc.org/cc/v3 v3.35.8/go.mod h1:iPJg1pkwXqAV16SNgFBVYmggfMg6xhs+2oiO0vclK3g= -modernc.org/cc/v3 v3.35.10/go.mod h1:iPJg1pkwXqAV16SNgFBVYmggfMg6xhs+2oiO0vclK3g= -modernc.org/cc/v3 v3.35.15/go.mod h1:iPJg1pkwXqAV16SNgFBVYmggfMg6xhs+2oiO0vclK3g= -modernc.org/cc/v3 v3.35.16/go.mod h1:iPJg1pkwXqAV16SNgFBVYmggfMg6xhs+2oiO0vclK3g= -modernc.org/cc/v3 v3.35.17/go.mod h1:iPJg1pkwXqAV16SNgFBVYmggfMg6xhs+2oiO0vclK3g= -modernc.org/cc/v3 v3.35.18 h1:rMZhRcWrba0y3nVmdiQ7kxAgOOSq2m2f2VzjHLgEs6U= -modernc.org/cc/v3 v3.35.18/go.mod h1:iPJg1pkwXqAV16SNgFBVYmggfMg6xhs+2oiO0vclK3g= -modernc.org/ccgo/v3 v3.9.5/go.mod h1:umuo2EP2oDSBnD3ckjaVUXMrmeAw8C8OSICVa0iFf60= -modernc.org/ccgo/v3 v3.10.0/go.mod h1:c0yBmkRFi7uW4J7fwx/JiijwOjeAeR2NoSaRVFPmjMw= -modernc.org/ccgo/v3 v3.11.0/go.mod h1:dGNposbDp9TOZ/1KBxghxtUp/bzErD0/0QW4hhSaBMI= -modernc.org/ccgo/v3 v3.11.1/go.mod h1:lWHxfsn13L3f7hgGsGlU28D9eUOf6y3ZYHKoPaKU0ag= -modernc.org/ccgo/v3 v3.11.3/go.mod h1:0oHunRBMBiXOKdaglfMlRPBALQqsfrCKXgw9okQ3GEw= -modernc.org/ccgo/v3 v3.12.4/go.mod h1:Bk+m6m2tsooJchP/Yk5ji56cClmN6R1cqc9o/YtbgBQ= -modernc.org/ccgo/v3 v3.12.6/go.mod h1:0Ji3ruvpFPpz+yu+1m0wk68pdr/LENABhTrDkMDWH6c= -modernc.org/ccgo/v3 v3.12.8/go.mod h1:Hq9keM4ZfjCDuDXxaHptpv9N24JhgBZmUG5q60iLgUo= -modernc.org/ccgo/v3 v3.12.11/go.mod h1:0jVcmyDwDKDGWbcrzQ+xwJjbhZruHtouiBEvDfoIsdg= -modernc.org/ccgo/v3 v3.12.14/go.mod h1:GhTu1k0YCpJSuWwtRAEHAol5W7g1/RRfS4/9hc9vF5I= -modernc.org/ccgo/v3 v3.12.18/go.mod h1:jvg/xVdWWmZACSgOiAhpWpwHWylbJaSzayCqNOJKIhs= -modernc.org/ccgo/v3 v3.12.20/go.mod h1:aKEdssiu7gVgSy/jjMastnv/q6wWGRbszbheXgWRHc8= -modernc.org/ccgo/v3 v3.12.21/go.mod h1:ydgg2tEprnyMn159ZO/N4pLBqpL7NOkJ88GT5zNU2dE= -modernc.org/ccgo/v3 v3.12.22/go.mod h1:nyDVFMmMWhMsgQw+5JH6B6o4MnZ+UQNw1pp52XYFPRk= -modernc.org/ccgo/v3 v3.12.25/go.mod h1:UaLyWI26TwyIT4+ZFNjkyTbsPsY3plAEB6E7L/vZV3w= -modernc.org/ccgo/v3 v3.12.29/go.mod h1:FXVjG7YLf9FetsS2OOYcwNhcdOLGt8S9bQ48+OP75cE= -modernc.org/ccgo/v3 v3.12.36/go.mod h1:uP3/Fiezp/Ga8onfvMLpREq+KUjUmYMxXPO8tETHtA8= -modernc.org/ccgo/v3 v3.12.38/go.mod h1:93O0G7baRST1vNj4wnZ49b1kLxt0xCW5Hsa2qRaZPqc= -modernc.org/ccgo/v3 v3.12.43/go.mod h1:k+DqGXd3o7W+inNujK15S5ZYuPoWYLpF5PYougCmthU= -modernc.org/ccgo/v3 v3.12.46/go.mod h1:UZe6EvMSqOxaJ4sznY7b23/k13R8XNlyWsO5bAmSgOE= -modernc.org/ccgo/v3 v3.12.47/go.mod h1:m8d6p0zNps187fhBwzY/ii6gxfjob1VxWb919Nk1HUk= -modernc.org/ccgo/v3 v3.12.50/go.mod h1:bu9YIwtg+HXQxBhsRDE+cJjQRuINuT9PUK4orOco/JI= -modernc.org/ccgo/v3 v3.12.51/go.mod h1:gaIIlx4YpmGO2bLye04/yeblmvWEmE4BBBls4aJXFiE= -modernc.org/ccgo/v3 v3.12.53/go.mod h1:8xWGGTFkdFEWBEsUmi+DBjwu/WLy3SSOrqEmKUjMeEg= -modernc.org/ccgo/v3 v3.12.54/go.mod h1:yANKFTm9llTFVX1FqNKHE0aMcQb1fuPJx6p8AcUx+74= -modernc.org/ccgo/v3 v3.12.55/go.mod h1:rsXiIyJi9psOwiBkplOaHye5L4MOOaCjHg1Fxkj7IeU= -modernc.org/ccgo/v3 v3.12.56/go.mod h1:ljeFks3faDseCkr60JMpeDb2GSO3TKAmrzm7q9YOcMU= -modernc.org/ccgo/v3 v3.12.57/go.mod h1:hNSF4DNVgBl8wYHpMvPqQWDQx8luqxDnNGCMM4NFNMc= -modernc.org/ccgo/v3 v3.12.60/go.mod h1:k/Nn0zdO1xHVWjPYVshDeWKqbRWIfif5dtsIOCUVMqM= -modernc.org/ccgo/v3 v3.12.65/go.mod h1:D6hQtKxPNZiY6wDBtehSGKFKmyXn53F8nGTpH+POmS4= -modernc.org/ccgo/v3 v3.12.66/go.mod h1:jUuxlCFZTUZLMV08s7B1ekHX5+LIAurKTTaugUr/EhQ= -modernc.org/ccgo/v3 v3.12.67/go.mod h1:Bll3KwKvGROizP2Xj17GEGOTrlvB1XcVaBrC90ORO84= -modernc.org/ccgo/v3 v3.12.73/go.mod h1:hngkB+nUUqzOf3iqsM48Gf1FZhY599qzVg1iX+BT3cQ= -modernc.org/ccgo/v3 v3.12.81/go.mod h1:p2A1duHoBBg1mFtYvnhAnQyI6vL0uw5PGYLSIgF6rYY= -modernc.org/ccgo/v3 v3.12.82 h1:wudcnJyjLj1aQQCXF3IM9Gz2X6UNjw+afIghzdtn0v8= -modernc.org/ccgo/v3 v3.12.82/go.mod h1:ApbflUfa5BKadjHynCficldU1ghjen84tuM5jRynB7w= -modernc.org/ccorpus v1.11.1/go.mod h1:2gEUTrWqdpH2pXsmTM1ZkjeSrUWDpjMu2T6m29L/ErQ= -modernc.org/httpfs v1.0.6/go.mod h1:7dosgurJGp0sPaRanU53W4xZYKh14wfzX420oZADeHM= -modernc.org/libc v1.9.8/go.mod h1:U1eq8YWr/Kc1RWCMFUWEdkTg8OTcfLw2kY8EDwl039w= -modernc.org/libc v1.9.11/go.mod h1:NyF3tsA5ArIjJ83XB0JlqhjTabTCHm9aX4XMPHyQn0Q= -modernc.org/libc v1.11.0/go.mod h1:2lOfPmj7cz+g1MrPNmX65QCzVxgNq2C5o0jdLY2gAYg= -modernc.org/libc v1.11.2/go.mod h1:ioIyrl3ETkugDO3SGZ+6EOKvlP3zSOycUETe4XM4n8M= -modernc.org/libc v1.11.5/go.mod h1:k3HDCP95A6U111Q5TmG3nAyUcp3kR5YFZTeDS9v8vSU= -modernc.org/libc v1.11.6/go.mod h1:ddqmzR6p5i4jIGK1d/EiSw97LBcE3dK24QEwCFvgNgE= -modernc.org/libc v1.11.11/go.mod h1:lXEp9QOOk4qAYOtL3BmMve99S5Owz7Qyowzvg6LiZso= -modernc.org/libc v1.11.13/go.mod h1:ZYawJWlXIzXy2Pzghaf7YfM8OKacP3eZQI81PDLFdY8= -modernc.org/libc v1.11.16/go.mod h1:+DJquzYi+DMRUtWI1YNxrlQO6TcA5+dRRiq8HWBWRC8= -modernc.org/libc v1.11.19/go.mod h1:e0dgEame6mkydy19KKaVPBeEnyJB4LGNb0bBH1EtQ3I= -modernc.org/libc v1.11.24/go.mod h1:FOSzE0UwookyT1TtCJrRkvsOrX2k38HoInhw+cSCUGk= -modernc.org/libc v1.11.26/go.mod h1:SFjnYi9OSd2W7f4ct622o/PAYqk7KHv6GS8NZULIjKY= -modernc.org/libc v1.11.27/go.mod h1:zmWm6kcFXt/jpzeCgfvUNswM0qke8qVwxqZrnddlDiE= -modernc.org/libc v1.11.28/go.mod h1:Ii4V0fTFcbq3qrv3CNn+OGHAvzqMBvC7dBNyC4vHZlg= -modernc.org/libc v1.11.31/go.mod h1:FpBncUkEAtopRNJj8aRo29qUiyx5AvAlAxzlx9GNaVM= -modernc.org/libc v1.11.34/go.mod h1:+Tzc4hnb1iaX/SKAutJmfzES6awxfU1BPvrrJO0pYLg= -modernc.org/libc v1.11.37/go.mod h1:dCQebOwoO1046yTrfUE5nX1f3YpGZQKNcITUYWlrAWo= -modernc.org/libc v1.11.39/go.mod h1:mV8lJMo2S5A31uD0k1cMu7vrJbSA3J3waQJxpV4iqx8= -modernc.org/libc v1.11.42/go.mod h1:yzrLDU+sSjLE+D4bIhS7q1L5UwXDOw99PLSX0BlZvSQ= -modernc.org/libc v1.11.44/go.mod h1:KFq33jsma7F5WXiYelU8quMJasCCTnHK0mkri4yPHgA= -modernc.org/libc v1.11.45/go.mod h1:Y192orvfVQQYFzCNsn+Xt0Hxt4DiO4USpLNXBlXg/tM= -modernc.org/libc v1.11.47/go.mod h1:tPkE4PzCTW27E6AIKIR5IwHAQKCAtudEIeAV1/SiyBg= -modernc.org/libc v1.11.49/go.mod h1:9JrJuK5WTtoTWIFQ7QjX2Mb/bagYdZdscI3xrvHbXjE= -modernc.org/libc v1.11.51/go.mod h1:R9I8u9TS+meaWLdbfQhq2kFknTW0O3aw3kEMqDDxMaM= -modernc.org/libc v1.11.53/go.mod h1:5ip5vWYPAoMulkQ5XlSJTy12Sz5U6blOQiYasilVPsU= -modernc.org/libc v1.11.54/go.mod h1:S/FVnskbzVUrjfBqlGFIPA5m7UwB3n9fojHhCNfSsnw= -modernc.org/libc v1.11.55/go.mod h1:j2A5YBRm6HjNkoSs/fzZrSxCuwWqcMYTDPLNx0URn3M= -modernc.org/libc v1.11.56/go.mod h1:pakHkg5JdMLt2OgRadpPOTnyRXm/uzu+Yyg/LSLdi18= -modernc.org/libc v1.11.58/go.mod h1:ns94Rxv0OWyoQrDqMFfWwka2BcaF6/61CqJRK9LP7S8= -modernc.org/libc v1.11.70/go.mod h1:DUOmMYe+IvKi9n6Mycyx3DbjfzSKrdr/0Vgt3j7P5gw= -modernc.org/libc v1.11.71/go.mod h1:DUOmMYe+IvKi9n6Mycyx3DbjfzSKrdr/0Vgt3j7P5gw= -modernc.org/libc v1.11.75/go.mod h1:dGRVugT6edz361wmD9gk6ax1AbDSe0x5vji0dGJiPT0= -modernc.org/libc v1.11.82/go.mod h1:NF+Ek1BOl2jeC7lw3a7Jj5PWyHPwWD4aq3wVKxqV1fI= -modernc.org/libc v1.11.86/go.mod h1:ePuYgoQLmvxdNT06RpGnaDKJmDNEkV7ZPKI2jnsvZoE= -modernc.org/libc v1.11.87 h1:PzIzOqtlzMDDcCzJ5cUP6h/Ku6Fa9iyflP2ccTY64aE= -modernc.org/libc v1.11.87/go.mod h1:Qvd5iXTeLhI5PS0XSyqMY99282y+3euapQFxM7jYnpY= -modernc.org/mathutil v1.1.1/go.mod h1:mZW8CKdRPY1v87qxC/wUdX5O1qDzXMP5TH3wjfpga6E= -modernc.org/mathutil v1.2.2/go.mod h1:mZW8CKdRPY1v87qxC/wUdX5O1qDzXMP5TH3wjfpga6E= -modernc.org/mathutil v1.4.0/go.mod h1:mZW8CKdRPY1v87qxC/wUdX5O1qDzXMP5TH3wjfpga6E= -modernc.org/mathutil v1.4.1 h1:ij3fYGe8zBF4Vu+g0oT7mB06r8sqGWKuJu1yXeR4by8= -modernc.org/mathutil v1.4.1/go.mod h1:mZW8CKdRPY1v87qxC/wUdX5O1qDzXMP5TH3wjfpga6E= -modernc.org/memory v1.0.4/go.mod h1:nV2OApxradM3/OVbs2/0OsP6nPfakXpi50C7dcoHXlc= -modernc.org/memory v1.0.5 h1:XRch8trV7GgvTec2i7jc33YlUI0RKVDBvZ5eZ5m8y14= -modernc.org/memory v1.0.5/go.mod h1:B7OYswTRnfGg+4tDH1t1OeUNnsy2viGTdME4tzd+IjM= -modernc.org/opt v0.1.1 h1:/0RX92k9vwVeDXj+Xn23DKp2VJubL7k8qNffND6qn3A= -modernc.org/opt v0.1.1/go.mod h1:WdSiB5evDcignE70guQKxYUl14mgWtbClRi5wmkkTX0= -modernc.org/sqlite v1.14.2 h1:ohsW2+e+Qe2To1W6GNezzKGwjXwSax6R+CrhRxVaFbE= -modernc.org/sqlite v1.14.2/go.mod h1:yqfn85u8wVOE6ub5UT8VI9JjhrwBUUCNyTACN0h6Sx8= -modernc.org/strutil v1.1.1 h1:xv+J1BXY3Opl2ALrBwyfEikFAj8pmqcpnfmuwUwcozs= -modernc.org/strutil v1.1.1/go.mod h1:DE+MQQ/hjKBZS2zNInV5hhcipt5rLPWkmpbGeW5mmdw= -modernc.org/tcl v1.8.13/go.mod h1:V+q/Ef0IJaNUSECieLU4o+8IScapxnMyFV6i/7uQlAY= -modernc.org/token v1.0.0 h1:a0jaWiNMDhDUtqOj09wvjWWAqd3q7WpBulmL9H2egsk= -modernc.org/token v1.0.0/go.mod h1:UGzOrNV1mAFSEB63lOFHIpNRUVMvYTc6yu1SMY/XTDM= -modernc.org/z v1.2.19/go.mod h1:+ZpP0pc4zz97eukOzW3xagV/lS82IpPN9NGG5pNF9vY= -rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8= -rsc.io/quote/v3 v3.1.0/go.mod h1:yEA65RcK8LyAZtP9Kv3t0HmxON59tX3rD+tICJqUlj0= -rsc.io/sampler v1.3.0/go.mod h1:T1hPZKmBbMNahiBKFy5HrXp6adAjACjK9JXDnKaTXpA= -sigs.k8s.io/yaml v1.1.0/go.mod h1:UJmg0vDUVViEyp3mgSv9WPwZCDxu4rQW1olrI1uml+o= -sigs.k8s.io/yaml v1.2.0/go.mod h1:yfXDCHCao9+ENCvLSE62v9VSji2MKu5jeNfTrofGhJc= -sourcegraph.com/sourcegraph/appdash v0.0.0-20190731080439-ebfcffb1b5c0/go.mod h1:hI742Nqp5OhwiqlzhgfbWU4mW4yO10fP+LoT9WOswdU= -xorm.io/builder v0.3.11-0.20220531020008-1bd24a7dc978 h1:bvLlAPW1ZMTWA32LuZMBEGHAUOcATZjzHcotf3SWweM= -xorm.io/builder v0.3.11-0.20220531020008-1bd24a7dc978/go.mod h1:aUW0S9eb9VCaPohFCH3j7czOx1PMW3i1HrSzbLYGBSE= -xorm.io/xorm v1.3.1 h1:z5egKrDoOLqZFhMjcGF4FBHiTmE5/feQoHclfhNidfM= -xorm.io/xorm v1.3.1/go.mod h1:9NbjqdnjX6eyjRRhh01GHm64r6N9shTb/8Ak3YRt8Nw= diff --git a/src/app/internal/config/Const.go b/src/app/internal/config/Const.go deleted file mode 100644 index d878168..0000000 --- a/src/app/internal/config/Const.go +++ /dev/null @@ -1,65 +0,0 @@ -/* - 本文文件由脚本自动生成,禁止手动编辑 -*/ - -package config - -import ( - "os" - "path" - "strings" - - "core/log" -) - -type ITable interface { - NumRows() int - Fields() []string - PrefixList(string) []string - - MaxInt(field string) (data int32) - Int(row int, field string) (data int32, ok bool) - IntNoErr(row int, field string) (data int32) - Str(row int, field string) (data string, ok bool) - RowByKey(key interface{}) (row int, ok bool) -} - -func handTableName(tableName string) (name string) { - words := strings.Split(tableName, "_") - if len(words) == 1 { - return tableName - } - for _, word := range words { - name += strings.Title(word) - } - return -} - -func TableByName(name string) (table ITable, ok bool) { - table, ok = table_name_index_map[handTableName(name)] - return -} - -func readfile(fpath string) ([]byte, bool) { - if path.Ext(fpath) != ".json" { - log.KV("path", fpath).Error("file ext not json") - return nil, false - } - - data, err := os.ReadFile(fpath) - if err != nil { - log.KV("path", fpath).KV("err", err).Error("read file failed") - return nil, false - } - return data, true -} - -var table_name_index_map map[string]ITable - -func Reload(fpath string) error { - new_map := map[string]ITable{} - - table_name_index_map = new_map - log.KV("path", fpath).Info("load game config over") - return nil -} diff --git a/src/app/internal/flags/flags.go b/src/app/internal/flags/flags.go deleted file mode 100644 index 8bad7a4..0000000 --- a/src/app/internal/flags/flags.go +++ /dev/null @@ -1,15 +0,0 @@ -package flags - -import ( - "core/tools" - "github.com/jessevdk/go-flags" - "os" -) - -func Parse(opts interface{}) { - _, err := flags.NewParser(opts, flags.HelpFlag|flags.PrintErrors|flags.IgnoreUnknown).Parse() - if ferr, ok := err.(*flags.Error); ok && ferr.Type == flags.ErrHelp { - os.Exit(0) - } - tools.AssertNil(err) -} diff --git a/src/app/internal/iniconfig/ini.go b/src/app/internal/iniconfig/ini.go deleted file mode 100644 index 5bce843..0000000 --- a/src/app/internal/iniconfig/ini.go +++ /dev/null @@ -1,127 +0,0 @@ -package iniconfig - -import ( - "core/tools" - "fmt" - "github.com/go-ini/ini" - "sync" -) - -var base *ini.Section -var iniFile *ini.File -var loadOnce sync.Once - -func Init(filePath string) { - loadOnce.Do(func() { - file, err := ini.Load(filePath) - tools.AssertNil(err) - - file.BlockMode = false - base, err = file.GetSection("base") - tools.AssertNil(err) - - iniFile = file - }) -} - -func NewAppConf(appType string, appId int32) *Config { - conf := &Config{appType: appType, appId: appId} - app, err := iniFile.GetSection(fmt.Sprintf("%s_%d", appType, appId)) - tools.AssertNil(err) - conf.app = app - return conf -} - -type Config struct { - appType string - appId int32 - app *ini.Section -} - -// func (c *Config) AppId() int32 { return c.appId } -// func (c *Config) AppType() string { return c.appType } -func (c *Config) Has(key string) bool { return c.app.HasKey(key) || base.HasKey(key) } - -func (c *Config) Int32(key string) int32 { - value, err := c.findKey(key).Int() - tools.AssertNil(err) - return int32(value) -} - -func (c *Config) MustInt32(key string, val int32) int32 { - if c.Has(key) { - value, err := c.findKey(key).Int() - if err == nil { - return int32(value) - } - } - return val -} - -func (c *Config) Int64(key string) int64 { - value, err := c.findKey(key).Int() - tools.AssertNil(err) - return int64(value) -} - -func (c *Config) MustInt64(key string, val int64) int64 { - if c.Has(key) { - value, err := c.findKey(key).Int() - if err == nil { - return int64(value) - } - } - return val -} - -func (c *Config) String(key string) string { - return c.findKey(key).String() -} - -func (c *Config) MustString(key string, val string) string { - if c.Has(key) { - return c.findKey(key).String() - } - return val -} - -func (c *Config) Bool(key string) bool { - value, err := c.findKey(key).Bool() - tools.AssertNil(err) - return value -} - -func (c *Config) MustBool(key string, val bool) bool { - if c.Has(key) { - value, err := c.findKey(key).Bool() - if err == nil { - return value - } - } - return val -} - -// 不含base -func (c *Config) AppKeys() []string { - return c.app.KeyStrings() -} - -func (c *Config) BaseKeys() []string { - return base.KeyStrings() -} - -func (c *Config) ChildSections() []*ini.Section { - return c.app.ChildSections() -} - -// app的配置可覆盖base -func (c *Config) findKey(key string) *ini.Key { - if c.app.HasKey(key) { - return c.app.Key(key) - } - if base.HasKey(key) { - return base.Key(key) - } - tools.AssertTrue(false, key) - return nil -} diff --git a/src/app/internal/message/common.pb.go b/src/app/internal/message/common.pb.go deleted file mode 100644 index 863ae14..0000000 --- a/src/app/internal/message/common.pb.go +++ /dev/null @@ -1,1239 +0,0 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.26.0 -// protoc v3.17.3 -// source: common.proto - -package message - -import ( - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" - reflect "reflect" - sync "sync" -) - -import proto "google.golang.org/protobuf/proto" - -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 KICK_OUT_REASON int32 - -const ( - KICK_OUT_REASON_REPLACE KICK_OUT_REASON = 0 //顶号 - KICK_OUT_REASON_MAINTAIN KICK_OUT_REASON = 1 //维护 - KICK_OUT_REASON_GM KICK_OUT_REASON = 2 //后台踢人 - KICK_OUT_REASON_OTHER KICK_OUT_REASON = 3 //其他原因 -) - -// Enum value maps for KICK_OUT_REASON. -var ( - KICK_OUT_REASON_name = map[int32]string{ - 0: "REPLACE", - 1: "MAINTAIN", - 2: "GM", - 3: "OTHER", - } - KICK_OUT_REASON_value = map[string]int32{ - "REPLACE": 0, - "MAINTAIN": 1, - "GM": 2, - "OTHER": 3, - } -) - -func (x KICK_OUT_REASON) Enum() *KICK_OUT_REASON { - p := new(KICK_OUT_REASON) - *p = x - return p -} - -func (x KICK_OUT_REASON) String() string { - return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) -} - -func (KICK_OUT_REASON) Descriptor() protoreflect.EnumDescriptor { - return file_common_proto_enumTypes[0].Descriptor() -} - -func (KICK_OUT_REASON) Type() protoreflect.EnumType { - return &file_common_proto_enumTypes[0] -} - -func (x KICK_OUT_REASON) Number() protoreflect.EnumNumber { - return protoreflect.EnumNumber(x) -} - -// Deprecated: Use KICK_OUT_REASON.Descriptor instead. -func (KICK_OUT_REASON) EnumDescriptor() ([]byte, []int) { - return file_common_proto_rawDescGZIP(), []int{0} -} - -type BAN_REASON int32 - -const ( - BAN_REASON_PLUGIN BAN_REASON = 0 //在游戏中使用外挂或脚本攫取利益. - BAN_REASON_EXPLOIT_BUG BAN_REASON = 1 //在游戏中恶意利用bug攫取利益. - BAN_REASON_ILLEGAL_RESOURCE_TRADING BAN_REASON = 2 //在游戏中进行非法资源交易. - BAN_REASON_SALE_ACCOUNT BAN_REASON = 3 //在游戏中买卖账号 - BAN_REASON_MALICIOUS_REFUND BAN_REASON = 4 //在游戏中恶意退款 - BAN_REASON_IRREGULARITIES BAN_REASON = 5 //存在违规游戏行为 -) - -// Enum value maps for BAN_REASON. -var ( - BAN_REASON_name = map[int32]string{ - 0: "PLUGIN", - 1: "EXPLOIT_BUG", - 2: "ILLEGAL_RESOURCE_TRADING", - 3: "SALE_ACCOUNT", - 4: "MALICIOUS_REFUND", - 5: "IRREGULARITIES", - } - BAN_REASON_value = map[string]int32{ - "PLUGIN": 0, - "EXPLOIT_BUG": 1, - "ILLEGAL_RESOURCE_TRADING": 2, - "SALE_ACCOUNT": 3, - "MALICIOUS_REFUND": 4, - "IRREGULARITIES": 5, - } -) - -func (x BAN_REASON) Enum() *BAN_REASON { - p := new(BAN_REASON) - *p = x - return p -} - -func (x BAN_REASON) String() string { - return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) -} - -func (BAN_REASON) Descriptor() protoreflect.EnumDescriptor { - return file_common_proto_enumTypes[1].Descriptor() -} - -func (BAN_REASON) Type() protoreflect.EnumType { - return &file_common_proto_enumTypes[1] -} - -func (x BAN_REASON) Number() protoreflect.EnumNumber { - return protoreflect.EnumNumber(x) -} - -// Deprecated: Use BAN_REASON.Descriptor instead. -func (BAN_REASON) EnumDescriptor() ([]byte, []int) { - return file_common_proto_rawDescGZIP(), []int{1} -} - -type MessageResult struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - ProtoId int32 `protobuf:"varint,1,opt,name=ProtoId,proto3" json:"ProtoId"` //协议号 - Result MSG_RESULT `protobuf:"varint,2,opt,name=Result,proto3,enum=message.MSG_RESULT" json:"Result"` //错误码 - Data []byte `protobuf:"bytes,3,opt,name=Data,proto3" json:"Data"` //自定义数据 -} - -func (x *MessageResult) Reset() { - *x = MessageResult{} - if protoimpl.UnsafeEnabled { - mi := &file_common_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *MessageResult) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (x *MessageResult) FromDB(data []byte) error { - return proto.Unmarshal(data, x) -} - -func (x *MessageResult) ToDB() ([]byte, error) { - return proto.Marshal(x) -} - -func (*MessageResult) ProtoMessage() {} - -func (x *MessageResult) ProtoReflect() protoreflect.Message { - mi := &file_common_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 MessageResult.ProtoReflect.Descriptor instead. -func (*MessageResult) Descriptor() ([]byte, []int) { - return file_common_proto_rawDescGZIP(), []int{0} -} - -func (x *MessageResult) GetProtoId() int32 { - if x != nil { - return x.ProtoId - } - return 0 -} - -func (x *MessageResult) GetResult() MSG_RESULT { - if x != nil { - return x.Result - } - return MSG_RESULT_SUCCESS -} - -func (x *MessageResult) GetData() []byte { - if x != nil { - return x.Data - } - return nil -} - -func (x *MessageResult) SetProtoId(val int32) { - if x != nil { - x.ProtoId = val - } -} -func (x *MessageResult) SetResult(val MSG_RESULT) { - if x != nil { - x.Result = val - } -} -func (x *MessageResult) SetData(val []byte) { - if x != nil { - x.Data = val - } -} - -type Ping struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - ClientTime int64 `protobuf:"varint,1,opt,name=ClientTime,proto3" json:"ClientTime"` //客户端时间戳 - ServerIP string `protobuf:"bytes,2,opt,name=ServerIP,proto3" json:"ServerIP"` //客户端使用的ip - RID int64 `protobuf:"varint,3,opt,name=RID,proto3" json:"RID"` //客户端RID - Dt int32 `protobuf:"varint,4,opt,name=Dt,proto3" json:"Dt"` //RTT - TypeOfNetwork string `protobuf:"bytes,5,opt,name=TypeOfNetwork,proto3" json:"TypeOfNetwork"` //网络 - DeviceModel string `protobuf:"bytes,6,opt,name=DeviceModel,proto3" json:"DeviceModel"` //设备类型 - OS string `protobuf:"bytes,7,opt,name=OS,proto3" json:"OS"` //ios/android/win/mac -} - -func (x *Ping) Reset() { - *x = Ping{} - if protoimpl.UnsafeEnabled { - mi := &file_common_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *Ping) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (x *Ping) FromDB(data []byte) error { - return proto.Unmarshal(data, x) -} - -func (x *Ping) ToDB() ([]byte, error) { - return proto.Marshal(x) -} - -func (*Ping) ProtoMessage() {} - -func (x *Ping) ProtoReflect() protoreflect.Message { - mi := &file_common_proto_msgTypes[1] - 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 Ping.ProtoReflect.Descriptor instead. -func (*Ping) Descriptor() ([]byte, []int) { - return file_common_proto_rawDescGZIP(), []int{1} -} - -func (x *Ping) GetClientTime() int64 { - if x != nil { - return x.ClientTime - } - return 0 -} - -func (x *Ping) GetServerIP() string { - if x != nil { - return x.ServerIP - } - return "" -} - -func (x *Ping) GetRID() int64 { - if x != nil { - return x.RID - } - return 0 -} - -func (x *Ping) GetDt() int32 { - if x != nil { - return x.Dt - } - return 0 -} - -func (x *Ping) GetTypeOfNetwork() string { - if x != nil { - return x.TypeOfNetwork - } - return "" -} - -func (x *Ping) GetDeviceModel() string { - if x != nil { - return x.DeviceModel - } - return "" -} - -func (x *Ping) GetOS() string { - if x != nil { - return x.OS - } - return "" -} - -func (x *Ping) SetClientTime(val int64) { - if x != nil { - x.ClientTime = val - } -} -func (x *Ping) SetServerIP(val string) { - if x != nil { - x.ServerIP = val - } -} -func (x *Ping) SetRID(val int64) { - if x != nil { - x.RID = val - } -} -func (x *Ping) SetDt(val int32) { - if x != nil { - x.Dt = val - } -} -func (x *Ping) SetTypeOfNetwork(val string) { - if x != nil { - x.TypeOfNetwork = val - } -} -func (x *Ping) SetDeviceModel(val string) { - if x != nil { - x.DeviceModel = val - } -} -func (x *Ping) SetOS(val string) { - if x != nil { - x.OS = val - } -} - -type Pong struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - ServerTime int64 `protobuf:"varint,1,opt,name=ServerTime,proto3" json:"ServerTime"` //服务器本地时间戳 - ServerZone int32 `protobuf:"varint,2,opt,name=ServerZone,proto3" json:"ServerZone"` //服务器时区 - ClientTime int64 `protobuf:"varint,3,opt,name=ClientTime,proto3" json:"ClientTime"` //客户端时间戳 -} - -func (x *Pong) Reset() { - *x = Pong{} - if protoimpl.UnsafeEnabled { - mi := &file_common_proto_msgTypes[2] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *Pong) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (x *Pong) FromDB(data []byte) error { - return proto.Unmarshal(data, x) -} - -func (x *Pong) ToDB() ([]byte, error) { - return proto.Marshal(x) -} - -func (*Pong) ProtoMessage() {} - -func (x *Pong) ProtoReflect() protoreflect.Message { - mi := &file_common_proto_msgTypes[2] - 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 Pong.ProtoReflect.Descriptor instead. -func (*Pong) Descriptor() ([]byte, []int) { - return file_common_proto_rawDescGZIP(), []int{2} -} - -func (x *Pong) GetServerTime() int64 { - if x != nil { - return x.ServerTime - } - return 0 -} - -func (x *Pong) GetServerZone() int32 { - if x != nil { - return x.ServerZone - } - return 0 -} - -func (x *Pong) GetClientTime() int64 { - if x != nil { - return x.ClientTime - } - return 0 -} - -func (x *Pong) SetServerTime(val int64) { - if x != nil { - x.ServerTime = val - } -} -func (x *Pong) SetServerZone(val int32) { - if x != nil { - x.ServerZone = val - } -} -func (x *Pong) SetClientTime(val int64) { - if x != nil { - x.ClientTime = val - } -} - -type Login struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Session string `protobuf:"bytes,1,opt,name=Session,proto3" json:"Session"` - LoginTime int64 `protobuf:"varint,2,opt,name=LoginTime,proto3" json:"LoginTime"` - RID int64 `protobuf:"varint,3,opt,name=RID,proto3" json:"RID"` - SID int32 `protobuf:"varint,4,opt,name=SID,proto3" json:"SID"` - Mute int64 `protobuf:"varint,5,opt,name=Mute,proto3" json:"Mute"` - Ban int64 `protobuf:"varint,6,opt,name=Ban,proto3" json:"Ban"` - Super bool `protobuf:"varint,7,opt,name=Super,proto3" json:"Super"` - OS string `protobuf:"bytes,8,opt,name=OS,proto3" json:"OS"` //ios/android/win/mac - Language string `protobuf:"bytes,9,opt,name=Language,proto3" json:"Language"` //all/cn/en - DeviceToken string `protobuf:"bytes,10,opt,name=DeviceToken,proto3" json:"DeviceToken"` //设备标识 - UID int64 `protobuf:"varint,11,opt,name=UID,proto3" json:"UID"` //uid - White bool `protobuf:"varint,12,opt,name=White,proto3" json:"White"` //是否是白名单 - Passport string `protobuf:"bytes,13,opt,name=Passport,proto3" json:"Passport"` //账号 - PassportType string `protobuf:"bytes,14,opt,name=PassportType,proto3" json:"PassportType"` //账号渠道 - Channels int32 `protobuf:"varint,20,opt,name=Channels,proto3" json:"Channels"` //渠道 - DeviceModel string `protobuf:"bytes,21,opt,name=DeviceModel,proto3" json:"DeviceModel"` //设备类型 - TypeOfNetwork string `protobuf:"bytes,22,opt,name=TypeOfNetwork,proto3" json:"TypeOfNetwork"` //网络 - IP string `protobuf:"bytes,23,opt,name=IP,proto3" json:"IP"` //ip地址 - ABTest string `protobuf:"bytes,30,opt,name=ABTest,proto3" json:"ABTest"` //AB测试 - PackageCode string `protobuf:"bytes,31,opt,name=PackageCode,proto3" json:"PackageCode"` //客户端包名 - Memory string `protobuf:"bytes,32,opt,name=Memory,proto3" json:"Memory"` //客户端内存 - Version string `protobuf:"bytes,33,opt,name=Version,proto3" json:"Version"` //客户端版本号 -} - -func (x *Login) Reset() { - *x = Login{} - if protoimpl.UnsafeEnabled { - mi := &file_common_proto_msgTypes[3] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *Login) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (x *Login) FromDB(data []byte) error { - return proto.Unmarshal(data, x) -} - -func (x *Login) ToDB() ([]byte, error) { - return proto.Marshal(x) -} - -func (*Login) ProtoMessage() {} - -func (x *Login) ProtoReflect() protoreflect.Message { - mi := &file_common_proto_msgTypes[3] - 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 Login.ProtoReflect.Descriptor instead. -func (*Login) Descriptor() ([]byte, []int) { - return file_common_proto_rawDescGZIP(), []int{3} -} - -func (x *Login) GetSession() string { - if x != nil { - return x.Session - } - return "" -} - -func (x *Login) GetLoginTime() int64 { - if x != nil { - return x.LoginTime - } - return 0 -} - -func (x *Login) GetRID() int64 { - if x != nil { - return x.RID - } - return 0 -} - -func (x *Login) GetSID() int32 { - if x != nil { - return x.SID - } - return 0 -} - -func (x *Login) GetMute() int64 { - if x != nil { - return x.Mute - } - return 0 -} - -func (x *Login) GetBan() int64 { - if x != nil { - return x.Ban - } - return 0 -} - -func (x *Login) GetSuper() bool { - if x != nil { - return x.Super - } - return false -} - -func (x *Login) GetOS() string { - if x != nil { - return x.OS - } - return "" -} - -func (x *Login) GetLanguage() string { - if x != nil { - return x.Language - } - return "" -} - -func (x *Login) GetDeviceToken() string { - if x != nil { - return x.DeviceToken - } - return "" -} - -func (x *Login) GetUID() int64 { - if x != nil { - return x.UID - } - return 0 -} - -func (x *Login) GetWhite() bool { - if x != nil { - return x.White - } - return false -} - -func (x *Login) GetPassport() string { - if x != nil { - return x.Passport - } - return "" -} - -func (x *Login) GetPassportType() string { - if x != nil { - return x.PassportType - } - return "" -} - -func (x *Login) GetChannels() int32 { - if x != nil { - return x.Channels - } - return 0 -} - -func (x *Login) GetDeviceModel() string { - if x != nil { - return x.DeviceModel - } - return "" -} - -func (x *Login) GetTypeOfNetwork() string { - if x != nil { - return x.TypeOfNetwork - } - return "" -} - -func (x *Login) GetIP() string { - if x != nil { - return x.IP - } - return "" -} - -func (x *Login) GetABTest() string { - if x != nil { - return x.ABTest - } - return "" -} - -func (x *Login) GetPackageCode() string { - if x != nil { - return x.PackageCode - } - return "" -} - -func (x *Login) GetMemory() string { - if x != nil { - return x.Memory - } - return "" -} - -func (x *Login) GetVersion() string { - if x != nil { - return x.Version - } - return "" -} - -func (x *Login) SetSession(val string) { - if x != nil { - x.Session = val - } -} -func (x *Login) SetLoginTime(val int64) { - if x != nil { - x.LoginTime = val - } -} -func (x *Login) SetRID(val int64) { - if x != nil { - x.RID = val - } -} -func (x *Login) SetSID(val int32) { - if x != nil { - x.SID = val - } -} -func (x *Login) SetMute(val int64) { - if x != nil { - x.Mute = val - } -} -func (x *Login) SetBan(val int64) { - if x != nil { - x.Ban = val - } -} -func (x *Login) SetSuper(val bool) { - if x != nil { - x.Super = val - } -} -func (x *Login) SetOS(val string) { - if x != nil { - x.OS = val - } -} -func (x *Login) SetLanguage(val string) { - if x != nil { - x.Language = val - } -} -func (x *Login) SetDeviceToken(val string) { - if x != nil { - x.DeviceToken = val - } -} -func (x *Login) SetUID(val int64) { - if x != nil { - x.UID = val - } -} -func (x *Login) SetWhite(val bool) { - if x != nil { - x.White = val - } -} -func (x *Login) SetPassport(val string) { - if x != nil { - x.Passport = val - } -} -func (x *Login) SetPassportType(val string) { - if x != nil { - x.PassportType = val - } -} -func (x *Login) SetChannels(val int32) { - if x != nil { - x.Channels = val - } -} -func (x *Login) SetDeviceModel(val string) { - if x != nil { - x.DeviceModel = val - } -} -func (x *Login) SetTypeOfNetwork(val string) { - if x != nil { - x.TypeOfNetwork = val - } -} -func (x *Login) SetIP(val string) { - if x != nil { - x.IP = val - } -} -func (x *Login) SetABTest(val string) { - if x != nil { - x.ABTest = val - } -} -func (x *Login) SetPackageCode(val string) { - if x != nil { - x.PackageCode = val - } -} -func (x *Login) SetMemory(val string) { - if x != nil { - x.Memory = val - } -} -func (x *Login) SetVersion(val string) { - if x != nil { - x.Version = val - } -} - -type LoginResult struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Result MSG_RESULT `protobuf:"varint,1,opt,name=Result,proto3,enum=message.MSG_RESULT" json:"Result"` - Role int64 `protobuf:"varint,2,opt,name=Role,proto3" json:"Role"` - ServerTime int64 `protobuf:"varint,3,opt,name=ServerTime,proto3" json:"ServerTime"` - ServerZone int32 `protobuf:"varint,4,opt,name=ServerZone,proto3" json:"ServerZone"` - LeagueHelpPoint int32 `protobuf:"varint,6,opt,name=LeagueHelpPoint,proto3" json:"LeagueHelpPoint"` - ServerOpenTime int64 `protobuf:"varint,8,opt,name=ServerOpenTime,proto3" json:"ServerOpenTime"` - MainEventVersion int32 `protobuf:"varint,9,opt,name=MainEventVersion,proto3" json:"MainEventVersion"` -} - -func (x *LoginResult) Reset() { - *x = LoginResult{} - if protoimpl.UnsafeEnabled { - mi := &file_common_proto_msgTypes[4] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *LoginResult) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (x *LoginResult) FromDB(data []byte) error { - return proto.Unmarshal(data, x) -} - -func (x *LoginResult) ToDB() ([]byte, error) { - return proto.Marshal(x) -} - -func (*LoginResult) ProtoMessage() {} - -func (x *LoginResult) ProtoReflect() protoreflect.Message { - mi := &file_common_proto_msgTypes[4] - 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 LoginResult.ProtoReflect.Descriptor instead. -func (*LoginResult) Descriptor() ([]byte, []int) { - return file_common_proto_rawDescGZIP(), []int{4} -} - -func (x *LoginResult) GetResult() MSG_RESULT { - if x != nil { - return x.Result - } - return MSG_RESULT_SUCCESS -} - -func (x *LoginResult) GetRole() int64 { - if x != nil { - return x.Role - } - return 0 -} - -func (x *LoginResult) GetServerTime() int64 { - if x != nil { - return x.ServerTime - } - return 0 -} - -func (x *LoginResult) GetServerZone() int32 { - if x != nil { - return x.ServerZone - } - return 0 -} - -func (x *LoginResult) GetLeagueHelpPoint() int32 { - if x != nil { - return x.LeagueHelpPoint - } - return 0 -} - -func (x *LoginResult) GetServerOpenTime() int64 { - if x != nil { - return x.ServerOpenTime - } - return 0 -} - -func (x *LoginResult) GetMainEventVersion() int32 { - if x != nil { - return x.MainEventVersion - } - return 0 -} - -func (x *LoginResult) SetResult(val MSG_RESULT) { - if x != nil { - x.Result = val - } -} -func (x *LoginResult) SetRole(val int64) { - if x != nil { - x.Role = val - } -} -func (x *LoginResult) SetServerTime(val int64) { - if x != nil { - x.ServerTime = val - } -} -func (x *LoginResult) SetServerZone(val int32) { - if x != nil { - x.ServerZone = val - } -} -func (x *LoginResult) SetLeagueHelpPoint(val int32) { - if x != nil { - x.LeagueHelpPoint = val - } -} -func (x *LoginResult) SetServerOpenTime(val int64) { - if x != nil { - x.ServerOpenTime = val - } -} -func (x *LoginResult) SetMainEventVersion(val int32) { - if x != nil { - x.MainEventVersion = val - } -} - -type NotifyKickOut struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Reason KICK_OUT_REASON `protobuf:"varint,1,opt,name=reason,proto3,enum=message.KICK_OUT_REASON" json:"reason"` - Ban BAN_REASON `protobuf:"varint,2,opt,name=ban,proto3,enum=message.BAN_REASON" json:"ban"` //当reason = 2的时候 才会给当前字段赋值. -} - -func (x *NotifyKickOut) Reset() { - *x = NotifyKickOut{} - if protoimpl.UnsafeEnabled { - mi := &file_common_proto_msgTypes[5] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *NotifyKickOut) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (x *NotifyKickOut) FromDB(data []byte) error { - return proto.Unmarshal(data, x) -} - -func (x *NotifyKickOut) ToDB() ([]byte, error) { - return proto.Marshal(x) -} - -func (*NotifyKickOut) ProtoMessage() {} - -func (x *NotifyKickOut) ProtoReflect() protoreflect.Message { - mi := &file_common_proto_msgTypes[5] - 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 NotifyKickOut.ProtoReflect.Descriptor instead. -func (*NotifyKickOut) Descriptor() ([]byte, []int) { - return file_common_proto_rawDescGZIP(), []int{5} -} - -func (x *NotifyKickOut) GetReason() KICK_OUT_REASON { - if x != nil { - return x.Reason - } - return KICK_OUT_REASON_REPLACE -} - -func (x *NotifyKickOut) GetBan() BAN_REASON { - if x != nil { - return x.Ban - } - return BAN_REASON_PLUGIN -} - -func (x *NotifyKickOut) SetReason(val KICK_OUT_REASON) { - if x != nil { - x.Reason = val - } -} -func (x *NotifyKickOut) SetBan(val BAN_REASON) { - if x != nil { - x.Ban = val - } -} - -var File_common_proto protoreflect.FileDescriptor - -var file_common_proto_rawDesc = []byte{ - 0x0a, 0x0c, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x07, - 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x1a, 0x0d, 0x6d, 0x73, 0x67, 0x74, 0x79, 0x70, 0x65, - 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x6a, 0x0a, 0x0d, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, - 0x65, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x12, 0x18, 0x0a, 0x07, 0x50, 0x72, 0x6f, 0x74, 0x6f, - 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x07, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x49, - 0x64, 0x12, 0x2b, 0x0a, 0x06, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, - 0x0e, 0x32, 0x13, 0x2e, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x2e, 0x4d, 0x53, 0x47, 0x5f, - 0x52, 0x45, 0x53, 0x55, 0x4c, 0x54, 0x52, 0x06, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x12, 0x12, - 0x0a, 0x04, 0x44, 0x61, 0x74, 0x61, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x04, 0x44, 0x61, - 0x74, 0x61, 0x22, 0xbc, 0x01, 0x0a, 0x04, 0x50, 0x69, 0x6e, 0x67, 0x12, 0x1e, 0x0a, 0x0a, 0x43, - 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x54, 0x69, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, - 0x0a, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x53, - 0x65, 0x72, 0x76, 0x65, 0x72, 0x49, 0x50, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x53, - 0x65, 0x72, 0x76, 0x65, 0x72, 0x49, 0x50, 0x12, 0x10, 0x0a, 0x03, 0x52, 0x49, 0x44, 0x18, 0x03, - 0x20, 0x01, 0x28, 0x03, 0x52, 0x03, 0x52, 0x49, 0x44, 0x12, 0x0e, 0x0a, 0x02, 0x44, 0x74, 0x18, - 0x04, 0x20, 0x01, 0x28, 0x05, 0x52, 0x02, 0x44, 0x74, 0x12, 0x24, 0x0a, 0x0d, 0x54, 0x79, 0x70, - 0x65, 0x4f, 0x66, 0x4e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x0d, 0x54, 0x79, 0x70, 0x65, 0x4f, 0x66, 0x4e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x12, - 0x20, 0x0a, 0x0b, 0x44, 0x65, 0x76, 0x69, 0x63, 0x65, 0x4d, 0x6f, 0x64, 0x65, 0x6c, 0x18, 0x06, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x44, 0x65, 0x76, 0x69, 0x63, 0x65, 0x4d, 0x6f, 0x64, 0x65, - 0x6c, 0x12, 0x0e, 0x0a, 0x02, 0x4f, 0x53, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x4f, - 0x53, 0x22, 0x66, 0x0a, 0x04, 0x50, 0x6f, 0x6e, 0x67, 0x12, 0x1e, 0x0a, 0x0a, 0x53, 0x65, 0x72, - 0x76, 0x65, 0x72, 0x54, 0x69, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0a, 0x53, - 0x65, 0x72, 0x76, 0x65, 0x72, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x1e, 0x0a, 0x0a, 0x53, 0x65, 0x72, - 0x76, 0x65, 0x72, 0x5a, 0x6f, 0x6e, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0a, 0x53, - 0x65, 0x72, 0x76, 0x65, 0x72, 0x5a, 0x6f, 0x6e, 0x65, 0x12, 0x1e, 0x0a, 0x0a, 0x43, 0x6c, 0x69, - 0x65, 0x6e, 0x74, 0x54, 0x69, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0a, 0x43, - 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x54, 0x69, 0x6d, 0x65, 0x22, 0xb5, 0x04, 0x0a, 0x05, 0x4c, 0x6f, - 0x67, 0x69, 0x6e, 0x12, 0x18, 0x0a, 0x07, 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x1c, 0x0a, - 0x09, 0x4c, 0x6f, 0x67, 0x69, 0x6e, 0x54, 0x69, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, - 0x52, 0x09, 0x4c, 0x6f, 0x67, 0x69, 0x6e, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x10, 0x0a, 0x03, 0x52, - 0x49, 0x44, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x52, 0x03, 0x52, 0x49, 0x44, 0x12, 0x10, 0x0a, - 0x03, 0x53, 0x49, 0x44, 0x18, 0x04, 0x20, 0x01, 0x28, 0x05, 0x52, 0x03, 0x53, 0x49, 0x44, 0x12, - 0x12, 0x0a, 0x04, 0x4d, 0x75, 0x74, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x03, 0x52, 0x04, 0x4d, - 0x75, 0x74, 0x65, 0x12, 0x10, 0x0a, 0x03, 0x42, 0x61, 0x6e, 0x18, 0x06, 0x20, 0x01, 0x28, 0x03, - 0x52, 0x03, 0x42, 0x61, 0x6e, 0x12, 0x14, 0x0a, 0x05, 0x53, 0x75, 0x70, 0x65, 0x72, 0x18, 0x07, - 0x20, 0x01, 0x28, 0x08, 0x52, 0x05, 0x53, 0x75, 0x70, 0x65, 0x72, 0x12, 0x0e, 0x0a, 0x02, 0x4f, - 0x53, 0x18, 0x08, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x4f, 0x53, 0x12, 0x1a, 0x0a, 0x08, 0x4c, - 0x61, 0x6e, 0x67, 0x75, 0x61, 0x67, 0x65, 0x18, 0x09, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x4c, - 0x61, 0x6e, 0x67, 0x75, 0x61, 0x67, 0x65, 0x12, 0x20, 0x0a, 0x0b, 0x44, 0x65, 0x76, 0x69, 0x63, - 0x65, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x44, 0x65, - 0x76, 0x69, 0x63, 0x65, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x12, 0x10, 0x0a, 0x03, 0x55, 0x49, 0x44, - 0x18, 0x0b, 0x20, 0x01, 0x28, 0x03, 0x52, 0x03, 0x55, 0x49, 0x44, 0x12, 0x14, 0x0a, 0x05, 0x57, - 0x68, 0x69, 0x74, 0x65, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x08, 0x52, 0x05, 0x57, 0x68, 0x69, 0x74, - 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x50, 0x61, 0x73, 0x73, 0x70, 0x6f, 0x72, 0x74, 0x18, 0x0d, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x08, 0x50, 0x61, 0x73, 0x73, 0x70, 0x6f, 0x72, 0x74, 0x12, 0x22, 0x0a, - 0x0c, 0x50, 0x61, 0x73, 0x73, 0x70, 0x6f, 0x72, 0x74, 0x54, 0x79, 0x70, 0x65, 0x18, 0x0e, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x0c, 0x50, 0x61, 0x73, 0x73, 0x70, 0x6f, 0x72, 0x74, 0x54, 0x79, 0x70, - 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x43, 0x68, 0x61, 0x6e, 0x6e, 0x65, 0x6c, 0x73, 0x18, 0x14, 0x20, - 0x01, 0x28, 0x05, 0x52, 0x08, 0x43, 0x68, 0x61, 0x6e, 0x6e, 0x65, 0x6c, 0x73, 0x12, 0x20, 0x0a, - 0x0b, 0x44, 0x65, 0x76, 0x69, 0x63, 0x65, 0x4d, 0x6f, 0x64, 0x65, 0x6c, 0x18, 0x15, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x0b, 0x44, 0x65, 0x76, 0x69, 0x63, 0x65, 0x4d, 0x6f, 0x64, 0x65, 0x6c, 0x12, - 0x24, 0x0a, 0x0d, 0x54, 0x79, 0x70, 0x65, 0x4f, 0x66, 0x4e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, - 0x18, 0x16, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x54, 0x79, 0x70, 0x65, 0x4f, 0x66, 0x4e, 0x65, - 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x12, 0x0e, 0x0a, 0x02, 0x49, 0x50, 0x18, 0x17, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x02, 0x49, 0x50, 0x12, 0x16, 0x0a, 0x06, 0x41, 0x42, 0x54, 0x65, 0x73, 0x74, 0x18, - 0x1e, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x41, 0x42, 0x54, 0x65, 0x73, 0x74, 0x12, 0x20, 0x0a, - 0x0b, 0x50, 0x61, 0x63, 0x6b, 0x61, 0x67, 0x65, 0x43, 0x6f, 0x64, 0x65, 0x18, 0x1f, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x0b, 0x50, 0x61, 0x63, 0x6b, 0x61, 0x67, 0x65, 0x43, 0x6f, 0x64, 0x65, 0x12, - 0x16, 0x0a, 0x06, 0x4d, 0x65, 0x6d, 0x6f, 0x72, 0x79, 0x18, 0x20, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x06, 0x4d, 0x65, 0x6d, 0x6f, 0x72, 0x79, 0x12, 0x18, 0x0a, 0x07, 0x56, 0x65, 0x72, 0x73, 0x69, - 0x6f, 0x6e, 0x18, 0x21, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, - 0x6e, 0x22, 0x8c, 0x02, 0x0a, 0x0b, 0x4c, 0x6f, 0x67, 0x69, 0x6e, 0x52, 0x65, 0x73, 0x75, 0x6c, - 0x74, 0x12, 0x2b, 0x0a, 0x06, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x0e, 0x32, 0x13, 0x2e, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x2e, 0x4d, 0x53, 0x47, 0x5f, - 0x52, 0x45, 0x53, 0x55, 0x4c, 0x54, 0x52, 0x06, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x12, 0x12, - 0x0a, 0x04, 0x52, 0x6f, 0x6c, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x04, 0x52, 0x6f, - 0x6c, 0x65, 0x12, 0x1e, 0x0a, 0x0a, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x54, 0x69, 0x6d, 0x65, - 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0a, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x54, 0x69, - 0x6d, 0x65, 0x12, 0x1e, 0x0a, 0x0a, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x5a, 0x6f, 0x6e, 0x65, - 0x18, 0x04, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0a, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x5a, 0x6f, - 0x6e, 0x65, 0x12, 0x28, 0x0a, 0x0f, 0x4c, 0x65, 0x61, 0x67, 0x75, 0x65, 0x48, 0x65, 0x6c, 0x70, - 0x50, 0x6f, 0x69, 0x6e, 0x74, 0x18, 0x06, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0f, 0x4c, 0x65, 0x61, - 0x67, 0x75, 0x65, 0x48, 0x65, 0x6c, 0x70, 0x50, 0x6f, 0x69, 0x6e, 0x74, 0x12, 0x26, 0x0a, 0x0e, - 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x4f, 0x70, 0x65, 0x6e, 0x54, 0x69, 0x6d, 0x65, 0x18, 0x08, - 0x20, 0x01, 0x28, 0x03, 0x52, 0x0e, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x4f, 0x70, 0x65, 0x6e, - 0x54, 0x69, 0x6d, 0x65, 0x12, 0x2a, 0x0a, 0x10, 0x4d, 0x61, 0x69, 0x6e, 0x45, 0x76, 0x65, 0x6e, - 0x74, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x09, 0x20, 0x01, 0x28, 0x05, 0x52, 0x10, - 0x4d, 0x61, 0x69, 0x6e, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, - 0x22, 0x68, 0x0a, 0x0d, 0x4e, 0x6f, 0x74, 0x69, 0x66, 0x79, 0x4b, 0x69, 0x63, 0x6b, 0x4f, 0x75, - 0x74, 0x12, 0x30, 0x0a, 0x06, 0x72, 0x65, 0x61, 0x73, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x0e, 0x32, 0x18, 0x2e, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x2e, 0x4b, 0x49, 0x43, 0x4b, - 0x5f, 0x4f, 0x55, 0x54, 0x5f, 0x52, 0x45, 0x41, 0x53, 0x4f, 0x4e, 0x52, 0x06, 0x72, 0x65, 0x61, - 0x73, 0x6f, 0x6e, 0x12, 0x25, 0x0a, 0x03, 0x62, 0x61, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, - 0x32, 0x13, 0x2e, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x2e, 0x42, 0x41, 0x4e, 0x5f, 0x52, - 0x45, 0x41, 0x53, 0x4f, 0x4e, 0x52, 0x03, 0x62, 0x61, 0x6e, 0x2a, 0x3f, 0x0a, 0x0f, 0x4b, 0x49, - 0x43, 0x4b, 0x5f, 0x4f, 0x55, 0x54, 0x5f, 0x52, 0x45, 0x41, 0x53, 0x4f, 0x4e, 0x12, 0x0b, 0x0a, - 0x07, 0x52, 0x45, 0x50, 0x4c, 0x41, 0x43, 0x45, 0x10, 0x00, 0x12, 0x0c, 0x0a, 0x08, 0x4d, 0x41, - 0x49, 0x4e, 0x54, 0x41, 0x49, 0x4e, 0x10, 0x01, 0x12, 0x06, 0x0a, 0x02, 0x47, 0x4d, 0x10, 0x02, - 0x12, 0x09, 0x0a, 0x05, 0x4f, 0x54, 0x48, 0x45, 0x52, 0x10, 0x03, 0x2a, 0x83, 0x01, 0x0a, 0x0a, - 0x42, 0x41, 0x4e, 0x5f, 0x52, 0x45, 0x41, 0x53, 0x4f, 0x4e, 0x12, 0x0a, 0x0a, 0x06, 0x50, 0x4c, - 0x55, 0x47, 0x49, 0x4e, 0x10, 0x00, 0x12, 0x0f, 0x0a, 0x0b, 0x45, 0x58, 0x50, 0x4c, 0x4f, 0x49, - 0x54, 0x5f, 0x42, 0x55, 0x47, 0x10, 0x01, 0x12, 0x1c, 0x0a, 0x18, 0x49, 0x4c, 0x4c, 0x45, 0x47, - 0x41, 0x4c, 0x5f, 0x52, 0x45, 0x53, 0x4f, 0x55, 0x52, 0x43, 0x45, 0x5f, 0x54, 0x52, 0x41, 0x44, - 0x49, 0x4e, 0x47, 0x10, 0x02, 0x12, 0x10, 0x0a, 0x0c, 0x53, 0x41, 0x4c, 0x45, 0x5f, 0x41, 0x43, - 0x43, 0x4f, 0x55, 0x4e, 0x54, 0x10, 0x03, 0x12, 0x14, 0x0a, 0x10, 0x4d, 0x41, 0x4c, 0x49, 0x43, - 0x49, 0x4f, 0x55, 0x53, 0x5f, 0x52, 0x45, 0x46, 0x55, 0x4e, 0x44, 0x10, 0x04, 0x12, 0x12, 0x0a, - 0x0e, 0x49, 0x52, 0x52, 0x45, 0x47, 0x55, 0x4c, 0x41, 0x52, 0x49, 0x54, 0x49, 0x45, 0x53, 0x10, - 0x05, 0x42, 0x28, 0x5a, 0x26, 0x67, 0x6f, 0x61, 0x74, 0x67, 0x61, 0x6d, 0x65, 0x73, 0x2e, 0x63, - 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x73, 0x2d, 0x61, 0x70, 0x70, 0x2f, 0x69, 0x6e, 0x74, 0x65, 0x72, - 0x6e, 0x61, 0x6c, 0x2f, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x62, 0x06, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x33, -} - -var ( - file_common_proto_rawDescOnce sync.Once - file_common_proto_rawDescData = file_common_proto_rawDesc -) - -func file_common_proto_rawDescGZIP() []byte { - file_common_proto_rawDescOnce.Do(func() { - file_common_proto_rawDescData = protoimpl.X.CompressGZIP(file_common_proto_rawDescData) - }) - return file_common_proto_rawDescData -} - -var file_common_proto_enumTypes = make([]protoimpl.EnumInfo, 2) -var file_common_proto_msgTypes = make([]protoimpl.MessageInfo, 6) -var file_common_proto_goTypes = []interface{}{ - (KICK_OUT_REASON)(0), // 0: message.KICK_OUT_REASON - (BAN_REASON)(0), // 1: message.BAN_REASON - (*MessageResult)(nil), // 2: message.MessageResult - (*Ping)(nil), // 3: message.Ping - (*Pong)(nil), // 4: message.Pong - (*Login)(nil), // 5: message.Login - (*LoginResult)(nil), // 6: message.LoginResult - (*NotifyKickOut)(nil), // 7: message.NotifyKickOut - (MSG_RESULT)(0), // 8: message.MSG_RESULT -} -var file_common_proto_depIdxs = []int32{ - 8, // 0: message.MessageResult.Result:type_name -> message.MSG_RESULT - 8, // 1: message.LoginResult.Result:type_name -> message.MSG_RESULT - 0, // 2: message.NotifyKickOut.reason:type_name -> message.KICK_OUT_REASON - 1, // 3: message.NotifyKickOut.ban:type_name -> message.BAN_REASON - 4, // [4:4] is the sub-list for method output_type - 4, // [4:4] is the sub-list for method input_type - 4, // [4:4] is the sub-list for extension type_name - 4, // [4:4] is the sub-list for extension extendee - 0, // [0:4] is the sub-list for field type_name -} - -func init() { file_common_proto_init() } -func file_common_proto_init() { - if File_common_proto != nil { - return - } - file_msgtype_proto_init() - if !protoimpl.UnsafeEnabled { - file_common_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*MessageResult); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_common_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Ping); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_common_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Pong); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_common_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Login); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_common_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*LoginResult); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_common_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*NotifyKickOut); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - } - type x struct{} - out := protoimpl.TypeBuilder{ - File: protoimpl.DescBuilder{ - GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_common_proto_rawDesc, - NumEnums: 2, - NumMessages: 6, - NumExtensions: 0, - NumServices: 0, - }, - GoTypes: file_common_proto_goTypes, - DependencyIndexes: file_common_proto_depIdxs, - EnumInfos: file_common_proto_enumTypes, - MessageInfos: file_common_proto_msgTypes, - }.Build() - File_common_proto = out.File - file_common_proto_rawDesc = nil - file_common_proto_goTypes = nil - file_common_proto_depIdxs = nil -} diff --git a/src/app/internal/message/gamemap.pb.go b/src/app/internal/message/gamemap.pb.go deleted file mode 100644 index e656917..0000000 --- a/src/app/internal/message/gamemap.pb.go +++ /dev/null @@ -1,2107 +0,0 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.26.0 -// protoc v3.17.3 -// source: gamemap.proto - -package message - -import ( - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" - reflect "reflect" - sync "sync" -) - -import proto "google.golang.org/protobuf/proto" - -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 MAP_ENTITY_STATE int32 - -const ( - MAP_ENTITY_STATE_IDLE MAP_ENTITY_STATE = 0 //待机 - MAP_ENTITY_STATE_MOVE MAP_ENTITY_STATE = 1 //移动 - MAP_ENTITY_STATE_MOVE_TO MAP_ENTITY_STATE = 2 //移动到目标/追击 - MAP_ENTITY_STATE_BATTLE MAP_ENTITY_STATE = 3 //战斗 -) - -// Enum value maps for MAP_ENTITY_STATE. -var ( - MAP_ENTITY_STATE_name = map[int32]string{ - 0: "IDLE", - 1: "MOVE", - 2: "MOVE_TO", - 3: "BATTLE", - } - MAP_ENTITY_STATE_value = map[string]int32{ - "IDLE": 0, - "MOVE": 1, - "MOVE_TO": 2, - "BATTLE": 3, - } -) - -func (x MAP_ENTITY_STATE) Enum() *MAP_ENTITY_STATE { - p := new(MAP_ENTITY_STATE) - *p = x - return p -} - -func (x MAP_ENTITY_STATE) String() string { - return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) -} - -func (MAP_ENTITY_STATE) Descriptor() protoreflect.EnumDescriptor { - return file_gamemap_proto_enumTypes[0].Descriptor() -} - -func (MAP_ENTITY_STATE) Type() protoreflect.EnumType { - return &file_gamemap_proto_enumTypes[0] -} - -func (x MAP_ENTITY_STATE) Number() protoreflect.EnumNumber { - return protoreflect.EnumNumber(x) -} - -// Deprecated: Use MAP_ENTITY_STATE.Descriptor instead. -func (MAP_ENTITY_STATE) EnumDescriptor() ([]byte, []int) { - return file_gamemap_proto_rawDescGZIP(), []int{0} -} - -type MAP_ENTITY_KIND int32 - -const ( - MAP_ENTITY_KIND_TEST MAP_ENTITY_KIND = 0 //测试战斗实体 - MAP_ENTITY_KIND_CITY MAP_ENTITY_KIND = 1 //玩家主城 - MAP_ENTITY_KIND_MONSTER MAP_ENTITY_KIND = 2 //怪物 - MAP_ENTITY_KIND_RES MAP_ENTITY_KIND = 3 //资源点 -) - -// Enum value maps for MAP_ENTITY_KIND. -var ( - MAP_ENTITY_KIND_name = map[int32]string{ - 0: "TEST", - 1: "CITY", - 2: "MONSTER", - 3: "RES", - } - MAP_ENTITY_KIND_value = map[string]int32{ - "TEST": 0, - "CITY": 1, - "MONSTER": 2, - "RES": 3, - } -) - -func (x MAP_ENTITY_KIND) Enum() *MAP_ENTITY_KIND { - p := new(MAP_ENTITY_KIND) - *p = x - return p -} - -func (x MAP_ENTITY_KIND) String() string { - return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) -} - -func (MAP_ENTITY_KIND) Descriptor() protoreflect.EnumDescriptor { - return file_gamemap_proto_enumTypes[1].Descriptor() -} - -func (MAP_ENTITY_KIND) Type() protoreflect.EnumType { - return &file_gamemap_proto_enumTypes[1] -} - -func (x MAP_ENTITY_KIND) Number() protoreflect.EnumNumber { - return protoreflect.EnumNumber(x) -} - -// Deprecated: Use MAP_ENTITY_KIND.Descriptor instead. -func (MAP_ENTITY_KIND) EnumDescriptor() ([]byte, []int) { - return file_gamemap_proto_rawDescGZIP(), []int{1} -} - -type MAP_BATTLE_INFO int32 - -const ( - MAP_BATTLE_INFO_DAMAGE_ATTACK MAP_BATTLE_INFO = 0 //普攻伤害 - MAP_BATTLE_INFO_DAMAGE_SKILL MAP_BATTLE_INFO = 1 //技能伤害 - MAP_BATTLE_INFO_HEAL_SKILL MAP_BATTLE_INFO = 2 //技能治疗 -) - -// Enum value maps for MAP_BATTLE_INFO. -var ( - MAP_BATTLE_INFO_name = map[int32]string{ - 0: "DAMAGE_ATTACK", - 1: "DAMAGE_SKILL", - 2: "HEAL_SKILL", - } - MAP_BATTLE_INFO_value = map[string]int32{ - "DAMAGE_ATTACK": 0, - "DAMAGE_SKILL": 1, - "HEAL_SKILL": 2, - } -) - -func (x MAP_BATTLE_INFO) Enum() *MAP_BATTLE_INFO { - p := new(MAP_BATTLE_INFO) - *p = x - return p -} - -func (x MAP_BATTLE_INFO) String() string { - return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) -} - -func (MAP_BATTLE_INFO) Descriptor() protoreflect.EnumDescriptor { - return file_gamemap_proto_enumTypes[2].Descriptor() -} - -func (MAP_BATTLE_INFO) Type() protoreflect.EnumType { - return &file_gamemap_proto_enumTypes[2] -} - -func (x MAP_BATTLE_INFO) Number() protoreflect.EnumNumber { - return protoreflect.EnumNumber(x) -} - -// Deprecated: Use MAP_BATTLE_INFO.Descriptor instead. -func (MAP_BATTLE_INFO) EnumDescriptor() ([]byte, []int) { - return file_gamemap_proto_rawDescGZIP(), []int{2} -} - -type Vector struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - X float64 `protobuf:"fixed64,1,opt,name=X,proto3" json:"X"` - Y float64 `protobuf:"fixed64,2,opt,name=Y,proto3" json:"Y"` -} - -func (x *Vector) Reset() { - *x = Vector{} - if protoimpl.UnsafeEnabled { - mi := &file_gamemap_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *Vector) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (x *Vector) FromDB(data []byte) error { - return proto.Unmarshal(data, x) -} - -func (x *Vector) ToDB() ([]byte, error) { - return proto.Marshal(x) -} - -func (*Vector) ProtoMessage() {} - -func (x *Vector) ProtoReflect() protoreflect.Message { - mi := &file_gamemap_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 Vector.ProtoReflect.Descriptor instead. -func (*Vector) Descriptor() ([]byte, []int) { - return file_gamemap_proto_rawDescGZIP(), []int{0} -} - -func (x *Vector) GetX() float64 { - if x != nil { - return x.X - } - return 0 -} - -func (x *Vector) GetY() float64 { - if x != nil { - return x.Y - } - return 0 -} - -func (x *Vector) SetX(val float64) { - if x != nil { - x.X = val - } -} -func (x *Vector) SetY(val float64) { - if x != nil { - x.Y = val - } -} - -//测试创建实体 -type TestCreateMapEntity struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Pos *Vector `protobuf:"bytes,1,opt,name=Pos,proto3" json:"Pos"` -} - -func (x *TestCreateMapEntity) Reset() { - *x = TestCreateMapEntity{} - if protoimpl.UnsafeEnabled { - mi := &file_gamemap_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *TestCreateMapEntity) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (x *TestCreateMapEntity) FromDB(data []byte) error { - return proto.Unmarshal(data, x) -} - -func (x *TestCreateMapEntity) ToDB() ([]byte, error) { - return proto.Marshal(x) -} - -func (*TestCreateMapEntity) ProtoMessage() {} - -func (x *TestCreateMapEntity) ProtoReflect() protoreflect.Message { - mi := &file_gamemap_proto_msgTypes[1] - 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 TestCreateMapEntity.ProtoReflect.Descriptor instead. -func (*TestCreateMapEntity) Descriptor() ([]byte, []int) { - return file_gamemap_proto_rawDescGZIP(), []int{1} -} - -func (x *TestCreateMapEntity) GetPos() *Vector { - if x != nil { - return x.Pos - } - return nil -} - -func (x *TestCreateMapEntity) SetPos(val *Vector) { - if x != nil { - x.Pos = val - } -} - -//实体移动到位置 -type MapEntityMove struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - EID int64 `protobuf:"varint,1,opt,name=EID,proto3" json:"EID"` - Pos *Vector `protobuf:"bytes,2,opt,name=Pos,proto3" json:"Pos"` -} - -func (x *MapEntityMove) Reset() { - *x = MapEntityMove{} - if protoimpl.UnsafeEnabled { - mi := &file_gamemap_proto_msgTypes[2] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *MapEntityMove) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (x *MapEntityMove) FromDB(data []byte) error { - return proto.Unmarshal(data, x) -} - -func (x *MapEntityMove) ToDB() ([]byte, error) { - return proto.Marshal(x) -} - -func (*MapEntityMove) ProtoMessage() {} - -func (x *MapEntityMove) ProtoReflect() protoreflect.Message { - mi := &file_gamemap_proto_msgTypes[2] - 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 MapEntityMove.ProtoReflect.Descriptor instead. -func (*MapEntityMove) Descriptor() ([]byte, []int) { - return file_gamemap_proto_rawDescGZIP(), []int{2} -} - -func (x *MapEntityMove) GetEID() int64 { - if x != nil { - return x.EID - } - return 0 -} - -func (x *MapEntityMove) GetPos() *Vector { - if x != nil { - return x.Pos - } - return nil -} - -func (x *MapEntityMove) SetEID(val int64) { - if x != nil { - x.EID = val - } -} -func (x *MapEntityMove) SetPos(val *Vector) { - if x != nil { - x.Pos = val - } -} - -//实体追击 -type MapEntityMoveTo struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - EID int64 `protobuf:"varint,1,opt,name=EID,proto3" json:"EID"` - TargetEID int64 `protobuf:"varint,2,opt,name=TargetEID,proto3" json:"TargetEID"` -} - -func (x *MapEntityMoveTo) Reset() { - *x = MapEntityMoveTo{} - if protoimpl.UnsafeEnabled { - mi := &file_gamemap_proto_msgTypes[3] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *MapEntityMoveTo) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (x *MapEntityMoveTo) FromDB(data []byte) error { - return proto.Unmarshal(data, x) -} - -func (x *MapEntityMoveTo) ToDB() ([]byte, error) { - return proto.Marshal(x) -} - -func (*MapEntityMoveTo) ProtoMessage() {} - -func (x *MapEntityMoveTo) ProtoReflect() protoreflect.Message { - mi := &file_gamemap_proto_msgTypes[3] - 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 MapEntityMoveTo.ProtoReflect.Descriptor instead. -func (*MapEntityMoveTo) Descriptor() ([]byte, []int) { - return file_gamemap_proto_rawDescGZIP(), []int{3} -} - -func (x *MapEntityMoveTo) GetEID() int64 { - if x != nil { - return x.EID - } - return 0 -} - -func (x *MapEntityMoveTo) GetTargetEID() int64 { - if x != nil { - return x.TargetEID - } - return 0 -} - -func (x *MapEntityMoveTo) SetEID(val int64) { - if x != nil { - x.EID = val - } -} -func (x *MapEntityMoveTo) SetTargetEID(val int64) { - if x != nil { - x.TargetEID = val - } -} - -//实体驻扎/停止 -type MapEntityStop struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - EID int64 `protobuf:"varint,1,opt,name=EID,proto3" json:"EID"` -} - -func (x *MapEntityStop) Reset() { - *x = MapEntityStop{} - if protoimpl.UnsafeEnabled { - mi := &file_gamemap_proto_msgTypes[4] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *MapEntityStop) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (x *MapEntityStop) FromDB(data []byte) error { - return proto.Unmarshal(data, x) -} - -func (x *MapEntityStop) ToDB() ([]byte, error) { - return proto.Marshal(x) -} - -func (*MapEntityStop) ProtoMessage() {} - -func (x *MapEntityStop) ProtoReflect() protoreflect.Message { - mi := &file_gamemap_proto_msgTypes[4] - 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 MapEntityStop.ProtoReflect.Descriptor instead. -func (*MapEntityStop) Descriptor() ([]byte, []int) { - return file_gamemap_proto_rawDescGZIP(), []int{4} -} - -func (x *MapEntityStop) GetEID() int64 { - if x != nil { - return x.EID - } - return 0 -} - -func (x *MapEntityStop) SetEID(val int64) { - if x != nil { - x.EID = val - } -} - -//实体回城 -type MapEntityReturn struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - EID int64 `protobuf:"varint,1,opt,name=EID,proto3" json:"EID"` -} - -func (x *MapEntityReturn) Reset() { - *x = MapEntityReturn{} - if protoimpl.UnsafeEnabled { - mi := &file_gamemap_proto_msgTypes[5] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *MapEntityReturn) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (x *MapEntityReturn) FromDB(data []byte) error { - return proto.Unmarshal(data, x) -} - -func (x *MapEntityReturn) ToDB() ([]byte, error) { - return proto.Marshal(x) -} - -func (*MapEntityReturn) ProtoMessage() {} - -func (x *MapEntityReturn) ProtoReflect() protoreflect.Message { - mi := &file_gamemap_proto_msgTypes[5] - 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 MapEntityReturn.ProtoReflect.Descriptor instead. -func (*MapEntityReturn) Descriptor() ([]byte, []int) { - return file_gamemap_proto_rawDescGZIP(), []int{5} -} - -func (x *MapEntityReturn) GetEID() int64 { - if x != nil { - return x.EID - } - return 0 -} - -func (x *MapEntityReturn) SetEID(val int64) { - if x != nil { - x.EID = val - } -} - -//实体通知 -type NotifyMapEntityList struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - MapEntityList []*MapEntity `protobuf:"bytes,1,rep,name=MapEntityList,proto3" json:"MapEntityList"` //更新的实体列表 - MapEntityDelList []int64 `protobuf:"varint,2,rep,packed,name=MapEntityDelList,proto3" json:"MapEntityDelList"` //删除的实体列表 - MapEntityCrossList []*MapEntityCross `protobuf:"bytes,3,rep,name=MapEntityCrossList,proto3" json:"MapEntityCrossList"` //跨越地块的实体列表 -} - -func (x *NotifyMapEntityList) Reset() { - *x = NotifyMapEntityList{} - if protoimpl.UnsafeEnabled { - mi := &file_gamemap_proto_msgTypes[6] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *NotifyMapEntityList) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (x *NotifyMapEntityList) FromDB(data []byte) error { - return proto.Unmarshal(data, x) -} - -func (x *NotifyMapEntityList) ToDB() ([]byte, error) { - return proto.Marshal(x) -} - -func (*NotifyMapEntityList) ProtoMessage() {} - -func (x *NotifyMapEntityList) ProtoReflect() protoreflect.Message { - mi := &file_gamemap_proto_msgTypes[6] - 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 NotifyMapEntityList.ProtoReflect.Descriptor instead. -func (*NotifyMapEntityList) Descriptor() ([]byte, []int) { - return file_gamemap_proto_rawDescGZIP(), []int{6} -} - -func (x *NotifyMapEntityList) GetMapEntityList() []*MapEntity { - if x != nil { - return x.MapEntityList - } - return nil -} - -func (x *NotifyMapEntityList) GetMapEntityDelList() []int64 { - if x != nil { - return x.MapEntityDelList - } - return nil -} - -func (x *NotifyMapEntityList) GetMapEntityCrossList() []*MapEntityCross { - if x != nil { - return x.MapEntityCrossList - } - return nil -} - -func (x *NotifyMapEntityList) SetMapEntityList(val []*MapEntity) { - if x != nil { - x.MapEntityList = val - } -} -func (x *NotifyMapEntityList) SetMapEntityDelList(val []int64) { - if x != nil { - x.MapEntityDelList = val - } -} -func (x *NotifyMapEntityList) SetMapEntityCrossList(val []*MapEntityCross) { - if x != nil { - x.MapEntityCrossList = val - } -} - -type MapEntityCross struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - EID int64 `protobuf:"varint,1,opt,name=EID,proto3" json:"EID"` //eid - GridId int32 `protobuf:"varint,2,opt,name=GridId,proto3" json:"GridId"` //目标格子id -} - -func (x *MapEntityCross) Reset() { - *x = MapEntityCross{} - if protoimpl.UnsafeEnabled { - mi := &file_gamemap_proto_msgTypes[7] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *MapEntityCross) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (x *MapEntityCross) FromDB(data []byte) error { - return proto.Unmarshal(data, x) -} - -func (x *MapEntityCross) ToDB() ([]byte, error) { - return proto.Marshal(x) -} - -func (*MapEntityCross) ProtoMessage() {} - -func (x *MapEntityCross) ProtoReflect() protoreflect.Message { - mi := &file_gamemap_proto_msgTypes[7] - 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 MapEntityCross.ProtoReflect.Descriptor instead. -func (*MapEntityCross) Descriptor() ([]byte, []int) { - return file_gamemap_proto_rawDescGZIP(), []int{7} -} - -func (x *MapEntityCross) GetEID() int64 { - if x != nil { - return x.EID - } - return 0 -} - -func (x *MapEntityCross) GetGridId() int32 { - if x != nil { - return x.GridId - } - return 0 -} - -func (x *MapEntityCross) SetEID(val int64) { - if x != nil { - x.EID = val - } -} -func (x *MapEntityCross) SetGridId(val int32) { - if x != nil { - x.GridId = val - } -} - -type MapEntity struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - EID int64 `protobuf:"varint,1,opt,name=EID,proto3" json:"EID"` - RID int64 `protobuf:"varint,2,opt,name=RID,proto3" json:"RID"` - Pos *Vector `protobuf:"bytes,3,opt,name=Pos,proto3" json:"Pos"` - GridId int32 `protobuf:"varint,4,opt,name=GridId,proto3" json:"GridId"` - State MAP_ENTITY_STATE `protobuf:"varint,5,opt,name=State,proto3,enum=message.MAP_ENTITY_STATE" json:"State"` - Kind MAP_ENTITY_KIND `protobuf:"varint,6,opt,name=Kind,proto3,enum=message.MAP_ENTITY_KIND" json:"Kind"` - Move *MapEntityCompMove `protobuf:"bytes,7,opt,name=Move,proto3" json:"Move"` -} - -func (x *MapEntity) Reset() { - *x = MapEntity{} - if protoimpl.UnsafeEnabled { - mi := &file_gamemap_proto_msgTypes[8] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *MapEntity) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (x *MapEntity) FromDB(data []byte) error { - return proto.Unmarshal(data, x) -} - -func (x *MapEntity) ToDB() ([]byte, error) { - return proto.Marshal(x) -} - -func (*MapEntity) ProtoMessage() {} - -func (x *MapEntity) ProtoReflect() protoreflect.Message { - mi := &file_gamemap_proto_msgTypes[8] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use MapEntity.ProtoReflect.Descriptor instead. -func (*MapEntity) Descriptor() ([]byte, []int) { - return file_gamemap_proto_rawDescGZIP(), []int{8} -} - -func (x *MapEntity) GetEID() int64 { - if x != nil { - return x.EID - } - return 0 -} - -func (x *MapEntity) GetRID() int64 { - if x != nil { - return x.RID - } - return 0 -} - -func (x *MapEntity) GetPos() *Vector { - if x != nil { - return x.Pos - } - return nil -} - -func (x *MapEntity) GetGridId() int32 { - if x != nil { - return x.GridId - } - return 0 -} - -func (x *MapEntity) GetState() MAP_ENTITY_STATE { - if x != nil { - return x.State - } - return MAP_ENTITY_STATE_IDLE -} - -func (x *MapEntity) GetKind() MAP_ENTITY_KIND { - if x != nil { - return x.Kind - } - return MAP_ENTITY_KIND_TEST -} - -func (x *MapEntity) GetMove() *MapEntityCompMove { - if x != nil { - return x.Move - } - return nil -} - -func (x *MapEntity) SetEID(val int64) { - if x != nil { - x.EID = val - } -} -func (x *MapEntity) SetRID(val int64) { - if x != nil { - x.RID = val - } -} -func (x *MapEntity) SetPos(val *Vector) { - if x != nil { - x.Pos = val - } -} -func (x *MapEntity) SetGridId(val int32) { - if x != nil { - x.GridId = val - } -} -func (x *MapEntity) SetState(val MAP_ENTITY_STATE) { - if x != nil { - x.State = val - } -} -func (x *MapEntity) SetKind(val MAP_ENTITY_KIND) { - if x != nil { - x.Kind = val - } -} -func (x *MapEntity) SetMove(val *MapEntityCompMove) { - if x != nil { - x.Move = val - } -} - -type MapEntityCompMove struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - MoveAble bool `protobuf:"varint,1,opt,name=MoveAble,proto3" json:"MoveAble"` //是否可以移动 - TargetEID int64 `protobuf:"varint,2,opt,name=TargetEID,proto3" json:"TargetEID"` //目标eid - TargetPos *Vector `protobuf:"bytes,3,opt,name=TargetPos,proto3" json:"TargetPos"` //目标位置 - Velocity *Vector `protobuf:"bytes,4,opt,name=Velocity,proto3" json:"Velocity"` //速度 向量 - Speed float64 `protobuf:"fixed64,5,opt,name=Speed,proto3" json:"Speed"` //速度 格/秒 -} - -func (x *MapEntityCompMove) Reset() { - *x = MapEntityCompMove{} - if protoimpl.UnsafeEnabled { - mi := &file_gamemap_proto_msgTypes[9] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *MapEntityCompMove) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (x *MapEntityCompMove) FromDB(data []byte) error { - return proto.Unmarshal(data, x) -} - -func (x *MapEntityCompMove) ToDB() ([]byte, error) { - return proto.Marshal(x) -} - -func (*MapEntityCompMove) ProtoMessage() {} - -func (x *MapEntityCompMove) ProtoReflect() protoreflect.Message { - mi := &file_gamemap_proto_msgTypes[9] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use MapEntityCompMove.ProtoReflect.Descriptor instead. -func (*MapEntityCompMove) Descriptor() ([]byte, []int) { - return file_gamemap_proto_rawDescGZIP(), []int{9} -} - -func (x *MapEntityCompMove) GetMoveAble() bool { - if x != nil { - return x.MoveAble - } - return false -} - -func (x *MapEntityCompMove) GetTargetEID() int64 { - if x != nil { - return x.TargetEID - } - return 0 -} - -func (x *MapEntityCompMove) GetTargetPos() *Vector { - if x != nil { - return x.TargetPos - } - return nil -} - -func (x *MapEntityCompMove) GetVelocity() *Vector { - if x != nil { - return x.Velocity - } - return nil -} - -func (x *MapEntityCompMove) GetSpeed() float64 { - if x != nil { - return x.Speed - } - return 0 -} - -func (x *MapEntityCompMove) SetMoveAble(val bool) { - if x != nil { - x.MoveAble = val - } -} -func (x *MapEntityCompMove) SetTargetEID(val int64) { - if x != nil { - x.TargetEID = val - } -} -func (x *MapEntityCompMove) SetTargetPos(val *Vector) { - if x != nil { - x.TargetPos = val - } -} -func (x *MapEntityCompMove) SetVelocity(val *Vector) { - if x != nil { - x.Velocity = val - } -} -func (x *MapEntityCompMove) SetSpeed(val float64) { - if x != nil { - x.Speed = val - } -} - -//战斗信息通知 -type NotifyMapBattleInfo struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - MapBattleInfoList []*MapBattleInfo `protobuf:"bytes,1,rep,name=MapBattleInfoList,proto3" json:"MapBattleInfoList"` //战斗信息列表 -} - -func (x *NotifyMapBattleInfo) Reset() { - *x = NotifyMapBattleInfo{} - if protoimpl.UnsafeEnabled { - mi := &file_gamemap_proto_msgTypes[10] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *NotifyMapBattleInfo) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (x *NotifyMapBattleInfo) FromDB(data []byte) error { - return proto.Unmarshal(data, x) -} - -func (x *NotifyMapBattleInfo) ToDB() ([]byte, error) { - return proto.Marshal(x) -} - -func (*NotifyMapBattleInfo) ProtoMessage() {} - -func (x *NotifyMapBattleInfo) ProtoReflect() protoreflect.Message { - mi := &file_gamemap_proto_msgTypes[10] - 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 NotifyMapBattleInfo.ProtoReflect.Descriptor instead. -func (*NotifyMapBattleInfo) Descriptor() ([]byte, []int) { - return file_gamemap_proto_rawDescGZIP(), []int{10} -} - -func (x *NotifyMapBattleInfo) GetMapBattleInfoList() []*MapBattleInfo { - if x != nil { - return x.MapBattleInfoList - } - return nil -} - -func (x *NotifyMapBattleInfo) SetMapBattleInfoList(val []*MapBattleInfo) { - if x != nil { - x.MapBattleInfoList = val - } -} - -//战斗信息 -type MapBattleInfo struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - EID int64 `protobuf:"varint,1,opt,name=EID,proto3" json:"EID"` //源EID - TargetEID int64 `protobuf:"varint,2,opt,name=TargetEID,proto3" json:"TargetEID"` //目标EID - Type MAP_BATTLE_INFO `protobuf:"varint,3,opt,name=Type,proto3,enum=message.MAP_BATTLE_INFO" json:"Type"` //信息类型 - Value int64 `protobuf:"varint,4,opt,name=Value,proto3" json:"Value"` //值 -} - -func (x *MapBattleInfo) Reset() { - *x = MapBattleInfo{} - if protoimpl.UnsafeEnabled { - mi := &file_gamemap_proto_msgTypes[11] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *MapBattleInfo) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (x *MapBattleInfo) FromDB(data []byte) error { - return proto.Unmarshal(data, x) -} - -func (x *MapBattleInfo) ToDB() ([]byte, error) { - return proto.Marshal(x) -} - -func (*MapBattleInfo) ProtoMessage() {} - -func (x *MapBattleInfo) ProtoReflect() protoreflect.Message { - mi := &file_gamemap_proto_msgTypes[11] - 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 MapBattleInfo.ProtoReflect.Descriptor instead. -func (*MapBattleInfo) Descriptor() ([]byte, []int) { - return file_gamemap_proto_rawDescGZIP(), []int{11} -} - -func (x *MapBattleInfo) GetEID() int64 { - if x != nil { - return x.EID - } - return 0 -} - -func (x *MapBattleInfo) GetTargetEID() int64 { - if x != nil { - return x.TargetEID - } - return 0 -} - -func (x *MapBattleInfo) GetType() MAP_BATTLE_INFO { - if x != nil { - return x.Type - } - return MAP_BATTLE_INFO_DAMAGE_ATTACK -} - -func (x *MapBattleInfo) GetValue() int64 { - if x != nil { - return x.Value - } - return 0 -} - -func (x *MapBattleInfo) SetEID(val int64) { - if x != nil { - x.EID = val - } -} -func (x *MapBattleInfo) SetTargetEID(val int64) { - if x != nil { - x.TargetEID = val - } -} -func (x *MapBattleInfo) SetType(val MAP_BATTLE_INFO) { - if x != nil { - x.Type = val - } -} -func (x *MapBattleInfo) SetValue(val int64) { - if x != nil { - x.Value = val - } -} - -//移动信息通知 -type NotifyMapMoveInfo struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - MapMoveInfoList []*MapMoveInfo `protobuf:"bytes,1,rep,name=MapMoveInfoList,proto3" json:"MapMoveInfoList"` //移动信息列表 -} - -func (x *NotifyMapMoveInfo) Reset() { - *x = NotifyMapMoveInfo{} - if protoimpl.UnsafeEnabled { - mi := &file_gamemap_proto_msgTypes[12] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *NotifyMapMoveInfo) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (x *NotifyMapMoveInfo) FromDB(data []byte) error { - return proto.Unmarshal(data, x) -} - -func (x *NotifyMapMoveInfo) ToDB() ([]byte, error) { - return proto.Marshal(x) -} - -func (*NotifyMapMoveInfo) ProtoMessage() {} - -func (x *NotifyMapMoveInfo) ProtoReflect() protoreflect.Message { - mi := &file_gamemap_proto_msgTypes[12] - 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 NotifyMapMoveInfo.ProtoReflect.Descriptor instead. -func (*NotifyMapMoveInfo) Descriptor() ([]byte, []int) { - return file_gamemap_proto_rawDescGZIP(), []int{12} -} - -func (x *NotifyMapMoveInfo) GetMapMoveInfoList() []*MapMoveInfo { - if x != nil { - return x.MapMoveInfoList - } - return nil -} - -func (x *NotifyMapMoveInfo) SetMapMoveInfoList(val []*MapMoveInfo) { - if x != nil { - x.MapMoveInfoList = val - } -} - -//移动信息 -type MapMoveInfo struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - EID int64 `protobuf:"varint,1,opt,name=EID,proto3" json:"EID"` //EID - Pos *Vector `protobuf:"bytes,2,opt,name=Pos,proto3" json:"Pos"` //位置 - Velocity *Vector `protobuf:"bytes,3,opt,name=Velocity,proto3" json:"Velocity"` //速度 向量 -} - -func (x *MapMoveInfo) Reset() { - *x = MapMoveInfo{} - if protoimpl.UnsafeEnabled { - mi := &file_gamemap_proto_msgTypes[13] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *MapMoveInfo) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (x *MapMoveInfo) FromDB(data []byte) error { - return proto.Unmarshal(data, x) -} - -func (x *MapMoveInfo) ToDB() ([]byte, error) { - return proto.Marshal(x) -} - -func (*MapMoveInfo) ProtoMessage() {} - -func (x *MapMoveInfo) ProtoReflect() protoreflect.Message { - mi := &file_gamemap_proto_msgTypes[13] - 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 MapMoveInfo.ProtoReflect.Descriptor instead. -func (*MapMoveInfo) Descriptor() ([]byte, []int) { - return file_gamemap_proto_rawDescGZIP(), []int{13} -} - -func (x *MapMoveInfo) GetEID() int64 { - if x != nil { - return x.EID - } - return 0 -} - -func (x *MapMoveInfo) GetPos() *Vector { - if x != nil { - return x.Pos - } - return nil -} - -func (x *MapMoveInfo) GetVelocity() *Vector { - if x != nil { - return x.Velocity - } - return nil -} - -func (x *MapMoveInfo) SetEID(val int64) { - if x != nil { - x.EID = val - } -} -func (x *MapMoveInfo) SetPos(val *Vector) { - if x != nil { - x.Pos = val - } -} -func (x *MapMoveInfo) SetVelocity(val *Vector) { - if x != nil { - x.Velocity = val - } -} - -//血量信息通知 -type NotifyMapHpInfo struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - MapHpInfoList []*MapHpInfo `protobuf:"bytes,1,rep,name=MapHpInfoList,proto3" json:"MapHpInfoList"` //血量信息列表 -} - -func (x *NotifyMapHpInfo) Reset() { - *x = NotifyMapHpInfo{} - if protoimpl.UnsafeEnabled { - mi := &file_gamemap_proto_msgTypes[14] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *NotifyMapHpInfo) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (x *NotifyMapHpInfo) FromDB(data []byte) error { - return proto.Unmarshal(data, x) -} - -func (x *NotifyMapHpInfo) ToDB() ([]byte, error) { - return proto.Marshal(x) -} - -func (*NotifyMapHpInfo) ProtoMessage() {} - -func (x *NotifyMapHpInfo) ProtoReflect() protoreflect.Message { - mi := &file_gamemap_proto_msgTypes[14] - 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 NotifyMapHpInfo.ProtoReflect.Descriptor instead. -func (*NotifyMapHpInfo) Descriptor() ([]byte, []int) { - return file_gamemap_proto_rawDescGZIP(), []int{14} -} - -func (x *NotifyMapHpInfo) GetMapHpInfoList() []*MapHpInfo { - if x != nil { - return x.MapHpInfoList - } - return nil -} - -func (x *NotifyMapHpInfo) SetMapHpInfoList(val []*MapHpInfo) { - if x != nil { - x.MapHpInfoList = val - } -} - -//血量信息 -type MapHpInfo struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - EID int64 `protobuf:"varint,1,opt,name=EID,proto3" json:"EID"` //EID - Hp float64 `protobuf:"fixed64,2,opt,name=Hp,proto3" json:"Hp"` //血量 -} - -func (x *MapHpInfo) Reset() { - *x = MapHpInfo{} - if protoimpl.UnsafeEnabled { - mi := &file_gamemap_proto_msgTypes[15] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *MapHpInfo) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (x *MapHpInfo) FromDB(data []byte) error { - return proto.Unmarshal(data, x) -} - -func (x *MapHpInfo) ToDB() ([]byte, error) { - return proto.Marshal(x) -} - -func (*MapHpInfo) ProtoMessage() {} - -func (x *MapHpInfo) ProtoReflect() protoreflect.Message { - mi := &file_gamemap_proto_msgTypes[15] - 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 MapHpInfo.ProtoReflect.Descriptor instead. -func (*MapHpInfo) Descriptor() ([]byte, []int) { - return file_gamemap_proto_rawDescGZIP(), []int{15} -} - -func (x *MapHpInfo) GetEID() int64 { - if x != nil { - return x.EID - } - return 0 -} - -func (x *MapHpInfo) GetHp() float64 { - if x != nil { - return x.Hp - } - return 0 -} - -func (x *MapHpInfo) SetEID(val int64) { - if x != nil { - x.EID = val - } -} -func (x *MapHpInfo) SetHp(val float64) { - if x != nil { - x.Hp = val - } -} - -//切换大地图观测点 -type MapLookAt struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - PosX int32 `protobuf:"varint,1,opt,name=PosX,proto3" json:"PosX"` //观测中心位置x - PosY int32 `protobuf:"varint,2,opt,name=PosY,proto3" json:"PosY"` //观测中心位置y - Width int32 `protobuf:"varint,3,opt,name=Width,proto3" json:"Width"` //宽度 - Height int32 `protobuf:"varint,4,opt,name=Height,proto3" json:"Height"` //高度 -} - -func (x *MapLookAt) Reset() { - *x = MapLookAt{} - if protoimpl.UnsafeEnabled { - mi := &file_gamemap_proto_msgTypes[16] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *MapLookAt) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (x *MapLookAt) FromDB(data []byte) error { - return proto.Unmarshal(data, x) -} - -func (x *MapLookAt) ToDB() ([]byte, error) { - return proto.Marshal(x) -} - -func (*MapLookAt) ProtoMessage() {} - -func (x *MapLookAt) ProtoReflect() protoreflect.Message { - mi := &file_gamemap_proto_msgTypes[16] - 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 MapLookAt.ProtoReflect.Descriptor instead. -func (*MapLookAt) Descriptor() ([]byte, []int) { - return file_gamemap_proto_rawDescGZIP(), []int{16} -} - -func (x *MapLookAt) GetPosX() int32 { - if x != nil { - return x.PosX - } - return 0 -} - -func (x *MapLookAt) GetPosY() int32 { - if x != nil { - return x.PosY - } - return 0 -} - -func (x *MapLookAt) GetWidth() int32 { - if x != nil { - return x.Width - } - return 0 -} - -func (x *MapLookAt) GetHeight() int32 { - if x != nil { - return x.Height - } - return 0 -} - -func (x *MapLookAt) SetPosX(val int32) { - if x != nil { - x.PosX = val - } -} -func (x *MapLookAt) SetPosY(val int32) { - if x != nil { - x.PosY = val - } -} -func (x *MapLookAt) SetWidth(val int32) { - if x != nil { - x.Width = val - } -} -func (x *MapLookAt) SetHeight(val int32) { - if x != nil { - x.Height = val - } -} - -type MapLookAtResult struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - GridIdList []int32 `protobuf:"varint,1,rep,packed,name=GridIdList,proto3" json:"GridIdList"` //战斗地图格子列表 -} - -func (x *MapLookAtResult) Reset() { - *x = MapLookAtResult{} - if protoimpl.UnsafeEnabled { - mi := &file_gamemap_proto_msgTypes[17] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *MapLookAtResult) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (x *MapLookAtResult) FromDB(data []byte) error { - return proto.Unmarshal(data, x) -} - -func (x *MapLookAtResult) ToDB() ([]byte, error) { - return proto.Marshal(x) -} - -func (*MapLookAtResult) ProtoMessage() {} - -func (x *MapLookAtResult) ProtoReflect() protoreflect.Message { - mi := &file_gamemap_proto_msgTypes[17] - 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 MapLookAtResult.ProtoReflect.Descriptor instead. -func (*MapLookAtResult) Descriptor() ([]byte, []int) { - return file_gamemap_proto_rawDescGZIP(), []int{17} -} - -func (x *MapLookAtResult) GetGridIdList() []int32 { - if x != nil { - return x.GridIdList - } - return nil -} - -func (x *MapLookAtResult) SetGridIdList(val []int32) { - if x != nil { - x.GridIdList = val - } -} - -//关闭大地图观测 进入主城/其他场景时发送 -type MapRemoveLookAt struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields -} - -func (x *MapRemoveLookAt) Reset() { - *x = MapRemoveLookAt{} - if protoimpl.UnsafeEnabled { - mi := &file_gamemap_proto_msgTypes[18] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *MapRemoveLookAt) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (x *MapRemoveLookAt) FromDB(data []byte) error { - return proto.Unmarshal(data, x) -} - -func (x *MapRemoveLookAt) ToDB() ([]byte, error) { - return proto.Marshal(x) -} - -func (*MapRemoveLookAt) ProtoMessage() {} - -func (x *MapRemoveLookAt) ProtoReflect() protoreflect.Message { - mi := &file_gamemap_proto_msgTypes[18] - 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 MapRemoveLookAt.ProtoReflect.Descriptor instead. -func (*MapRemoveLookAt) Descriptor() ([]byte, []int) { - return file_gamemap_proto_rawDescGZIP(), []int{18} -} - -var File_gamemap_proto protoreflect.FileDescriptor - -var file_gamemap_proto_rawDesc = []byte{ - 0x0a, 0x0d, 0x67, 0x61, 0x6d, 0x65, 0x6d, 0x61, 0x70, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, - 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x22, 0x24, 0x0a, 0x06, 0x56, 0x65, 0x63, 0x74, - 0x6f, 0x72, 0x12, 0x0c, 0x0a, 0x01, 0x58, 0x18, 0x01, 0x20, 0x01, 0x28, 0x01, 0x52, 0x01, 0x58, - 0x12, 0x0c, 0x0a, 0x01, 0x59, 0x18, 0x02, 0x20, 0x01, 0x28, 0x01, 0x52, 0x01, 0x59, 0x22, 0x38, - 0x0a, 0x13, 0x54, 0x65, 0x73, 0x74, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x4d, 0x61, 0x70, 0x45, - 0x6e, 0x74, 0x69, 0x74, 0x79, 0x12, 0x21, 0x0a, 0x03, 0x50, 0x6f, 0x73, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x0b, 0x32, 0x0f, 0x2e, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x2e, 0x56, 0x65, 0x63, - 0x74, 0x6f, 0x72, 0x52, 0x03, 0x50, 0x6f, 0x73, 0x22, 0x44, 0x0a, 0x0d, 0x4d, 0x61, 0x70, 0x45, - 0x6e, 0x74, 0x69, 0x74, 0x79, 0x4d, 0x6f, 0x76, 0x65, 0x12, 0x10, 0x0a, 0x03, 0x45, 0x49, 0x44, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x03, 0x45, 0x49, 0x44, 0x12, 0x21, 0x0a, 0x03, 0x50, - 0x6f, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0f, 0x2e, 0x6d, 0x65, 0x73, 0x73, 0x61, - 0x67, 0x65, 0x2e, 0x56, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x52, 0x03, 0x50, 0x6f, 0x73, 0x22, 0x41, - 0x0a, 0x0f, 0x4d, 0x61, 0x70, 0x45, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x4d, 0x6f, 0x76, 0x65, 0x54, - 0x6f, 0x12, 0x10, 0x0a, 0x03, 0x45, 0x49, 0x44, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x03, - 0x45, 0x49, 0x44, 0x12, 0x1c, 0x0a, 0x09, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x45, 0x49, 0x44, - 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x45, 0x49, - 0x44, 0x22, 0x21, 0x0a, 0x0d, 0x4d, 0x61, 0x70, 0x45, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x53, 0x74, - 0x6f, 0x70, 0x12, 0x10, 0x0a, 0x03, 0x45, 0x49, 0x44, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, - 0x03, 0x45, 0x49, 0x44, 0x22, 0x23, 0x0a, 0x0f, 0x4d, 0x61, 0x70, 0x45, 0x6e, 0x74, 0x69, 0x74, - 0x79, 0x52, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x12, 0x10, 0x0a, 0x03, 0x45, 0x49, 0x44, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x03, 0x52, 0x03, 0x45, 0x49, 0x44, 0x22, 0xc4, 0x01, 0x0a, 0x13, 0x4e, 0x6f, - 0x74, 0x69, 0x66, 0x79, 0x4d, 0x61, 0x70, 0x45, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x4c, 0x69, 0x73, - 0x74, 0x12, 0x38, 0x0a, 0x0d, 0x4d, 0x61, 0x70, 0x45, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x4c, 0x69, - 0x73, 0x74, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x6d, 0x65, 0x73, 0x73, 0x61, - 0x67, 0x65, 0x2e, 0x4d, 0x61, 0x70, 0x45, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x52, 0x0d, 0x4d, 0x61, - 0x70, 0x45, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x4c, 0x69, 0x73, 0x74, 0x12, 0x2a, 0x0a, 0x10, 0x4d, - 0x61, 0x70, 0x45, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x44, 0x65, 0x6c, 0x4c, 0x69, 0x73, 0x74, 0x18, - 0x02, 0x20, 0x03, 0x28, 0x03, 0x52, 0x10, 0x4d, 0x61, 0x70, 0x45, 0x6e, 0x74, 0x69, 0x74, 0x79, - 0x44, 0x65, 0x6c, 0x4c, 0x69, 0x73, 0x74, 0x12, 0x47, 0x0a, 0x12, 0x4d, 0x61, 0x70, 0x45, 0x6e, - 0x74, 0x69, 0x74, 0x79, 0x43, 0x72, 0x6f, 0x73, 0x73, 0x4c, 0x69, 0x73, 0x74, 0x18, 0x03, 0x20, - 0x03, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x2e, 0x4d, 0x61, - 0x70, 0x45, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x43, 0x72, 0x6f, 0x73, 0x73, 0x52, 0x12, 0x4d, 0x61, - 0x70, 0x45, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x43, 0x72, 0x6f, 0x73, 0x73, 0x4c, 0x69, 0x73, 0x74, - 0x22, 0x3a, 0x0a, 0x0e, 0x4d, 0x61, 0x70, 0x45, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x43, 0x72, 0x6f, - 0x73, 0x73, 0x12, 0x10, 0x0a, 0x03, 0x45, 0x49, 0x44, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, - 0x03, 0x45, 0x49, 0x44, 0x12, 0x16, 0x0a, 0x06, 0x47, 0x72, 0x69, 0x64, 0x49, 0x64, 0x18, 0x02, - 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x47, 0x72, 0x69, 0x64, 0x49, 0x64, 0x22, 0xf9, 0x01, 0x0a, - 0x09, 0x4d, 0x61, 0x70, 0x45, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x45, 0x49, - 0x44, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x03, 0x45, 0x49, 0x44, 0x12, 0x10, 0x0a, 0x03, - 0x52, 0x49, 0x44, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x03, 0x52, 0x49, 0x44, 0x12, 0x21, - 0x0a, 0x03, 0x50, 0x6f, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0f, 0x2e, 0x6d, 0x65, - 0x73, 0x73, 0x61, 0x67, 0x65, 0x2e, 0x56, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x52, 0x03, 0x50, 0x6f, - 0x73, 0x12, 0x16, 0x0a, 0x06, 0x47, 0x72, 0x69, 0x64, 0x49, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, - 0x05, 0x52, 0x06, 0x47, 0x72, 0x69, 0x64, 0x49, 0x64, 0x12, 0x2f, 0x0a, 0x05, 0x53, 0x74, 0x61, - 0x74, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x19, 0x2e, 0x6d, 0x65, 0x73, 0x73, 0x61, - 0x67, 0x65, 0x2e, 0x4d, 0x41, 0x50, 0x5f, 0x45, 0x4e, 0x54, 0x49, 0x54, 0x59, 0x5f, 0x53, 0x54, - 0x41, 0x54, 0x45, 0x52, 0x05, 0x53, 0x74, 0x61, 0x74, 0x65, 0x12, 0x2c, 0x0a, 0x04, 0x4b, 0x69, - 0x6e, 0x64, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x18, 0x2e, 0x6d, 0x65, 0x73, 0x73, 0x61, - 0x67, 0x65, 0x2e, 0x4d, 0x41, 0x50, 0x5f, 0x45, 0x4e, 0x54, 0x49, 0x54, 0x59, 0x5f, 0x4b, 0x49, - 0x4e, 0x44, 0x52, 0x04, 0x4b, 0x69, 0x6e, 0x64, 0x12, 0x2e, 0x0a, 0x04, 0x4d, 0x6f, 0x76, 0x65, - 0x18, 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, - 0x2e, 0x4d, 0x61, 0x70, 0x45, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x43, 0x6f, 0x6d, 0x70, 0x4d, 0x6f, - 0x76, 0x65, 0x52, 0x04, 0x4d, 0x6f, 0x76, 0x65, 0x22, 0xbf, 0x01, 0x0a, 0x11, 0x4d, 0x61, 0x70, - 0x45, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x43, 0x6f, 0x6d, 0x70, 0x4d, 0x6f, 0x76, 0x65, 0x12, 0x1a, - 0x0a, 0x08, 0x4d, 0x6f, 0x76, 0x65, 0x41, 0x62, 0x6c, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, - 0x52, 0x08, 0x4d, 0x6f, 0x76, 0x65, 0x41, 0x62, 0x6c, 0x65, 0x12, 0x1c, 0x0a, 0x09, 0x54, 0x61, - 0x72, 0x67, 0x65, 0x74, 0x45, 0x49, 0x44, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x54, - 0x61, 0x72, 0x67, 0x65, 0x74, 0x45, 0x49, 0x44, 0x12, 0x2d, 0x0a, 0x09, 0x54, 0x61, 0x72, 0x67, - 0x65, 0x74, 0x50, 0x6f, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0f, 0x2e, 0x6d, 0x65, - 0x73, 0x73, 0x61, 0x67, 0x65, 0x2e, 0x56, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x52, 0x09, 0x54, 0x61, - 0x72, 0x67, 0x65, 0x74, 0x50, 0x6f, 0x73, 0x12, 0x2b, 0x0a, 0x08, 0x56, 0x65, 0x6c, 0x6f, 0x63, - 0x69, 0x74, 0x79, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0f, 0x2e, 0x6d, 0x65, 0x73, 0x73, - 0x61, 0x67, 0x65, 0x2e, 0x56, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x52, 0x08, 0x56, 0x65, 0x6c, 0x6f, - 0x63, 0x69, 0x74, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x53, 0x70, 0x65, 0x65, 0x64, 0x18, 0x05, 0x20, - 0x01, 0x28, 0x01, 0x52, 0x05, 0x53, 0x70, 0x65, 0x65, 0x64, 0x22, 0x5b, 0x0a, 0x13, 0x4e, 0x6f, - 0x74, 0x69, 0x66, 0x79, 0x4d, 0x61, 0x70, 0x42, 0x61, 0x74, 0x74, 0x6c, 0x65, 0x49, 0x6e, 0x66, - 0x6f, 0x12, 0x44, 0x0a, 0x11, 0x4d, 0x61, 0x70, 0x42, 0x61, 0x74, 0x74, 0x6c, 0x65, 0x49, 0x6e, - 0x66, 0x6f, 0x4c, 0x69, 0x73, 0x74, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x6d, - 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x2e, 0x4d, 0x61, 0x70, 0x42, 0x61, 0x74, 0x74, 0x6c, 0x65, - 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x11, 0x4d, 0x61, 0x70, 0x42, 0x61, 0x74, 0x74, 0x6c, 0x65, 0x49, - 0x6e, 0x66, 0x6f, 0x4c, 0x69, 0x73, 0x74, 0x22, 0x83, 0x01, 0x0a, 0x0d, 0x4d, 0x61, 0x70, 0x42, - 0x61, 0x74, 0x74, 0x6c, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x10, 0x0a, 0x03, 0x45, 0x49, 0x44, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x03, 0x45, 0x49, 0x44, 0x12, 0x1c, 0x0a, 0x09, 0x54, - 0x61, 0x72, 0x67, 0x65, 0x74, 0x45, 0x49, 0x44, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, - 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x45, 0x49, 0x44, 0x12, 0x2c, 0x0a, 0x04, 0x54, 0x79, 0x70, - 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x18, 0x2e, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, - 0x65, 0x2e, 0x4d, 0x41, 0x50, 0x5f, 0x42, 0x41, 0x54, 0x54, 0x4c, 0x45, 0x5f, 0x49, 0x4e, 0x46, - 0x4f, 0x52, 0x04, 0x54, 0x79, 0x70, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x56, 0x61, 0x6c, 0x75, 0x65, - 0x18, 0x04, 0x20, 0x01, 0x28, 0x03, 0x52, 0x05, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x22, 0x53, 0x0a, - 0x11, 0x4e, 0x6f, 0x74, 0x69, 0x66, 0x79, 0x4d, 0x61, 0x70, 0x4d, 0x6f, 0x76, 0x65, 0x49, 0x6e, - 0x66, 0x6f, 0x12, 0x3e, 0x0a, 0x0f, 0x4d, 0x61, 0x70, 0x4d, 0x6f, 0x76, 0x65, 0x49, 0x6e, 0x66, - 0x6f, 0x4c, 0x69, 0x73, 0x74, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x6d, 0x65, - 0x73, 0x73, 0x61, 0x67, 0x65, 0x2e, 0x4d, 0x61, 0x70, 0x4d, 0x6f, 0x76, 0x65, 0x49, 0x6e, 0x66, - 0x6f, 0x52, 0x0f, 0x4d, 0x61, 0x70, 0x4d, 0x6f, 0x76, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x4c, 0x69, - 0x73, 0x74, 0x22, 0x6f, 0x0a, 0x0b, 0x4d, 0x61, 0x70, 0x4d, 0x6f, 0x76, 0x65, 0x49, 0x6e, 0x66, - 0x6f, 0x12, 0x10, 0x0a, 0x03, 0x45, 0x49, 0x44, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x03, - 0x45, 0x49, 0x44, 0x12, 0x21, 0x0a, 0x03, 0x50, 0x6f, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, - 0x32, 0x0f, 0x2e, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x2e, 0x56, 0x65, 0x63, 0x74, 0x6f, - 0x72, 0x52, 0x03, 0x50, 0x6f, 0x73, 0x12, 0x2b, 0x0a, 0x08, 0x56, 0x65, 0x6c, 0x6f, 0x63, 0x69, - 0x74, 0x79, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0f, 0x2e, 0x6d, 0x65, 0x73, 0x73, 0x61, - 0x67, 0x65, 0x2e, 0x56, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x52, 0x08, 0x56, 0x65, 0x6c, 0x6f, 0x63, - 0x69, 0x74, 0x79, 0x22, 0x4b, 0x0a, 0x0f, 0x4e, 0x6f, 0x74, 0x69, 0x66, 0x79, 0x4d, 0x61, 0x70, - 0x48, 0x70, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x38, 0x0a, 0x0d, 0x4d, 0x61, 0x70, 0x48, 0x70, 0x49, - 0x6e, 0x66, 0x6f, 0x4c, 0x69, 0x73, 0x74, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x12, 0x2e, - 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x2e, 0x4d, 0x61, 0x70, 0x48, 0x70, 0x49, 0x6e, 0x66, - 0x6f, 0x52, 0x0d, 0x4d, 0x61, 0x70, 0x48, 0x70, 0x49, 0x6e, 0x66, 0x6f, 0x4c, 0x69, 0x73, 0x74, - 0x22, 0x2d, 0x0a, 0x09, 0x4d, 0x61, 0x70, 0x48, 0x70, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x10, 0x0a, - 0x03, 0x45, 0x49, 0x44, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x03, 0x45, 0x49, 0x44, 0x12, - 0x0e, 0x0a, 0x02, 0x48, 0x70, 0x18, 0x02, 0x20, 0x01, 0x28, 0x01, 0x52, 0x02, 0x48, 0x70, 0x22, - 0x61, 0x0a, 0x09, 0x4d, 0x61, 0x70, 0x4c, 0x6f, 0x6f, 0x6b, 0x41, 0x74, 0x12, 0x12, 0x0a, 0x04, - 0x50, 0x6f, 0x73, 0x58, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x04, 0x50, 0x6f, 0x73, 0x58, - 0x12, 0x12, 0x0a, 0x04, 0x50, 0x6f, 0x73, 0x59, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x04, - 0x50, 0x6f, 0x73, 0x59, 0x12, 0x14, 0x0a, 0x05, 0x57, 0x69, 0x64, 0x74, 0x68, 0x18, 0x03, 0x20, - 0x01, 0x28, 0x05, 0x52, 0x05, 0x57, 0x69, 0x64, 0x74, 0x68, 0x12, 0x16, 0x0a, 0x06, 0x48, 0x65, - 0x69, 0x67, 0x68, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x48, 0x65, 0x69, 0x67, - 0x68, 0x74, 0x22, 0x31, 0x0a, 0x0f, 0x4d, 0x61, 0x70, 0x4c, 0x6f, 0x6f, 0x6b, 0x41, 0x74, 0x52, - 0x65, 0x73, 0x75, 0x6c, 0x74, 0x12, 0x1e, 0x0a, 0x0a, 0x47, 0x72, 0x69, 0x64, 0x49, 0x64, 0x4c, - 0x69, 0x73, 0x74, 0x18, 0x01, 0x20, 0x03, 0x28, 0x05, 0x52, 0x0a, 0x47, 0x72, 0x69, 0x64, 0x49, - 0x64, 0x4c, 0x69, 0x73, 0x74, 0x22, 0x11, 0x0a, 0x0f, 0x4d, 0x61, 0x70, 0x52, 0x65, 0x6d, 0x6f, - 0x76, 0x65, 0x4c, 0x6f, 0x6f, 0x6b, 0x41, 0x74, 0x2a, 0x3f, 0x0a, 0x10, 0x4d, 0x41, 0x50, 0x5f, - 0x45, 0x4e, 0x54, 0x49, 0x54, 0x59, 0x5f, 0x53, 0x54, 0x41, 0x54, 0x45, 0x12, 0x08, 0x0a, 0x04, - 0x49, 0x44, 0x4c, 0x45, 0x10, 0x00, 0x12, 0x08, 0x0a, 0x04, 0x4d, 0x4f, 0x56, 0x45, 0x10, 0x01, - 0x12, 0x0b, 0x0a, 0x07, 0x4d, 0x4f, 0x56, 0x45, 0x5f, 0x54, 0x4f, 0x10, 0x02, 0x12, 0x0a, 0x0a, - 0x06, 0x42, 0x41, 0x54, 0x54, 0x4c, 0x45, 0x10, 0x03, 0x2a, 0x3b, 0x0a, 0x0f, 0x4d, 0x41, 0x50, - 0x5f, 0x45, 0x4e, 0x54, 0x49, 0x54, 0x59, 0x5f, 0x4b, 0x49, 0x4e, 0x44, 0x12, 0x08, 0x0a, 0x04, - 0x54, 0x45, 0x53, 0x54, 0x10, 0x00, 0x12, 0x08, 0x0a, 0x04, 0x43, 0x49, 0x54, 0x59, 0x10, 0x01, - 0x12, 0x0b, 0x0a, 0x07, 0x4d, 0x4f, 0x4e, 0x53, 0x54, 0x45, 0x52, 0x10, 0x02, 0x12, 0x07, 0x0a, - 0x03, 0x52, 0x45, 0x53, 0x10, 0x03, 0x2a, 0x46, 0x0a, 0x0f, 0x4d, 0x41, 0x50, 0x5f, 0x42, 0x41, - 0x54, 0x54, 0x4c, 0x45, 0x5f, 0x49, 0x4e, 0x46, 0x4f, 0x12, 0x11, 0x0a, 0x0d, 0x44, 0x41, 0x4d, - 0x41, 0x47, 0x45, 0x5f, 0x41, 0x54, 0x54, 0x41, 0x43, 0x4b, 0x10, 0x00, 0x12, 0x10, 0x0a, 0x0c, - 0x44, 0x41, 0x4d, 0x41, 0x47, 0x45, 0x5f, 0x53, 0x4b, 0x49, 0x4c, 0x4c, 0x10, 0x01, 0x12, 0x0e, - 0x0a, 0x0a, 0x48, 0x45, 0x41, 0x4c, 0x5f, 0x53, 0x4b, 0x49, 0x4c, 0x4c, 0x10, 0x02, 0x42, 0x28, - 0x5a, 0x26, 0x67, 0x6f, 0x61, 0x74, 0x67, 0x61, 0x6d, 0x65, 0x73, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, - 0x70, 0x72, 0x73, 0x2d, 0x61, 0x70, 0x70, 0x2f, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, - 0x2f, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, -} - -var ( - file_gamemap_proto_rawDescOnce sync.Once - file_gamemap_proto_rawDescData = file_gamemap_proto_rawDesc -) - -func file_gamemap_proto_rawDescGZIP() []byte { - file_gamemap_proto_rawDescOnce.Do(func() { - file_gamemap_proto_rawDescData = protoimpl.X.CompressGZIP(file_gamemap_proto_rawDescData) - }) - return file_gamemap_proto_rawDescData -} - -var file_gamemap_proto_enumTypes = make([]protoimpl.EnumInfo, 3) -var file_gamemap_proto_msgTypes = make([]protoimpl.MessageInfo, 19) -var file_gamemap_proto_goTypes = []interface{}{ - (MAP_ENTITY_STATE)(0), // 0: message.MAP_ENTITY_STATE - (MAP_ENTITY_KIND)(0), // 1: message.MAP_ENTITY_KIND - (MAP_BATTLE_INFO)(0), // 2: message.MAP_BATTLE_INFO - (*Vector)(nil), // 3: message.Vector - (*TestCreateMapEntity)(nil), // 4: message.TestCreateMapEntity - (*MapEntityMove)(nil), // 5: message.MapEntityMove - (*MapEntityMoveTo)(nil), // 6: message.MapEntityMoveTo - (*MapEntityStop)(nil), // 7: message.MapEntityStop - (*MapEntityReturn)(nil), // 8: message.MapEntityReturn - (*NotifyMapEntityList)(nil), // 9: message.NotifyMapEntityList - (*MapEntityCross)(nil), // 10: message.MapEntityCross - (*MapEntity)(nil), // 11: message.MapEntity - (*MapEntityCompMove)(nil), // 12: message.MapEntityCompMove - (*NotifyMapBattleInfo)(nil), // 13: message.NotifyMapBattleInfo - (*MapBattleInfo)(nil), // 14: message.MapBattleInfo - (*NotifyMapMoveInfo)(nil), // 15: message.NotifyMapMoveInfo - (*MapMoveInfo)(nil), // 16: message.MapMoveInfo - (*NotifyMapHpInfo)(nil), // 17: message.NotifyMapHpInfo - (*MapHpInfo)(nil), // 18: message.MapHpInfo - (*MapLookAt)(nil), // 19: message.MapLookAt - (*MapLookAtResult)(nil), // 20: message.MapLookAtResult - (*MapRemoveLookAt)(nil), // 21: message.MapRemoveLookAt -} -var file_gamemap_proto_depIdxs = []int32{ - 3, // 0: message.TestCreateMapEntity.Pos:type_name -> message.Vector - 3, // 1: message.MapEntityMove.Pos:type_name -> message.Vector - 11, // 2: message.NotifyMapEntityList.MapEntityList:type_name -> message.MapEntity - 10, // 3: message.NotifyMapEntityList.MapEntityCrossList:type_name -> message.MapEntityCross - 3, // 4: message.MapEntity.Pos:type_name -> message.Vector - 0, // 5: message.MapEntity.State:type_name -> message.MAP_ENTITY_STATE - 1, // 6: message.MapEntity.Kind:type_name -> message.MAP_ENTITY_KIND - 12, // 7: message.MapEntity.Move:type_name -> message.MapEntityCompMove - 3, // 8: message.MapEntityCompMove.TargetPos:type_name -> message.Vector - 3, // 9: message.MapEntityCompMove.Velocity:type_name -> message.Vector - 14, // 10: message.NotifyMapBattleInfo.MapBattleInfoList:type_name -> message.MapBattleInfo - 2, // 11: message.MapBattleInfo.Type:type_name -> message.MAP_BATTLE_INFO - 16, // 12: message.NotifyMapMoveInfo.MapMoveInfoList:type_name -> message.MapMoveInfo - 3, // 13: message.MapMoveInfo.Pos:type_name -> message.Vector - 3, // 14: message.MapMoveInfo.Velocity:type_name -> message.Vector - 18, // 15: message.NotifyMapHpInfo.MapHpInfoList:type_name -> message.MapHpInfo - 16, // [16:16] is the sub-list for method output_type - 16, // [16:16] is the sub-list for method input_type - 16, // [16:16] is the sub-list for extension type_name - 16, // [16:16] is the sub-list for extension extendee - 0, // [0:16] is the sub-list for field type_name -} - -func init() { file_gamemap_proto_init() } -func file_gamemap_proto_init() { - if File_gamemap_proto != nil { - return - } - if !protoimpl.UnsafeEnabled { - file_gamemap_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Vector); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_gamemap_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*TestCreateMapEntity); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_gamemap_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*MapEntityMove); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_gamemap_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*MapEntityMoveTo); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_gamemap_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*MapEntityStop); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_gamemap_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*MapEntityReturn); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_gamemap_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*NotifyMapEntityList); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_gamemap_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*MapEntityCross); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_gamemap_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*MapEntity); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_gamemap_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*MapEntityCompMove); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_gamemap_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*NotifyMapBattleInfo); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_gamemap_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*MapBattleInfo); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_gamemap_proto_msgTypes[12].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*NotifyMapMoveInfo); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_gamemap_proto_msgTypes[13].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*MapMoveInfo); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_gamemap_proto_msgTypes[14].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*NotifyMapHpInfo); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_gamemap_proto_msgTypes[15].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*MapHpInfo); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_gamemap_proto_msgTypes[16].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*MapLookAt); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_gamemap_proto_msgTypes[17].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*MapLookAtResult); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_gamemap_proto_msgTypes[18].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*MapRemoveLookAt); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - } - type x struct{} - out := protoimpl.TypeBuilder{ - File: protoimpl.DescBuilder{ - GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_gamemap_proto_rawDesc, - NumEnums: 3, - NumMessages: 19, - NumExtensions: 0, - NumServices: 0, - }, - GoTypes: file_gamemap_proto_goTypes, - DependencyIndexes: file_gamemap_proto_depIdxs, - EnumInfos: file_gamemap_proto_enumTypes, - MessageInfos: file_gamemap_proto_msgTypes, - }.Build() - File_gamemap_proto = out.File - file_gamemap_proto_rawDesc = nil - file_gamemap_proto_goTypes = nil - file_gamemap_proto_depIdxs = nil -} diff --git a/src/app/internal/message/msgtype.pb.go b/src/app/internal/message/msgtype.pb.go deleted file mode 100644 index 04876a8..0000000 --- a/src/app/internal/message/msgtype.pb.go +++ /dev/null @@ -1,326 +0,0 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.26.0 -// protoc v3.17.3 -// source: msgtype.proto - -package message - -import ( - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" - reflect "reflect" - sync "sync" -) - -import proto "google.golang.org/protobuf/proto" - -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) -) - -//协议分段 -//1-999 common -//1001-1999 role -//2001-2999 game -//3001-3999 map -//4001-4999 league -//5001-5999 chat -//6001-6999 activity -//50000+ result使用 -type MSG_TYPE int32 - -const ( - //占位 - MSG_TYPE__ERROR MSG_TYPE = 0 //Error - MSG_TYPE__MessageResult MSG_TYPE = 1 //MessageResult - MSG_TYPE__Login MSG_TYPE = 2 //Login - MSG_TYPE__NotifyKickOut MSG_TYPE = 11 //NotifyKickOut - MSG_TYPE__Ping MSG_TYPE = 21 //Ping - MSG_TYPE__Pong MSG_TYPE = 22 //Pong - MSG_TYPE__MapEntityMove MSG_TYPE = 3001 //MapEntityMove - MSG_TYPE__MapEntityMoveTo MSG_TYPE = 3002 //MapEntityMoveTo - MSG_TYPE__MapEntityStop MSG_TYPE = 3003 //MapEntityStop - MSG_TYPE__MapEntityReturn MSG_TYPE = 3004 //MapEntityReturn - MSG_TYPE__MapLookAt MSG_TYPE = 3010 //MapLookAt - MSG_TYPE__MapRemoveLookAt MSG_TYPE = 3011 //MapRemoveLookAt - MSG_TYPE__NotifyMapEntityList MSG_TYPE = 3101 //NotifyMapEntityList - MSG_TYPE__NotifyMapBattleInfo MSG_TYPE = 3102 //NotifyMapBattleInfo - MSG_TYPE__NotifyMapMoveInfo MSG_TYPE = 3103 //NotifyMapMoveInfo - MSG_TYPE__NotifyMapHpInfo MSG_TYPE = 3104 //NotifyMapHpInfo - MSG_TYPE__TestCreateMapEntity MSG_TYPE = 3999 //TestCreateMapEntity -) - -// Enum value maps for MSG_TYPE. -var ( - MSG_TYPE_name = map[int32]string{ - 0: "_ERROR", - 1: "_MessageResult", - 2: "_Login", - 11: "_NotifyKickOut", - 21: "_Ping", - 22: "_Pong", - 3001: "_MapEntityMove", - 3002: "_MapEntityMoveTo", - 3003: "_MapEntityStop", - 3004: "_MapEntityReturn", - 3010: "_MapLookAt", - 3011: "_MapRemoveLookAt", - 3101: "_NotifyMapEntityList", - 3102: "_NotifyMapBattleInfo", - 3103: "_NotifyMapMoveInfo", - 3104: "_NotifyMapHpInfo", - 3999: "_TestCreateMapEntity", - } - MSG_TYPE_value = map[string]int32{ - "_ERROR": 0, - "_MessageResult": 1, - "_Login": 2, - "_NotifyKickOut": 11, - "_Ping": 21, - "_Pong": 22, - "_MapEntityMove": 3001, - "_MapEntityMoveTo": 3002, - "_MapEntityStop": 3003, - "_MapEntityReturn": 3004, - "_MapLookAt": 3010, - "_MapRemoveLookAt": 3011, - "_NotifyMapEntityList": 3101, - "_NotifyMapBattleInfo": 3102, - "_NotifyMapMoveInfo": 3103, - "_NotifyMapHpInfo": 3104, - "_TestCreateMapEntity": 3999, - } -) - -func (x MSG_TYPE) Enum() *MSG_TYPE { - p := new(MSG_TYPE) - *p = x - return p -} - -func (x MSG_TYPE) String() string { - return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) -} - -func (MSG_TYPE) Descriptor() protoreflect.EnumDescriptor { - return file_msgtype_proto_enumTypes[0].Descriptor() -} - -func (MSG_TYPE) Type() protoreflect.EnumType { - return &file_msgtype_proto_enumTypes[0] -} - -func (x MSG_TYPE) Number() protoreflect.EnumNumber { - return protoreflect.EnumNumber(x) -} - -// Deprecated: Use MSG_TYPE.Descriptor instead. -func (MSG_TYPE) EnumDescriptor() ([]byte, []int) { - return file_msgtype_proto_rawDescGZIP(), []int{0} -} - -type MSG_RESULT int32 - -const ( - MSG_RESULT_SUCCESS MSG_RESULT = 0 //执行成功 - MSG_RESULT_FAILED MSG_RESULT = 1 //协议执行失败,原因模糊 - MSG_RESULT_BAD_POS MSG_RESULT = 2 //非法坐标 - MSG_RESULT_USER_OFFLINE MSG_RESULT = 3 //玩家已离线 -) - -// Enum value maps for MSG_RESULT. -var ( - MSG_RESULT_name = map[int32]string{ - 0: "SUCCESS", - 1: "FAILED", - 2: "BAD_POS", - 3: "USER_OFFLINE", - } - MSG_RESULT_value = map[string]int32{ - "SUCCESS": 0, - "FAILED": 1, - "BAD_POS": 2, - "USER_OFFLINE": 3, - } -) - -func (x MSG_RESULT) Enum() *MSG_RESULT { - p := new(MSG_RESULT) - *p = x - return p -} - -func (x MSG_RESULT) String() string { - return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) -} - -func (MSG_RESULT) Descriptor() protoreflect.EnumDescriptor { - return file_msgtype_proto_enumTypes[1].Descriptor() -} - -func (MSG_RESULT) Type() protoreflect.EnumType { - return &file_msgtype_proto_enumTypes[1] -} - -func (x MSG_RESULT) Number() protoreflect.EnumNumber { - return protoreflect.EnumNumber(x) -} - -// Deprecated: Use MSG_RESULT.Descriptor instead. -func (MSG_RESULT) EnumDescriptor() ([]byte, []int) { - return file_msgtype_proto_rawDescGZIP(), []int{1} -} - -type Error struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields -} - -func (x *Error) Reset() { - *x = Error{} - if protoimpl.UnsafeEnabled { - mi := &file_msgtype_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *Error) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (x *Error) FromDB(data []byte) error { - return proto.Unmarshal(data, x) -} - -func (x *Error) ToDB() ([]byte, error) { - return proto.Marshal(x) -} - -func (*Error) ProtoMessage() {} - -func (x *Error) ProtoReflect() protoreflect.Message { - mi := &file_msgtype_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_msgtype_proto_rawDescGZIP(), []int{0} -} - -var File_msgtype_proto protoreflect.FileDescriptor - -var file_msgtype_proto_rawDesc = []byte{ - 0x0a, 0x0d, 0x6d, 0x73, 0x67, 0x74, 0x79, 0x70, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, - 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x22, 0x07, 0x0a, 0x05, 0x45, 0x72, 0x72, 0x6f, - 0x72, 0x2a, 0xe1, 0x02, 0x0a, 0x08, 0x4d, 0x53, 0x47, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x12, 0x0a, - 0x0a, 0x06, 0x5f, 0x45, 0x52, 0x52, 0x4f, 0x52, 0x10, 0x00, 0x12, 0x12, 0x0a, 0x0e, 0x5f, 0x4d, - 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x10, 0x01, 0x12, 0x0a, - 0x0a, 0x06, 0x5f, 0x4c, 0x6f, 0x67, 0x69, 0x6e, 0x10, 0x02, 0x12, 0x12, 0x0a, 0x0e, 0x5f, 0x4e, - 0x6f, 0x74, 0x69, 0x66, 0x79, 0x4b, 0x69, 0x63, 0x6b, 0x4f, 0x75, 0x74, 0x10, 0x0b, 0x12, 0x09, - 0x0a, 0x05, 0x5f, 0x50, 0x69, 0x6e, 0x67, 0x10, 0x15, 0x12, 0x09, 0x0a, 0x05, 0x5f, 0x50, 0x6f, - 0x6e, 0x67, 0x10, 0x16, 0x12, 0x13, 0x0a, 0x0e, 0x5f, 0x4d, 0x61, 0x70, 0x45, 0x6e, 0x74, 0x69, - 0x74, 0x79, 0x4d, 0x6f, 0x76, 0x65, 0x10, 0xb9, 0x17, 0x12, 0x15, 0x0a, 0x10, 0x5f, 0x4d, 0x61, - 0x70, 0x45, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x4d, 0x6f, 0x76, 0x65, 0x54, 0x6f, 0x10, 0xba, 0x17, - 0x12, 0x13, 0x0a, 0x0e, 0x5f, 0x4d, 0x61, 0x70, 0x45, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x53, 0x74, - 0x6f, 0x70, 0x10, 0xbb, 0x17, 0x12, 0x15, 0x0a, 0x10, 0x5f, 0x4d, 0x61, 0x70, 0x45, 0x6e, 0x74, - 0x69, 0x74, 0x79, 0x52, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x10, 0xbc, 0x17, 0x12, 0x0f, 0x0a, 0x0a, - 0x5f, 0x4d, 0x61, 0x70, 0x4c, 0x6f, 0x6f, 0x6b, 0x41, 0x74, 0x10, 0xc2, 0x17, 0x12, 0x15, 0x0a, - 0x10, 0x5f, 0x4d, 0x61, 0x70, 0x52, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x4c, 0x6f, 0x6f, 0x6b, 0x41, - 0x74, 0x10, 0xc3, 0x17, 0x12, 0x19, 0x0a, 0x14, 0x5f, 0x4e, 0x6f, 0x74, 0x69, 0x66, 0x79, 0x4d, - 0x61, 0x70, 0x45, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x4c, 0x69, 0x73, 0x74, 0x10, 0x9d, 0x18, 0x12, - 0x19, 0x0a, 0x14, 0x5f, 0x4e, 0x6f, 0x74, 0x69, 0x66, 0x79, 0x4d, 0x61, 0x70, 0x42, 0x61, 0x74, - 0x74, 0x6c, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x10, 0x9e, 0x18, 0x12, 0x17, 0x0a, 0x12, 0x5f, 0x4e, - 0x6f, 0x74, 0x69, 0x66, 0x79, 0x4d, 0x61, 0x70, 0x4d, 0x6f, 0x76, 0x65, 0x49, 0x6e, 0x66, 0x6f, - 0x10, 0x9f, 0x18, 0x12, 0x15, 0x0a, 0x10, 0x5f, 0x4e, 0x6f, 0x74, 0x69, 0x66, 0x79, 0x4d, 0x61, - 0x70, 0x48, 0x70, 0x49, 0x6e, 0x66, 0x6f, 0x10, 0xa0, 0x18, 0x12, 0x19, 0x0a, 0x14, 0x5f, 0x54, - 0x65, 0x73, 0x74, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x4d, 0x61, 0x70, 0x45, 0x6e, 0x74, 0x69, - 0x74, 0x79, 0x10, 0x9f, 0x1f, 0x2a, 0x44, 0x0a, 0x0a, 0x4d, 0x53, 0x47, 0x5f, 0x52, 0x45, 0x53, - 0x55, 0x4c, 0x54, 0x12, 0x0b, 0x0a, 0x07, 0x53, 0x55, 0x43, 0x43, 0x45, 0x53, 0x53, 0x10, 0x00, - 0x12, 0x0a, 0x0a, 0x06, 0x46, 0x41, 0x49, 0x4c, 0x45, 0x44, 0x10, 0x01, 0x12, 0x0b, 0x0a, 0x07, - 0x42, 0x41, 0x44, 0x5f, 0x50, 0x4f, 0x53, 0x10, 0x02, 0x12, 0x10, 0x0a, 0x0c, 0x55, 0x53, 0x45, - 0x52, 0x5f, 0x4f, 0x46, 0x46, 0x4c, 0x49, 0x4e, 0x45, 0x10, 0x03, 0x42, 0x28, 0x5a, 0x26, 0x67, - 0x6f, 0x61, 0x74, 0x67, 0x61, 0x6d, 0x65, 0x73, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x73, - 0x2d, 0x61, 0x70, 0x70, 0x2f, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x2f, 0x6d, 0x65, - 0x73, 0x73, 0x61, 0x67, 0x65, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, -} - -var ( - file_msgtype_proto_rawDescOnce sync.Once - file_msgtype_proto_rawDescData = file_msgtype_proto_rawDesc -) - -func file_msgtype_proto_rawDescGZIP() []byte { - file_msgtype_proto_rawDescOnce.Do(func() { - file_msgtype_proto_rawDescData = protoimpl.X.CompressGZIP(file_msgtype_proto_rawDescData) - }) - return file_msgtype_proto_rawDescData -} - -var file_msgtype_proto_enumTypes = make([]protoimpl.EnumInfo, 2) -var file_msgtype_proto_msgTypes = make([]protoimpl.MessageInfo, 1) -var file_msgtype_proto_goTypes = []interface{}{ - (MSG_TYPE)(0), // 0: message.MSG_TYPE - (MSG_RESULT)(0), // 1: message.MSG_RESULT - (*Error)(nil), // 2: message.Error -} -var file_msgtype_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_msgtype_proto_init() } -func file_msgtype_proto_init() { - if File_msgtype_proto != nil { - return - } - if !protoimpl.UnsafeEnabled { - file_msgtype_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 - } - } - } - type x struct{} - out := protoimpl.TypeBuilder{ - File: protoimpl.DescBuilder{ - GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_msgtype_proto_rawDesc, - NumEnums: 2, - NumMessages: 1, - NumExtensions: 0, - NumServices: 0, - }, - GoTypes: file_msgtype_proto_goTypes, - DependencyIndexes: file_msgtype_proto_depIdxs, - EnumInfos: file_msgtype_proto_enumTypes, - MessageInfos: file_msgtype_proto_msgTypes, - }.Build() - File_msgtype_proto = out.File - file_msgtype_proto_rawDesc = nil - file_msgtype_proto_goTypes = nil - file_msgtype_proto_depIdxs = nil -} diff --git a/src/app/internal/msg_inner/msg_inner.pb.go b/src/app/internal/msg_inner/msg_inner.pb.go deleted file mode 100644 index 38663b5..0000000 --- a/src/app/internal/msg_inner/msg_inner.pb.go +++ /dev/null @@ -1,1018 +0,0 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.26.0 -// protoc v3.17.3 -// source: msg_inner.proto - -package msg_inner - -import ( - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" - reflect "reflect" - sync "sync" -) - -import proto "google.golang.org/protobuf/proto" - -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) -) - -//检测目标服务存活 区别于keep alive,检测主线程信息消费速度正常 -type CheckAlive struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields -} - -func (x *CheckAlive) Reset() { - *x = CheckAlive{} - if protoimpl.UnsafeEnabled { - mi := &file_msg_inner_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *CheckAlive) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (x *CheckAlive) FromDB(data []byte) error { - return proto.Unmarshal(data, x) -} - -func (x *CheckAlive) ToDB() ([]byte, error) { - return proto.Marshal(x) -} - -func (*CheckAlive) ProtoMessage() {} - -func (x *CheckAlive) ProtoReflect() protoreflect.Message { - mi := &file_msg_inner_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 CheckAlive.ProtoReflect.Descriptor instead. -func (*CheckAlive) Descriptor() ([]byte, []int) { - return file_msg_inner_proto_rawDescGZIP(), []int{0} -} - -//负载均衡后端主动上报 -type LoadBalanceReport struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Rank float64 `protobuf:"fixed64,1,opt,name=Rank,proto3" json:"Rank"` //负载评分 归一化 - Address string `protobuf:"bytes,2,opt,name=Address,proto3" json:"Address"` //ip:port -} - -func (x *LoadBalanceReport) Reset() { - *x = LoadBalanceReport{} - if protoimpl.UnsafeEnabled { - mi := &file_msg_inner_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *LoadBalanceReport) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (x *LoadBalanceReport) FromDB(data []byte) error { - return proto.Unmarshal(data, x) -} - -func (x *LoadBalanceReport) ToDB() ([]byte, error) { - return proto.Marshal(x) -} - -func (*LoadBalanceReport) ProtoMessage() {} - -func (x *LoadBalanceReport) ProtoReflect() protoreflect.Message { - mi := &file_msg_inner_proto_msgTypes[1] - 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 LoadBalanceReport.ProtoReflect.Descriptor instead. -func (*LoadBalanceReport) Descriptor() ([]byte, []int) { - return file_msg_inner_proto_rawDescGZIP(), []int{1} -} - -func (x *LoadBalanceReport) GetRank() float64 { - if x != nil { - return x.Rank - } - return 0 -} - -func (x *LoadBalanceReport) GetAddress() string { - if x != nil { - return x.Address - } - return "" -} - -func (x *LoadBalanceReport) SetRank(val float64) { - if x != nil { - x.Rank = val - } -} -func (x *LoadBalanceReport) SetAddress(val string) { - if x != nil { - x.Address = val - } -} - -//虚拟客户端创建 -type VirtualUserCreate struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - RID int64 `protobuf:"varint,1,opt,name=RID,proto3" json:"RID"` - GID int32 `protobuf:"varint,3,opt,name=GID,proto3" json:"GID"` //gate id -} - -func (x *VirtualUserCreate) Reset() { - *x = VirtualUserCreate{} - if protoimpl.UnsafeEnabled { - mi := &file_msg_inner_proto_msgTypes[2] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *VirtualUserCreate) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (x *VirtualUserCreate) FromDB(data []byte) error { - return proto.Unmarshal(data, x) -} - -func (x *VirtualUserCreate) ToDB() ([]byte, error) { - return proto.Marshal(x) -} - -func (*VirtualUserCreate) ProtoMessage() {} - -func (x *VirtualUserCreate) ProtoReflect() protoreflect.Message { - mi := &file_msg_inner_proto_msgTypes[2] - 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 VirtualUserCreate.ProtoReflect.Descriptor instead. -func (*VirtualUserCreate) Descriptor() ([]byte, []int) { - return file_msg_inner_proto_rawDescGZIP(), []int{2} -} - -func (x *VirtualUserCreate) GetRID() int64 { - if x != nil { - return x.RID - } - return 0 -} - -func (x *VirtualUserCreate) GetGID() int32 { - if x != nil { - return x.GID - } - return 0 -} - -func (x *VirtualUserCreate) SetRID(val int64) { - if x != nil { - x.RID = val - } -} -func (x *VirtualUserCreate) SetGID(val int32) { - if x != nil { - x.GID = val - } -} - -//虚拟客户端销毁 -type VirtualUserDestroy struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - RID int64 `protobuf:"varint,1,opt,name=RID,proto3" json:"RID"` -} - -func (x *VirtualUserDestroy) Reset() { - *x = VirtualUserDestroy{} - if protoimpl.UnsafeEnabled { - mi := &file_msg_inner_proto_msgTypes[3] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *VirtualUserDestroy) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (x *VirtualUserDestroy) FromDB(data []byte) error { - return proto.Unmarshal(data, x) -} - -func (x *VirtualUserDestroy) ToDB() ([]byte, error) { - return proto.Marshal(x) -} - -func (*VirtualUserDestroy) ProtoMessage() {} - -func (x *VirtualUserDestroy) ProtoReflect() protoreflect.Message { - mi := &file_msg_inner_proto_msgTypes[3] - 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 VirtualUserDestroy.ProtoReflect.Descriptor instead. -func (*VirtualUserDestroy) Descriptor() ([]byte, []int) { - return file_msg_inner_proto_rawDescGZIP(), []int{3} -} - -func (x *VirtualUserDestroy) GetRID() int64 { - if x != nil { - return x.RID - } - return 0 -} - -func (x *VirtualUserDestroy) SetRID(val int64) { - if x != nil { - x.RID = val - } -} - -//发送到虚拟客户端 -type Send2VirtualUser struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - RID int64 `protobuf:"varint,1,opt,name=RID,proto3" json:"RID"` - Data []byte `protobuf:"bytes,2,opt,name=Data,proto3" json:"Data"` -} - -func (x *Send2VirtualUser) Reset() { - *x = Send2VirtualUser{} - if protoimpl.UnsafeEnabled { - mi := &file_msg_inner_proto_msgTypes[4] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *Send2VirtualUser) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (x *Send2VirtualUser) FromDB(data []byte) error { - return proto.Unmarshal(data, x) -} - -func (x *Send2VirtualUser) ToDB() ([]byte, error) { - return proto.Marshal(x) -} - -func (*Send2VirtualUser) ProtoMessage() {} - -func (x *Send2VirtualUser) ProtoReflect() protoreflect.Message { - mi := &file_msg_inner_proto_msgTypes[4] - 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 Send2VirtualUser.ProtoReflect.Descriptor instead. -func (*Send2VirtualUser) Descriptor() ([]byte, []int) { - return file_msg_inner_proto_rawDescGZIP(), []int{4} -} - -func (x *Send2VirtualUser) GetRID() int64 { - if x != nil { - return x.RID - } - return 0 -} - -func (x *Send2VirtualUser) GetData() []byte { - if x != nil { - return x.Data - } - return nil -} - -func (x *Send2VirtualUser) SetRID(val int64) { - if x != nil { - x.RID = val - } -} -func (x *Send2VirtualUser) SetData(val []byte) { - if x != nil { - x.Data = val - } -} - -//广播到虚拟客户端 -type BroadCast2VirtualUser struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - SID int32 `protobuf:"varint,1,opt,name=SID,proto3" json:"SID"` // - Data []byte `protobuf:"bytes,2,opt,name=Data,proto3" json:"Data"` -} - -func (x *BroadCast2VirtualUser) Reset() { - *x = BroadCast2VirtualUser{} - if protoimpl.UnsafeEnabled { - mi := &file_msg_inner_proto_msgTypes[5] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *BroadCast2VirtualUser) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (x *BroadCast2VirtualUser) FromDB(data []byte) error { - return proto.Unmarshal(data, x) -} - -func (x *BroadCast2VirtualUser) ToDB() ([]byte, error) { - return proto.Marshal(x) -} - -func (*BroadCast2VirtualUser) ProtoMessage() {} - -func (x *BroadCast2VirtualUser) ProtoReflect() protoreflect.Message { - mi := &file_msg_inner_proto_msgTypes[5] - 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 BroadCast2VirtualUser.ProtoReflect.Descriptor instead. -func (*BroadCast2VirtualUser) Descriptor() ([]byte, []int) { - return file_msg_inner_proto_rawDescGZIP(), []int{5} -} - -func (x *BroadCast2VirtualUser) GetSID() int32 { - if x != nil { - return x.SID - } - return 0 -} - -func (x *BroadCast2VirtualUser) GetData() []byte { - if x != nil { - return x.Data - } - return nil -} - -func (x *BroadCast2VirtualUser) SetSID(val int32) { - if x != nil { - x.SID = val - } -} -func (x *BroadCast2VirtualUser) SetData(val []byte) { - if x != nil { - x.Data = val - } -} - -//组播到虚拟客户端 -type GroupCast2VirtualUser struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - RIDList []int64 `protobuf:"varint,1,rep,packed,name=RIDList,proto3" json:"RIDList"` //rid列表 - Data []byte `protobuf:"bytes,2,opt,name=Data,proto3" json:"Data"` -} - -func (x *GroupCast2VirtualUser) Reset() { - *x = GroupCast2VirtualUser{} - if protoimpl.UnsafeEnabled { - mi := &file_msg_inner_proto_msgTypes[6] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *GroupCast2VirtualUser) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (x *GroupCast2VirtualUser) FromDB(data []byte) error { - return proto.Unmarshal(data, x) -} - -func (x *GroupCast2VirtualUser) ToDB() ([]byte, error) { - return proto.Marshal(x) -} - -func (*GroupCast2VirtualUser) ProtoMessage() {} - -func (x *GroupCast2VirtualUser) ProtoReflect() protoreflect.Message { - mi := &file_msg_inner_proto_msgTypes[6] - 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 GroupCast2VirtualUser.ProtoReflect.Descriptor instead. -func (*GroupCast2VirtualUser) Descriptor() ([]byte, []int) { - return file_msg_inner_proto_rawDescGZIP(), []int{6} -} - -func (x *GroupCast2VirtualUser) GetRIDList() []int64 { - if x != nil { - return x.RIDList - } - return nil -} - -func (x *GroupCast2VirtualUser) GetData() []byte { - if x != nil { - return x.Data - } - return nil -} - -func (x *GroupCast2VirtualUser) SetRIDList(val []int64) { - if x != nil { - x.RIDList = val - } -} -func (x *GroupCast2VirtualUser) SetData(val []byte) { - if x != nil { - x.Data = val - } -} - -//虚拟客户端消息 -type VirtualUserMessage struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - RID int64 `protobuf:"varint,1,opt,name=RID,proto3" json:"RID"` - MsgId int32 `protobuf:"varint,2,opt,name=MsgId,proto3" json:"MsgId"` - Data []byte `protobuf:"bytes,3,opt,name=Data,proto3" json:"Data"` -} - -func (x *VirtualUserMessage) Reset() { - *x = VirtualUserMessage{} - if protoimpl.UnsafeEnabled { - mi := &file_msg_inner_proto_msgTypes[7] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *VirtualUserMessage) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (x *VirtualUserMessage) FromDB(data []byte) error { - return proto.Unmarshal(data, x) -} - -func (x *VirtualUserMessage) ToDB() ([]byte, error) { - return proto.Marshal(x) -} - -func (*VirtualUserMessage) ProtoMessage() {} - -func (x *VirtualUserMessage) ProtoReflect() protoreflect.Message { - mi := &file_msg_inner_proto_msgTypes[7] - 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 VirtualUserMessage.ProtoReflect.Descriptor instead. -func (*VirtualUserMessage) Descriptor() ([]byte, []int) { - return file_msg_inner_proto_rawDescGZIP(), []int{7} -} - -func (x *VirtualUserMessage) GetRID() int64 { - if x != nil { - return x.RID - } - return 0 -} - -func (x *VirtualUserMessage) GetMsgId() int32 { - if x != nil { - return x.MsgId - } - return 0 -} - -func (x *VirtualUserMessage) GetData() []byte { - if x != nil { - return x.Data - } - return nil -} - -func (x *VirtualUserMessage) SetRID(val int64) { - if x != nil { - x.RID = val - } -} -func (x *VirtualUserMessage) SetMsgId(val int32) { - if x != nil { - x.MsgId = val - } -} -func (x *VirtualUserMessage) SetData(val []byte) { - if x != nil { - x.Data = val - } -} - -//玩家登录时gate之间广播,保证登陆状态唯一 -type UserLoginBroadcastGate struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - RID int64 `protobuf:"varint,1,opt,name=RID,proto3" json:"RID"` -} - -func (x *UserLoginBroadcastGate) Reset() { - *x = UserLoginBroadcastGate{} - if protoimpl.UnsafeEnabled { - mi := &file_msg_inner_proto_msgTypes[8] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *UserLoginBroadcastGate) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (x *UserLoginBroadcastGate) FromDB(data []byte) error { - return proto.Unmarshal(data, x) -} - -func (x *UserLoginBroadcastGate) ToDB() ([]byte, error) { - return proto.Marshal(x) -} - -func (*UserLoginBroadcastGate) ProtoMessage() {} - -func (x *UserLoginBroadcastGate) ProtoReflect() protoreflect.Message { - mi := &file_msg_inner_proto_msgTypes[8] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use UserLoginBroadcastGate.ProtoReflect.Descriptor instead. -func (*UserLoginBroadcastGate) Descriptor() ([]byte, []int) { - return file_msg_inner_proto_rawDescGZIP(), []int{8} -} - -func (x *UserLoginBroadcastGate) GetRID() int64 { - if x != nil { - return x.RID - } - return 0 -} - -func (x *UserLoginBroadcastGate) SetRID(val int64) { - if x != nil { - x.RID = val - } -} - -//RoleGate <-> Role 登录 -type RoleLogin struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - RID int64 `protobuf:"varint,1,opt,name=RID,proto3" json:"RID"` -} - -func (x *RoleLogin) Reset() { - *x = RoleLogin{} - if protoimpl.UnsafeEnabled { - mi := &file_msg_inner_proto_msgTypes[9] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *RoleLogin) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (x *RoleLogin) FromDB(data []byte) error { - return proto.Unmarshal(data, x) -} - -func (x *RoleLogin) ToDB() ([]byte, error) { - return proto.Marshal(x) -} - -func (*RoleLogin) ProtoMessage() {} - -func (x *RoleLogin) ProtoReflect() protoreflect.Message { - mi := &file_msg_inner_proto_msgTypes[9] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use RoleLogin.ProtoReflect.Descriptor instead. -func (*RoleLogin) Descriptor() ([]byte, []int) { - return file_msg_inner_proto_rawDescGZIP(), []int{9} -} - -func (x *RoleLogin) GetRID() int64 { - if x != nil { - return x.RID - } - return 0 -} - -func (x *RoleLogin) SetRID(val int64) { - if x != nil { - x.RID = val - } -} - -//RoleGate <-> Role 登出 -type RoleLogout struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - RID int64 `protobuf:"varint,1,opt,name=RID,proto3" json:"RID"` -} - -func (x *RoleLogout) Reset() { - *x = RoleLogout{} - if protoimpl.UnsafeEnabled { - mi := &file_msg_inner_proto_msgTypes[10] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *RoleLogout) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (x *RoleLogout) FromDB(data []byte) error { - return proto.Unmarshal(data, x) -} - -func (x *RoleLogout) ToDB() ([]byte, error) { - return proto.Marshal(x) -} - -func (*RoleLogout) ProtoMessage() {} - -func (x *RoleLogout) ProtoReflect() protoreflect.Message { - mi := &file_msg_inner_proto_msgTypes[10] - 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 RoleLogout.ProtoReflect.Descriptor instead. -func (*RoleLogout) Descriptor() ([]byte, []int) { - return file_msg_inner_proto_rawDescGZIP(), []int{10} -} - -func (x *RoleLogout) GetRID() int64 { - if x != nil { - return x.RID - } - return 0 -} - -func (x *RoleLogout) SetRID(val int64) { - if x != nil { - x.RID = val - } -} - -var File_msg_inner_proto protoreflect.FileDescriptor - -var file_msg_inner_proto_rawDesc = []byte{ - 0x0a, 0x0f, 0x6d, 0x73, 0x67, 0x5f, 0x69, 0x6e, 0x6e, 0x65, 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, - 0x6f, 0x12, 0x09, 0x6d, 0x73, 0x67, 0x5f, 0x69, 0x6e, 0x6e, 0x65, 0x72, 0x22, 0x0c, 0x0a, 0x0a, - 0x43, 0x68, 0x65, 0x63, 0x6b, 0x41, 0x6c, 0x69, 0x76, 0x65, 0x22, 0x41, 0x0a, 0x11, 0x4c, 0x6f, - 0x61, 0x64, 0x42, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x52, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x12, - 0x12, 0x0a, 0x04, 0x52, 0x61, 0x6e, 0x6b, 0x18, 0x01, 0x20, 0x01, 0x28, 0x01, 0x52, 0x04, 0x52, - 0x61, 0x6e, 0x6b, 0x12, 0x18, 0x0a, 0x07, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x02, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x22, 0x37, 0x0a, - 0x11, 0x56, 0x69, 0x72, 0x74, 0x75, 0x61, 0x6c, 0x55, 0x73, 0x65, 0x72, 0x43, 0x72, 0x65, 0x61, - 0x74, 0x65, 0x12, 0x10, 0x0a, 0x03, 0x52, 0x49, 0x44, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, - 0x03, 0x52, 0x49, 0x44, 0x12, 0x10, 0x0a, 0x03, 0x47, 0x49, 0x44, 0x18, 0x03, 0x20, 0x01, 0x28, - 0x05, 0x52, 0x03, 0x47, 0x49, 0x44, 0x22, 0x26, 0x0a, 0x12, 0x56, 0x69, 0x72, 0x74, 0x75, 0x61, - 0x6c, 0x55, 0x73, 0x65, 0x72, 0x44, 0x65, 0x73, 0x74, 0x72, 0x6f, 0x79, 0x12, 0x10, 0x0a, 0x03, - 0x52, 0x49, 0x44, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x03, 0x52, 0x49, 0x44, 0x22, 0x38, - 0x0a, 0x10, 0x53, 0x65, 0x6e, 0x64, 0x32, 0x56, 0x69, 0x72, 0x74, 0x75, 0x61, 0x6c, 0x55, 0x73, - 0x65, 0x72, 0x12, 0x10, 0x0a, 0x03, 0x52, 0x49, 0x44, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, - 0x03, 0x52, 0x49, 0x44, 0x12, 0x12, 0x0a, 0x04, 0x44, 0x61, 0x74, 0x61, 0x18, 0x02, 0x20, 0x01, - 0x28, 0x0c, 0x52, 0x04, 0x44, 0x61, 0x74, 0x61, 0x22, 0x3d, 0x0a, 0x15, 0x42, 0x72, 0x6f, 0x61, - 0x64, 0x43, 0x61, 0x73, 0x74, 0x32, 0x56, 0x69, 0x72, 0x74, 0x75, 0x61, 0x6c, 0x55, 0x73, 0x65, - 0x72, 0x12, 0x10, 0x0a, 0x03, 0x53, 0x49, 0x44, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x03, - 0x53, 0x49, 0x44, 0x12, 0x12, 0x0a, 0x04, 0x44, 0x61, 0x74, 0x61, 0x18, 0x02, 0x20, 0x01, 0x28, - 0x0c, 0x52, 0x04, 0x44, 0x61, 0x74, 0x61, 0x22, 0x45, 0x0a, 0x15, 0x47, 0x72, 0x6f, 0x75, 0x70, - 0x43, 0x61, 0x73, 0x74, 0x32, 0x56, 0x69, 0x72, 0x74, 0x75, 0x61, 0x6c, 0x55, 0x73, 0x65, 0x72, - 0x12, 0x18, 0x0a, 0x07, 0x52, 0x49, 0x44, 0x4c, 0x69, 0x73, 0x74, 0x18, 0x01, 0x20, 0x03, 0x28, - 0x03, 0x52, 0x07, 0x52, 0x49, 0x44, 0x4c, 0x69, 0x73, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x44, 0x61, - 0x74, 0x61, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x04, 0x44, 0x61, 0x74, 0x61, 0x22, 0x50, - 0x0a, 0x12, 0x56, 0x69, 0x72, 0x74, 0x75, 0x61, 0x6c, 0x55, 0x73, 0x65, 0x72, 0x4d, 0x65, 0x73, - 0x73, 0x61, 0x67, 0x65, 0x12, 0x10, 0x0a, 0x03, 0x52, 0x49, 0x44, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x03, 0x52, 0x03, 0x52, 0x49, 0x44, 0x12, 0x14, 0x0a, 0x05, 0x4d, 0x73, 0x67, 0x49, 0x64, 0x18, - 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x4d, 0x73, 0x67, 0x49, 0x64, 0x12, 0x12, 0x0a, 0x04, - 0x44, 0x61, 0x74, 0x61, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x04, 0x44, 0x61, 0x74, 0x61, - 0x22, 0x2a, 0x0a, 0x16, 0x55, 0x73, 0x65, 0x72, 0x4c, 0x6f, 0x67, 0x69, 0x6e, 0x42, 0x72, 0x6f, - 0x61, 0x64, 0x63, 0x61, 0x73, 0x74, 0x47, 0x61, 0x74, 0x65, 0x12, 0x10, 0x0a, 0x03, 0x52, 0x49, - 0x44, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x03, 0x52, 0x49, 0x44, 0x22, 0x1d, 0x0a, 0x09, - 0x52, 0x6f, 0x6c, 0x65, 0x4c, 0x6f, 0x67, 0x69, 0x6e, 0x12, 0x10, 0x0a, 0x03, 0x52, 0x49, 0x44, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x03, 0x52, 0x49, 0x44, 0x22, 0x1e, 0x0a, 0x0a, 0x52, - 0x6f, 0x6c, 0x65, 0x4c, 0x6f, 0x67, 0x6f, 0x75, 0x74, 0x12, 0x10, 0x0a, 0x03, 0x52, 0x49, 0x44, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x03, 0x52, 0x49, 0x44, 0x42, 0x0c, 0x5a, 0x0a, 0x2f, - 0x6d, 0x73, 0x67, 0x5f, 0x69, 0x6e, 0x6e, 0x65, 0x72, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x33, -} - -var ( - file_msg_inner_proto_rawDescOnce sync.Once - file_msg_inner_proto_rawDescData = file_msg_inner_proto_rawDesc -) - -func file_msg_inner_proto_rawDescGZIP() []byte { - file_msg_inner_proto_rawDescOnce.Do(func() { - file_msg_inner_proto_rawDescData = protoimpl.X.CompressGZIP(file_msg_inner_proto_rawDescData) - }) - return file_msg_inner_proto_rawDescData -} - -var file_msg_inner_proto_msgTypes = make([]protoimpl.MessageInfo, 11) -var file_msg_inner_proto_goTypes = []interface{}{ - (*CheckAlive)(nil), // 0: msg_inner.CheckAlive - (*LoadBalanceReport)(nil), // 1: msg_inner.LoadBalanceReport - (*VirtualUserCreate)(nil), // 2: msg_inner.VirtualUserCreate - (*VirtualUserDestroy)(nil), // 3: msg_inner.VirtualUserDestroy - (*Send2VirtualUser)(nil), // 4: msg_inner.Send2VirtualUser - (*BroadCast2VirtualUser)(nil), // 5: msg_inner.BroadCast2VirtualUser - (*GroupCast2VirtualUser)(nil), // 6: msg_inner.GroupCast2VirtualUser - (*VirtualUserMessage)(nil), // 7: msg_inner.VirtualUserMessage - (*UserLoginBroadcastGate)(nil), // 8: msg_inner.UserLoginBroadcastGate - (*RoleLogin)(nil), // 9: msg_inner.RoleLogin - (*RoleLogout)(nil), // 10: msg_inner.RoleLogout -} -var file_msg_inner_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_msg_inner_proto_init() } -func file_msg_inner_proto_init() { - if File_msg_inner_proto != nil { - return - } - if !protoimpl.UnsafeEnabled { - file_msg_inner_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*CheckAlive); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_msg_inner_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*LoadBalanceReport); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_msg_inner_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*VirtualUserCreate); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_msg_inner_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*VirtualUserDestroy); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_msg_inner_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Send2VirtualUser); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_msg_inner_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*BroadCast2VirtualUser); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_msg_inner_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GroupCast2VirtualUser); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_msg_inner_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*VirtualUserMessage); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_msg_inner_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*UserLoginBroadcastGate); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_msg_inner_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*RoleLogin); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_msg_inner_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*RoleLogout); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - } - type x struct{} - out := protoimpl.TypeBuilder{ - File: protoimpl.DescBuilder{ - GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_msg_inner_proto_rawDesc, - NumEnums: 0, - NumMessages: 11, - NumExtensions: 0, - NumServices: 0, - }, - GoTypes: file_msg_inner_proto_goTypes, - DependencyIndexes: file_msg_inner_proto_depIdxs, - MessageInfos: file_msg_inner_proto_msgTypes, - }.Build() - File_msg_inner_proto = out.File - file_msg_inner_proto_rawDesc = nil - file_msg_inner_proto_goTypes = nil - file_msg_inner_proto_depIdxs = nil -} diff --git a/src/app/internal/msg_inner/msg_inner.proto b/src/app/internal/msg_inner/msg_inner.proto deleted file mode 100644 index 6c693c1..0000000 --- a/src/app/internal/msg_inner/msg_inner.proto +++ /dev/null @@ -1,72 +0,0 @@ -syntax = "proto3"; -package msg_inner; -option go_package = "/msg_inner"; - -//检测目标服务存活 区别于keep alive,检测主线程信息消费速度正常 -message CheckAlive -{ -} - -//负载均衡后端主动上报 -message LoadBalanceReport -{ - double Rank = 1; //负载评分 归一化 - string Address = 2; //ip:port -} - -//虚拟客户端创建 -message VirtualUserCreate -{ - int64 RID = 1; - int32 GID = 3; //gate id -} - -//虚拟客户端销毁 -message VirtualUserDestroy -{ - int64 RID = 1; -} - -//发送到虚拟客户端 -message Send2VirtualUser -{ - int64 RID = 1; - bytes Data = 2; -} -//广播到虚拟客户端 -message BroadCast2VirtualUser -{ - int32 SID = 1; // - bytes Data = 2; -} -//组播到虚拟客户端 -message GroupCast2VirtualUser -{ - repeated int64 RIDList = 1; //rid列表 - bytes Data = 2; -} - -//虚拟客户端消息 -message VirtualUserMessage -{ - int64 RID = 1; - int32 MsgId = 2; - bytes Data = 3; -} - -//玩家登录时gate之间广播,保证登陆状态唯一 -message UserLoginBroadcastGate -{ - int64 RID = 1; -} - -//RoleGate <-> Role 登录 -message RoleLogin -{ - int64 RID = 1; -} -//RoleGate <-> Role 登出 -message RoleLogout -{ - int64 RID = 1; -} \ No newline at end of file diff --git a/src/app/internal/msg_util/msg_handler.go b/src/app/internal/msg_util/msg_handler.go deleted file mode 100644 index f19ef3f..0000000 --- a/src/app/internal/msg_util/msg_handler.go +++ /dev/null @@ -1,57 +0,0 @@ -package msg_util - -import ( - "core/actor/actor_msg" - "core/tools" -) - -/* -按消息/请求的数据类型注册回调 -注意:不是区分具体类型的值 -*/ - -func NewMsgTypeHandler() *MsgTypeHandler { - return &MsgTypeHandler{msgMap: make(map[string]MsgFun), reqMap: make(map[string]ReqFun)} -} - -type MsgFun func(sourceId, msg interface{}) -type ReqFun func(requestId, msg interface{}) - -type MsgTypeHandler struct { - msgMap map[string]MsgFun - reqMap map[string]ReqFun -} - -// 注册消息回调 -func (h *MsgTypeHandler) RegistMsg(msg interface{}, f MsgFun) { - msgName := MsgName(msg) - _, ok := h.msgMap[msgName] - tools.AssertTrue(!ok, "regist repeated msg=%v", msgName) - h.msgMap[msgName] = f -} - -func (h *MsgTypeHandler) HandleMsg(sourceId, msg interface{}) bool { - msgName := MsgName(msg) - handler := h.msgMap[msgName] - tools.AssertTrue(handler != nil, "msg=%v not regist handler", msgName) - handler(sourceId, msg) - return true -} - -// 注册请求回调 -func (h *MsgTypeHandler) RegistReq(msg interface{}, f ReqFun) { - msgName := MsgName(msg) - _, ok := h.reqMap[msgName] - tools.AssertTrue(!ok, "regist repeated req=%v", msgName) - h.reqMap[msgName] = f -} - -func (h *MsgTypeHandler) HandleReq(requestId, msg interface{}) { - msgName := MsgName(msg) - handler := h.reqMap[msgName] - tools.AssertTrue(handler != nil, "req=%v not regist handler", msgName) - //log.KV("msg", msgName).KV("requestId", requestId).Debug("hand request") - handler(requestId, msg) -} - -func MsgName(msg interface{}) string { return actor_msg.MsgName(msg) } diff --git a/src/app/internal/service/service.go b/src/app/internal/service/service.go deleted file mode 100644 index a56536a..0000000 --- a/src/app/internal/service/service.go +++ /dev/null @@ -1,52 +0,0 @@ -package service - -import ( - "fmt" -) - -const ( - Login = "login" - Gate = "gate" - - RoleGate = "rolegate" - LeagueGate = "leaguegate" - - Game = "game" - - GameMap = "gamemap" - - Role = "role" - League = "league" - - Chat = "chat" - Webconsole = "webconsole" - Payment = "payment" - - //工具 - All = "all" //测试 - Robot = "robot" - DBUpdate = "dbupdate" -) - -func LoginId(id int32) string { return ServiceId(Login, id) } -func GateId(id int32) string { return ServiceId(Gate, id) } -func GameId(id int32) string { return ServiceId(Game, id) } -func GameMapId(id int32) string { return ServiceId(GameMap, id) } -func RoleGateId(id int32) string { return ServiceId(RoleGate, id) } -func RoleId(id int32) string { return ServiceId(Role, id) } - -func ChatId(id int32) string { return ServiceId(Chat, id) } -func WebconsoleId(id int32) string { return ServiceId(Webconsole, id) } -func PaymentId(id int32) string { return ServiceId(Payment, id) } - -func RobotId(id int32) string { return ServiceId(Robot, id) } -func DBUpdateId(id int32) string { return ServiceId(DBUpdate, id) } -func ServiceId(tp string, id int32) string { return fmt.Sprintf("%s_%d", tp, id) } - -type GameServerStatus int32 - -const ( - StatusClose GameServerStatus = iota //未开放 - StatusMaintain //维护 - StatusOpen //开启 -) diff --git a/src/app/servers/game/game.go b/src/app/servers/game/game.go deleted file mode 100644 index 56df4ad..0000000 --- a/src/app/servers/game/game.go +++ /dev/null @@ -1,45 +0,0 @@ -package game - -import ( - "app/internal/service" - "app/servers/game/logic/fathers" - "app/servers/internal/service_base" - "core/abtime" - "core/log" - "core/tools" -) - -func NewGame(appId int32) *Game { - return &Game{IServiceBase: service_base.New(service.Game, appId)} -} - -var _ fathers.IGame = (*Game)(nil) //interface实现检查 -type Game struct { - service_base.IServiceBase -} - -func (s *Game) OnStart() (err error) { - s.IServiceBase.OnStart() - - s.init() - - s.DependOn(service.GameMapId(s.SID()), func() { - log.KV("sid", s.SID()).Info("Game DependOn OK") - }) - - return nil -} - -// 返回false表示需要延迟处理,待可以退出时,game自己调用Suspend() -func (s *Game) OnStop() bool { - t1 := abtime.Now() - log.KV("actor", s.Actor().Id()).Info("game stop start") - defer func() { log.KV("cost", abtime.Now().Sub(t1)).KV("actor", s.Actor().Id()).Info("game stop over") }() - - return s.IServiceBase.OnStop() -} - -/*注意不要随意改变加载顺序*/ -func (s *Game) init() { - defer tools.TimeCostLog(abtime.Now(), 0, "game init over") -} diff --git a/src/app/servers/game/logic/fathers/entity.go b/src/app/servers/game/logic/fathers/entity.go deleted file mode 100644 index cbe881f..0000000 --- a/src/app/servers/game/logic/fathers/entity.go +++ /dev/null @@ -1,13 +0,0 @@ -package fathers - -import ( - "app/servers/internal/service_base" -) - -type IEntity interface { - service_base.ITimerManager - IGameSub - - RID() int64 - Type() int32 -} diff --git a/src/app/servers/game/logic/fathers/game.go b/src/app/servers/game/logic/fathers/game.go deleted file mode 100644 index d7fc9a1..0000000 --- a/src/app/servers/game/logic/fathers/game.go +++ /dev/null @@ -1,17 +0,0 @@ -package fathers - -import ( - "app/servers/internal/service_base" - "core/dispatcher" - "core/ormdb" -) - -type IGame interface { - service_base.IServiceBase -} - -type IGameSub interface { - Game() IGame - DBSaver() ormdb.IQueSaver - GameDispatcher() dispatcher.IDispatcher -} diff --git a/src/app/servers/gate/gate.go b/src/app/servers/gate/gate.go deleted file mode 100644 index 8f5a341..0000000 --- a/src/app/servers/gate/gate.go +++ /dev/null @@ -1,84 +0,0 @@ -package gate - -import ( - "app/internal/msg_util" - "app/internal/service" - "app/servers/gate/logic/fathers" - "app/servers/gate/logic/mgr_online" - "app/servers/gate/logic/mgr_user" - "app/servers/gate/user_session" - "app/servers/internal/service_base" - "core/abtime" - "core/log" - "core/network" - "core/tools" -) - -func NewGate(appId int32) *Gate { - return &Gate{IServiceBase: service_base.New(service.Gate, appId)} -} - -var _ fathers.IGate = (*Gate)(nil) //interface实现检查 -type Gate struct { - service_base.IServiceBase - listener network.INetListener //客户端连接监听 - userMgr *mgr_user.GateUserManager //玩家 - onlineMgr *mgr_online.OnlineManager //在线管理 -} - -func (s *Gate) OnStart() (err error) { - s.IServiceBase.OnStart() - s.onlineMgr = mgr_online.New(s) - s.userMgr = mgr_user.NewGateUserMgr(s) - - s.init() - - s.DependOn(service.LoginId(1), func() { - log.KV("sid", s.SID()).Info("Gate DependOn OK") - s.LoadBalance().StartAsBackend(service.LoginId(1)) - - //连接监听 - listener := network.NewTcpListener( - s.Config().String("client_addr"), - func() network.ICodec { return msg_util.NewProtoCodec(s.Parser(), 1024*64, true) }, - func() network.INetHandler { return user_session.NewUserSession(s) }, - network.WithPrometheus(s.Actor().Prometheus()), - ) - err2 := listener.Listen() - tools.AssertNil(err2) - s.listener = listener - }) - return -} - -// 返回false表示需要延迟处理,待可以退出时,game自己调用Suspend() -func (s *Gate) OnStop() bool { - t1 := abtime.Now() - log.KV("actor", s.Actor().Id()).Info("gate stop start") - defer func() { log.KV("cost", abtime.Now().Sub(t1)).KV("actor", s.Actor().Id()).Info("gate stop over") }() - - s.listener.Stop() - - return s.IServiceBase.OnStop() -} - -/*注意不要随意改变加载顺序*/ -func (s *Gate) init() { - defer tools.TimeCostLog(abtime.Now(), 0, "gate init over") - s.initAPI() -} - -var broadcastServerKindList = []string{service.RoleGate, service.LeagueGate, service.Game, service.GameMap, service.Role, service.League, service.Chat} - -func (s *Gate) BroadcastAll(msg interface{}) { - for _, kind := range broadcastServerKindList { - s.Actor().Broadcast(kind, msg) - } -} -func (s *Gate) BroadcastGate(msg interface{}) { - s.Actor().Broadcast(service.Gate, msg) -} - -// ///////////////////////////////各种getter///////////////////////////////// -func (s *Gate) UserMgr() fathers.IGateUserManager { return s.userMgr } -func (s *Gate) UserByRID(rid int64) fathers.IGateUser { return s.userMgr.User(rid) } diff --git a/src/app/servers/gate/gate_api.go b/src/app/servers/gate/gate_api.go deleted file mode 100644 index c5b804b..0000000 --- a/src/app/servers/gate/gate_api.go +++ /dev/null @@ -1,17 +0,0 @@ -package gate - -import ( - "app/internal/msg_inner" - "app/servers/gate/logic/fathers" -) - -func (s *Gate) initAPI() { - s.RegistMsg((*fathers.SessionCreate)(nil), s.onlineMgr.OnConnect) - s.RegistMsg((*fathers.SessionClose)(nil), s.onlineMgr.OnDisconnect) - s.RegistMsg((*fathers.SessionMsg)(nil), s.onlineMgr.OnMessage) - - s.RegistMsg((*msg_inner.Send2VirtualUser)(nil), s.onlineMgr.OnMessage2User) - s.RegistMsg((*msg_inner.BroadCast2VirtualUser)(nil), s.onlineMgr.OnBroadCastMessage2User) - s.RegistMsg((*msg_inner.GroupCast2VirtualUser)(nil), s.onlineMgr.OnGroupCast2VirtualUser) - s.RegistMsg((*msg_inner.UserLoginBroadcastGate)(nil), s.onlineMgr.OnUserLoginBroadcastGate) -} diff --git a/src/app/servers/gate/logic/fathers/gate.go b/src/app/servers/gate/logic/fathers/gate.go deleted file mode 100644 index 6181cab..0000000 --- a/src/app/servers/gate/logic/fathers/gate.go +++ /dev/null @@ -1,27 +0,0 @@ -package fathers - -import ( - "app/servers/internal/service_base" -) - -type IGate interface { - service_base.IServiceBase - UserMgr() IGateUserManager - UserByRID(rid int64) IGateUser - BroadcastAll(msg interface{}) - BroadcastGate(msg interface{}) -} - -type IGateSub interface { - Gate() IGate -} - -func NewGateSub(gate IGate) IGateSub { - return &GateSub{gate: gate} -} - -type GateSub struct { - gate IGate -} - -func (this *GateSub) Gate() IGate { return this.gate } diff --git a/src/app/servers/gate/logic/fathers/gate_user.go b/src/app/servers/gate/logic/fathers/gate_user.go deleted file mode 100644 index 463bae3..0000000 --- a/src/app/servers/gate/logic/fathers/gate_user.go +++ /dev/null @@ -1,20 +0,0 @@ -package fathers - -type IGateUser interface { - RID() int64 - UID() int64 - SID() int32 -} - -type IGateUserModule interface { - SetUser(IGateUser) - OnInit() error -} - -type ModuleBase struct { - IGateUser -} - -func (this *ModuleBase) SetUser(user IGateUser) { this.IGateUser = user } -func (this *ModuleBase) OnInit() error { return nil } -func (this *ModuleBase) OnNewUser() error { return nil } diff --git a/src/app/servers/gate/logic/fathers/mgr_online.go b/src/app/servers/gate/logic/fathers/mgr_online.go deleted file mode 100644 index 5bdf104..0000000 --- a/src/app/servers/gate/logic/fathers/mgr_online.go +++ /dev/null @@ -1,42 +0,0 @@ -package fathers - -import ( - "core/network" - "google.golang.org/protobuf/proto" -) - -type IOnlineManager interface { - IGateSub - OnConnect(sourceId, msg interface{}) - OnDisconnect(sourceId, msg interface{}) - RemoteIP(rid int64) string - - OnMessage(sourceId, msg interface{}) - SendMsg(rid int64, msg proto.Message) - Broadcast(msg proto.Message) - - IsOnline(rid int64) bool - OnlineNum() int - GetOnlineAll() []int64 -} - -type IGateUserSession interface { - network.INetSession - SetRID(rid int64) - RID() int64 - SetSID(sid int32) - SID() int32 -} - -type SessionCreate struct { - Session IGateUserSession -} - -type SessionClose struct { - Session IGateUserSession -} - -type SessionMsg struct { - Session IGateUserSession - Msg proto.Message -} diff --git a/src/app/servers/gate/logic/fathers/mgr_user.go b/src/app/servers/gate/logic/fathers/mgr_user.go deleted file mode 100644 index 5ca376a..0000000 --- a/src/app/servers/gate/logic/fathers/mgr_user.go +++ /dev/null @@ -1,9 +0,0 @@ -package fathers - -type IGateUserManager interface { - NewUser(uid int64, rid int64, sid int32) IGateUser - Add(user IGateUser) (ok bool) - Del(user IGateUser) (ok bool) - - User(rid int64) IGateUser -} diff --git a/src/app/servers/gate/logic/gate_user/gate_user.go b/src/app/servers/gate/logic/gate_user/gate_user.go deleted file mode 100644 index 48cfd5f..0000000 --- a/src/app/servers/gate/logic/gate_user/gate_user.go +++ /dev/null @@ -1,27 +0,0 @@ -package gate_user - -import ( - "app/servers/gate/logic/fathers" -) - -var _ fathers.IGateUser = (*GateUser)(nil) //interface实现检查 -type GateUser struct { - fathers.IGateSub - rid int64 - uid int64 - sid int32 -} - -func NewGateUser(gateSub fathers.IGateSub, uid int64, rid int64, sid int32) *GateUser { - user := &GateUser{ - IGateSub: gateSub, - uid: uid, - rid: rid, - sid: sid, - } - return user -} - -func (this *GateUser) RID() int64 { return this.rid } -func (this *GateUser) UID() int64 { return this.uid } -func (this *GateUser) SID() int32 { return this.sid } diff --git a/src/app/servers/gate/logic/mgr_online/handler.go b/src/app/servers/gate/logic/mgr_online/handler.go deleted file mode 100644 index f217198..0000000 --- a/src/app/servers/gate/logic/mgr_online/handler.go +++ /dev/null @@ -1,64 +0,0 @@ -package mgr_online - -import ( - "app/internal/message" - "app/servers/gate/logic/fathers" - "core/abtime" - "core/log" - "google.golang.org/protobuf/proto" -) - -func (this *OnlineManager) handeLogin(sm *fathers.SessionMsg) { - var recvData = sm.Msg.(*message.Login) - rid := recvData.RID - - log.KV("rid", rid).KV("ip", sm.Session.RemoteIP()).KV("msg", recvData).KV("msgip", recvData.IP).Info("gate handeLogin") - recvData.IP = sm.Session.RemoteIP() - - //TODO 临时屏蔽 - //if this.startAt > recvData.LoginTime || !app_tools.IsLogin(this.Gate().LoginKey(), recvData.SID, rid, recvData.UID, recvData.LoginTime, recvData.Mute, recvData.Ban, recvData.Super, recvData.Session) { - // log.KV("start", this.startAt).KV("login", recvData.LoginTime).KV("rid", rid).Info("login check failed") - // this.respLogin(sm.Session, message.MSG_RESULT_FAILED) - // return - //} - - user := this.Gate().UserByRID(rid) - if isNewUser := user == nil; isNewUser { - user = this.Gate().UserMgr().NewUser(recvData.UID, rid, recvData.SID) - if !this.Gate().UserMgr().Add(user) { - log.KV("rid", rid).Warn("add user failed") - this.respLogin(sm.Session, message.MSG_RESULT_FAILED) - return - } - } - if user != nil && this.IsOnline(rid) { - log.KV("rid", rid).Info("replace login") - this.SendMsg(rid, &message.NotifyKickOut{Reason: message.KICK_OUT_REASON_REPLACE}) - this.unbind(rid) - } - - if !this.bind(user.RID(), user.SID(), sm.Session) { - log.KV("rid", user.RID()).Warn("bind user failed") - this.respLogin(sm.Session, message.MSG_RESULT_FAILED) - return - } - this.respLogin(sm.Session, message.MSG_RESULT_SUCCESS) - - log.KV("uid", user.UID()).KV("rid", user.RID()).KV("ip", sm.Session.RemoteIP()).KV("login_session", recvData.Session).KV("session", sm.Session.Id()).Info("gate login success") -} - -func (this *OnlineManager) respLogin(session fathers.IGateUserSession, result message.MSG_RESULT) { - msg := &message.LoginResult{ - Result: result, - Role: session.RID(), - ServerTime: abtime.Now().UnixNano(), - ServerZone: int32(abtime.TimeZone / 3600), - } - respData, _ := proto.Marshal(msg) - msgResult := &message.MessageResult{ - ProtoId: int32(message.MSG_TYPE__Login), - Result: result, - Data: respData, - } - session.SendMsg(msgResult) -} diff --git a/src/app/servers/gate/logic/mgr_online/mgr_online.go b/src/app/servers/gate/logic/mgr_online/mgr_online.go deleted file mode 100644 index d9eb0e7..0000000 --- a/src/app/servers/gate/logic/mgr_online/mgr_online.go +++ /dev/null @@ -1,173 +0,0 @@ -package mgr_online - -import ( - "app/internal/message" - "app/internal/msg_inner" - "app/internal/msg_util" - "app/servers/gate/logic/fathers" - "core/abtime" - "core/log" - "google.golang.org/protobuf/proto" -) - -func New(gate fathers.IGate) *OnlineManager { - o := &OnlineManager{ - IGateSub: fathers.NewGateSub(gate), - u2s: make(map[int64]fathers.IGateUserSession), - startAt: abtime.Now().Unix(), - } - return o -} - -var _ fathers.IOnlineManager = (*OnlineManager)(nil) //interface实现检查 -type OnlineManager struct { - fathers.IGateSub - u2s map[int64]fathers.IGateUserSession //rid=>session - startAt int64 -} - -func (this *OnlineManager) OnConnect(sourceId, msg interface{}) {} -func (this *OnlineManager) OnDisconnect(sourceId, msg interface{}) { - session := msg.(*fathers.SessionClose).Session - this.unbind(session.RID()) -} - -func (this *OnlineManager) OnMessage(sourceId, msg interface{}) { - data := msg.(*fathers.SessionMsg) - msgName := msg_util.MsgName(data.Msg) - defer this.Gate().Prometheus().RecordHandMsg(abtime.Now(), msgName) - - if _, ok := data.Msg.(*message.Login); ok { - this.handeLogin(data) - } else { - if user := this.Gate().UserByRID(data.Session.RID()); user != nil { - this.handleMessage(user, data.Msg) - } else { - log.KV("rid", data.Session.RID()).KV("session", data.Session.Id()).KV("msg", msg_util.MsgName(msg)).KV("data", data.Msg).Warn("msg not find user") - } - } -} - -func (this *OnlineManager) OnMessage2User(sourceId, msg interface{}) { - data := msg.(*msg_inner.Send2VirtualUser) - rid := data.RID - if session, ok := this.u2s[rid]; ok { - session.SendMsg(data.Data) - } -} - -func (this *OnlineManager) OnBroadCastMessage2User(sourceId, msg interface{}) { - data := msg.(*msg_inner.BroadCast2VirtualUser) - for _, session := range this.u2s { - if user := this.User(session.RID()); user.SID() == data.SID { - session.SendMsg(data.Data) - } - } -} -func (this *OnlineManager) OnGroupCast2VirtualUser(sourceId, msg interface{}) { - data := msg.(*msg_inner.GroupCast2VirtualUser) - for _, rid := range data.RIDList { - if session, ok := this.u2s[rid]; ok { - session.SendMsg(data.Data) - } - } -} - -func (this *OnlineManager) OnUserLoginBroadcastGate(sourceId, msg interface{}) { - if sourceId == this.Gate().Actor().Id() { - return - } - data := msg.(*msg_inner.UserLoginBroadcastGate) - rid := data.RID - this.SendMsg(rid, &message.NotifyKickOut{Reason: message.KICK_OUT_REASON_REPLACE}) - this.unbind(rid) -} - -func (this *OnlineManager) bind(rid int64, sid int32, session fathers.IGateUserSession) bool { - if _, ok := this.u2s[rid]; ok { - return false - } - this.u2s[rid] = session - session.SetRID(rid) - session.SetSID(sid) - this.Gate().Prometheus().RecordOnline(len(this.u2s)) - req := &msg_inner.VirtualUserCreate{RID: rid, GID: this.Gate().SID()} - this.Gate().BroadcastAll(req) - return true -} - -func (this *OnlineManager) unbind(rid int64) { - session, ok := this.u2s[rid] - if !ok { - return - } - if user := this.User(rid); user != nil { - //user.OnUserOffLine() - } - session.SetRID(0) - session.SetSID(0) - delete(this.u2s, rid) - this.Gate().Prometheus().RecordOnline(len(this.u2s)) - req := &msg_inner.VirtualUserDestroy{RID: rid} - this.Gate().BroadcastAll(req) -} - -func (this *OnlineManager) OnlineNum() int { return len(this.u2s) } -func (this *OnlineManager) User(rid int64) fathers.IGateUser { - if _, ok := this.u2s[rid]; !ok { - return nil - } - return this.Gate().UserByRID(rid) -} - -func (this *OnlineManager) GetOnlineAll() []int64 { - var ret []int64 - for rid := range this.u2s { - ret = append(ret, rid) - } - return ret -} - -// IsOnline 获取当前rid是否在线. -func (this *OnlineManager) IsOnline(rid int64) bool { - _, ok := this.u2s[rid] - return ok -} - -func (this *OnlineManager) SendMsg(rid int64, msg proto.Message) { - if sess, ok := this.u2s[rid]; ok { - sess.SendMsg(msg) - } -} - -func (this *OnlineManager) Broadcast(msg proto.Message) { - for _, sess := range this.u2s { - sess.SendMsg(msg) - } -} - -func (this *OnlineManager) Kick(rid int64, reason message.KICK_OUT_REASON, ban message.BAN_REASON) { - session, ok := this.u2s[rid] - if !ok { - return - } - session.SendMsg(&message.NotifyKickOut{Reason: reason, Ban: ban}) - this.unbind(rid) -} - -func (this *OnlineManager) NotifyClose() { - for rid := range this.u2s { - this.Kick(rid, message.KICK_OUT_REASON_MAINTAIN, 0) - } -} - -func (this *OnlineManager) RemoteIP(rid int64) string { - if sess, ok := this.u2s[rid]; ok { - return sess.RemoteIP() - } - return "" -} - -func (this *OnlineManager) handleMessage(user fathers.IGateUser, msg proto.Message) { - //msg_name := msg_util.MsgName(msg) -} diff --git a/src/app/servers/gate/logic/mgr_user/user_mgr.go b/src/app/servers/gate/logic/mgr_user/user_mgr.go deleted file mode 100644 index fa1ab69..0000000 --- a/src/app/servers/gate/logic/mgr_user/user_mgr.go +++ /dev/null @@ -1,65 +0,0 @@ -package mgr_user - -import ( - "app/servers/gate/logic/fathers" - "app/servers/gate/logic/gate_user" - "core/log" -) - -func NewGateUserMgr(gate fathers.IGate) *GateUserManager { - u := &GateUserManager{ - IGateSub: fathers.NewGateSub(gate), - users: make(map[int64]*gate_user.GateUser), - } - return u -} - -// 玩家列表 -var _ fathers.IGateUserManager = (*GateUserManager)(nil) //interface实现检查 -type GateUserManager struct { - fathers.IGateSub - users map[int64]*gate_user.GateUser -} - -func (this *GateUserManager) Len() int32 { - return int32(len(this.users)) -} - -func (this *GateUserManager) Range(fn func(user fathers.IGateUser) (stop bool)) { - for _, user := range this.users { - if fn(user) { - break - } - } - return -} - -func (this *GateUserManager) User(rid int64) fathers.IGateUser { - entity := this.users[rid] - if entity == nil { - return nil - } - return entity -} - -func (this *GateUserManager) Add(entity fathers.IGateUser) (ok bool) { - if this.users[entity.RID()] != nil { - log.KV("rid", entity.RID()).Error("add entity already exists") - return - } - this.users[entity.RID()] = entity.(*gate_user.GateUser) - return true -} - -func (this *GateUserManager) Del(user fathers.IGateUser) (ok bool) { - if this.users[user.RID()] != nil { - delete(this.users, user.RID()) - return true - } - return false -} - -func (this *GateUserManager) NewUser(uid int64, rid int64, sid int32) fathers.IGateUser { - user := gate_user.NewGateUser(this, uid, rid, sid) - return user -} diff --git a/src/app/servers/gate/user_session/handler.go b/src/app/servers/gate/user_session/handler.go deleted file mode 100644 index e8a5df2..0000000 --- a/src/app/servers/gate/user_session/handler.go +++ /dev/null @@ -1,54 +0,0 @@ -package user_session - -import ( - "app/internal/message" - "app/internal/msg_inner" - "app/internal/service" - "app/servers/gate/logic/fathers" - "core/abtime" - "google.golang.org/protobuf/proto" -) - -//协议分段 -//1-999 common -//1001-1999 role -//2001-2999 game -//3001-3999 map -//4001-4999 league -//5001-5999 chat -//6001-6999 activity - -// 根据协议号进行转发 -func (s *UserSession) handeSessionMsg(msgId int32, rawData interface{}) { - msgTarget := msgId / 1000 - - switch msgTarget { - case 0: //gate - s.handleByGate(msgId, rawData) - case 3: //map - s.sendUserMessage(service.GameMapId(s.SID()), msgId, rawData) - } - -} - -func (s *UserSession) handleByGate(msgId int32, rawData interface{}) { - //注意这里不是主线程 - if data, ok := s.gate.Parser().Unmarshal(msgId, rawData.([]byte)); ok { - switch msgId { - case int32(message.MSG_TYPE__Ping): - ping := data.(*message.Ping) - s.SendMsg(&message.Pong{ServerTime: abtime.Now().UnixNano(), ServerZone: int32(abtime.TimeZone / 3600), ClientTime: ping.ClientTime}) - default: - s.gate.Actor().Send(s.gate.Actor().Id(), &fathers.SessionMsg{Session: s, Msg: data.(proto.Message)}) - } - } -} - -func (s *UserSession) sendUserMessage(targetId interface{}, msgId int32, rawData interface{}) { - userMsg := &msg_inner.VirtualUserMessage{ - RID: s.rid, - MsgId: msgId, - Data: rawData.([]byte), - } - s.gate.Actor().Send(targetId, userMsg) -} diff --git a/src/app/servers/gate/user_session/user_session.go b/src/app/servers/gate/user_session/user_session.go deleted file mode 100644 index b13659b..0000000 --- a/src/app/servers/gate/user_session/user_session.go +++ /dev/null @@ -1,37 +0,0 @@ -package user_session - -import ( - "app/servers/gate/logic/fathers" - "app/servers/internal/ip2country" - "core/network" -) - -func NewUserSession(gate fathers.IGate) *UserSession { - return &UserSession{gate: gate} -} - -type UserSession struct { - network.BaseNetHandler - gate fathers.IGate - rid int64 - sid int32 - country string -} - -func (s *UserSession) OnSessionCreated() { - s.country = ip2country.ToCountryISO(s.RemoteIP()) - s.gate.Actor().Send(s.gate.Actor().Id(), &fathers.SessionCreate{Session: s}) -} - -func (s *UserSession) OnSessionClosed() { - s.gate.Actor().Send(s.gate.Actor().Id(), &fathers.SessionClose{Session: s}) -} - -func (s *UserSession) OnRecv(msgId int32, data interface{}) { - s.handeSessionMsg(msgId, data) -} - -func (s *UserSession) SetRID(rid int64) { s.rid = rid } -func (s *UserSession) RID() int64 { return s.rid } -func (s *UserSession) SetSID(sid int32) { s.sid = sid } -func (s *UserSession) SID() int32 { return s.sid } diff --git a/src/app/servers/internal/service_base/db_base.go b/src/app/servers/internal/service_base/db_base.go deleted file mode 100644 index 19fdbb2..0000000 --- a/src/app/servers/internal/service_base/db_base.go +++ /dev/null @@ -1,81 +0,0 @@ -package service_base - -import ( - "core/abtime" - "core/ormdb" - "core/tools" - "reflect" - "time" - "xorm.io/xorm" -) - -type IDBBase interface { - ormdb.IQueSaver - DBCount(ormdb.IDBObj, func(*xorm.Session) *xorm.Session) (int64, error) - PageLoad(ormdb.IDBObj, func(*xorm.Session) *xorm.Session) (interface{}, error) - LoadAll(ormdb.IDBObj, func(*xorm.Session) *xorm.Session) (interface{}, error) - CreateTable(beans ...interface{}) error - DBEngine() *xorm.Engine - NewDBSession() (*xorm.Session, error) - - setBase(datas interface{}) -} - -var _ IDBBase = (*DBBase)(nil) // -type DBBase struct { - db *ormdb.MysqlEngine //数据库 -} - -func (s *DBBase) Init(service *ServiceBase) { - mysql_dsn := service.Config().MustString("mysql", "") - if mysql_dsn == "" { - return - } - flushInterval := time.Second * time.Duration(service.Config().MustInt32("db_flush", 1)) - dbPageSize := service.Config().MustInt64("db_page_size", 200000) - dbQueNum := service.Config().MustInt64("db_que_num", 4) - var err error - s.db, err = ormdb.New(mysql_dsn, ormdb.WithFlushInterval(flushInterval), ormdb.WithPrometheus(service.Actor().Prometheus()), ormdb.WithPageSize(dbPageSize), ormdb.WithQueNum(dbQueNum)) - tools.AssertNil(err) - service.AddScheduleTask(abtime.Now(), flushInterval, func(dt int64) { s.db.Flush(false) }) -} - -func (s *DBBase) DBEngine() *xorm.Engine { return s.db.Engine() } -func (s *DBBase) NewDBSession() (*xorm.Session, error) { return s.db.NewSession() } -func (s *DBBase) CreateTable(beans ...interface{}) error { return s.db.CreateTable(beans...) } -func (s *DBBase) TableName(bean interface{}) string { return s.db.TableName(bean) } -func (s *DBBase) AddToQue(data ormdb.IDBObj) { s.db.AddToQue(data) } -func (s *DBBase) DBCount(beanPtr ormdb.IDBObj, wraper func(*xorm.Session) *xorm.Session) (int64, error) { - return s.db.Count(beanPtr, wraper) -} - -func (s *DBBase) Stop() { - if s.db != nil { - s.db.Stop() - } -} -func (s *DBBase) PageLoad(beanPtr ormdb.IDBObj, wraper func(*xorm.Session) *xorm.Session) (interface{}, error) { - datas, err := s.db.PageLoad(beanPtr, wraper) - if err != nil { - return datas, err - } - s.setBase(datas) - return datas, err -} -func (s *DBBase) LoadAll(beanPtr ormdb.IDBObj, wraper func(*xorm.Session) *xorm.Session) (interface{}, error) { - datas, err := s.db.LoadAll(beanPtr, wraper) - if err != nil { - return nil, err - } - s.setBase(datas) - return datas, err -} - -func (s *DBBase) setBase(datas interface{}) { - rd := reflect.ValueOf(datas) - total := rd.Len() - for i := 0; i < total; i++ { - data := rd.Index(i).Interface().(ormdb.IDBObj) - data.OnLoadObj(s.db, data) - } -} diff --git a/src/app/servers/internal/service_base/load_balance.go b/src/app/servers/internal/service_base/load_balance.go deleted file mode 100644 index b69e685..0000000 --- a/src/app/servers/internal/service_base/load_balance.go +++ /dev/null @@ -1,121 +0,0 @@ -package service_base - -import ( - "app/internal/msg_inner" - "core/tools" - "time" -) - -type LB_TYPE int32 - -const ( - LBTypeNone LB_TYPE = iota - LBTypeFrontend - LBTypeBackend -) -const ( - CHECK_ALIVE_RETRY_MAX = 3 //被动检测存活 重试次数 - FRONTEND_CHECKALIVE_INTERVAL = 30 //前端检测存活的间隔 秒 - FRONTEND_ROUTER_REFRESH_INTERVAL = 60 //前端路由刷新时间 秒 - BAKCEND_REPORT_INTERVAL = 30 //后端主动上报的间隔 秒 -) - -func NewLoadBalanceManager() ILoadBalanceManager { - return &LoadBalanceManager{ - backendMap: make(map[string]*LoadBalanceNode), - } -} - -var _ ILoadBalanceManager = (*LoadBalanceManager)(nil) //interface实现检查 -type ILoadBalanceManager interface { - Init(serviceBase IServiceBase) ILoadBalanceManager - StartAsFrontend() //作为前端启动 - StartAsBackend(frontendAppId string) //作为后端启动 - GetBestBackend() (addr, appId string) //获得路由后的后端地址 目前策略:根据后端上报的rank选择最优 -} -type LoadBalanceManager struct { - serviceBase IServiceBase - frontendAppId string - bestBackendAppId string - backendMap map[string]*LoadBalanceNode - lbType LB_TYPE -} - -type LoadBalanceNode struct { - appId string - address string - rank float64 - isAlive bool -} - -func (s *LoadBalanceManager) Init(serviceBase IServiceBase) ILoadBalanceManager { - s.serviceBase = serviceBase - s.initAPI() - return s -} - -func (s *LoadBalanceManager) StartAsFrontend() { - tools.AssertTrue(s.lbType == LBTypeNone, "StartAsFrontend fail, lbType is not LBTypeNone") - s.lbType = LBTypeFrontend - act := s.serviceBase.Actor() - act.AddTimer(time.Second*FRONTEND_CHECKALIVE_INTERVAL, -1, func(dt int64) { - for _, node := range s.backendMap { - var timerId int64 - retry := CHECK_ALIVE_RETRY_MAX - act.Send(act.Id(), func() { - timerId = act.AddTimer(time.Second, -1, func(dt int64) { - if _, err := act.RequestWait(node.appId, &msg_inner.CheckAlive{}); err == nil { - act.CancelTimer(timerId) - node.isAlive = true - } else { - retry-- - if retry < 0 { - act.CancelTimer(timerId) - node.isAlive = false - } - } - }) - }) - } - }) - act.AddTimer(time.Second*FRONTEND_ROUTER_REFRESH_INTERVAL, -1, func(dt int64) { - if len(s.backendMap) == 0 { - return - } - var bestAppId string - var bestRank float64 - for _, node := range s.backendMap { - if bestAppId == "" || node.rank < bestRank { - bestAppId = node.appId - bestRank = node.rank - } - } - s.bestBackendAppId = bestAppId - }) -} - -func (s *LoadBalanceManager) StartAsBackend(frontendAppId string) { - tools.AssertTrue(s.lbType == LBTypeNone, "StartAsFrontend fail, lbType is not LBTypeNone") - s.lbType = LBTypeBackend - s.frontendAppId = frontendAppId - var addr string - if s.serviceBase.Config().Has("client_addr") { - _, port := tools.AddressSplit(s.serviceBase.Config().String("client_addr")) - addr = tools.AddressMerge(tools.GetOutboundIP().String(), port) - } - act := s.serviceBase.Actor() - act.AddTimer(time.Second*BAKCEND_REPORT_INTERVAL, -1, func(dt int64) { - act.Send(s.frontendAppId, &msg_inner.LoadBalanceReport{ - Rank: 0, - Address: addr, - }) - }) -} - -func (s *LoadBalanceManager) GetBestBackend() (addr, appId string) { - tools.AssertTrue(s.lbType == LBTypeFrontend, "GetBestBackend fail, lbType is not LBTypeFrontend") - if node, ok := s.backendMap[s.bestBackendAppId]; ok { - addr, appId = node.address, node.appId - } - return -} diff --git a/src/app/servers/internal/service_base/load_balance_api.go b/src/app/servers/internal/service_base/load_balance_api.go deleted file mode 100644 index 6561c15..0000000 --- a/src/app/servers/internal/service_base/load_balance_api.go +++ /dev/null @@ -1,29 +0,0 @@ -package service_base - -import ( - "app/internal/msg_inner" - "core/actor/actor_msg" -) - -func (s *LoadBalanceManager) initAPI() { - s.serviceBase.RegistMsg((*msg_inner.LoadBalanceReport)(nil), s.handLoadBalanceReport) -} - -func (s *LoadBalanceManager) handLoadBalanceReport(sourceId, data interface{}) { - appId := sourceId.(*actor_msg.ActorId).Id - msg := data.(*msg_inner.LoadBalanceReport) - if _, ok := s.backendMap[appId]; !ok { - s.backendMap[appId] = &LoadBalanceNode{ - appId: appId, - address: msg.Address, - rank: msg.Rank, - isAlive: true, - } - } else { - s.backendMap[appId].address = msg.Address - s.backendMap[appId].rank = msg.Rank - } - if s.bestBackendAppId == "" { - s.bestBackendAppId = appId - } -} diff --git a/src/app/servers/internal/service_base/prometheus.go b/src/app/servers/internal/service_base/prometheus.go deleted file mode 100644 index a01c2fc..0000000 --- a/src/app/servers/internal/service_base/prometheus.go +++ /dev/null @@ -1,47 +0,0 @@ -package service_base - -import ( - "core/abtime" - "core/prometheus" - "strconv" - "time" -) - -type Prometheus struct { - registry *prometheus.Prometheus - stype string - sid string - - handMsgNum *prometheus.CounterVec //客户端消息处理数量 - handMsgCost *prometheus.CounterVec //客户端消息处理耗时 - online *prometheus.GaugeVec //在线玩家数量 - battle_histogram *prometheus.HistogramVec //战斗耗时分布 -} - -func (this *Prometheus) init(registry *prometheus.Prometheus, stype string, sid int32) { - this.registry = registry - this.stype = stype - this.sid = strconv.Itoa(int(sid)) - subsystem := "service" - this.handMsgNum = this.registry.RegCounter(subsystem, "msg_num", []string{"stype", "sid", "msg"}) - this.handMsgCost = this.registry.RegCounter(subsystem, "msg_cost", []string{"stype", "sid", "msg"}) - this.online = this.registry.RegGauge(subsystem, "online", []string{"sid"}) - this.battle_histogram = this.registry.RegHistogram(subsystem, "battle_his", []string{"sid"}, []float64{2, 4, 8, 16, 32, 64, 256, 512, 1024, 2048, 4096}) -} - -func (this *Prometheus) RecordHandMsg(start time.Time, msg string) { - cost := abtime.Now().Sub(start) - if cost < 0 { - cost = 0 - } - this.handMsgNum.Inc(this.stype, this.sid, msg) - this.handMsgCost.Add(float64(cost), this.stype, this.sid, msg) -} - -func (this *Prometheus) RecordOnline(num int) { - this.online.Set(float64(num), this.sid) -} - -func (this *Prometheus) RecordBattle(t int64) { - this.battle_histogram.Observe(float64(t), this.sid) -} diff --git a/src/app/servers/internal/service_base/service_base.go b/src/app/servers/internal/service_base/service_base.go deleted file mode 100644 index 80befe0..0000000 --- a/src/app/servers/internal/service_base/service_base.go +++ /dev/null @@ -1,130 +0,0 @@ -package service_base - -import ( - "app/internal/iniconfig" - "app/internal/msg_inner" - "app/internal/msg_util" - "core/abtime" - "core/actor" - "core/dispatcher" - "net/http" - "time" -) - -func New(appType string, appId int32) IServiceBase { - service := &ServiceBase{ - appType: appType, - appId: appId, - config: iniconfig.NewAppConf(appType, appId), - prometheus: &Prometheus{}, - } - return service -} - -type IServiceBase interface { - ITimerManager - actor.IActorHandler - dispatcher.IDispatcher - IDBBase - - SID() int32 - SType() string - Config() *iniconfig.Config - LoginKey() string - - Parser() *msg_util.ProtoParser - RegistMsg(msg interface{}, f msg_util.MsgFun) - RegistReq(msg interface{}, f msg_util.ReqFun) - Prometheus() *Prometheus - RecordCost(handler http.HandlerFunc) http.HandlerFunc - DependOn(targetId interface{}, f func()) - - VirtualUser() IVirtualUserManager - LoadBalance() ILoadBalanceManager -} - -var _ IServiceBase = (*ServiceBase)(nil) // -type ServiceBase struct { - ITimerManager - actor.ActorHanlerBase //actor - dispatcher.Dispatcher //事件分发 - DBBase - - appType string - appId int32 - config *iniconfig.Config //game基础配置 - msgParser *msg_util.ProtoParser //协议解析器 - msgHandler *msg_util.MsgTypeHandler //actor消息处理 - prometheus *Prometheus //监控 - virtualUserMgr IVirtualUserManager //虚拟客户端 - loadBalanceMgr ILoadBalanceManager //负载均衡 -} - -func (s *ServiceBase) OnStart() error { - s.ITimerManager = NewTimerManager(s.Actor()) - s.DBBase.Init(s) - s.prometheus.init(s.Actor().Prometheus(), s.SType(), s.SID()) - s.msgParser = msg_util.NewProtoParser("message", "MSG_TYPE") - s.msgHandler = msg_util.NewMsgTypeHandler() - s.virtualUserMgr = NewVirtualUserManager().Init(s) - s.loadBalanceMgr = NewLoadBalanceManager().Init(s) - s.registDependOn() - return nil -} - -func (s *ServiceBase) OnStop() bool { - s.DBBase.Stop() - return true -} - -func (s *ServiceBase) registDependOn() { - s.msgHandler.RegistReq((*msg_inner.CheckAlive)(nil), func(requestId, msg interface{}) { - s.Actor().Response(requestId, msg) - }) -} - -func (s *ServiceBase) DependOn(targetId interface{}, f func()) { - var timerId int64 - s.Actor().Send(s.Actor().Id(), func() { - timerId = s.Actor().AddTimer(time.Second, -1, func(dt int64) { - if _, err := s.Actor().RequestWait(targetId, &msg_inner.CheckAlive{}); err == nil { - if timerId != 0 { //保证只执行一次 - s.Actor().CancelTimer(timerId) - timerId = 0 - f() - } - } - }) - }) -} - -func (s *ServiceBase) HandleMessage(sourceId, targetId, msg interface{}) { - defer s.Prometheus().RecordHandMsg(abtime.Now(), msg_util.MsgName(msg)) - s.msgHandler.HandleMsg(sourceId, msg) -} - -func (s *ServiceBase) HandleRequest(sourceId, targetId, requestId, msg interface{}) { - defer s.Prometheus().RecordHandMsg(abtime.Now(), msg_util.MsgName(msg)) - s.msgHandler.HandleReq(requestId, msg) -} - -func (s *ServiceBase) RegistMsg(msg interface{}, f msg_util.MsgFun) { s.msgHandler.RegistMsg(msg, f) } -func (s *ServiceBase) RegistReq(msg interface{}, f msg_util.ReqFun) { s.msgHandler.RegistReq(msg, f) } -func (s *ServiceBase) SID() int32 { return s.appId } -func (s *ServiceBase) SType() string { return s.appType } -func (s *ServiceBase) Config() *iniconfig.Config { return s.config } -func (s *ServiceBase) Prometheus() *Prometheus { return s.prometheus } -func (s *ServiceBase) VirtualUser() IVirtualUserManager { return s.virtualUserMgr } -func (s *ServiceBase) LoadBalance() ILoadBalanceManager { return s.loadBalanceMgr } -func (s *ServiceBase) Parser() *msg_util.ProtoParser { return s.msgParser } - -func (s *ServiceBase) LoginKey() string { - return s.config.MustString("login_key", "6^2f1onGbkK8iIW%vaC4b*2#oK4rwj&aOa%") -} - -func (s *ServiceBase) RecordCost(handler http.HandlerFunc) http.HandlerFunc { - return func(writer http.ResponseWriter, request *http.Request) { - defer s.Prometheus().RecordHandMsg(abtime.Now(), request.URL.String()) - handler(writer, request) - } -} diff --git a/src/app/servers/internal/service_base/timer.go b/src/app/servers/internal/service_base/timer.go deleted file mode 100644 index edfface..0000000 --- a/src/app/servers/internal/service_base/timer.go +++ /dev/null @@ -1,51 +0,0 @@ -package service_base - -import ( - "core/abtime" - "core/actor/timer" - "time" -) - -type ITimer interface { - CancelTimer(timerId int64) - AddTimer(interval time.Duration, times int32, callback timer.FuncCallback) int64 -} - -type ITimerManager interface { - AddTimer(interval time.Duration, trigger_times int32, callback timer.FuncCallback) int64 - AddScheduleTask(start time.Time, dur time.Duration, callback timer.FuncCallback) - CancelTimer(timerId int64) - ClearTimer() -} - -func NewTimerManager(timer ITimer) ITimerManager { - return &TimerManager{timer: timer, timerIds: make(map[int64]bool)} -} - -type TimerManager struct { - timer ITimer - timerIds map[int64]bool -} - -func (this *TimerManager) AddTimer(interval time.Duration, trigger_times int32, callback timer.FuncCallback) int64 { - timerId := this.timer.AddTimer(interval, trigger_times, callback) - this.timerIds[timerId] = true - return timerId -} - -// 周期性无限循环任务 -func (s *TimerManager) AddScheduleTask(start time.Time, dur time.Duration, callback timer.FuncCallback) { - first := start.Sub(abtime.Now()) - s.AddTimer(first, 1, func(dt int64) { callback(dt); s.AddTimer(dur, -1, callback) }) -} - -func (this *TimerManager) CancelTimer(timerId int64) { - this.timer.CancelTimer(timerId) - delete(this.timerIds, timerId) -} - -func (this *TimerManager) ClearTimer() { - for timerId := range this.timerIds { - this.CancelTimer(timerId) - } -} diff --git a/src/app/servers/internal/service_base/virtual_user.go b/src/app/servers/internal/service_base/virtual_user.go deleted file mode 100644 index 008793e..0000000 --- a/src/app/servers/internal/service_base/virtual_user.go +++ /dev/null @@ -1,124 +0,0 @@ -package service_base - -import ( - "app/internal/message" - "app/internal/msg_inner" - "app/internal/service" - "encoding/binary" - "google.golang.org/protobuf/proto" -) - -// 所有与客户端通信的actor,需要在本机注册角色的当前状态、注册gate等信息 -func NewVirtualUserManager() IVirtualUserManager { - return &VirtualUserManager{ - userMap: make(map[int64]*VirtualUser), - } -} - -type UserMsgRawFunc func(*msg_inner.VirtualUserMessage) -type UserMsgFunc func(rid int64, data interface{}) (message.MSG_RESULT, proto.Message) -type UserStatusFunc func(rid int64) - -var _ IVirtualUserManager = (*VirtualUserManager)(nil) //interface实现检查 -type IVirtualUserManager interface { - Init(serviceBase IServiceBase) IVirtualUserManager - Send2User(rid int64, msg interface{}) - BroadCast2User(sid int32, msg interface{}) - GroupCast2User(ridList []int64, msg interface{}) - RegistUserMsg(msg interface{}, f UserMsgFunc) - RegistUserMsgRaw(f UserMsgRawFunc) - RegistUserOnline(f UserStatusFunc) - RegistUserOffline(f UserStatusFunc) -} - -type VirtualUserManager struct { - serviceBase IServiceBase - - userMap map[int64]*VirtualUser //rid->user - msgHandler *VirtualUserHandler //user消息处理 - msgRawHandler UserMsgRawFunc //user未解析消息处理 - userStatusOnline UserStatusFunc //user上线消息 - userStatusOffline UserStatusFunc //user离线消息 -} - -type VirtualUser struct { - serviceBase IServiceBase - RID int64 - GID int32 -} - -func (s *VirtualUserManager) Init(serviceBase IServiceBase) IVirtualUserManager { - s.serviceBase = serviceBase - s.msgHandler = NewVirtualUserHandler(s) - - s.initAPI() - return s -} - -func (s *VirtualUserManager) BroadCast2User(sid int32, msg interface{}) { - if data := s.getMessageData(msg); data != nil { - s.serviceBase.Actor().Broadcast(service.Gate, &msg_inner.BroadCast2VirtualUser{ - SID: sid, - Data: data, - }) - } -} - -func (s *VirtualUserManager) GroupCast2User(ridList []int64, msg interface{}) { - groupCastMap := make(map[int32][]int64) //sid->ridList - if data := s.getMessageData(msg); data != nil { - for _, rid := range ridList { - if user, ok := s.userMap[rid]; ok { - groupCastMap[user.GID] = append(groupCastMap[user.GID], rid) - } - } - for gid, rids := range groupCastMap { - s.serviceBase.Actor().Send(service.GateId(gid), &msg_inner.GroupCast2VirtualUser{ - RIDList: rids, - Data: data, - }) - } - } -} - -func (s *VirtualUserManager) Send2User(rid int64, msg interface{}) { - if user, ok := s.userMap[rid]; ok { - if data := s.getMessageData(msg); data != nil { - s.serviceBase.Actor().Send(service.GateId(user.GID), &msg_inner.Send2VirtualUser{ - RID: user.RID, - Data: data, - }) - } - } -} - -func (s *VirtualUserManager) RegistUserMsg(msg interface{}, f UserMsgFunc) { - s.msgHandler.RegistMsg(msg, f) -} -func (s *VirtualUserManager) RegistUserMsgRaw(f UserMsgRawFunc) { - s.msgRawHandler = f -} -func (s *VirtualUserManager) RegistUserOnline(f UserStatusFunc) { - s.userStatusOnline = f -} -func (s *VirtualUserManager) RegistUserOffline(f UserStatusFunc) { - s.userStatusOffline = f -} - -func (s *VirtualUserManager) getMessageData(msg interface{}) []byte { - if message, ok := msg.(proto.Message); ok { - if msgId, ok2 := s.serviceBase.Parser().MsgToId(message); ok2 { - if payload, err := proto.Marshal(message); err == nil { - data := make([]byte, 6+len(payload)) - binary.BigEndian.PutUint32(data, uint32(len(payload)+6)) - binary.BigEndian.PutUint16(data[4:], uint16(msgId)) - copy(data[6:], payload) - return data - } - } - } - return nil -} -func (s *VirtualUserManager) onUserMessage(mgsId int32, rid int64, msg interface{}) { - s.msgHandler.HandleMessage(mgsId, rid, msg) -} diff --git a/src/app/servers/internal/service_base/virtual_user_api.go b/src/app/servers/internal/service_base/virtual_user_api.go deleted file mode 100644 index 9110b9e..0000000 --- a/src/app/servers/internal/service_base/virtual_user_api.go +++ /dev/null @@ -1,48 +0,0 @@ -package service_base - -import ( - "app/internal/msg_inner" - "core/log" -) - -func (s *VirtualUserManager) initAPI() { - s.serviceBase.RegistMsg((*msg_inner.VirtualUserCreate)(nil), s.handUserCreate) - s.serviceBase.RegistMsg((*msg_inner.VirtualUserDestroy)(nil), s.handUserDestroy) - s.serviceBase.RegistMsg((*msg_inner.VirtualUserMessage)(nil), s.handUserMessage) -} - -func (this *VirtualUserManager) handUserCreate(sourceId, data interface{}) { - msg := data.(*msg_inner.VirtualUserCreate) - if user, ok := this.userMap[msg.RID]; ok { - user.GID = msg.GID - } else { - this.userMap[msg.RID] = &VirtualUser{ - RID: msg.RID, - GID: msg.GID, - } - } - if this.userStatusOnline != nil { - this.userStatusOnline(msg.RID) - } -} - -func (this *VirtualUserManager) handUserDestroy(sourceId, data interface{}) { - msg := data.(*msg_inner.VirtualUserDestroy) - delete(this.userMap, msg.RID) - if this.userStatusOffline != nil { - this.userStatusOffline(msg.RID) - } -} - -func (this *VirtualUserManager) handUserMessage(sourceId, data interface{}) { - msg := data.(*msg_inner.VirtualUserMessage) - if this.msgRawHandler != nil { - this.msgRawHandler(msg) - } else { - if message, ok := this.serviceBase.Parser().Unmarshal(msg.MsgId, msg.Data); ok { - this.onUserMessage(msg.MsgId, msg.RID, message) - } else { - log.KV("MsgId", msg.MsgId).Error("VirtualUserMessage Unmarshal err") - } - } -} diff --git a/src/app/servers/internal/service_base/virtual_user_handler.go b/src/app/servers/internal/service_base/virtual_user_handler.go deleted file mode 100644 index 0d75a77..0000000 --- a/src/app/servers/internal/service_base/virtual_user_handler.go +++ /dev/null @@ -1,47 +0,0 @@ -package service_base - -import ( - "app/internal/message" - "core/actor/actor_msg" - "core/tools" - "google.golang.org/protobuf/proto" -) - -func NewVirtualUserHandler(mgr IVirtualUserManager) *VirtualUserHandler { - return &VirtualUserHandler{ - mgr: mgr, - msgMap: make(map[string]UserMsgFunc), - } -} - -type VirtualUserHandler struct { - mgr IVirtualUserManager - msgMap map[string]UserMsgFunc -} - -// 注册消息回调 -func (h *VirtualUserHandler) RegistMsg(msg interface{}, f UserMsgFunc) { - msgName := MsgName(msg) - _, ok := h.msgMap[msgName] - tools.AssertTrue(!ok, "regist repeated msg=%v", msgName) - h.msgMap[msgName] = f -} - -func (h *VirtualUserHandler) HandleMessage(msgId int32, rid int64, msg interface{}) bool { - msgName := MsgName(msg) - handler := h.msgMap[msgName] - tools.AssertTrue(handler != nil, "msg=%v not regist handler", msgName) - result, resultMsg := handler(rid, msg) - if resultMsg != nil { - data, err := proto.Marshal(resultMsg) - tools.AssertTrue(err == nil, "msg=%v Marshal err: %v", msgName, err) - h.mgr.Send2User(rid, &message.MessageResult{ - ProtoId: msgId, - Result: result, - Data: data, - }) - } - return true -} - -func MsgName(msg interface{}) string { return actor_msg.MsgName(msg) } diff --git a/src/app/servers/login/cmd.go b/src/app/servers/login/cmd.go deleted file mode 100644 index 57245d8..0000000 --- a/src/app/servers/login/cmd.go +++ /dev/null @@ -1,41 +0,0 @@ -package login - -import ( - "app/servers/login/model" - "core/log" - "core/tools" - "encoding/json" -) - -func (s *Login) initCmd() { - s.Actor().RegistCmd("game_info", s.cmdGameInfo) - s.Actor().RegistCmd("dev_login", s.cmdDevLogin) - s.Actor().RegistCmd("white_ip", s.cmdWhiteIP) -} - -func (s *Login) cmdGameInfo(param string) ([]byte, error) { - log.KV("param", param).Info("cmdGameInfo") - - games := []*model.GameServer{} - s.gameServerMgr.RangeServers(func(server *model.GameServer) (stop bool) { - games = append(games, server) - return true - }) - return json.Marshal(games) -} - -func (s *Login) cmdDevLogin(param string) ([]byte, error) { - log.KV("param", param).Info("cmdDevLogin") - - tools.AssertTrue(len(param) > 0, "param length error") - s.loginHandler.SetDevLogin(param) - return []byte("success"), nil -} - -func (s *Login) cmdWhiteIP(param string) ([]byte, error) { - log.KV("param", param).Info("cmdWhiteIP") - - tools.AssertTrue(len(param) > 0, "param length error") - s.userMgr.SetWhiteIP(param) - return []byte("success"), nil -} diff --git a/src/app/servers/login/logic/fathers/login.go b/src/app/servers/login/logic/fathers/login.go deleted file mode 100644 index fda8141..0000000 --- a/src/app/servers/login/logic/fathers/login.go +++ /dev/null @@ -1,12 +0,0 @@ -package fathers - -import ( - "app/servers/internal/service_base" -) - -type ILogin interface { - service_base.IServiceBase - Debug() bool - UserMgr() IUserManager - GameMgr() IGameManager -} diff --git a/src/app/servers/login/logic/fathers/mgr_game.go b/src/app/servers/login/logic/fathers/mgr_game.go deleted file mode 100644 index 8c7bd15..0000000 --- a/src/app/servers/login/logic/fathers/mgr_game.go +++ /dev/null @@ -1,14 +0,0 @@ -package fathers - -import ( - "app/servers/login/model" -) - -type IGameManager interface { - GetGameServer(sid int32) *model.GameServer - SelectGame(isWhite bool) *model.GameServer - RangeServers(fn func(server *model.GameServer) (stop bool)) - ABTestServer(abtest string) int32 - ABTestCDN(abtest string) string - RandABTest() string -} diff --git a/src/app/servers/login/logic/fathers/mgr_user.go b/src/app/servers/login/logic/fathers/mgr_user.go deleted file mode 100644 index 6020330..0000000 --- a/src/app/servers/login/logic/fathers/mgr_user.go +++ /dev/null @@ -1,28 +0,0 @@ -package fathers - -import ( - "app/servers/login/model" -) - -const AUDI_SID = 999 //审核服 -type IUserManager interface { - Login(passport string, ptype string, rid int64, version, ip, packageCode string) (*model.Role, *model.GameUser, *model.GameServer) - GetUser(passport string, ptype string) *model.GameUser - NewUser(passport, ptype string, ip string, abtest string) *model.GameUser - NewRole(passport, ptype string, ip string, sid int32) *model.Role - - //客户端审核版本号 - UpdateAudit(version string) - IsAudit(version string) bool - //白名单账号 - UpdateUserWhite(uid int64, white bool) - IsWhite(user *model.GameUser, ip string) bool - IsWhiteIP(ip string) bool - - UpdateUserSuper(uid int64, super bool) bool - UpdateUserBan(uid int64, deadline, bancode int64) bool - UpdateUserMute(uid int64, deadline int64) bool - GetUserRoleList(uid int64) []*model.Role - HasRoleBySID(uid int64, sid int32) bool - GetSID(rids []int64) []int32 -} diff --git a/src/app/servers/login/logic/fathers/sdk.go b/src/app/servers/login/logic/fathers/sdk.go deleted file mode 100644 index 42c4ee9..0000000 --- a/src/app/servers/login/logic/fathers/sdk.go +++ /dev/null @@ -1,5 +0,0 @@ -package fathers - -type ISDK interface { - Verify(passport string, ptype string, extra string) bool -} diff --git a/src/app/servers/login/logic/login/login.go b/src/app/servers/login/logic/login/login.go deleted file mode 100644 index 3a090db..0000000 --- a/src/app/servers/login/logic/login/login.go +++ /dev/null @@ -1,391 +0,0 @@ -package login - -import ( - "app/internal/service" - "app/servers/login/logic/fathers" - "app/servers/login/model" - "core/abtime" - "core/actor/actor_msg" - "core/goroutine" - "core/log" - "core/tools" - "net" - "net/http" - "sync" -) - -func New(login fathers.ILogin) *LoginHandler { - lh := &LoginHandler{ - login: login, - sdk: map[string]fathers.ISDK{}, - } - return lh -} - -type LoginHandler struct { - login fathers.ILogin - sdk map[string]fathers.ISDK - devLogin sync.Map -} - -func (this *LoginHandler) HttpToMainLoop(fn func()) { - var handler actor_msg.RequestWaitMsg = func(requestId interface{}) { - goroutine.Try(fn, nil) - this.login.Actor().Response(requestId, nil) - } - _, err := this.login.Actor().RequestWait(this.login.Actor().Id(), handler) - tools.AssertNil(err) -} - -func (this *LoginHandler) SetDevLogin(passport string) { - if _, ok := this.devLogin.Load(passport); ok { - this.devLogin.Delete(passport) - } else { - this.devLogin.Store(passport, true) - } - - passports := []string{} - this.devLogin.Range(func(key, value any) bool { - passports = append(passports, key.(string)) - return true - }) - log.KV("devlogin", passports).Info("devlogin list") -} - -func (this *LoginHandler) CanDevLogin(passport, ip string) bool { - if this.login.Debug() { - return true - } - _, ok := this.devLogin.Load(passport) - return ok || this.login.UserMgr().IsWhiteIP(ip) -} - -func (this *LoginHandler) HandLogin(w http.ResponseWriter, r *http.Request) { - type LoginReq struct { - Passport string //账号 - PassportType string //账号类型 - OS string //操作系统 - Version string //客户端版本号 - RID int64 //角色ID(0=由服务器分配) - Extra string //sdk额外数据 - PackageCode string //客户端包名 - Channels int32 //渠道 - DeviceModel string //设备类型 - TypeOfNetwork string //网络 - } - - type LoginResp struct { - Code int32 //成功码 - RID int64 //玩家RID - UID int64 //玩家UID - SID int32 //服务器Id - GameServerAddr string //服务器ip:port - GameServerAddrSource string //服务器ip:port - Mute int64 //禁言截止时间 - Ban int64 //封号截止时间 - BanCode int64 //封号的原因. - Super bool //是否GM账号 - Session string //登录session - Timestamp int64 //登录时间 - MaintainTime int64 //维护结束时间 - RoleCreateTime int64 //角色创建时间 - UserCreateTime int64 //账号创建时间 - White bool - UploadLog bool - RoleName string - RoleLevel int32 - } - - const ( - Success = iota - ReqErr //请求解析失败 - SDKErr //sdk验证失败 - PassportTypeUndefine //渠道未定义 - UserNotFind //用户未找到 - UserBan //封号 - Maintain //维护中 - CanNotDev //没有调试登录权限 - ) - - resp := &LoginResp{Code: ReqErr, Timestamp: abtime.Now().Unix()} - defer tools.HttpResponse(w, resp) - - req := &LoginReq{} - if _, ok := tools.HttpUnmarshalBody(r, req); !ok { - return - } - - ip, _, _ := net.SplitHostPort(r.RemoteAddr) - var ok bool - - sdk, ok := this.sdk[req.PassportType] - if !ok { - resp.Code = PassportTypeUndefine - return - } - - if !sdk.Verify(req.Passport, req.PassportType, req.Extra) && !this.CanDevLogin(req.Passport, ip) { - resp.Code = SDKErr - return - } - - this.HttpToMainLoop(func() { - role, user, game := this.login.UserMgr().Login(req.Passport, req.PassportType, req.RID, req.Version, ip, req.PackageCode) - if game == nil || game.Status == service.StatusClose { - resp.MaintainTime = abtime.Now().Unix() + 8*3600 - resp.Code = Maintain - return - } - - if game.Status < service.StatusOpen && !this.login.UserMgr().IsWhite(user, ip) { - resp.MaintainTime = game.Maintain() - resp.Code = Maintain - return - } - - if user == nil || role == nil { - resp.Code = UserNotFind - return - } - - if user.Ban > abtime.Now().Unix() { - resp.Code = UserBan - resp.BanCode = user.BanCode - return - } - - addr, _ := this.login.LoadBalance().GetBestBackend() - if addr == "" { - resp.MaintainTime = abtime.Now().Unix() + 8*3600 - resp.Code = Maintain - return - } - - resp.GameServerAddr = addr - resp.GameServerAddrSource = addr - - resp.RID = role.RID - resp.UID = user.UID - resp.Ban = user.Ban - resp.Mute = user.Mute - resp.Super = user.Super - resp.SID = role.SID - resp.Timestamp = role.LastLogin - resp.Session = user.LastSession - resp.UserCreateTime = user.CreatedAt - resp.RoleCreateTime = role.CreatedAt - resp.White = this.login.UserMgr().IsWhite(user, ip) - resp.UploadLog = false - resp.RoleName = role.Name - resp.RoleLevel = role.TownhallLv - - if user.IsNew { - user.IsNew = false - user.Update() - } - resp.Code = Success - }) -} - -func (this *LoginHandler) HandNewRole(w http.ResponseWriter, r *http.Request) { - type Req struct { - Passport string //账号 - PassportType string //账号类型 - SID int32 //指定服务器地址 - Session string //登录session - } - - type Resp struct { - Code int32 //成功码 - RID int64 //玩家RID - SID int32 //服务器Id - } - - const ( - Success = iota - ReqErr - CanNotDev - UserNotFind - UserBan - NeedLogin - GameIsFull - NewRoleFailed - ) - - resp := &Resp{Code: ReqErr} - defer tools.HttpResponse(w, resp) - - req := &Req{} - if _, ok := tools.HttpUnmarshalBody(r, req); !ok { - return - } - - ip, _, _ := net.SplitHostPort(r.RemoteAddr) - - this.HttpToMainLoop(func() { - user := this.login.UserMgr().GetUser(req.Passport, req.PassportType) - if user == nil { - resp.Code = UserNotFind - return - } - - if user.Ban > abtime.Now().Unix() { - resp.Code = UserBan - return - } - - if req.Session != user.LastSession { - resp.Code = NeedLogin - return - } - - game := this.login.GameMgr().GetGameServer(req.SID) - if game == nil || !game.CanNewRole(this.login.UserMgr().IsWhite(user, ip)) { - resp.Code = GameIsFull - return - } - - newRole := this.login.UserMgr().NewRole(req.Passport, req.PassportType, ip, req.SID) - if newRole == nil { - resp.Code = NewRoleFailed - return - } - - resp.RID = newRole.RID - resp.SID = newRole.SID - resp.Code = Success - }) -} - -func (this *LoginHandler) HandRoleList(w http.ResponseWriter, r *http.Request) { - type Req struct { - Passport string //账号 - PassportType string //账号类型 - Session string //登录session - } - - type Role struct { - RID int64 //角色Id - SID int32 //角色所在服 - Icon string //头像 - Name string //角色名 - League string //联盟短名字 - Power int64 //战力 - TownhallLv int32 //主城等级 - } - - type Resp struct { - Code int32 //成功码 - Roles []*Role //角色列表 - } - - const ( - Success = iota - ReqErr - UserNotFind - NeedLogin - CanNotDev - ) - - resp := &Resp{Code: ReqErr} - defer tools.HttpResponse(w, resp) - - req := &Req{} - if _, ok := tools.HttpUnmarshalBody(r, req); !ok { - return - } - - this.HttpToMainLoop(func() { - user := this.login.UserMgr().GetUser(req.Passport, req.PassportType) - if user == nil { - resp.Code = UserNotFind - return - } - - if req.Session != user.LastSession { - resp.Code = NeedLogin - return - } - - for _, role := range this.login.UserMgr().GetUserRoleList(user.UID) { - if user.ABTest == "" && role.SID > fathers.AUDI_SID && !user.Super { - continue - } - resp.Roles = append(resp.Roles, &Role{RID: role.RID, SID: role.SID, Icon: role.Icon, Name: role.Name, League: role.League, TownhallLv: role.TownhallLv, Power: role.Power}) - } - resp.Code = Success - }) -} - -func (this *LoginHandler) HandServerList(w http.ResponseWriter, r *http.Request) { - type Req struct { - Version string //客户端版本号 - Passport string //账号 - PassportType string //账号类型 - } - - type Server struct { - SID int32 - Name string - Status service.GameServerStatus - } - - type Resp struct { - Code int - Servers []*Server - } - - const ( - Success = iota - ReqErr - CanNotDev - UserNotFound - ) - - resp := &Resp{Code: ReqErr} - defer tools.HttpResponse(w, resp) - - req := &Req{} - if _, ok := tools.HttpUnmarshalBody(r, req); !ok { - return - } - - this.HttpToMainLoop(func() { - user := this.login.UserMgr().GetUser(req.Passport, req.PassportType) - if user == nil { - resp.Code = UserNotFound - return - } - - if user.Super { - this.login.GameMgr().RangeServers(func(server *model.GameServer) (stop bool) { - if server.Status > service.StatusClose { - resp.Servers = append(resp.Servers, &Server{SID: server.ServerId, Name: server.ServerName, Status: server.Status}) - } - return - }) - } else if this.login.UserMgr().IsAudit(req.Version) { - if server := this.login.GameMgr().GetGameServer(fathers.AUDI_SID); server != nil && server.Status > service.StatusClose { - resp.Servers = append(resp.Servers, &Server{SID: server.ServerId, Name: server.ServerName, Status: server.Status}) - } - } else if sid := this.login.GameMgr().ABTestServer(user.ABTest); sid > fathers.AUDI_SID { - if server := this.login.GameMgr().GetGameServer(sid); server != nil && server.Status > service.StatusClose { - resp.Servers = append(resp.Servers, &Server{SID: server.ServerId, Name: server.ServerName, Status: server.Status}) - } - } else { - this.login.GameMgr().RangeServers(func(server *model.GameServer) (stop bool) { - if server.Status > service.StatusClose && server.ServerId < fathers.AUDI_SID { - //hasS3 := this.login.UserMgr().HasRoleBySID(user.UID, 3) - //if hasS3 && server.ServerId == 3 { - // resp.Servers = append(resp.Servers, &Server{SID: server.ServerId, Name: server.ServerName, Status: server.Status}) - //} else if !hasS3 && server.ServerId != 3 { - // resp.Servers = append(resp.Servers, &Server{SID: server.ServerId, Name: server.ServerName, Status: server.Status}) - //} - resp.Servers = append(resp.Servers, &Server{SID: server.ServerId, Name: server.ServerName, Status: server.Status}) - } - return - }) - } - resp.Code = Success - }) -} diff --git a/src/app/servers/login/logic/mgr_game/mgr_game.go b/src/app/servers/login/logic/mgr_game/mgr_game.go deleted file mode 100644 index 79ae8ad..0000000 --- a/src/app/servers/login/logic/mgr_game/mgr_game.go +++ /dev/null @@ -1,137 +0,0 @@ -package mgr_game - -import ( - "app/internal/service" - "app/servers/login/logic/fathers" - "app/servers/login/model" - "core/log" - "core/tools" - "strings" - "sync" -) - -func New(login fathers.ILogin) *GameServerManager { - return &GameServerManager{ - login: login, - } -} - -type GameServerManager struct { - login fathers.ILogin - allGames sync.Map - recommendGames sync.Map - - abtests map[string]int32 - clientCDNs map[string]string - newABTests []string - newABTestNum int -} - -func (this *GameServerManager) Init() *GameServerManager { - tools.AssertNil(this.login.CreateTable(&model.GameServer{})) - data, err := this.login.PageLoad(&model.GameServer{}, nil) - tools.AssertNil(err) - gameservers := data.([]*model.GameServer) - if len(gameservers) == 0 { - testNew := &model.GameServer{ - ServerId: 1, - Status: service.StatusOpen, - MaxRoleNum: 1000, - } - this.allGames.Store(testNew.ServerId, testNew) - } else { - for _, game := range data.([]*model.GameServer) { - this.allGames.Store(game.ServerId, game) - if game.Recommend { - this.recommendGames.Store(game.ServerId, game) - } - } - } - this.initABTest() - return this -} - -func (this *GameServerManager) SelectGame(isWhite bool) (selectGame *model.GameServer) { - this.recommendGames.Range(func(key, value interface{}) bool { - game := value.(*model.GameServer) - if game.CanNewRole(isWhite) && game.ServerId < fathers.AUDI_SID { - selectGame = game - return false - } - return true - }) - - if selectGame != nil { - return - } - - this.allGames.Range(func(key, value interface{}) bool { - game := value.(*model.GameServer) - if game.CanNewRole(isWhite) && game.ServerId < fathers.AUDI_SID { - selectGame = game - return false - } - return true - }) - return -} - -func (this *GameServerManager) GetGameServer(sid int32) *model.GameServer { - gameServer, ok := this.allGames.Load(sid) - if !ok { - log.KV("sid", sid).WarnStack(1, "sid not find") - this.allGames.Range(func(key, value interface{}) bool { - log.KV("info", value).Warn("server info") - return true - }) - return nil - } - return gameServer.(*model.GameServer) -} - -func (this *GameServerManager) RangeServers(fn func(server *model.GameServer) (stop bool)) { - this.allGames.Range(func(key, value interface{}) bool { - if fn(value.(*model.GameServer)) { - return false - } - return true - }) -} - -func (this *GameServerManager) initABTest() { - this.abtests = map[string]int32{} - this.clientCDNs = map[string]string{} - abtests := this.login.Config().ChildSections() - for _, abtest := range abtests { - if strings.Index(abtest.Name(), "abtest") < 0 { - continue - } - - game_id := abtest.Key("game_id").MustInt(0) - name := abtest.Key("name").String() - this.clientCDNs[name] = abtest.Key("client_cdn").String() - if abtest.Key("new_user").MustBool(false) { - this.abtests[name] = int32(game_id) - this.newABTests = append(this.newABTests, name) - } else { - this.abtests[name] = int32(game_id) - } - } - log.KV("new_user", this.newABTests).KV("games", this.abtests).KV("cdn", this.clientCDNs).Info("init abtest") -} - -func (this *GameServerManager) ABTestServer(abtest string) int32 { - return this.abtests[abtest] -} - -func (this *GameServerManager) ABTestCDN(abtest string) string { - return this.clientCDNs[abtest] -} - -func (this *GameServerManager) RandABTest() string { - if l := len(this.newABTests); l > 0 { - this.newABTestNum++ - return this.newABTests[this.newABTestNum%l] - } - return "" -} diff --git a/src/app/servers/login/logic/mgr_user/mgr_user.go b/src/app/servers/login/logic/mgr_user/mgr_user.go deleted file mode 100644 index 0762873..0000000 --- a/src/app/servers/login/logic/mgr_user/mgr_user.go +++ /dev/null @@ -1,358 +0,0 @@ -package mgr_user - -import ( - "app/servers/internal/app_tools" - "sort" - "strings" - "sync" - - "app/servers/login/logic/fathers" - "app/servers/login/model" - "core/abtime" - "core/log" - "core/tools" -) - -func New(login fathers.ILogin) *UserManager { - mgr := &UserManager{ - login: login, - roles: map[int64]*model.Role{}, - users: map[int64]*model.GameUser{}, - passports: map[string]*model.Passport{}, - } - snode, err := tools.NewSnowflakeNode(int64(login.SID())) - tools.AssertNil(err) - mgr.uidCreator = snode - mgr.ridCreator = NewRIDCreator(login.SID()) - return mgr -} - -type UserManager struct { - login fathers.ILogin - roles map[int64]*model.Role - users map[int64]*model.GameUser - passports map[string]*model.Passport - auditVersion sync.Map //审核版本号 - uidCreator *tools.SnowflakeNode - ridCreator *RIDCreator - whiteIP sync.Map -} - -func (this *UserManager) Init() *UserManager { - tools.AssertNil(this.login.CreateTable(&model.GameUser{})) - - data, err := this.login.PageLoad(&model.GameUser{}, nil) - tools.AssertNil(err) - - datas := data.([]*model.GameUser) - for _, user := range datas { - this.users[user.UID] = user - } - - tools.AssertNil(this.login.CreateTable(&model.Role{})) - data, err = this.login.PageLoad(&model.Role{}, nil) - tools.AssertNil(err) - roleRows := data.([]*model.Role) - for _, role := range roleRows { - this.roles[role.RID] = role - this.ridCreator.Add(role.RID) - } - - tools.AssertNil(this.login.CreateTable(&model.Passport{})) - data, err = this.login.PageLoad(&model.Passport{}, nil) - tools.AssertNil(err) - passportRows := data.([]*model.Passport) - for _, passport := range passportRows { - key := app_tools.PassportMerge(passport.PID, passport.Type) - this.passports[key] = passport - } - - //if user := this.GetUser("703480445736910631", "goat"); user != nil && !user.Roles[2306541] { - // user.Super = true - // this.newRole("703480445736910631", "goat", "", 1, 2306541) - // this.newRole("703480445736910631", "goat", "", 1, 4699161) - // this.newRole("703480445736910631", "goat", "", 1, 6792871) - // this.newRole("703480445736910631", "goat", "", 1, 3054520) - // this.newRole("703480445736910631", "goat", "", 2, 5642957) - // this.ridCreator.Add(2306541) - // this.ridCreator.Add(4699161) - // this.ridCreator.Add(6792871) - // this.ridCreator.Add(3054520) - // this.ridCreator.Add(5642957) - //} - return this -} - -func (this *UserManager) GetUserRoleList(uid int64) []*model.Role { - user := this.users[uid] - if user == nil { - return nil - } - - var roles []*model.Role - for rid, _ := range user.Roles { - if role := this.getUserRole(user.UID, rid); role != nil { - roles = append(roles, role) - } - } - return roles -} - -func (this *UserManager) HasRoleBySID(uid int64, sid int32) bool { - user := this.users[uid] - if user == nil { - return false - } - for rid, _ := range user.Roles { - if role := this.getUserRole(user.UID, rid); role != nil { - if role.SID == sid { - return true - } - } - } - return false -} - -func (this *UserManager) getUserRole(uid int64, rid int64) *model.Role { - if uRole := this.roles[rid]; uRole != nil && uRole.UID == uid { - return uRole - } - return nil -} - -func (this *UserManager) SetWhiteIP(ip string) { - if _, ok := this.whiteIP.Load(ip); ok { - this.whiteIP.Delete(ip) - } else { - this.whiteIP.Store(ip, true) - } - - ips := []string{} - this.whiteIP.Range(func(key, value any) bool { - ips = append(ips, key.(string)) - return true - }) - log.KV("whiteip", ips).Info("whiteip list") -} - -func (this *UserManager) IsWhite(user *model.GameUser, ip string) bool { - return user.White || this.IsWhiteIP(ip) -} - -func (this *UserManager) IsWhiteIP(ip string) bool { - _, ok := this.whiteIP.Load(ip) - return ok -} - -func (this *UserManager) Login(passport string, ptype string, rid int64, version, ip, packageCode string) (role *model.Role, user *model.GameUser, game *model.GameServer) { - pport := this.passports[app_tools.PassportMerge(passport, ptype)] - if pport == nil { - user = this.NewUser(passport, ptype, ip, "") - } else { - user = this.users[pport.UID] - } - if user == nil { - log.KV("pport", passport).KV("ptype", ptype).Error("user is nil") - return - } - - role = this.getUserRole(user.UID, rid) - if lastRole := this.getUserRole(user.UID, user.LastLoginRID); role == nil && lastRole != nil { //没有选就用最近一次登录角色登录 - role = lastRole - } - - if this.IsAudit(version) { //审核包只能进审核服 - game = this.login.GameMgr().GetGameServer(fathers.AUDI_SID) - if role != nil && role.SID != fathers.AUDI_SID { - role = nil - for _, arole := range this.GetUserRoleList(user.UID) { - if arole.SID == fathers.AUDI_SID { - role = arole - break - } - } - } - } else if absid := this.login.GameMgr().ABTestServer(user.ABTest); absid > fathers.AUDI_SID { //abtest只能进abtest服 - game = this.login.GameMgr().GetGameServer(absid) - if role != nil && role.SID != absid { - role = nil - for _, abrole := range this.GetUserRoleList(user.UID) { - if abrole.SID == absid { - role = abrole - break - } - } - } - } else { - if role != nil && user.ABTest == "" && role.SID > fathers.AUDI_SID && !user.Super { - role = nil - } - - if role == nil { - roles := this.GetUserRoleList(user.UID) - sort.Slice(roles, func(i, j int) bool { return roles[i].TownhallLv > roles[j].TownhallLv }) - for _, has := range roles { - if user.ABTest == "" && has.SID > fathers.AUDI_SID && !user.Super { - continue - } - role = has - break - } - } - - if role != nil { - game = this.login.GameMgr().GetGameServer(role.SID) - } else { - game = this.login.GameMgr().SelectGame(this.login.UserMgr().IsWhite(user, ip)) - } - } - - if game == nil { - log.KV("pport", passport).KV("ptype", ptype).Error("game is nil") - return - } - - if role == nil { - if role = this.NewRole(passport, ptype, ip, game.ServerId); role == nil { - return - } - } - - user.LastLoginRID = role.RID - user.LastLogin = abtime.Now().Unix() - role.LastLogin = user.LastLogin - user.LastSession = app_tools.LoginSession(this.login.LoginKey(), role.SID, role.RID, user.UID, user.LastLogin, user.Mute, user.Ban, user.Super) - user.PackageCode = packageCode - user.Update() - role.Update() - log.KV("passport", passport).KV("ptype", ptype).KV("uid", user.UID).KV("rid", role.RID).KV("session", user.LastSession).Info("login success") - return -} - -func (this *UserManager) GetUser(passport string, ptype string) *model.GameUser { - pport := this.passports[app_tools.PassportMerge(passport, ptype)] - if pport != nil { - return this.users[pport.UID] - } - return nil -} - -func (this *UserManager) NewUser(passport, ptype string, ip string, abtest string) *model.GameUser { - newUser := model.NewUser(this.login, this.uidCreator.ID(), ip, abtest) - this.users[newUser.UID] = newUser - newUser.Update() - - newPassport := model.NewPassport(this.login, newUser.UID, passport, ptype, ip) - newPassport.Update() - this.passports[app_tools.PassportMerge(passport, ptype)] = newPassport - log.KV("pport", passport).KV("ptype", ptype).KV("uid", newUser.UID).KV("abtest", abtest).InfoStack(1, "NewUser") - return newUser -} - -func (this *UserManager) NewRole(passport, ptype string, ip string, sid int32) *model.Role { - return this.newRole(passport, ptype, ip, sid, this.ridCreator.ID(sid)) -} - -func (this *UserManager) newRole(passport, ptype string, ip string, sid int32, rid int64) *model.Role { - pport := this.passports[app_tools.PassportMerge(passport, ptype)] - tools.AssertTrue(pport != nil, "newrole pport=%v ptype=%v not find", passport, ptype) - - user := this.users[pport.UID] - tools.AssertTrue(user != nil, "newrole uid=%v not find", pport.UID) - - hasCount := 0 - for _, role := range this.GetUserRoleList(user.UID) { - if role.SID == sid { - hasCount++ - } - } - - const MaxRoleSameServer = 2 //同一账号单服最大角色数 - if hasCount >= MaxRoleSameServer && !user.Super { - log.KV("uid", user.UID).KV("sid", sid).KV("hasCount", hasCount).WarnStack(1, "has too many role") - user.LastLoginRID = 0 - return nil - } - - newRole := model.NewRole(this.login, user.UID, rid, sid, ip, user.ABTest) - newRole.Update() - - user.Roles[newRole.RID] = true - user.Update() - - this.roles[newRole.RID] = newRole - log.KV("passport", passport).KV("ptype", ptype).KV("sid", sid).KV("rid", newRole.RID).KV("uid", user.UID).InfoStack(1, "newrole") - return newRole -} - -// 封号/解封 -func (this *UserManager) UpdateUserBan(uid int64, deadline, bancode int64) bool { - user := this.users[uid] - tools.AssertTrue(user != nil, "uid=%v not find", uid) - user.Ban = deadline - user.BanCode = bancode - user.Update() - log.KV("uid", uid).KV("deadline", deadline).Info("UpdateUserBan success") - return true -} - -// 禁言/解禁 -func (this *UserManager) UpdateUserMute(uid int64, deadline int64) bool { - user := this.users[uid] - if user == nil { - log.KV("uid", uid).Warn("uid not find") - return false - } - - user.Mute = deadline - user.Update() - log.KV("uid", uid).KV("deadline", deadline).Info("UpdateUserMute success") - return true -} - -func (this *UserManager) UpdateUserSuper(uid int64, super bool) bool { - user := this.users[uid] - tools.AssertTrue(user != nil, "uid=%v not find", uid) - user.Super = super - user.Update() - log.KV("uid", uid).KV("super", super).Info("UpdateUserSuper success") - return true -} - -func (this *UserManager) UpdateUserWhite(uid int64, white bool) { - user := this.users[uid] - tools.AssertTrue(user != nil, "uid=%v not find", uid) - user.White = white - user.Update() - log.KV("uid", uid).KV("white", white).Info("UpdateUserWhite success") -} - -// todo 没有区分Android/ios -func (this *UserManager) UpdateAudit(version string) { - mp := sync.Map{} - for _, i := range strings.Split(version, "|") { - if len(i) > 0 { - mp.Store(i, true) - } - } - this.auditVersion = mp - return -} - -func (this *UserManager) IsAudit(version string) bool { - _, audit := this.auditVersion.Load(version) - return audit -} - -func (this *UserManager) GetSID(rids []int64) []int32 { - sids := make([]int32, 0) - for _, rid := range rids { - role := this.roles[rid] - if role != nil { - sids = append(sids, role.SID) - } else { - sids = append(sids, -1) - } - } - return sids -} diff --git a/src/app/servers/login/logic/mgr_user/rid.go b/src/app/servers/login/logic/mgr_user/rid.go deleted file mode 100644 index 2905973..0000000 --- a/src/app/servers/login/logic/mgr_user/rid.go +++ /dev/null @@ -1,43 +0,0 @@ -package mgr_user - -import "math/rand" - -const period = 1000000 //7位 -const array = 100 - -func NewRIDCreator(lsid int32) *RIDCreator { - creator := &RIDCreator{sids: make(map[int32]int64, 1024)} - for rid := int64(lsid * period); rid < int64(lsid*period*10); rid++ { - idx := rid % array - if creator.ids[idx] == nil { - creator.ids[idx] = make(map[int64]bool) - } - creator.ids[idx][rid] = true - } - return creator -} - -type RIDCreator struct { - ids [array]map[int64]bool - sids map[int32]int64 -} - -func (this *RIDCreator) Add(rid int64) { - idx := rid % array - if this.ids[idx] != nil { - delete(this.ids[idx], rid) - } -} - -func (this *RIDCreator) ID(sid int32) int64 { - for { - idx := rand.Intn(array) - for rid := range this.ids[idx] { - if this.sids[sid]%10 == rid%10 { - this.sids[sid]++ - this.Add(rid) - return rid - } - } - } -} diff --git a/src/app/servers/login/login.go b/src/app/servers/login/login.go deleted file mode 100644 index c00676d..0000000 --- a/src/app/servers/login/login.go +++ /dev/null @@ -1,94 +0,0 @@ -package login - -import ( - "app/internal/service" - "app/servers/internal/service_base" - "app/servers/login/logic/fathers" - "app/servers/login/logic/login" - "app/servers/login/logic/mgr_game" - "app/servers/login/logic/mgr_user" - "core/abtime" - "core/goroutine" - "core/log" - "core/tools" - "net/http" - "time" -) - -func NewLogin(appId int32) *Login { - return &Login{IServiceBase: service_base.New(service.Login, appId)} -} - -type Login struct { - service_base.IServiceBase - httpServ *http.Server - userMgr *mgr_user.UserManager - gameServerMgr *mgr_game.GameServerManager - loginHandler *login.LoginHandler - debug bool -} - -func (s *Login) Debug() bool { return s.debug } - -func (s *Login) OnStart() (err error) { - s.IServiceBase.OnStart() - - s.initCmd() - - s.debug = s.Config().MustBool("debug", false) - - s.init() - s.startHttp() - - s.LoadBalance().StartAsFrontend() - return nil -} - -// 返回false表示需要延迟处理,待可以退出时,game自己调用Suspend() -func (s *Login) OnStop() bool { - t1 := abtime.Now() - log.KV("actor", s.Actor().Id()).Info("login stop start") - defer func() { log.KV("cost", abtime.Now().Sub(t1)).KV("actor", s.Actor().Id()).Info("login stop over") }() - s.httpServ.Close() - return s.IServiceBase.OnStop() -} - -/*注意不要随意改变加载顺序*/ -func (s *Login) init() { - defer tools.TimeCostLog(abtime.Now(), 0, "login init over") - - s.loginHandler = login.New(s) - - s.userMgr = mgr_user.New(s).Init() - s.gameServerMgr = mgr_game.New(s).Init() - s.initAPI() -} - -func (s *Login) UserMgr() fathers.IUserManager { return s.userMgr } -func (s *Login) GameMgr() fathers.IGameManager { return s.gameServerMgr } - -func (s *Login) startHttp() { - addr := s.Config().String("client_addr") - s.httpServ = &http.Server{ - Addr: addr, - Handler: &tools.HttpHandler{ - HanderMap: map[string]http.Handler{ - "/login": s.RecordCost(s.loginHandler.HandLogin), //登录 - "/newrole": s.RecordCost(s.loginHandler.HandNewRole), //新建角色 - "/rolelist": s.RecordCost(s.loginHandler.HandRoleList), //账号列表 - "/serverlist": s.RecordCost(s.loginHandler.HandServerList), //服务器列表 - }, - }, - ReadTimeout: 3 * time.Second, - WriteTimeout: 3 * time.Second, - } - - goroutine.GoLogic(func() { - log.KV("addr", addr).Info("login http start") - err := s.httpServ.ListenAndServe() - if err != nil { - log.KV("addr", addr).KV("err", err).Info("login http stop") - } - s.Actor().SuspendStop() - }, nil) -} diff --git a/src/app/servers/login/login_api.go b/src/app/servers/login/login_api.go deleted file mode 100644 index d00a12e..0000000 --- a/src/app/servers/login/login_api.go +++ /dev/null @@ -1,5 +0,0 @@ -package login - -func (s *Login) initAPI() { - -} diff --git a/src/app/servers/login/model/game.go b/src/app/servers/login/model/game.go deleted file mode 100644 index b2e7817..0000000 --- a/src/app/servers/login/model/game.go +++ /dev/null @@ -1,49 +0,0 @@ -package model - -import ( - "app/internal/service" - "core/abtime" - "core/ormdb" -) - -type GameServer struct { - ormdb.DBObjBase `xorm:"extends"` - ServerId int32 `xorm:"unique index"` //服务器Id - ServerName string //服务器名字 - MaxRoleNum int32 //最大角色数 - Status service.GameServerStatus //服务器状态 - Recommend bool //是否推荐 - MaintainDeadline int64 //维护结束时间 - - Hearbeat int64 //心跳 - OnlineNum int32 //当前在线 - RoleNum int32 //注册数 -} - -func NewGameServer(saver ormdb.IQueSaver, sid int32) *GameServer { - result := &GameServer{ServerId: sid} - result.OnNewObj(saver, result) - return result -} - -func (this *GameServer) IsAlive() bool { - //const AliveHeart = 30 //x秒未收到心跳则表示失联 - //return abtime.Now().Unix()-this.Hearbeat < AliveHeart - return true -} - -func (this *GameServer) CanNewRole(isWhite bool) bool { - if isWhite { - return this.IsAlive() && this.Status >= service.StatusMaintain - } - return this.RoleNum < this.MaxRoleNum && this.IsAlive() && this.Status >= service.StatusOpen -} - -func (this *GameServer) Maintain() int64 { - if this.Status == service.StatusMaintain { - return this.MaintainDeadline - } else if this.Status == service.StatusClose { - return abtime.Now().Unix() + 8*3600 - } - return 0 -} diff --git a/src/app/servers/login/model/passport.go b/src/app/servers/login/model/passport.go deleted file mode 100644 index 3337520..0000000 --- a/src/app/servers/login/model/passport.go +++ /dev/null @@ -1,25 +0,0 @@ -package model - -import ( - "core/ormdb" -) - -// Passport 第三方登录账号 -type Passport struct { - ormdb.DBObjBase `xorm:"extends"` - Type string //账号类型 - PID string `xorm:"index"` //账号ID - UID int64 `xorm:"index"` //游戏内账号ID - CreateIP string //绑定时的客户端IP -} - -func NewPassport(saver ormdb.IQueSaver, uid int64, pid, ptype, ip string) *Passport { - result := &Passport{ - Type: ptype, - PID: pid, - UID: uid, - CreateIP: ip, - } - result.OnNewObj(saver, result) - return result -} diff --git a/src/app/servers/login/model/role.go b/src/app/servers/login/model/role.go deleted file mode 100644 index cf2e214..0000000 --- a/src/app/servers/login/model/role.go +++ /dev/null @@ -1,35 +0,0 @@ -package model - -import ( - "core/ormdb" - "fmt" -) - -// Role 单个服内角色 -type Role struct { - ormdb.DBObjBase `xorm:"extends"` - RID int64 `xorm:"unique index"` //角色Id - UID int64 `xorm:"index"` //游戏内账号ID - SID int32 //角色所在服 - Icon string //头像 - Name string `xorm:"index"` //角色名 - League string //联盟短名字 - Power int64 //战力 - TownhallLv int32 //主城等级 - LastLogin int64 //最近一次登录时间 - CreateIP string //创建IP - ABTest string //ab测试 -} - -func NewRole(saver ormdb.IQueSaver, uid, rid int64, sid int32, ip, abtest string) *Role { - result := &Role{ - RID: rid, - UID: uid, - SID: sid, - CreateIP: ip, - ABTest: abtest, - } - result.Name = fmt.Sprintf("Player%d", result.RID) - result.OnNewObj(saver, result) - return result -} diff --git a/src/app/servers/login/model/user.go b/src/app/servers/login/model/user.go deleted file mode 100644 index 57ccff9..0000000 --- a/src/app/servers/login/model/user.go +++ /dev/null @@ -1,42 +0,0 @@ -package model - -import ( - "core/abtime" - "core/ormdb" -) - -// 游戏内玩家 -type GameUser struct { - ormdb.DBObjBase `xorm:"extends"` - UID int64 `xorm:"unique index"` //游戏内账号ID - - Roles map[int64]bool //RID=>Role 一个玩家可以拥有多个角色(包含已删除RID) - LastLogin int64 //最近一次登录时间 - LastLoginRID int64 //最近一次登录RID - Mute int64 //禁言时间截止 - Ban int64 //封号时间截止 - BanCode int64 //封号原因 - Super bool //是否是超级玩家(GM) - White bool //是否是白名单玩家 - ABTest string //ab测试 - PackageCode string //客户端包名 - CreateIP string //绑定时的客户端IP - IsNew bool //是否是新账号 - LastSession string `json:"-" xorm:"-"` //最近一次登录Session -} - -func NewUser(saver ormdb.IQueSaver, uid int64, ip string, abtest string) *GameUser { - result := &GameUser{ - UID: uid, - Ban: 0, - Mute: 0, - Super: false, - Roles: map[int64]bool{}, - LastLogin: abtime.Now().Unix(), - CreateIP: ip, - ABTest: abtest, - IsNew: true, - } - result.OnNewObj(saver, result) - return result -} diff --git a/src/app/servers/robot/data/role.go b/src/app/servers/robot/data/role.go deleted file mode 100644 index 5faf0f1..0000000 --- a/src/app/servers/robot/data/role.go +++ /dev/null @@ -1,25 +0,0 @@ -package data - -import ( - "app/internal/message" -) - -type Role struct { - HasLogin bool - - RID int64 - UID int64 - Name string -} - -func NewRole() *Role { - return &Role{} -} - -func (role *Role) SyncLoginResult(msg *message.LoginResult) { - if msg.Result != message.MSG_RESULT_SUCCESS { - return - } - role.HasLogin = true - role.RID = msg.Role -} diff --git a/src/app/servers/robot/internal/client.go b/src/app/servers/robot/internal/client.go deleted file mode 100644 index 6926e37..0000000 --- a/src/app/servers/robot/internal/client.go +++ /dev/null @@ -1,93 +0,0 @@ -package internal - -import ( - "app/internal/iniconfig" - "app/internal/msg_util" - "app/servers/internal/app_tools" - "core/log" - "core/network" - "google.golang.org/protobuf/proto" -) - -func NewClient(conf *iniconfig.Config, account string, parser *msg_util.ProtoParser, initState IState, isCycle bool) *Client { - c := &Client{ - conf: conf, - paymentAddr: conf.String("payment"), - loginAddr: conf.String("login"), - goatLoginKey: conf.String("goat_key"), - account: account, - passport_type: conf.MustString("passport_type", app_tools.PassportTypeUUID), - msgCh: make(chan proto.Message, 64), - parser: parser, - isCycle: isCycle, - } - c.fsm = NewFsm(c, initState) - log.KV("account", account).Info("robot start") - return c -} - -type Client struct { - conf *iniconfig.Config - fsm *Fsm - - parser *msg_util.ProtoParser - msgCh chan proto.Message - gameConn network.INetClient - chatConn network.INetClient - - paymentAddr string - loginAddr string - gameAddr string - goatLoginKey string - - account string - passport_type string - sid int32 - uid int64 - rid int64 - isCycle bool -} - -func (this *Client) Config() *iniconfig.Config { return this.conf } -func (this *Client) GoatKey() string { return this.goatLoginKey } -func (this *Client) FixState() string { return this.conf.MustString("state_mode", "") } -func (this *Client) Parser() *msg_util.ProtoParser { return this.parser } -func (this *Client) PaymentAddr() string { return this.paymentAddr } -func (this *Client) LoginAddr() string { return this.loginAddr } -func (this *Client) GameAddr() string { return this.gameAddr } -func (this *Client) Account() string { return this.account } -func (this *Client) PassportType() string { return this.passport_type } -func (this *Client) SID() int32 { return this.sid } -func (this *Client) UpdateLoginInfo(gameAddr string, gameConn network.INetClient, sid int32, uid int64, rid int64) { - this.gameAddr = gameAddr - this.rid = rid - this.uid = uid - this.sid = sid - this.gameConn = gameConn -} - -func (this *Client) recvMsg(pbmsg proto.Message) { this.msgCh <- pbmsg } - -func (this *Client) Send2Game(msg proto.Message) { - if conn := this.gameConn; conn != nil { - conn.SendMsg(msg) - } -} -func (this *Client) Send2Chat(msg proto.Message) { - if conn := this.chatConn; conn != nil { - conn.SendMsg(msg) - } -} - -func (this *Client) Stop() { - if conn := this.gameConn; conn != nil { - this.gameConn = nil - conn.Stop() - } - - if conn := this.chatConn; conn != nil { - this.chatConn = nil - conn.Stop() - } - this.fsm.Stop() -} diff --git a/src/app/servers/robot/internal/fsm.go b/src/app/servers/robot/internal/fsm.go deleted file mode 100644 index 3a388dc..0000000 --- a/src/app/servers/robot/internal/fsm.go +++ /dev/null @@ -1,129 +0,0 @@ -package internal - -import ( - "app/internal/message" - "app/internal/msg_util" - "app/servers/robot/data" - "core/abtime" - "core/goroutine" - "core/log" - "google.golang.org/protobuf/proto" - "reflect" - "sync" - "time" -) - -func NewFsm(c *Client, initState IState) *Fsm { - f := &Fsm{ - role: data.NewRole(), - states: make(map[reflect.Type]IState), - initState: initState, - msgDispatcher: make(map[string][]StateHandler), - client: c, - closec: make(chan struct{}), - } - - for ptrType := range _states { - f.regist(ptrType) - } - - goroutine.GoLogic(func() { - f.RegistMsgHandler((*message.Pong)(nil), f.handPong) - f.SwtichToState(f.initState) - f.start(c.msgCh) - }, nil) - return f -} - -type Fsm struct { - role *data.Role - curState IState - initState IState - states map[reflect.Type]IState //stateT->state - msgDispatcher map[string][]StateHandler //msgName->handlers - client *Client - closec chan struct{} - closeOnce sync.Once -} - -func (this *Fsm) regist(stateType reflect.Type) { - statePtr := reflect.New(stateType.Elem()).Interface().(IState) - this.states[stateType] = statePtr - statePtr.init(this) - statePtr.Init() -} - -func (this *Fsm) start(msgCh <-chan proto.Message) { - ticker := time.NewTicker(time.Second) - defer ticker.Stop() -loop: - for { - select { - case <-this.closec: - break loop - case <-ticker.C: - goroutine.Try(this.update, nil) - case msg := <-msgCh: - goroutine.Try(func() { this.dispatchMsg(msg) }, nil) - } - } - this.Stop() -} - -func (this *Fsm) dispatchMsg(msg proto.Message) { - if handlers, ok := this.msgDispatcher["*"]; ok { - for _, handler := range handlers { - handler(msg) - } - } - - msgName := msg_util.MsgName(msg) - if handlers, ok := this.msgDispatcher[msgName]; ok { - for _, handler := range handlers { - handler(msg) - } - } else { - log.KV("msg_name", msg_util.MsgName(msg)).Debug("not hand msg") - } -} - -func (this *Fsm) update() { - this.curState.OnUpdate() - //log.KV("state", reflect.TypeOf(this.curState).Elem().Name()).Debug("fsm state update") - this.client.Send2Game(&message.Ping{ClientTime: abtime.Now().UnixNano()}) -} - -func (this *Fsm) SwtichToState(statePtr IState, params ...interface{}) { - stateType := reflect.TypeOf(statePtr) - state, ok := this.states[stateType] - if !ok { - log.KV("state", stateType.Elem().Name()).Error("SwtichToState not regist") - return - } - if this.curState != nil { - this.curState.OnExit() - } - this.curState = state - state.OnEnter(params...) - log.KV("account", this.client.account).KV("state", stateType.Elem().Name()).Info("SwtichToState") -} - -func (this *Fsm) Stop() { - this.closeOnce.Do(func() { close(this.closec) }) -} - -func (this *Fsm) RegistMsgHandler(msg interface{}, hander StateHandler) { - msgName := msg_util.MsgName(msg) - this.msgDispatcher[msgName] = append(this.msgDispatcher[msgName], hander) -} - -func (this *Fsm) GetState(statePtr IState) IState { - stateType := reflect.TypeOf(statePtr) - return this.states[stateType] -} - -func (this *Fsm) handPong(msg proto.Message) { - //resp := msg.(*message.S2CPong) - //cost := abtime.Now().UnixNano() - resp.ClientTime - //log.KV("rtt", cost).Debug("StateHome handPingResult") -} diff --git a/src/app/servers/robot/internal/handler.go b/src/app/servers/robot/internal/handler.go deleted file mode 100644 index 6761ae7..0000000 --- a/src/app/servers/robot/internal/handler.go +++ /dev/null @@ -1,49 +0,0 @@ -package internal - -import ( - "app/internal/message" - "core/log" - "core/network" - "fmt" - "google.golang.org/protobuf/proto" - "time" -) - -type StateHandler func(msg proto.Message) - -func NewGameHandler(client *Client) *GameHandler { return &GameHandler{client: client} } - -type GameHandler struct { - network.BaseNetHandler - client *Client -} - -func (this *GameHandler) OnSessionCreated() {} -func (this *GameHandler) OnSessionClosed() { - log.KV("account", this.client.account).Info("robot stop") - this.client.Stop() - if !this.client.isCycle { - time.Sleep(time.Second * 2) - NewClient(this.client.conf, this.client.account, this.client.parser, this.client.fsm.initState, false) - } -} - -func (this *GameHandler) OnRecv(msgId int32, msg interface{}) { - if res, ok := msg.(*message.NotifyKickOut); ok { - log.KV("account", this.client.account).KV("reason", res.Reason).Warn("client kick out") - this.client.Stop() - return - } - if res, ok := msg.(*message.MessageResult); ok { - if reqName, ok2 := this.client.Parser().MsgIdToName(res.ProtoId); ok2 { - if res.Data != nil { - respName := fmt.Sprintf("%sResult", reqName) - if msgData, ok3 := this.client.Parser().UnmarshalByName(respName, res.Data); ok3 { - this.client.recvMsg(msgData) - } - } - } - return - } - this.client.recvMsg(msg.(proto.Message)) -} diff --git a/src/app/servers/robot/internal/random.go b/src/app/servers/robot/internal/random.go deleted file mode 100644 index 71d961d..0000000 --- a/src/app/servers/robot/internal/random.go +++ /dev/null @@ -1,50 +0,0 @@ -package internal - -import ( - "app/internal/message" - "app/servers/internal/worldmap" - "math/rand" -) - -func RandomPick(count int) int { - indexList := make([]int, count) - for i := 0; i < count; i++ { - indexList[i] = i - } - Shuffle(indexList) - return indexList[0] -} -func RandomSample(count int, pickCount int) []int { - if count == 0 { - return nil - } - if pickCount > count { - pickCount = count - } - indexList := make([]int, count) - for i := 0; i < count; i++ { - indexList[i] = i - } - Shuffle(indexList) - return indexList[:pickCount] -} -func Shuffle(indexList []int) { - rand.Shuffle(len(indexList), func(i, j int) { indexList[i], indexList[j] = indexList[j], indexList[i] }) -} - -func RandPos() *message.Vector { - return &message.Vector{ - X: float64(rand.Intn(worldmap.WORLD_MAP_SIZE)), - Y: float64(rand.Intn(worldmap.WORLD_MAP_SIZE)), - } -} -func RandPosValue() int32 { - return int32(rand.Intn(worldmap.WORLD_MAP_SIZE)) -} -func RandRadius() float64 { - return rand.Float64() * 30 //[0,30) -} - -func Roll(chance float64) bool { - return rand.Float64() < chance -} diff --git a/src/app/servers/robot/internal/state.go b/src/app/servers/robot/internal/state.go deleted file mode 100644 index bfbf1da..0000000 --- a/src/app/servers/robot/internal/state.go +++ /dev/null @@ -1,95 +0,0 @@ -package internal - -import ( - "app/servers/robot/data" - "core/goroutine" - "core/tools" - "google.golang.org/protobuf/proto" - "reflect" - "strings" -) - -type IState interface { - init(fsm *Fsm) - Init() - - OnEnter(params ...interface{}) - OnExit() - OnUpdate() -} - -type BaseState struct { - role *data.Role - fsm *Fsm - client *Client - sendF []func() //待执行队列 -} - -func (this *BaseState) Role() *data.Role { return this.role } -func (this *BaseState) Client() *Client { return this.client } - -func (this *BaseState) init(fsm *Fsm) { - this.role = fsm.role - this.fsm = fsm - this.client = fsm.client -} - -func (this *BaseState) OnUpdate() { - if len(this.sendF) <= 0 { - this.SwtichToState(this.fsm.initState, nil) - } else { - goroutine.Try(this.sendF[0], nil) - this.sendF = this.sendF[1:] - } -} - -func (this *BaseState) AppendFunc(fns ...func()) { - for _, fn := range fns { - this.sendF = append(this.sendF, fn) - } -} - -func (this *BaseState) GetState(statePtr IState) IState { - return this.fsm.GetState(statePtr) -} - -func (this *BaseState) SwtichToState(statePtr IState, params ...interface{}) { - this.fsm.SwtichToState(statePtr, params...) -} - -func (this *BaseState) Send2Game(msg proto.Message) { - this.client.Send2Game(msg) -} - -func (this *BaseState) Send2Chat(msg proto.Message) { - this.client.Send2Chat(msg) -} - -func (this *BaseState) RegistMsgHandler(msg interface{}, hander StateHandler) { - this.fsm.RegistMsgHandler(msg, hander) -} -func (this *BaseState) Void(msg proto.Message) {} - -var _states = map[reflect.Type]IState{} -var _stateNames = map[string]IState{} - -func RegistState(statePtr IState) bool { - stateType := reflect.TypeOf(statePtr) - tools.AssertTrue(stateType.Kind() == reflect.Ptr, stateType.Name()) - - name := strings.ToLower(stateType.Elem().Name()) - - _, ok := _stateNames[name] - tools.AssertTrue(!ok, name) - - _stateNames[name] = statePtr - _states[stateType] = statePtr - return false -} - -func FindState(name string) IState { - if s, ok := _stateNames[strings.ToLower(name)]; ok { - return s - } - return nil -} diff --git a/src/app/servers/robot/internal/webcmd.go b/src/app/servers/robot/internal/webcmd.go deleted file mode 100644 index 763a1d4..0000000 --- a/src/app/servers/robot/internal/webcmd.go +++ /dev/null @@ -1,114 +0,0 @@ -package internal - -import ( - "bytes" - "core/log" - "encoding/json" - "fmt" - "io/ioutil" - "net/http" - "net/http/cookiejar" -) - -const ( - WEB_ADDR = "192.168.0.37:8100" - WEB_USER = "admin" - WEB_PWD = "admin123" -) - -type WebSession struct { - addr string - user string - pwd string - client *http.Client - token string -} -type CommonResp struct { - Code int "json:code" -} -type LoginResp struct { - Code int "json:code" - Msg LoginRespMsg "json:msg" -} -type LoginRespMsg struct { - Token string "json:token" -} - -var session *WebSession - -func getSession() *WebSession { - if session == nil { - jar, _ := cookiejar.New(nil) - session = &WebSession{ - WEB_ADDR, WEB_USER, WEB_PWD, &http.Client{Jar: jar}, "", - } - } - return session -} - -// 返回是否登录成功 -func (s *WebSession) login() bool { - values := map[string]string{"account": s.user, "pwd": s.pwd} - resp := s.cmd("/api/login", values) - if resp == nil { - return false - } - ret := &LoginResp{} - err := json.Unmarshal(resp, ret) - if err != nil { - s.token = ret.Msg.Token - return ret.Code == 0 - } else { - return false - } -} -func (s *WebSession) cmd(cmd string, values interface{}) []byte { - jsonValue, e1 := json.Marshal(values) - if e1 != nil { - log.KV("err", e1).Warn("json marshal err") - return nil - } - req, e2 := http.NewRequest("POST", fmt.Sprintf("http://%s%s", s.addr, cmd), bytes.NewBuffer(jsonValue)) - if e2 != nil { - log.KV("err", e2).Warn("http request create err") - return nil - } - req.Header.Set("accesstoken", s.token) - req.Header.Set("Content-Type", "application/json") - resp, e3 := s.client.Do(req) - if e3 != nil { - log.KV("err", e3).Warn("http request err") - return nil - } - respData, e4 := ioutil.ReadAll(resp.Body) - if e4 != nil { - log.KV("err", e4).Warn("http read response err") - return nil - } - e5 := resp.Body.Close() - if e5 != nil { - log.KV("err", e5).Warn("http response io close err") - return nil - } - respJson := &CommonResp{} - e6 := json.Unmarshal(respData, respJson) - if e6 != nil { - log.KV("err", e6).Warn("json unmarshal io err") - return nil - } - if respJson.Code == 1002 { //未登录 - isLoginOK := s.login() - if isLoginOK { - return s.cmd(cmd, values) - } else { - return nil - } - } - return respData -} - -// WebCmd 外部接口 -func WebCmd(cmd string, values interface{}) { - se := getSession() - se.cmd(cmd, values) -} diff --git a/src/app/servers/robot/robot.go b/src/app/servers/robot/robot.go deleted file mode 100644 index 1faaab3..0000000 --- a/src/app/servers/robot/robot.go +++ /dev/null @@ -1,86 +0,0 @@ -package robot - -import ( - "app/internal/service" - "app/servers/internal/service_base" - "app/servers/robot/internal" - "app/servers/robot/states" - "core/abtime" - "core/container/unsafe/ring_queue" - "core/log" - "core/tools" - "fmt" - "math/rand" - "time" -) - -func NewRobot(appId int32) *Robot { - return &Robot{IServiceBase: service_base.New(service.Robot, appId)} -} - -type Robot struct { - service_base.IServiceBase -} - -func (s *Robot) OnStart() (err error) { - states.InitStates() - s.IServiceBase.OnStart() - if s.Config().Int32("login_mode") == 0 { - s.startAll() - } else if s.Config().Int32("login_mode") == 1 { - s.startCycle() - } else if s.Config().Int32("login_mode") == 2 { - s.startOne() - } - return nil -} - -// 返回false表示需要延迟处理,待可以退出时,game自己调用Suspend() -func (s *Robot) OnStop() bool { - t1 := abtime.Now() - log.KV("actor", s.Actor().Id()).Info("robot stop start") - defer func() { log.KV("cost", abtime.Now().Sub(t1)).KV("actor", s.Actor().Id()).Info("robot stop over") }() - - return s.IServiceBase.OnStop() -} - -// 一次性登录所有 -func (s *Robot) startAll() { - defer tools.TimeCostLog(abtime.Now(), 0, "robot init over") - for idx := int32(0); idx < s.Config().Int32("count"); idx++ { - time.Sleep(time.Millisecond * time.Duration(rand.Intn(100))) - internal.NewClient(s.Config(), fmt.Sprintf("%s%d", s.Config().String("prefix"), idx), s.Parser(), (*states.StateHome)(nil), false) - } -} - -// 循环登录 -func (s *Robot) startCycle() { - idx := int64(0) - userList := ring_queue.NewQueue[*internal.Client]() - count := s.Config().Int64("count") - max_regist := s.Config().Int64("max_regist") - if count > max_regist { - count = max_regist - 1 - } - interval := s.Config().MustInt64("interval", 100) - - s.AddScheduleTask(abtime.Now(), time.Millisecond*time.Duration(interval), func(dt int64) { - if userList.Length() > int(count) { - userClient := userList.Pop() - if userClient != nil { - userClient.Stop() - } - } - client := internal.NewClient(s.Config(), fmt.Sprintf("%s%d", s.Config().String("prefix"), idx), s.Parser(), (*states.StateHome)(nil), true) - userList.Push(client) - idx++ - if idx >= max_regist { - idx = 0 - } - }) -} - -// 只登录一个 -func (s *Robot) startOne() { - internal.NewClient(s.Config(), s.Config().String("prefix"), s.Parser(), (*states.StateHome)(nil), false) -} diff --git a/src/app/servers/robot/states/init.go b/src/app/servers/robot/states/init.go deleted file mode 100644 index 9fa4d4d..0000000 --- a/src/app/servers/robot/states/init.go +++ /dev/null @@ -1,22 +0,0 @@ -package states - -import ( - "app/servers/robot/internal" - "sync" -) - -var allStates = [...]internal.IState{ - (*StateHome)(nil), - (*StateLogin)(nil), - (*StateDemo)(nil), -} - -var _initOnce sync.Once - -func InitStates() { - _initOnce.Do(func() { - for _, state := range allStates { - internal.RegistState(state) - } - }) -} diff --git a/src/app/servers/robot/states/state_demo.go b/src/app/servers/robot/states/state_demo.go deleted file mode 100644 index aed51b7..0000000 --- a/src/app/servers/robot/states/state_demo.go +++ /dev/null @@ -1,179 +0,0 @@ -package states - -import ( - "app/internal/message" - "app/servers/robot/internal" - "golang.org/x/exp/maps" - "google.golang.org/protobuf/proto" -) - -type StateDemo struct { - internal.BaseState - entityMap map[int64]*message.MapEntity - entityMapSelf map[int64]*message.MapEntity - gridListenMap map[int32]bool -} - -func (this *StateDemo) Init() { - this.entityMap = make(map[int64]*message.MapEntity) - this.entityMapSelf = make(map[int64]*message.MapEntity) - this.gridListenMap = make(map[int32]bool) - this.RegistMsgHandler((*message.NotifyMapEntityList)(nil), this.handNotifyMapEntityList) - this.RegistMsgHandler((*message.MapLookAtResult)(nil), this.handMapLookAtResult) - this.RegistMsgHandler((*message.NotifyMapBattleInfo)(nil), this.Void) - this.RegistMsgHandler((*message.NotifyMapMoveInfo)(nil), this.Void) - this.RegistMsgHandler((*message.NotifyMapHpInfo)(nil), this.Void) -} - -func (this *StateDemo) OnEnter(params ...interface{}) { - this.AppendFunc( - this.TestCreateMapEntity, - this.MapEntityMove, - this.MapEntityMoveTo, - //this.MapEntityStop, - //this.MapEntityReturn, - this.MapLookAt, - //this.MapRemoveLookAt, - ) - -} - -func (this *StateDemo) OnExit() {} - -func (this *StateDemo) TestCreateMapEntity() { - if internal.Roll(0.8) { - return - } - this.Send2Game(&message.TestCreateMapEntity{ - Pos: internal.RandPos(), - }) -} -func (this *StateDemo) MapEntityMove() { - if eid := this.PickEntitySelfIdle(); eid != 0 { - this.Send2Game(&message.MapEntityMove{ - EID: eid, - Pos: internal.RandPos(), - }) - } -} - -func (this *StateDemo) MapEntityMoveTo() { - if eid := this.PickEntitySelfIdle(); eid != 0 { - if eidTarget := this.PickEntityOther(); eidTarget != 0 { - this.Send2Game(&message.MapEntityMoveTo{ - EID: eid, - TargetEID: eidTarget, - }) - } - } -} -func (this *StateDemo) MapEntityStop() { - if eid := this.PickEntitySelf(); eid != 0 { - this.Send2Game(&message.MapEntityStop{ - EID: eid, - }) - } -} -func (this *StateDemo) MapEntityReturn() { - if eid := this.PickEntitySelf(); eid != 0 { - this.Send2Game(&message.MapEntityReturn{ - EID: eid, - }) - } -} -func (this *StateDemo) MapLookAt() { - maps.Clear(this.entityMapSelf) - maps.Clear(this.entityMap) - this.Send2Game(&message.MapLookAt{ - PosX: internal.RandPosValue(), - PosY: internal.RandPosValue(), - Width: 200, - Height: 100, - }) -} -func (this *StateDemo) MapRemoveLookAt() { - maps.Clear(this.entityMapSelf) - maps.Clear(this.entityMap) - if internal.Roll(0.2) { - this.Send2Game(&message.MapRemoveLookAt{}) - } -} -func (this *StateDemo) PickEntitySelfIdle() int64 { - var eidList []int64 - for _, entity := range this.entityMapSelf { - if entity.State == message.MAP_ENTITY_STATE_IDLE { - eidList = append(eidList, entity.EID) - } - } - if len(eidList) > 0 { - pickIndex := internal.RandomPick(len(eidList)) - return eidList[pickIndex] - } - return 0 -} -func (this *StateDemo) PickEntitySelf() int64 { - var eidList []int64 - for _, entity := range this.entityMapSelf { - eidList = append(eidList, entity.EID) - } - if len(eidList) > 0 { - pickIndex := internal.RandomPick(len(eidList)) - return eidList[pickIndex] - } - return 0 -} - -func (this *StateDemo) PickEntityOther() int64 { - var eidList []int64 - for _, entity := range this.entityMap { - if entity.RID != this.Role().RID { - eidList = append(eidList, entity.EID) - } - } - if len(eidList) > 0 { - pickIndex := internal.RandomPick(len(eidList)) - return eidList[pickIndex] - } - return 0 -} - -func (this *StateDemo) handTestCreateMapEntityResult(msg proto.Message) { - //resp := msg.(*message.TestCreateMapEntityResult) -} -func (this *StateDemo) handMapEntityMoveResult(msg proto.Message) { - //resp := msg.(*message.MapEntityMoveResult) -} -func (this *StateDemo) handNotifyMapEntityList(msg proto.Message) { - resp := msg.(*message.NotifyMapEntityList) - for _, entity := range resp.MapEntityList { - this.entityMap[entity.EID] = entity - if this.Role().RID == entity.RID { - this.entityMapSelf[entity.EID] = entity - } - } - for _, eid := range resp.MapEntityDelList { - this.delEntity(eid) - } - for _, cross := range resp.MapEntityCrossList { - if _, ok := this.gridListenMap[cross.GridId]; !ok { - this.delEntity(cross.EID) - } - } -} - -func (this *StateDemo) handMapLookAtResult(msg proto.Message) { - resp := msg.(*message.MapLookAtResult) - maps.Clear(this.gridListenMap) - for _, gridId := range resp.GridIdList { - this.gridListenMap[gridId] = true - } - for eid, entity := range this.entityMap { - if _, ok := this.gridListenMap[entity.GridId]; !ok { - this.delEntity(eid) - } - } -} -func (this *StateDemo) delEntity(eid int64) { - delete(this.entityMap, eid) - delete(this.entityMapSelf, eid) -} diff --git a/src/app/servers/robot/states/state_home.go b/src/app/servers/robot/states/state_home.go deleted file mode 100644 index 24d1322..0000000 --- a/src/app/servers/robot/states/state_home.go +++ /dev/null @@ -1,54 +0,0 @@ -package states - -import ( - "app/internal/message" - "app/servers/robot/internal" - "google.golang.org/protobuf/proto" - "math/rand" -) - -type StateHome struct { - internal.BaseState - hasLogin bool -} - -func (this *StateHome) Init() { - this.RegistMsgHandler("*", this.handAll) -} - -func (this *StateHome) OnEnter(params ...interface{}) { - if len(params) > 0 { - if _, ok := params[0].(*StateLogin); ok { - this.hasLogin = true - } - } - if !this.hasLogin { - this.SwtichToState((*StateLogin)(nil)) - } -} -func (this *StateHome) OnExit() {} - -func (this *StateHome) OnUpdate() { - name := this.Client().FixState() - if state := internal.FindState(name); state != nil { - this.SwtichToState(state, nil) - } else { - this.randState() - } -} - -func (this *StateHome) randState() { - state := allStates[rand.Intn(len(allStates))] - _, login := state.(*StateLogin) - _, home := state.(*StateHome) - if !login && !home { - this.SwtichToState(state, nil) - } -} - -func (this *StateHome) handAll(arg proto.Message) { - switch msg := arg.(type) { - case *message.LoginResult: - this.Role().SyncLoginResult(msg) - } -} diff --git a/src/app/servers/robot/states/state_login.go b/src/app/servers/robot/states/state_login.go deleted file mode 100644 index 0226282..0000000 --- a/src/app/servers/robot/states/state_login.go +++ /dev/null @@ -1,164 +0,0 @@ -package states - -import ( - "crypto/md5" - "encoding/hex" - "encoding/json" - "fmt" - "math/rand" - "time" - - "app/internal/message" - "app/internal/msg_util" - "app/servers/robot/internal" - "core/abtime" - "core/log" - "core/network" - "core/tools" - "google.golang.org/protobuf/proto" -) - -type StateLogin struct { - internal.BaseState - ip string -} - -func (this *StateLogin) Init() { - this.RegistMsgHandler((*message.LoginResult)(nil), this.handLoginResult) -} - -func (this *StateLogin) OnEnter(params ...interface{}) { - if !this.Login() { - time.Sleep(time.Second * 10) - this.SwtichToState((*StateLogin)(nil), nil) - } - if this.ip == "" { - this.ip = fmt.Sprintf("%d:%d:%d:%d", rand.Intn(255)+1, rand.Intn(255)+1, rand.Intn(255)+1, rand.Intn(255)+1) - } -} - -func (this *StateLogin) OnExit() {} -func (this *StateLogin) OnUpdate() {} - -func (this *StateLogin) Login() (ok bool) { - type LoginReq struct { - Passport string //账号 - PassportType string //账号类型 - OS string //操作系统 - Version string //客户端版本号 - RID int64 //角色ID(0=由服务器分配) - Extra string //sdk额外数据 - ClientIP string //客户端IP - } - - type LoginResp struct { - Code int32 //成功码 - RID int64 //玩家RID - UID int64 - SID int32 //服务器Id - GameServerAddr string //服务器ip:port - Mute int64 //禁言截止时间 - Ban int64 //封号截止时间 - Super bool //是否GM账号 - Session string //登录session - Timestamp int64 //登录时间 - MaintainTime int64 //维护结束时间 - } - - req := &LoginReq{ - Passport: this.Client().Account(), - PassportType: this.Client().PassportType(), - OS: "Android", - ClientIP: this.ip, - Extra: this.loginExtra(this.Client().Account()), - } - - reqData, _ := json.Marshal(req) - loginUrl := fmt.Sprintf("%s/login", this.Client().LoginAddr()) - respData, err := tools.HttpPost(loginUrl, reqData) - if err != nil { - log.KV("err", err).KV("url", loginUrl).KV("reqData", string(reqData)).KV("respData", string(respData)).Warn("login request") - return - } - - resp := &LoginResp{} - err = json.Unmarshal(respData, resp) - if err != nil { - log.KV("err", err).KV("resp", string(respData)).Warn("login resp json unmarshal failed") - return - } - - if resp.Code != 0 { - log.KV("code", resp.Code).KV("resp", string(respData)).Warn("login failed") - return - } - log.KV("account", this.Client().Account()).Info("StateLogin: login success") - - tcpClient := network.NewTcpClient(resp.GameServerAddr, - func() network.ICodec { return msg_util.NewProtoCodec(this.Client().Parser(), 0, false) }, - func() network.INetHandler { return internal.NewGameHandler(this.Client()) }, - ) - - if err := tcpClient.Connect(false); err != nil { - return - } - - this.Client().UpdateLoginInfo(resp.GameServerAddr, tcpClient, resp.SID, resp.UID, resp.RID) - - this.Send2Game(&message.Login{ - Session: resp.Session, - LoginTime: resp.Timestamp, - RID: resp.RID, - SID: resp.SID, - UID: resp.UID, - Mute: resp.Mute, - Ban: resp.Ban, - Super: resp.Super, - OS: "Android", - Language: "cn", - }) - return true -} - -func (this *StateLogin) handLoginResult(msg proto.Message) { - resp := msg.(*message.LoginResult) - if resp.Result != message.MSG_RESULT_SUCCESS { - log.KV("account", this.Client().Account()).KV("result", resp.Result).Warn("client login failed") - time.Sleep(time.Second * 2) - this.SwtichToState((*StateLogin)(nil), nil) - } else { - log.KV("account", this.Client().Account()).Info("handLoginResult") - this.SwtichToState((*StateHome)(nil), this) - } -} - -func (this *StateLogin) loginExtra(account string) string { - type Req struct { - //AliasID int `json:"aliasId"` - //Nick string `json:"nick"` - //Username string `json:"username"` - //Avatar string `json:"avatar"` - //Email string `json:"email"` - UserID string `json:"userId"` - //Create bool `json:"create"` - //Reset bool `json:"reset"` - //Bound bool `json:"bound"` - //UserType string `json:"userType"` - //Info interface{} `json:"info"` - //Token string `json:"token"` - Timestamp string `json:"timestamp"` - Sign string `json:"sign"` - } - - param := &Req{ - UserID: account, - Timestamp: tools.Itoa64(abtime.Now().Unix()), - } - - h := md5.New() - h.Write([]byte(this.Client().GoatKey() + param.UserID + param.Timestamp)) - b := h.Sum(nil) - param.Sign = hex.EncodeToString(b) - data, _ := json.Marshal(param) - return string(data) -} diff --git a/src/app/servers/role/logic/fathers/role.go b/src/app/servers/role/logic/fathers/role.go deleted file mode 100644 index ebec841..0000000 --- a/src/app/servers/role/logic/fathers/role.go +++ /dev/null @@ -1,9 +0,0 @@ -package fathers - -import ( - "app/servers/internal/service_base" -) - -type IRole interface { - service_base.IServiceBase -} diff --git a/src/app/servers/role/role.go b/src/app/servers/role/role.go deleted file mode 100644 index 431b6e0..0000000 --- a/src/app/servers/role/role.go +++ /dev/null @@ -1,47 +0,0 @@ -package role - -import ( - "app/internal/service" - "app/servers/internal/service_base" - "app/servers/role/logic/fathers" - "core/abtime" - "core/log" - "core/tools" -) - -func NewRole(appId int32) *Role { - return &Role{IServiceBase: service_base.New(service.Role, appId)} -} - -var _ fathers.IRole = (*Role)(nil) //interface实现检查 -type Role struct { - service_base.IServiceBase -} - -func (s *Role) OnStart() (err error) { - s.IServiceBase.OnStart() - s.init() - s.DependOn(service.RoleGateId(1), func() { - log.KV("sid", s.SID()).Info("Role DependOn OK") - s.LoadBalance().StartAsBackend(service.RoleGateId(1)) - }) - - return nil -} - -// 返回false表示需要延迟处理,待可以退出时,game自己调用Suspend() -func (s *Role) OnStop() bool { - t1 := abtime.Now() - log.KV("actor", s.Actor().Id()).Info("role stop start") - defer func() { log.KV("cost", abtime.Now().Sub(t1)).KV("actor", s.Actor().Id()).Info("role stop over") }() - - return s.IServiceBase.OnStop() -} - -/*注意不要随意改变加载顺序*/ -func (s *Role) init() { - defer tools.TimeCostLog(abtime.Now(), 0, "role init over") - s.initAPI() -} - -/////////////////////////////////各种getter///////////////////////////////// diff --git a/src/app/servers/role/role_api.go b/src/app/servers/role/role_api.go deleted file mode 100644 index 83c251f..0000000 --- a/src/app/servers/role/role_api.go +++ /dev/null @@ -1,5 +0,0 @@ -package role - -func (s *Role) initAPI() { - -} diff --git a/src/app/service/main/game_mgr/game_mgr.go b/src/app/service/main/game_mgr/game_mgr.go new file mode 100644 index 0000000..14d5142 --- /dev/null +++ b/src/app/service/main/game_mgr/game_mgr.go @@ -0,0 +1,85 @@ +package game_mgr + +import ( + "app/service/main/message/pb" + "app/service/main/msg_util" + "app/service/main/user" + "core/douyin" + "core/network" +) + +var APP_TOKEN_MAP = map[string]string{ + "ttaef8d84531c975bb10": "123", +} + +type GameMgr struct { + appMap map[string]douyin.IApp +} + +func NewGameMgr() *GameMgr { + return &GameMgr{} +} + +func (s *GameMgr) Run() error { + s.appMap = make(map[string]douyin.IApp) + + //for appId, appSecret := range APP_TOKEN_MAP { + // newApp := douyin.NewApp(appId, appSecret) + // s.appMap[appId] = newApp + // newApp.StartRefreshToken() + //} + + listener := network.NewTcpListener( + ":8888", + s.newParser, + s.newHandler) + + err := listener.Listen() + return err +} + +func (s *GameMgr) newParser() network.ICodec { + return msg_util.NewProtoCodec(msg_util.NewProtoParser("message", "MSG_TYPE"), 1024*64, false) +} + +func (s *GameMgr) newHandler() network.INetHandler { + return user.NewUser(s) +} + +func (s *GameMgr) Login(appId string, token string) (string, string, string, pb.ERROR_CODE) { + app, ok := s.appMap[appId] + if !ok { + return "", "", "", pb.ERROR_CODE_INVALID_APPID + } + roomId, uid, nickName, err := app.GetRoomId(token) + if err != nil { + return "", "", "", pb.ERROR_CODE_INVALID_TOKEN + } + return roomId, uid, nickName, pb.ERROR_CODE_SUCCESS +} + +func (s *GameMgr) StartTask(appId string, roomId string, msgType string) pb.ERROR_CODE { + app, ok := s.appMap[appId] + if !ok { + return pb.ERROR_CODE_INVALID_APPID + } + + _, err := app.StartTask(roomId, msgType) + if err != nil { + return pb.ERROR_CODE_FAIL + } + return pb.ERROR_CODE_SUCCESS +} + +func (s *GameMgr) StopTask(appId string, roomId string, msgType string) pb.ERROR_CODE { + app, ok := s.appMap[appId] + if !ok { + return pb.ERROR_CODE_INVALID_APPID + } + + _, err := app.StopTask(roomId, msgType) + if err != nil { + return pb.ERROR_CODE_FAIL + } + return pb.ERROR_CODE_SUCCESS +} diff --git a/src/app/service/main/game_mgr/handler_http.go b/src/app/service/main/game_mgr/handler_http.go new file mode 100644 index 0000000..42ee6f9 --- /dev/null +++ b/src/app/service/main/game_mgr/handler_http.go @@ -0,0 +1 @@ +package game_mgr diff --git a/src/app/service/main/in_obj/interface.go b/src/app/service/main/in_obj/interface.go new file mode 100644 index 0000000..589eae7 --- /dev/null +++ b/src/app/service/main/in_obj/interface.go @@ -0,0 +1,9 @@ +package in_obj + +import "app/service/main/message/pb" + +type IGameMgr interface { + Login(appId string, token string) (string, string, string, pb.ERROR_CODE) + StartTask(appId string, roomId string, msgType string) pb.ERROR_CODE + StopTask(appId string, roomId string, msgType string) pb.ERROR_CODE +} diff --git a/src/app/service/main/message/pb/common.pb.go b/src/app/service/main/message/pb/common.pb.go new file mode 100644 index 0000000..5aff1d9 --- /dev/null +++ b/src/app/service/main/message/pb/common.pb.go @@ -0,0 +1,1426 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.26.0 +// protoc (unknown) +// source: common.proto + +package pb + +import ( + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" +) + +import proto "google.golang.org/protobuf/proto" + +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 Login struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + AppId string `protobuf:"bytes,1,opt,name=AppId,json=appId,proto3" json:"AppId,omitempty"` + Token string `protobuf:"bytes,2,opt,name=Token,json=token,proto3" json:"Token,omitempty"` +} + +func (x *Login) Reset() { + *x = Login{} + if protoimpl.UnsafeEnabled { + mi := &file_common_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Login) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (x *Login) FromDB(data []byte) error { + return proto.Unmarshal(data, x) +} + +func (x *Login) ToDB() ([]byte, error) { + return proto.Marshal(x) +} + +func (*Login) ProtoMessage() {} + +func (x *Login) ProtoReflect() protoreflect.Message { + mi := &file_common_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 Login.ProtoReflect.Descriptor instead. +func (*Login) Descriptor() ([]byte, []int) { + return file_common_proto_rawDescGZIP(), []int{0} +} + +func (x *Login) GetAppId() string { + if x != nil { + return x.AppId + } + return "" +} + +func (x *Login) GetToken() string { + if x != nil { + return x.Token + } + return "" +} + +func (x *Login) SetAppId(val string) { + if x != nil { + x.AppId = val + } +} +func (x *Login) SetToken(val string) { + if x != nil { + x.Token = val + } +} + +type LoginResult struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Result ERROR_CODE `protobuf:"varint,1,opt,name=Result,json=result,proto3,enum=message.ERROR_CODE" json:"Result,omitempty"` + RoomId string `protobuf:"bytes,2,opt,name=RoomId,json=roomId,proto3" json:"RoomId,omitempty"` + UID string `protobuf:"bytes,3,opt,name=UID,json=uID,proto3" json:"UID,omitempty"` + NickName string `protobuf:"bytes,4,opt,name=NickName,json=nickName,proto3" json:"NickName,omitempty"` +} + +func (x *LoginResult) Reset() { + *x = LoginResult{} + if protoimpl.UnsafeEnabled { + mi := &file_common_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *LoginResult) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (x *LoginResult) FromDB(data []byte) error { + return proto.Unmarshal(data, x) +} + +func (x *LoginResult) ToDB() ([]byte, error) { + return proto.Marshal(x) +} + +func (*LoginResult) ProtoMessage() {} + +func (x *LoginResult) ProtoReflect() protoreflect.Message { + mi := &file_common_proto_msgTypes[1] + 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 LoginResult.ProtoReflect.Descriptor instead. +func (*LoginResult) Descriptor() ([]byte, []int) { + return file_common_proto_rawDescGZIP(), []int{1} +} + +func (x *LoginResult) GetResult() ERROR_CODE { + if x != nil { + return x.Result + } + return ERROR_CODE_SUCCESS +} + +func (x *LoginResult) GetRoomId() string { + if x != nil { + return x.RoomId + } + return "" +} + +func (x *LoginResult) GetUID() string { + if x != nil { + return x.UID + } + return "" +} + +func (x *LoginResult) GetNickName() string { + if x != nil { + return x.NickName + } + return "" +} + +func (x *LoginResult) SetResult(val ERROR_CODE) { + if x != nil { + x.Result = val + } +} +func (x *LoginResult) SetRoomId(val string) { + if x != nil { + x.RoomId = val + } +} +func (x *LoginResult) SetUID(val string) { + if x != nil { + x.UID = val + } +} +func (x *LoginResult) SetNickName(val string) { + if x != nil { + x.NickName = val + } +} + +type PlayStart struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *PlayStart) Reset() { + *x = PlayStart{} + if protoimpl.UnsafeEnabled { + mi := &file_common_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *PlayStart) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (x *PlayStart) FromDB(data []byte) error { + return proto.Unmarshal(data, x) +} + +func (x *PlayStart) ToDB() ([]byte, error) { + return proto.Marshal(x) +} + +func (*PlayStart) ProtoMessage() {} + +func (x *PlayStart) ProtoReflect() protoreflect.Message { + mi := &file_common_proto_msgTypes[2] + 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 PlayStart.ProtoReflect.Descriptor instead. +func (*PlayStart) Descriptor() ([]byte, []int) { + return file_common_proto_rawDescGZIP(), []int{2} +} + +type PlayStartResult struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Result ERROR_CODE `protobuf:"varint,1,opt,name=Result,json=result,proto3,enum=message.ERROR_CODE" json:"Result,omitempty"` +} + +func (x *PlayStartResult) Reset() { + *x = PlayStartResult{} + if protoimpl.UnsafeEnabled { + mi := &file_common_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *PlayStartResult) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (x *PlayStartResult) FromDB(data []byte) error { + return proto.Unmarshal(data, x) +} + +func (x *PlayStartResult) ToDB() ([]byte, error) { + return proto.Marshal(x) +} + +func (*PlayStartResult) ProtoMessage() {} + +func (x *PlayStartResult) ProtoReflect() protoreflect.Message { + mi := &file_common_proto_msgTypes[3] + 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 PlayStartResult.ProtoReflect.Descriptor instead. +func (*PlayStartResult) Descriptor() ([]byte, []int) { + return file_common_proto_rawDescGZIP(), []int{3} +} + +func (x *PlayStartResult) GetResult() ERROR_CODE { + if x != nil { + return x.Result + } + return ERROR_CODE_SUCCESS +} + +func (x *PlayStartResult) SetResult(val ERROR_CODE) { + if x != nil { + x.Result = val + } +} + +type PlayEnd struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *PlayEnd) Reset() { + *x = PlayEnd{} + if protoimpl.UnsafeEnabled { + mi := &file_common_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *PlayEnd) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (x *PlayEnd) FromDB(data []byte) error { + return proto.Unmarshal(data, x) +} + +func (x *PlayEnd) ToDB() ([]byte, error) { + return proto.Marshal(x) +} + +func (*PlayEnd) ProtoMessage() {} + +func (x *PlayEnd) ProtoReflect() protoreflect.Message { + mi := &file_common_proto_msgTypes[4] + 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 PlayEnd.ProtoReflect.Descriptor instead. +func (*PlayEnd) Descriptor() ([]byte, []int) { + return file_common_proto_rawDescGZIP(), []int{4} +} + +type PlayEndResult struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Result ERROR_CODE `protobuf:"varint,1,opt,name=Result,json=result,proto3,enum=message.ERROR_CODE" json:"Result,omitempty"` +} + +func (x *PlayEndResult) Reset() { + *x = PlayEndResult{} + if protoimpl.UnsafeEnabled { + mi := &file_common_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *PlayEndResult) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (x *PlayEndResult) FromDB(data []byte) error { + return proto.Unmarshal(data, x) +} + +func (x *PlayEndResult) ToDB() ([]byte, error) { + return proto.Marshal(x) +} + +func (*PlayEndResult) ProtoMessage() {} + +func (x *PlayEndResult) ProtoReflect() protoreflect.Message { + mi := &file_common_proto_msgTypes[5] + 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 PlayEndResult.ProtoReflect.Descriptor instead. +func (*PlayEndResult) Descriptor() ([]byte, []int) { + return file_common_proto_rawDescGZIP(), []int{5} +} + +func (x *PlayEndResult) GetResult() ERROR_CODE { + if x != nil { + return x.Result + } + return ERROR_CODE_SUCCESS +} + +func (x *PlayEndResult) SetResult(val ERROR_CODE) { + if x != nil { + x.Result = val + } +} + +type Report struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Info []*ReportInfo `protobuf:"bytes,1,rep,name=Info,json=info,proto3" json:"Info,omitempty"` +} + +func (x *Report) Reset() { + *x = Report{} + if protoimpl.UnsafeEnabled { + mi := &file_common_proto_msgTypes[6] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Report) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (x *Report) FromDB(data []byte) error { + return proto.Unmarshal(data, x) +} + +func (x *Report) ToDB() ([]byte, error) { + return proto.Marshal(x) +} + +func (*Report) ProtoMessage() {} + +func (x *Report) ProtoReflect() protoreflect.Message { + mi := &file_common_proto_msgTypes[6] + 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 Report.ProtoReflect.Descriptor instead. +func (*Report) Descriptor() ([]byte, []int) { + return file_common_proto_rawDescGZIP(), []int{6} +} + +func (x *Report) GetInfo() []*ReportInfo { + if x != nil { + return x.Info + } + return nil +} + +func (x *Report) SetInfo(val []*ReportInfo) { + if x != nil { + x.Info = val + } +} + +type ReportResult struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Result ERROR_CODE `protobuf:"varint,1,opt,name=Result,json=result,proto3,enum=message.ERROR_CODE" json:"Result,omitempty"` +} + +func (x *ReportResult) Reset() { + *x = ReportResult{} + if protoimpl.UnsafeEnabled { + mi := &file_common_proto_msgTypes[7] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ReportResult) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (x *ReportResult) FromDB(data []byte) error { + return proto.Unmarshal(data, x) +} + +func (x *ReportResult) ToDB() ([]byte, error) { + return proto.Marshal(x) +} + +func (*ReportResult) ProtoMessage() {} + +func (x *ReportResult) ProtoReflect() protoreflect.Message { + mi := &file_common_proto_msgTypes[7] + 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 ReportResult.ProtoReflect.Descriptor instead. +func (*ReportResult) Descriptor() ([]byte, []int) { + return file_common_proto_rawDescGZIP(), []int{7} +} + +func (x *ReportResult) GetResult() ERROR_CODE { + if x != nil { + return x.Result + } + return ERROR_CODE_SUCCESS +} + +func (x *ReportResult) SetResult(val ERROR_CODE) { + if x != nil { + x.Result = val + } +} + +type GetRank struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + TopCount int32 `protobuf:"varint,1,opt,name=TopCount,json=topCount,proto3" json:"TopCount,omitempty"` +} + +func (x *GetRank) Reset() { + *x = GetRank{} + if protoimpl.UnsafeEnabled { + mi := &file_common_proto_msgTypes[8] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GetRank) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (x *GetRank) FromDB(data []byte) error { + return proto.Unmarshal(data, x) +} + +func (x *GetRank) ToDB() ([]byte, error) { + return proto.Marshal(x) +} + +func (*GetRank) ProtoMessage() {} + +func (x *GetRank) ProtoReflect() protoreflect.Message { + mi := &file_common_proto_msgTypes[8] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetRank.ProtoReflect.Descriptor instead. +func (*GetRank) Descriptor() ([]byte, []int) { + return file_common_proto_rawDescGZIP(), []int{8} +} + +func (x *GetRank) GetTopCount() int32 { + if x != nil { + return x.TopCount + } + return 0 +} + +func (x *GetRank) SetTopCount(val int32) { + if x != nil { + x.TopCount = val + } +} + +type GetRankResult struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Result ERROR_CODE `protobuf:"varint,1,opt,name=Result,json=result,proto3,enum=message.ERROR_CODE" json:"Result,omitempty"` + Info []*ReportInfo `protobuf:"bytes,2,rep,name=Info,json=info,proto3" json:"Info,omitempty"` +} + +func (x *GetRankResult) Reset() { + *x = GetRankResult{} + if protoimpl.UnsafeEnabled { + mi := &file_common_proto_msgTypes[9] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GetRankResult) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (x *GetRankResult) FromDB(data []byte) error { + return proto.Unmarshal(data, x) +} + +func (x *GetRankResult) ToDB() ([]byte, error) { + return proto.Marshal(x) +} + +func (*GetRankResult) ProtoMessage() {} + +func (x *GetRankResult) ProtoReflect() protoreflect.Message { + mi := &file_common_proto_msgTypes[9] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetRankResult.ProtoReflect.Descriptor instead. +func (*GetRankResult) Descriptor() ([]byte, []int) { + return file_common_proto_rawDescGZIP(), []int{9} +} + +func (x *GetRankResult) GetResult() ERROR_CODE { + if x != nil { + return x.Result + } + return ERROR_CODE_SUCCESS +} + +func (x *GetRankResult) GetInfo() []*ReportInfo { + if x != nil { + return x.Info + } + return nil +} + +func (x *GetRankResult) SetResult(val ERROR_CODE) { + if x != nil { + x.Result = val + } +} +func (x *GetRankResult) SetInfo(val []*ReportInfo) { + if x != nil { + x.Info = val + } +} + +//新用户推送 +type NotifyNewAudience struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Audience *Audience `protobuf:"bytes,1,opt,name=Audience,json=audience,proto3" json:"Audience,omitempty"` +} + +func (x *NotifyNewAudience) Reset() { + *x = NotifyNewAudience{} + if protoimpl.UnsafeEnabled { + mi := &file_common_proto_msgTypes[10] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *NotifyNewAudience) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (x *NotifyNewAudience) FromDB(data []byte) error { + return proto.Unmarshal(data, x) +} + +func (x *NotifyNewAudience) ToDB() ([]byte, error) { + return proto.Marshal(x) +} + +func (*NotifyNewAudience) ProtoMessage() {} + +func (x *NotifyNewAudience) ProtoReflect() protoreflect.Message { + mi := &file_common_proto_msgTypes[10] + 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 NotifyNewAudience.ProtoReflect.Descriptor instead. +func (*NotifyNewAudience) Descriptor() ([]byte, []int) { + return file_common_proto_rawDescGZIP(), []int{10} +} + +func (x *NotifyNewAudience) GetAudience() *Audience { + if x != nil { + return x.Audience + } + return nil +} + +func (x *NotifyNewAudience) SetAudience(val *Audience) { + if x != nil { + x.Audience = val + } +} + +//用户行为推送 +type NotifyAudienceAction struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + OpenId string `protobuf:"bytes,1,opt,name=OpenId,json=openId,proto3" json:"OpenId,omitempty"` + Content string `protobuf:"bytes,2,opt,name=Content,json=content,proto3" json:"Content,omitempty"` //评论 + LikeNum int32 `protobuf:"varint,3,opt,name=LikeNum,json=likeNum,proto3" json:"LikeNum,omitempty"` //点赞数量 + GiftId string `protobuf:"bytes,4,opt,name=GiftId,json=giftId,proto3" json:"GiftId,omitempty"` //礼物ID + GiftNum int32 `protobuf:"varint,5,opt,name=GiftNum,json=giftNum,proto3" json:"GiftNum,omitempty"` //礼物数量 +} + +func (x *NotifyAudienceAction) Reset() { + *x = NotifyAudienceAction{} + if protoimpl.UnsafeEnabled { + mi := &file_common_proto_msgTypes[11] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *NotifyAudienceAction) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (x *NotifyAudienceAction) FromDB(data []byte) error { + return proto.Unmarshal(data, x) +} + +func (x *NotifyAudienceAction) ToDB() ([]byte, error) { + return proto.Marshal(x) +} + +func (*NotifyAudienceAction) ProtoMessage() {} + +func (x *NotifyAudienceAction) ProtoReflect() protoreflect.Message { + mi := &file_common_proto_msgTypes[11] + 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 NotifyAudienceAction.ProtoReflect.Descriptor instead. +func (*NotifyAudienceAction) Descriptor() ([]byte, []int) { + return file_common_proto_rawDescGZIP(), []int{11} +} + +func (x *NotifyAudienceAction) GetOpenId() string { + if x != nil { + return x.OpenId + } + return "" +} + +func (x *NotifyAudienceAction) GetContent() string { + if x != nil { + return x.Content + } + return "" +} + +func (x *NotifyAudienceAction) GetLikeNum() int32 { + if x != nil { + return x.LikeNum + } + return 0 +} + +func (x *NotifyAudienceAction) GetGiftId() string { + if x != nil { + return x.GiftId + } + return "" +} + +func (x *NotifyAudienceAction) GetGiftNum() int32 { + if x != nil { + return x.GiftNum + } + return 0 +} + +func (x *NotifyAudienceAction) SetOpenId(val string) { + if x != nil { + x.OpenId = val + } +} +func (x *NotifyAudienceAction) SetContent(val string) { + if x != nil { + x.Content = val + } +} +func (x *NotifyAudienceAction) SetLikeNum(val int32) { + if x != nil { + x.LikeNum = val + } +} +func (x *NotifyAudienceAction) SetGiftId(val string) { + if x != nil { + x.GiftId = val + } +} +func (x *NotifyAudienceAction) SetGiftNum(val int32) { + if x != nil { + x.GiftNum = val + } +} + +//分数信息 +type ReportInfo struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + OpenId string `protobuf:"bytes,1,opt,name=OpenId,json=openId,proto3" json:"OpenId,omitempty"` + Score int32 `protobuf:"varint,2,opt,name=Score,json=score,proto3" json:"Score,omitempty"` +} + +func (x *ReportInfo) Reset() { + *x = ReportInfo{} + if protoimpl.UnsafeEnabled { + mi := &file_common_proto_msgTypes[12] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ReportInfo) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (x *ReportInfo) FromDB(data []byte) error { + return proto.Unmarshal(data, x) +} + +func (x *ReportInfo) ToDB() ([]byte, error) { + return proto.Marshal(x) +} + +func (*ReportInfo) ProtoMessage() {} + +func (x *ReportInfo) ProtoReflect() protoreflect.Message { + mi := &file_common_proto_msgTypes[12] + 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 ReportInfo.ProtoReflect.Descriptor instead. +func (*ReportInfo) Descriptor() ([]byte, []int) { + return file_common_proto_rawDescGZIP(), []int{12} +} + +func (x *ReportInfo) GetOpenId() string { + if x != nil { + return x.OpenId + } + return "" +} + +func (x *ReportInfo) GetScore() int32 { + if x != nil { + return x.Score + } + return 0 +} + +func (x *ReportInfo) SetOpenId(val string) { + if x != nil { + x.OpenId = val + } +} +func (x *ReportInfo) SetScore(val int32) { + if x != nil { + x.Score = val + } +} + +//观众信息 +type Audience struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + OpenId string `protobuf:"bytes,1,opt,name=OpenId,json=openId,proto3" json:"OpenId,omitempty"` + NickName string `protobuf:"bytes,2,opt,name=NickName,json=nickName,proto3" json:"NickName,omitempty"` + AvatarUrl string `protobuf:"bytes,3,opt,name=AvatarUrl,json=avatarUrl,proto3" json:"AvatarUrl,omitempty"` +} + +func (x *Audience) Reset() { + *x = Audience{} + if protoimpl.UnsafeEnabled { + mi := &file_common_proto_msgTypes[13] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Audience) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (x *Audience) FromDB(data []byte) error { + return proto.Unmarshal(data, x) +} + +func (x *Audience) ToDB() ([]byte, error) { + return proto.Marshal(x) +} + +func (*Audience) ProtoMessage() {} + +func (x *Audience) ProtoReflect() protoreflect.Message { + mi := &file_common_proto_msgTypes[13] + 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 Audience.ProtoReflect.Descriptor instead. +func (*Audience) Descriptor() ([]byte, []int) { + return file_common_proto_rawDescGZIP(), []int{13} +} + +func (x *Audience) GetOpenId() string { + if x != nil { + return x.OpenId + } + return "" +} + +func (x *Audience) GetNickName() string { + if x != nil { + return x.NickName + } + return "" +} + +func (x *Audience) GetAvatarUrl() string { + if x != nil { + return x.AvatarUrl + } + return "" +} + +func (x *Audience) SetOpenId(val string) { + if x != nil { + x.OpenId = val + } +} +func (x *Audience) SetNickName(val string) { + if x != nil { + x.NickName = val + } +} +func (x *Audience) SetAvatarUrl(val string) { + if x != nil { + x.AvatarUrl = val + } +} + +//排名信息 +type RankInfo struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Audience *Audience `protobuf:"bytes,1,opt,name=Audience,json=audience,proto3" json:"Audience,omitempty"` //观众信息 + Rank int32 `protobuf:"varint,2,opt,name=Rank,json=rank,proto3" json:"Rank,omitempty"` //排名 + Score int32 `protobuf:"varint,3,opt,name=Score,json=score,proto3" json:"Score,omitempty"` //用户分数 +} + +func (x *RankInfo) Reset() { + *x = RankInfo{} + if protoimpl.UnsafeEnabled { + mi := &file_common_proto_msgTypes[14] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *RankInfo) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (x *RankInfo) FromDB(data []byte) error { + return proto.Unmarshal(data, x) +} + +func (x *RankInfo) ToDB() ([]byte, error) { + return proto.Marshal(x) +} + +func (*RankInfo) ProtoMessage() {} + +func (x *RankInfo) ProtoReflect() protoreflect.Message { + mi := &file_common_proto_msgTypes[14] + 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 RankInfo.ProtoReflect.Descriptor instead. +func (*RankInfo) Descriptor() ([]byte, []int) { + return file_common_proto_rawDescGZIP(), []int{14} +} + +func (x *RankInfo) GetAudience() *Audience { + if x != nil { + return x.Audience + } + return nil +} + +func (x *RankInfo) GetRank() int32 { + if x != nil { + return x.Rank + } + return 0 +} + +func (x *RankInfo) GetScore() int32 { + if x != nil { + return x.Score + } + return 0 +} + +func (x *RankInfo) SetAudience(val *Audience) { + if x != nil { + x.Audience = val + } +} +func (x *RankInfo) SetRank(val int32) { + if x != nil { + x.Rank = val + } +} +func (x *RankInfo) SetScore(val int32) { + if x != nil { + x.Score = val + } +} + +var File_common_proto protoreflect.FileDescriptor + +var file_common_proto_rawDesc = []byte{ + 0x0a, 0x0c, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x07, + 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x1a, 0x0d, 0x6d, 0x73, 0x67, 0x74, 0x79, 0x70, 0x65, + 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x33, 0x0a, 0x05, 0x4c, 0x6f, 0x67, 0x69, 0x6e, 0x12, + 0x14, 0x0a, 0x05, 0x41, 0x70, 0x70, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, + 0x61, 0x70, 0x70, 0x49, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x22, 0x80, 0x01, 0x0a, 0x0b, + 0x4c, 0x6f, 0x67, 0x69, 0x6e, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x12, 0x2b, 0x0a, 0x06, 0x52, + 0x65, 0x73, 0x75, 0x6c, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x13, 0x2e, 0x6d, 0x65, + 0x73, 0x73, 0x61, 0x67, 0x65, 0x2e, 0x45, 0x52, 0x52, 0x4f, 0x52, 0x5f, 0x43, 0x4f, 0x44, 0x45, + 0x52, 0x06, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x12, 0x16, 0x0a, 0x06, 0x52, 0x6f, 0x6f, 0x6d, + 0x49, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x72, 0x6f, 0x6f, 0x6d, 0x49, 0x64, + 0x12, 0x10, 0x0a, 0x03, 0x55, 0x49, 0x44, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x75, + 0x49, 0x44, 0x12, 0x1a, 0x0a, 0x08, 0x4e, 0x69, 0x63, 0x6b, 0x4e, 0x61, 0x6d, 0x65, 0x18, 0x04, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x6e, 0x69, 0x63, 0x6b, 0x4e, 0x61, 0x6d, 0x65, 0x22, 0x0b, + 0x0a, 0x09, 0x50, 0x6c, 0x61, 0x79, 0x53, 0x74, 0x61, 0x72, 0x74, 0x22, 0x3e, 0x0a, 0x0f, 0x50, + 0x6c, 0x61, 0x79, 0x53, 0x74, 0x61, 0x72, 0x74, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x12, 0x2b, + 0x0a, 0x06, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x13, + 0x2e, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x2e, 0x45, 0x52, 0x52, 0x4f, 0x52, 0x5f, 0x43, + 0x4f, 0x44, 0x45, 0x52, 0x06, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x22, 0x09, 0x0a, 0x07, 0x50, + 0x6c, 0x61, 0x79, 0x45, 0x6e, 0x64, 0x22, 0x3c, 0x0a, 0x0d, 0x50, 0x6c, 0x61, 0x79, 0x45, 0x6e, + 0x64, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x12, 0x2b, 0x0a, 0x06, 0x52, 0x65, 0x73, 0x75, 0x6c, + 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x13, 0x2e, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, + 0x65, 0x2e, 0x45, 0x52, 0x52, 0x4f, 0x52, 0x5f, 0x43, 0x4f, 0x44, 0x45, 0x52, 0x06, 0x72, 0x65, + 0x73, 0x75, 0x6c, 0x74, 0x22, 0x31, 0x0a, 0x06, 0x52, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x12, 0x27, + 0x0a, 0x04, 0x49, 0x6e, 0x66, 0x6f, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x13, 0x2e, 0x6d, + 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x2e, 0x52, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x49, 0x6e, 0x66, + 0x6f, 0x52, 0x04, 0x69, 0x6e, 0x66, 0x6f, 0x22, 0x3b, 0x0a, 0x0c, 0x52, 0x65, 0x70, 0x6f, 0x72, + 0x74, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x12, 0x2b, 0x0a, 0x06, 0x52, 0x65, 0x73, 0x75, 0x6c, + 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x13, 0x2e, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, + 0x65, 0x2e, 0x45, 0x52, 0x52, 0x4f, 0x52, 0x5f, 0x43, 0x4f, 0x44, 0x45, 0x52, 0x06, 0x72, 0x65, + 0x73, 0x75, 0x6c, 0x74, 0x22, 0x25, 0x0a, 0x07, 0x47, 0x65, 0x74, 0x52, 0x61, 0x6e, 0x6b, 0x12, + 0x1a, 0x0a, 0x08, 0x54, 0x6f, 0x70, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x05, 0x52, 0x08, 0x74, 0x6f, 0x70, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x22, 0x65, 0x0a, 0x0d, 0x47, + 0x65, 0x74, 0x52, 0x61, 0x6e, 0x6b, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x12, 0x2b, 0x0a, 0x06, + 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x13, 0x2e, 0x6d, + 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x2e, 0x45, 0x52, 0x52, 0x4f, 0x52, 0x5f, 0x43, 0x4f, 0x44, + 0x45, 0x52, 0x06, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x12, 0x27, 0x0a, 0x04, 0x49, 0x6e, 0x66, + 0x6f, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x13, 0x2e, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, + 0x65, 0x2e, 0x52, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x04, 0x69, 0x6e, + 0x66, 0x6f, 0x22, 0x42, 0x0a, 0x11, 0x4e, 0x6f, 0x74, 0x69, 0x66, 0x79, 0x4e, 0x65, 0x77, 0x41, + 0x75, 0x64, 0x69, 0x65, 0x6e, 0x63, 0x65, 0x12, 0x2d, 0x0a, 0x08, 0x41, 0x75, 0x64, 0x69, 0x65, + 0x6e, 0x63, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x11, 0x2e, 0x6d, 0x65, 0x73, 0x73, + 0x61, 0x67, 0x65, 0x2e, 0x41, 0x75, 0x64, 0x69, 0x65, 0x6e, 0x63, 0x65, 0x52, 0x08, 0x61, 0x75, + 0x64, 0x69, 0x65, 0x6e, 0x63, 0x65, 0x22, 0x94, 0x01, 0x0a, 0x14, 0x4e, 0x6f, 0x74, 0x69, 0x66, + 0x79, 0x41, 0x75, 0x64, 0x69, 0x65, 0x6e, 0x63, 0x65, 0x41, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x12, + 0x16, 0x0a, 0x06, 0x4f, 0x70, 0x65, 0x6e, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x06, 0x6f, 0x70, 0x65, 0x6e, 0x49, 0x64, 0x12, 0x18, 0x0a, 0x07, 0x43, 0x6f, 0x6e, 0x74, 0x65, + 0x6e, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, + 0x74, 0x12, 0x18, 0x0a, 0x07, 0x4c, 0x69, 0x6b, 0x65, 0x4e, 0x75, 0x6d, 0x18, 0x03, 0x20, 0x01, + 0x28, 0x05, 0x52, 0x07, 0x6c, 0x69, 0x6b, 0x65, 0x4e, 0x75, 0x6d, 0x12, 0x16, 0x0a, 0x06, 0x47, + 0x69, 0x66, 0x74, 0x49, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x67, 0x69, 0x66, + 0x74, 0x49, 0x64, 0x12, 0x18, 0x0a, 0x07, 0x47, 0x69, 0x66, 0x74, 0x4e, 0x75, 0x6d, 0x18, 0x05, + 0x20, 0x01, 0x28, 0x05, 0x52, 0x07, 0x67, 0x69, 0x66, 0x74, 0x4e, 0x75, 0x6d, 0x22, 0x3a, 0x0a, + 0x0a, 0x52, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x16, 0x0a, 0x06, 0x4f, + 0x70, 0x65, 0x6e, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x6f, 0x70, 0x65, + 0x6e, 0x49, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x53, 0x63, 0x6f, 0x72, 0x65, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x05, 0x52, 0x05, 0x73, 0x63, 0x6f, 0x72, 0x65, 0x22, 0x5c, 0x0a, 0x08, 0x41, 0x75, 0x64, + 0x69, 0x65, 0x6e, 0x63, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x4f, 0x70, 0x65, 0x6e, 0x49, 0x64, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x6f, 0x70, 0x65, 0x6e, 0x49, 0x64, 0x12, 0x1a, 0x0a, + 0x08, 0x4e, 0x69, 0x63, 0x6b, 0x4e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x08, 0x6e, 0x69, 0x63, 0x6b, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x1c, 0x0a, 0x09, 0x41, 0x76, 0x61, + 0x74, 0x61, 0x72, 0x55, 0x72, 0x6c, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x61, 0x76, + 0x61, 0x74, 0x61, 0x72, 0x55, 0x72, 0x6c, 0x22, 0x63, 0x0a, 0x08, 0x52, 0x61, 0x6e, 0x6b, 0x49, + 0x6e, 0x66, 0x6f, 0x12, 0x2d, 0x0a, 0x08, 0x41, 0x75, 0x64, 0x69, 0x65, 0x6e, 0x63, 0x65, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x11, 0x2e, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x2e, + 0x41, 0x75, 0x64, 0x69, 0x65, 0x6e, 0x63, 0x65, 0x52, 0x08, 0x61, 0x75, 0x64, 0x69, 0x65, 0x6e, + 0x63, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x52, 0x61, 0x6e, 0x6b, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, + 0x52, 0x04, 0x72, 0x61, 0x6e, 0x6b, 0x12, 0x14, 0x0a, 0x05, 0x53, 0x63, 0x6f, 0x72, 0x65, 0x18, + 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x73, 0x63, 0x6f, 0x72, 0x65, 0x42, 0x05, 0x5a, 0x03, + 0x70, 0x62, 0x2f, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_common_proto_rawDescOnce sync.Once + file_common_proto_rawDescData = file_common_proto_rawDesc +) + +func file_common_proto_rawDescGZIP() []byte { + file_common_proto_rawDescOnce.Do(func() { + file_common_proto_rawDescData = protoimpl.X.CompressGZIP(file_common_proto_rawDescData) + }) + return file_common_proto_rawDescData +} + +var file_common_proto_msgTypes = make([]protoimpl.MessageInfo, 15) +var file_common_proto_goTypes = []interface{}{ + (*Login)(nil), // 0: message.Login + (*LoginResult)(nil), // 1: message.LoginResult + (*PlayStart)(nil), // 2: message.PlayStart + (*PlayStartResult)(nil), // 3: message.PlayStartResult + (*PlayEnd)(nil), // 4: message.PlayEnd + (*PlayEndResult)(nil), // 5: message.PlayEndResult + (*Report)(nil), // 6: message.Report + (*ReportResult)(nil), // 7: message.ReportResult + (*GetRank)(nil), // 8: message.GetRank + (*GetRankResult)(nil), // 9: message.GetRankResult + (*NotifyNewAudience)(nil), // 10: message.NotifyNewAudience + (*NotifyAudienceAction)(nil), // 11: message.NotifyAudienceAction + (*ReportInfo)(nil), // 12: message.ReportInfo + (*Audience)(nil), // 13: message.Audience + (*RankInfo)(nil), // 14: message.RankInfo + (ERROR_CODE)(0), // 15: message.ERROR_CODE +} +var file_common_proto_depIdxs = []int32{ + 15, // 0: message.LoginResult.Result:type_name -> message.ERROR_CODE + 15, // 1: message.PlayStartResult.Result:type_name -> message.ERROR_CODE + 15, // 2: message.PlayEndResult.Result:type_name -> message.ERROR_CODE + 12, // 3: message.Report.Info:type_name -> message.ReportInfo + 15, // 4: message.ReportResult.Result:type_name -> message.ERROR_CODE + 15, // 5: message.GetRankResult.Result:type_name -> message.ERROR_CODE + 12, // 6: message.GetRankResult.Info:type_name -> message.ReportInfo + 13, // 7: message.NotifyNewAudience.Audience:type_name -> message.Audience + 13, // 8: message.RankInfo.Audience:type_name -> message.Audience + 9, // [9:9] is the sub-list for method output_type + 9, // [9:9] is the sub-list for method input_type + 9, // [9:9] is the sub-list for extension type_name + 9, // [9:9] is the sub-list for extension extendee + 0, // [0:9] is the sub-list for field type_name +} + +func init() { file_common_proto_init() } +func file_common_proto_init() { + if File_common_proto != nil { + return + } + file_msgtype_proto_init() + if !protoimpl.UnsafeEnabled { + file_common_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Login); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_common_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*LoginResult); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_common_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*PlayStart); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_common_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*PlayStartResult); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_common_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*PlayEnd); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_common_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*PlayEndResult); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_common_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Report); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_common_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ReportResult); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_common_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetRank); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_common_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetRankResult); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_common_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*NotifyNewAudience); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_common_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*NotifyAudienceAction); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_common_proto_msgTypes[12].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ReportInfo); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_common_proto_msgTypes[13].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Audience); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_common_proto_msgTypes[14].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*RankInfo); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_common_proto_rawDesc, + NumEnums: 0, + NumMessages: 15, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_common_proto_goTypes, + DependencyIndexes: file_common_proto_depIdxs, + MessageInfos: file_common_proto_msgTypes, + }.Build() + File_common_proto = out.File + file_common_proto_rawDesc = nil + file_common_proto_goTypes = nil + file_common_proto_depIdxs = nil +} diff --git a/src/app/service/main/message/pb/msgtype.pb.go b/src/app/service/main/message/pb/msgtype.pb.go new file mode 100644 index 0000000..f3817d7 --- /dev/null +++ b/src/app/service/main/message/pb/msgtype.pb.go @@ -0,0 +1,304 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.26.0 +// protoc (unknown) +// source: msgtype.proto + +package pb + +import ( + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" +) + +import proto "google.golang.org/protobuf/proto" + +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 MSG_TYPE int32 + +const ( + MSG_TYPE__ERROR MSG_TYPE = 0 //Error + MSG_TYPE__Login MSG_TYPE = 1 //Login + MSG_TYPE__LoginResult MSG_TYPE = 2 //LoginResult + MSG_TYPE__PlayStart MSG_TYPE = 3 //PlayStart + MSG_TYPE__PlayStartResult MSG_TYPE = 4 //PlayStartResult + MSG_TYPE__PlayEnd MSG_TYPE = 5 //PlayEnd + MSG_TYPE__PlayEndResult MSG_TYPE = 6 //PlayEndResult + MSG_TYPE__Report MSG_TYPE = 7 //Report + MSG_TYPE__ReportResult MSG_TYPE = 8 //ReportResult + MSG_TYPE__GetRank MSG_TYPE = 9 //GetRank + MSG_TYPE__GetRankResult MSG_TYPE = 10 //GetRankResult + MSG_TYPE__NotifyNewAudience MSG_TYPE = 11 //NotifyNewAudience + MSG_TYPE__NotifyAudienceAction MSG_TYPE = 12 //NotifyAudienceAction +) + +// Enum value maps for MSG_TYPE. +var ( + MSG_TYPE_name = map[int32]string{ + 0: "_ERROR", + 1: "_Login", + 2: "_LoginResult", + 3: "_PlayStart", + 4: "_PlayStartResult", + 5: "_PlayEnd", + 6: "_PlayEndResult", + 7: "_Report", + 8: "_ReportResult", + 9: "_GetRank", + 10: "_GetRankResult", + 11: "_NotifyNewAudience", + 12: "_NotifyAudienceAction", + } + MSG_TYPE_value = map[string]int32{ + "_ERROR": 0, + "_Login": 1, + "_LoginResult": 2, + "_PlayStart": 3, + "_PlayStartResult": 4, + "_PlayEnd": 5, + "_PlayEndResult": 6, + "_Report": 7, + "_ReportResult": 8, + "_GetRank": 9, + "_GetRankResult": 10, + "_NotifyNewAudience": 11, + "_NotifyAudienceAction": 12, + } +) + +func (x MSG_TYPE) Enum() *MSG_TYPE { + p := new(MSG_TYPE) + *p = x + return p +} + +func (x MSG_TYPE) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (MSG_TYPE) Descriptor() protoreflect.EnumDescriptor { + return file_msgtype_proto_enumTypes[0].Descriptor() +} + +func (MSG_TYPE) Type() protoreflect.EnumType { + return &file_msgtype_proto_enumTypes[0] +} + +func (x MSG_TYPE) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use MSG_TYPE.Descriptor instead. +func (MSG_TYPE) EnumDescriptor() ([]byte, []int) { + return file_msgtype_proto_rawDescGZIP(), []int{0} +} + +type ERROR_CODE int32 + +const ( + ERROR_CODE_SUCCESS ERROR_CODE = 0 + ERROR_CODE_FAIL ERROR_CODE = 1 + ERROR_CODE_INVALID_APPID ERROR_CODE = 2 + ERROR_CODE_INVALID_TOKEN ERROR_CODE = 3 + ERROR_CODE_GAME_IS_RUNNING ERROR_CODE = 4 + ERROR_CODE_GAME_IS_STOPPED ERROR_CODE = 5 +) + +// Enum value maps for ERROR_CODE. +var ( + ERROR_CODE_name = map[int32]string{ + 0: "SUCCESS", + 1: "FAIL", + 2: "INVALID_APPID", + 3: "INVALID_TOKEN", + 4: "GAME_IS_RUNNING", + 5: "GAME_IS_STOPPED", + } + ERROR_CODE_value = map[string]int32{ + "SUCCESS": 0, + "FAIL": 1, + "INVALID_APPID": 2, + "INVALID_TOKEN": 3, + "GAME_IS_RUNNING": 4, + "GAME_IS_STOPPED": 5, + } +) + +func (x ERROR_CODE) Enum() *ERROR_CODE { + p := new(ERROR_CODE) + *p = x + return p +} + +func (x ERROR_CODE) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (ERROR_CODE) Descriptor() protoreflect.EnumDescriptor { + return file_msgtype_proto_enumTypes[1].Descriptor() +} + +func (ERROR_CODE) Type() protoreflect.EnumType { + return &file_msgtype_proto_enumTypes[1] +} + +func (x ERROR_CODE) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use ERROR_CODE.Descriptor instead. +func (ERROR_CODE) EnumDescriptor() ([]byte, []int) { + return file_msgtype_proto_rawDescGZIP(), []int{1} +} + +type Error struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *Error) Reset() { + *x = Error{} + if protoimpl.UnsafeEnabled { + mi := &file_msgtype_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Error) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (x *Error) FromDB(data []byte) error { + return proto.Unmarshal(data, x) +} + +func (x *Error) ToDB() ([]byte, error) { + return proto.Marshal(x) +} + +func (*Error) ProtoMessage() {} + +func (x *Error) ProtoReflect() protoreflect.Message { + mi := &file_msgtype_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_msgtype_proto_rawDescGZIP(), []int{0} +} + +var File_msgtype_proto protoreflect.FileDescriptor + +var file_msgtype_proto_rawDesc = []byte{ + 0x0a, 0x0d, 0x6d, 0x73, 0x67, 0x74, 0x79, 0x70, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, + 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x22, 0x07, 0x0a, 0x05, 0x45, 0x72, 0x72, 0x6f, + 0x72, 0x2a, 0xf1, 0x01, 0x0a, 0x08, 0x4d, 0x53, 0x47, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x12, 0x0a, + 0x0a, 0x06, 0x5f, 0x45, 0x52, 0x52, 0x4f, 0x52, 0x10, 0x00, 0x12, 0x0a, 0x0a, 0x06, 0x5f, 0x4c, + 0x6f, 0x67, 0x69, 0x6e, 0x10, 0x01, 0x12, 0x10, 0x0a, 0x0c, 0x5f, 0x4c, 0x6f, 0x67, 0x69, 0x6e, + 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x10, 0x02, 0x12, 0x0e, 0x0a, 0x0a, 0x5f, 0x50, 0x6c, 0x61, + 0x79, 0x53, 0x74, 0x61, 0x72, 0x74, 0x10, 0x03, 0x12, 0x14, 0x0a, 0x10, 0x5f, 0x50, 0x6c, 0x61, + 0x79, 0x53, 0x74, 0x61, 0x72, 0x74, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x10, 0x04, 0x12, 0x0c, + 0x0a, 0x08, 0x5f, 0x50, 0x6c, 0x61, 0x79, 0x45, 0x6e, 0x64, 0x10, 0x05, 0x12, 0x12, 0x0a, 0x0e, + 0x5f, 0x50, 0x6c, 0x61, 0x79, 0x45, 0x6e, 0x64, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x10, 0x06, + 0x12, 0x0b, 0x0a, 0x07, 0x5f, 0x52, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x10, 0x07, 0x12, 0x11, 0x0a, + 0x0d, 0x5f, 0x52, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x10, 0x08, + 0x12, 0x0c, 0x0a, 0x08, 0x5f, 0x47, 0x65, 0x74, 0x52, 0x61, 0x6e, 0x6b, 0x10, 0x09, 0x12, 0x12, + 0x0a, 0x0e, 0x5f, 0x47, 0x65, 0x74, 0x52, 0x61, 0x6e, 0x6b, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, + 0x10, 0x0a, 0x12, 0x16, 0x0a, 0x12, 0x5f, 0x4e, 0x6f, 0x74, 0x69, 0x66, 0x79, 0x4e, 0x65, 0x77, + 0x41, 0x75, 0x64, 0x69, 0x65, 0x6e, 0x63, 0x65, 0x10, 0x0b, 0x12, 0x19, 0x0a, 0x15, 0x5f, 0x4e, + 0x6f, 0x74, 0x69, 0x66, 0x79, 0x41, 0x75, 0x64, 0x69, 0x65, 0x6e, 0x63, 0x65, 0x41, 0x63, 0x74, + 0x69, 0x6f, 0x6e, 0x10, 0x0c, 0x2a, 0x73, 0x0a, 0x0a, 0x45, 0x52, 0x52, 0x4f, 0x52, 0x5f, 0x43, + 0x4f, 0x44, 0x45, 0x12, 0x0b, 0x0a, 0x07, 0x53, 0x55, 0x43, 0x43, 0x45, 0x53, 0x53, 0x10, 0x00, + 0x12, 0x08, 0x0a, 0x04, 0x46, 0x41, 0x49, 0x4c, 0x10, 0x01, 0x12, 0x11, 0x0a, 0x0d, 0x49, 0x4e, + 0x56, 0x41, 0x4c, 0x49, 0x44, 0x5f, 0x41, 0x50, 0x50, 0x49, 0x44, 0x10, 0x02, 0x12, 0x11, 0x0a, + 0x0d, 0x49, 0x4e, 0x56, 0x41, 0x4c, 0x49, 0x44, 0x5f, 0x54, 0x4f, 0x4b, 0x45, 0x4e, 0x10, 0x03, + 0x12, 0x13, 0x0a, 0x0f, 0x47, 0x41, 0x4d, 0x45, 0x5f, 0x49, 0x53, 0x5f, 0x52, 0x55, 0x4e, 0x4e, + 0x49, 0x4e, 0x47, 0x10, 0x04, 0x12, 0x13, 0x0a, 0x0f, 0x47, 0x41, 0x4d, 0x45, 0x5f, 0x49, 0x53, + 0x5f, 0x53, 0x54, 0x4f, 0x50, 0x50, 0x45, 0x44, 0x10, 0x05, 0x42, 0x05, 0x5a, 0x03, 0x70, 0x62, + 0x2f, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_msgtype_proto_rawDescOnce sync.Once + file_msgtype_proto_rawDescData = file_msgtype_proto_rawDesc +) + +func file_msgtype_proto_rawDescGZIP() []byte { + file_msgtype_proto_rawDescOnce.Do(func() { + file_msgtype_proto_rawDescData = protoimpl.X.CompressGZIP(file_msgtype_proto_rawDescData) + }) + return file_msgtype_proto_rawDescData +} + +var file_msgtype_proto_enumTypes = make([]protoimpl.EnumInfo, 2) +var file_msgtype_proto_msgTypes = make([]protoimpl.MessageInfo, 1) +var file_msgtype_proto_goTypes = []interface{}{ + (MSG_TYPE)(0), // 0: message.MSG_TYPE + (ERROR_CODE)(0), // 1: message.ERROR_CODE + (*Error)(nil), // 2: message.Error +} +var file_msgtype_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_msgtype_proto_init() } +func file_msgtype_proto_init() { + if File_msgtype_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_msgtype_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 + } + } + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_msgtype_proto_rawDesc, + NumEnums: 2, + NumMessages: 1, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_msgtype_proto_goTypes, + DependencyIndexes: file_msgtype_proto_depIdxs, + EnumInfos: file_msgtype_proto_enumTypes, + MessageInfos: file_msgtype_proto_msgTypes, + }.Build() + File_msgtype_proto = out.File + file_msgtype_proto_rawDesc = nil + file_msgtype_proto_goTypes = nil + file_msgtype_proto_depIdxs = nil +} diff --git a/src/app/internal/msg_util/proto_codec.go b/src/app/service/main/msg_util/proto_codec.go similarity index 82% rename from src/app/internal/msg_util/proto_codec.go rename to src/app/service/main/msg_util/proto_codec.go index 671ca08..1dd8db0 100644 --- a/src/app/internal/msg_util/proto_codec.go +++ b/src/app/service/main/msg_util/proto_codec.go @@ -2,7 +2,6 @@ package msg_util import ( "bytes" - "core/log" "core/network" "core/tools" "encoding/binary" @@ -29,9 +28,9 @@ type ProtoCodec struct { const STREAM_HEADLEN = 4 const STREAM_MSGID_LEN = 2 //uint16 -var ErrUnmarshal = errors.New("proto unmarshal failed") +var ErrUnmarshal = errors.New("message unmarshal failed") -func (s *ProtoCodec) Decode(data []byte, chains ...network.CodecChain) (msgIds []int32, ret []interface{}, err error) { +func (s *ProtoCodec) Decode(data []byte) (msgIds []int32, ret []interface{}, err error) { s.context.Write(data) for s.context.Len() >= STREAM_HEADLEN+STREAM_MSGID_LEN { @@ -71,9 +70,6 @@ func (s *ProtoCodec) Decode(data []byte, chains ...network.CodecChain) (msgIds [ } } - for _, chain := range chains { - chain(int(s.msglen), msg) - } s.msglen = 0 ret = append(ret, msg) msgIds = append(msgIds, msgId) @@ -81,16 +77,13 @@ func (s *ProtoCodec) Decode(data []byte, chains ...network.CodecChain) (msgIds [ return } -func (s *ProtoCodec) Encode(data interface{}, chains ...network.CodecChain) []byte { +func (s *ProtoCodec) Encode(data interface{}) []byte { if pb, ok := data.(proto.Message); ok { msgId, ok := s.parser.MsgToId(pb) tools.AssertTrue(ok, "msgId=%v not found", msgId, pb) pbBuf, err := proto.Marshal(pb) tools.AssertNil(err) - for _, chain := range chains { - chain(len(pbBuf), data) - } buf := make([]byte, STREAM_HEADLEN+STREAM_MSGID_LEN+len(pbBuf)) binary.BigEndian.PutUint32(buf, uint32(len(buf))) binary.BigEndian.PutUint16(buf[STREAM_HEADLEN:], uint16(msgId)) @@ -99,7 +92,6 @@ func (s *ProtoCodec) Encode(data interface{}, chains ...network.CodecChain) []by } else if byteArray, ok := data.([]byte); ok { return byteArray } else { - log.KV("data", data).Error("ProtoCodec Encode err") return nil } } diff --git a/src/app/internal/msg_util/proto_parser.go b/src/app/service/main/msg_util/proto_parser.go similarity index 87% rename from src/app/internal/msg_util/proto_parser.go rename to src/app/service/main/msg_util/proto_parser.go index 6267a37..408df2a 100644 --- a/src/app/internal/msg_util/proto_parser.go +++ b/src/app/service/main/msg_util/proto_parser.go @@ -1,11 +1,10 @@ package msg_util import ( + "core/tools" "fmt" "strings" - "core/log" - "core/tools" "google.golang.org/protobuf/proto" "google.golang.org/protobuf/reflect/protoreflect" "google.golang.org/protobuf/reflect/protoregistry" @@ -57,7 +56,6 @@ func (s *ProtoParser) init(packageName, msgEnum string) { delete(adapter, ln) } else { if isForce { - log.KV("msgTypeName", msgTypeName).KV("ln", ln).Error("msg format error") panic(fmt.Errorf("msg format error msgTypeName=%v", msgTypeName)) } else { return @@ -72,7 +70,6 @@ func (s *ProtoParser) init(packageName, msgEnum string) { msgTypeName := string(values.Get(i).Name()) msgId := int32(values.Get(i).Number()) msgDealFunc(msgTypeName, msgId, true) - msgDealFunc(fmt.Sprintf("%sResult", msgTypeName), msgId+50000, false) } tools.AssertTrue(len(adapter) == 0, "msg not fix") @@ -81,14 +78,12 @@ func (s *ProtoParser) init(packageName, msgEnum string) { func (p *ProtoParser) Unmarshal(msgId int32, data []byte) (proto.Message, bool) { tp, ok := p.typemap[msgId] if !ok { - log.KV("msgId", msgId).KV("data", data).Warn("msg not regist parser") return nil, false } msg := tp.New().Interface() err := proto.Unmarshal(data, msg) if err != nil { - log.KV("msgId", msgId).KV("data", data).Error("msg parse failed") return nil, false } return msg, true @@ -96,7 +91,6 @@ func (p *ProtoParser) Unmarshal(msgId int32, data []byte) (proto.Message, bool) func (p *ProtoParser) UnmarshalByName(msgName string, data []byte) (proto.Message, bool) { msgId, ok := p.MsgNameToId(msgName) if !ok { - log.KV("msgName", msgName).KV("data", data).Warn("msgName not regist parser") return nil, false } return p.Unmarshal(msgId, data) @@ -130,10 +124,6 @@ func ProtoFullName(msg proto.Message) string { return string(msg.ProtoReflect().Type().Descriptor().FullName()) } -func FindMsgByName(msgName string) (protoreflect.MessageType, error) { - return protoregistry.GlobalTypes.FindMessageByName(protoreflect.FullName(msgName)) -} - // 之前定义的消息id和消息体不适用自动解析的部分 func adapters() map[string]protoreflect.MessageType { return map[string]protoreflect.MessageType{} diff --git a/src/app/service/main/redis/redis.go b/src/app/service/main/redis/redis.go new file mode 100644 index 0000000..e975123 --- /dev/null +++ b/src/app/service/main/redis/redis.go @@ -0,0 +1,52 @@ +package redis + +import ( + "context" + "fmt" + "github.com/redis/go-redis/v9" +) + +type RankInfo struct { + OpenId string + Score int32 +} + +var client *redis.Client + +func init() { + url := "redis://:adhd@123@101.35.201.220:6379/1?protocol=3" + opts, err := redis.ParseURL(url) + if err != nil { + panic(err) + } + client = redis.NewClient(opts) +} + +func AddScore(appId string, scoreMap map[string]int32) error { + ctx := context.Background() + pip := client.Pipeline() + for openId, score := range scoreMap { + key := fmt.Sprintf("Score_%s", appId) + pip.ZIncrBy(ctx, key, float64(score), openId) + } + _, err := pip.Exec(ctx) + return err +} + +func GetRank(appId string, topCount int32) ([]*RankInfo, error) { + ctx := context.Background() + key := fmt.Sprintf("Score_%s_*", appId) + cmd := client.ZRevRangeWithScores(ctx, key, 0, int64(topCount)) + result, err := cmd.Result() + if err != nil { + return nil, err + } + rankList := make([]*RankInfo, 0) + for _, info := range result { + rankList = append(rankList, &RankInfo{ + OpenId: info.Member.(string), + Score: int32(info.Score), + }) + } + return rankList, nil +} diff --git a/src/app/service/main/user/user.go b/src/app/service/main/user/user.go new file mode 100644 index 0000000..1255bb8 --- /dev/null +++ b/src/app/service/main/user/user.go @@ -0,0 +1,133 @@ +package user + +import ( + "app/service/main/in_obj" + "app/service/main/message/pb" + "app/service/main/redis" + "core/network" +) + +func NewUser(mgr in_obj.IGameMgr) *User { + return &User{mgr: mgr} +} + +type User struct { + network.BaseNetHandler + mgr in_obj.IGameMgr + appId string + roomId string + isRunning bool + audienceSet map[int32]bool + msgChan chan func() + closeChan chan struct{} +} + +func (s *User) OnSessionCreated() { + //主协程 + s.msgChan = make(chan func()) + s.closeChan = make(chan struct{}) + go func() { + for { + select { + case f := <-s.msgChan: + f() + case <-s.closeChan: + return + } + } + }() +} + +func (s *User) OnSessionClosed() { + if !s.isRunning { + return + } + s.setPushActive(false) + s.isRunning = false + s.closeChan <- struct{}{} +} + +func (s *User) OnRecv(msgId int32, data interface{}) { + s.msgChan <- func() { + switch msgId { + case int32(pb.MSG_TYPE__Login): + s.OnLogin(data.(*pb.Login)) + case int32(pb.MSG_TYPE__PlayStart): + s.OnPlayStart(data.(*pb.PlayStart)) + case int32(pb.MSG_TYPE__PlayEnd): + s.OnPlayEnd(data.(*pb.PlayEnd)) + case int32(pb.MSG_TYPE__Report): + s.OnReport(data.(*pb.Report)) + case int32(pb.MSG_TYPE__GetRank): + s.OnGetRank(data.(*pb.GetRank)) + } + } +} + +func (s *User) OnLogin(msg *pb.Login) { + roomId, uid, nickName, result := s.mgr.Login(msg.AppId, msg.Token) + s.appId = msg.AppId + s.roomId = roomId + s.SendMsg(&pb.LoginResult{ + Result: result, + RoomId: roomId, + UID: uid, + NickName: nickName, + }) +} +func (s *User) OnPlayStart(msg *pb.PlayStart) { + if s.isRunning { + s.SendMsg(&pb.PlayStartResult{Result: pb.ERROR_CODE_GAME_IS_RUNNING}) + return + } + s.setPushActive(true) + s.SendMsg(&pb.PlayStartResult{Result: pb.ERROR_CODE_SUCCESS}) +} +func (s *User) OnPlayEnd(msg *pb.PlayEnd) { + if !s.isRunning { + s.SendMsg(&pb.PlayEndResult{Result: pb.ERROR_CODE_GAME_IS_STOPPED}) + return + } + s.setPushActive(false) + s.SendMsg(&pb.PlayEndResult{Result: pb.ERROR_CODE_SUCCESS}) +} +func (s *User) OnReport(msg *pb.Report) { + scoreMap := map[string]int32{} + for _, info := range msg.Info { + scoreMap[info.OpenId] = info.Score + } + err := redis.AddScore(s.appId, scoreMap) + if err != nil { + s.SendMsg(&pb.ReportResult{Result: pb.ERROR_CODE_FAIL}) + return + } + s.SendMsg(&pb.ReportResult{Result: pb.ERROR_CODE_SUCCESS}) +} +func (s *User) OnGetRank(msg *pb.GetRank) { + rankList, err := redis.GetRank(s.appId, msg.TopCount) + if err != nil { + s.SendMsg(&pb.GetRankResult{Result: pb.ERROR_CODE_FAIL}) + return + } + var ret []*pb.ReportInfo + for _, info := range rankList { + ret = append(ret, &pb.ReportInfo{ + OpenId: info.OpenId, + Score: info.Score, + }) + } + s.SendMsg(&pb.GetRankResult{Result: pb.ERROR_CODE_SUCCESS, Info: ret}) +} + +func (s *User) setPushActive(isActive bool) { + s.isRunning = isActive + if isActive { + s.mgr.StartTask(s.appId, s.roomId, "1") + s.mgr.StartTask(s.appId, s.roomId, "2") + s.mgr.StartTask(s.appId, s.roomId, "3") + } else { + s.mgr.StopTask(s.appId, s.roomId, "1") + s.mgr.StopTask(s.appId, s.roomId, "2") + s.mgr.StopTask(s.appId, s.roomId, "3") + } +} diff --git a/src/app/service/robot/user/user.go b/src/app/service/robot/user/user.go new file mode 100644 index 0000000..84711ec --- /dev/null +++ b/src/app/service/robot/user/user.go @@ -0,0 +1,23 @@ +package user + +import ( + "core/network" +) + +func NewUser() *User { + return &User{} +} + +type User struct { + network.BaseNetHandler +} + +func (s *User) OnSessionCreated() { +} + +func (s *User) OnSessionClosed() { +} + +func (s *User) OnRecv(msgId int32, data interface{}) { + +} diff --git a/src/core/abtime/common.go b/src/core/abtime/common.go deleted file mode 100644 index 1bdea0d..0000000 --- a/src/core/abtime/common.go +++ /dev/null @@ -1,139 +0,0 @@ -package abtime - -import ( - "fmt" - "time" -) - -const SecondsPerHour = 60 * 60 -const SecondsPerDay = 24 * SecondsPerHour -const SecondsForever = 10 * 365 * SecondsPerDay - -var TimeZero = Unix(0, 0) -var _, TimeZone = TimeZero.Zone() - -func Now() time.Time { - return time.Now().UTC() -} - -func Unix(sec int64, nsec int64) time.Time { - return time.Unix(sec, nsec).UTC() -} - -func Milliseconds() int64 { - return Now().UnixNano() / int64(time.Millisecond) -} - -func Seconds() int64 { - return Now().UnixNano() / int64(time.Second) -} - -func FloatSeconds() float64 { - return float64(Now().UnixNano()) / float64(time.Second) -} - -func Date(year int, month time.Month, day, hour, min, sec, nsec int) time.Time { - return time.Date(year, month, day, hour, min, sec, nsec, time.UTC) -} - -func IsSameDay(time1 time.Time, time2 time.Time) bool { - return time1.Year() == time2.Year() && time1.YearDay() == time2.YearDay() -} - -func TimeFormat(data time.Time) string { - return data.UTC().Format(time.RFC3339Nano) -} - -func TimeParse(data string) time.Time { - t, err := time.Parse(time.RFC3339Nano, data) - if err != nil { - return TimeZero - } - return t.UTC() -} - -func TimeParseFormat(layout, value string) (time.Time, error) { - t, err := time.Parse(layout, value) - if err != nil { - return TimeZero, err - } - return t.UTC(), nil -} - -func GetNextTime(hour, minute, second int) time.Time { - now := Now() - if hour < 0 || hour >= 24 || minute < 0 || minute >= 60 || second < 0 || second >= 60 { - panic(fmt.Sprintf("wrong param %d:%d", hour, minute)) - } - todayTime := BeginningOfTheDay(now).Add(time.Duration(hour) * time.Hour).Add(time.Duration(minute) * time.Minute).Add(time.Duration(second) * time.Second) - if todayTime.After(now) { - return todayTime - } - return todayTime.Add(24 * 60 * 60 * time.Second) -} - -func GetNextHour() time.Time { - return Now().Truncate(time.Hour).Add(time.Hour) -} - -func GetNextMinute() time.Time { - return Now().Truncate(time.Minute).Add(time.Minute) -} - -func GetTimeWithoutHours(t time.Time) time.Time { - return t.Truncate(time.Hour).Add(-time.Duration(t.Hour()) * time.Hour) -} - -func BeginningOfTheDay(t time.Time) time.Time { - return t.Truncate(24 * 60 * 60 * time.Second) -} - -func MidOfTheDay(t time.Time) time.Time { - return t.Truncate(24 * 60 * 60 * time.Second).Add(24 * 60 * 60 * time.Second / 2) -} - -func EndingOfTheDay(t time.Time) time.Time { - return t.Truncate(24 * 60 * 60 * time.Second).Add(24 * 60 * 60 * time.Second) -} - -func MondayBeginWeek() int64 { - now := Now() - offset := int64(time.Monday - now.Weekday()) - if offset > 0 { - offset = -6 - } - monday := now.Unix() + offset*SecondsPerDay - return monday - (monday % SecondsPerDay) -} - -func NextMondayBeginWeek() int64 { - return MondayBeginWeek() + SecondsPerDay*7 -} - -func DiffDay(t1, t2 time.Time) int32 { - t1Start := BeginningOfTheDay(t1) - t2Start := BeginningOfTheDay(t2) - return int32(t1Start.Sub(t2Start).Seconds() / SecondsPerDay) -} - -// 以当天开始时间为初始值 间隔 intervalSeconds触发一次,返回下次触发的时间 -func NextIntervalTime(t1 time.Time, intervalSeconds int) time.Time { - if intervalSeconds <= 0 || SecondsPerDay%intervalSeconds != 0 { - panic(fmt.Sprintf("wrong param %d", intervalSeconds)) - } - - begin := BeginningOfTheDay(t1) - duration := int(t1.Sub(begin).Seconds()) - next := intervalSeconds * (duration/intervalSeconds + 1) - return begin.Add(time.Second * time.Duration(next)) -} - -func ChatTime() int64 { - const move = 1e6 - t := Now() - nano := t.Nanosecond() - for nano/move > 1 { - nano /= 10 - } - return t.Unix()*move + int64(nano) -} diff --git a/src/core/actor/actor.go b/src/core/actor/actor.go deleted file mode 100644 index 5aa509a..0000000 --- a/src/core/actor/actor.go +++ /dev/null @@ -1,228 +0,0 @@ -package actor - -import ( - "errors" - "time" - - "go.uber.org/atomic" - - "core/actor/actor_msg" - "core/actor/cmd" - "core/actor/event" - "core/actor/lua" - "core/actor/monitor" - "core/actor/timer" - "core/container/safe/mpsc" - "core/goroutine" - "core/log" - "core/prometheus" - "core/tools" -) - -var defaultProps = ActorProps{TimerAccuracy: time.Second, Remote: true} - -func newActor(kind, id string, actorSystem *ActorSystem, handler IActorHandler, ops ...ActorOption) *Actor { - a := &Actor{ - id: &actor_msg.ActorId{Id: id, Host: actorSystem.address(), Kind: kind}, - props: defaultProps, - system: actorSystem, - handler: handler, - requests: make(map[int64]*request), - notifyNewMail: make(chan struct{}, 1), - } - - for _, op := range ops { - op(a) - } - - handler.setActor(a) - a.mailBox = mpsc.New[*actor_msg.Mail]() - a.timerMgr = timer.NewTimerMgr(a.props.TimerAccuracy, a.props.TimerWheelLen) - actorSystem.prometheus().RecordState(a.Id(), monitor.PActorState_New) - return a -} - -type ActorProps struct { - TimerAccuracy time.Duration // 定时器精度 - TimerWheelLen time.Duration // 定时器是否使用时间轮 - Remote bool // 是否能被远端发现 - InitErrExit bool // Init失败是否退出system -} - -type Actor struct { - props ActorProps // 基础配置 - id *actor_msg.ActorId - system *ActorSystem - mailBox *mpsc.Queue[*actor_msg.Mail] // 邮箱 - requests map[int64]*request // 发出的请求列表(需要处理应答) - notifyNewMail chan struct{} // 新消息通知 - mailReading atomic.Int32 // 处理消息状态 - stopping atomic.Int32 // 停止过程中 - stopOver atomic.Int32 // 停止过程完毕 - - handler IActorHandler // 邮件处理模块 - timerMgr *timer.TimerMgr // 定时器模块 - lua *lua.Lua // lua模块 -} - -func (s *Actor) Id() *actor_msg.ActorId { return s.id } -func (s *Actor) String() string { return s.id.Id } -func (s *Actor) Kind() string { return s.id.Kind } -func (s *Actor) Is(id interface{}) bool { - switch _id := id.(type) { - case string: - return _id == s.id.Id - case *actor_msg.ActorId: - return _id != nil && _id.Id == s.id.Id - } - return false -} -func (s *Actor) System() *ActorSystem { return s.system } -func (s *Actor) Event() *event.EventDispatcher { return s.system.event() } -func (s *Actor) Lua() *lua.Lua { return s.lua } //非线程安全 -func (s *Actor) Prometheus() *prometheus.Prometheus { return s.system.prometheus().Registry() } -func (s *Actor) RegistCmd(cmd string, fn cmd.Func) { s.system.cmd().Regist(s, cmd, fn) } -func (s *Actor) Send(targetId interface{}, msg interface{}) { s.system.send(s.id, targetId, nil, msg) } -func (s *Actor) Broadcast(kind string, msg interface{}) { s.system.broadcast(s.id, kind, msg) } -func (s *Actor) SuspendStop() { s.stopping.CAS(0, 1) } //通知停止(让handler决定什么时候真正停止) -func (s *Actor) CancelTimer(timerId int64) { s.timerMgr.CancelTimer(timerId) } //非线程安全 -func (s *Actor) AddTimer(interval time.Duration, times int32, callback timer.FuncCallback) int64 { //非线程安全 - return s.timerMgr.AddTimer(interval, time.Now().Add(interval), times, callback, false) -} - -func (s *Actor) StopNow() { //立即停止 - s.stopping.CAS(0, 1) - s.stopOver.CAS(0, 1) -} - -func (s *Actor) stopCheck() (stopNow bool) { - if s.stopping.CAS(1, 2) { - goroutine.Try(func() { stopNow = s.handler.OnStop() }, func(ex interface{}) { stopNow = true }) - } - if s.stopOver.Load() == 1 { - return true - } - return -} - -func (s *Actor) catchPanic(ex interface{}) { s.system.prometheus().RecordPanic(s.Id()) } - -// push一个消息到邮箱 -func (s *Actor) push(mail *actor_msg.Mail) { - s.mailBox.Push(mail) - if s.mailReading.CAS(0, 1) { - s.notifyNewMail <- struct{}{} - } -} - -func (s *Actor) loop() { - s.system.prometheus().RecordState(s.Id(), monitor.PActorState_Init) - defer func() { s.system.prometheus().RecordState(s.Id(), monitor.PActorState_Stop) }() - - var initErr error - goroutine.Try(func() { initErr = s.handler.OnStart() }, func(ex interface{}) { initErr = errors.New("actor init panic") }) - if initErr != nil { - log.KV("err", initErr).KV("actor", s).Error("actor init failed") - if s.props.InitErrExit { - s.system.Stop() - } - return - } - - if s.props.Remote { - s.Event().Dispatch(s, &actor_msg.ENewActor{ActorId: s.id}) - defer s.Event().Dispatch(s, &actor_msg.EDelActor{ActorId: s.id}) - } - - ticker := time.NewTicker(s.timerMgr.Accuracy()) - defer ticker.Stop() - for { - if s.stopCheck() { - return - } - select { - case <-ticker.C: - s.system.prometheus().RecordState(s.Id(), monitor.PActorState_Run) - goroutine.Try(func() { s.timerMgr.Update(time.Now().UnixNano(), s.catchPanic) }, s.catchPanic) - case <-s.notifyNewMail: - s.process() - } - } -} - -func (s *Actor) process() { - s.mailReading.Store(0) - count := 0 - start := time.Now() - for mail := s.mailBox.Pop(); mail != nil; mail = s.mailBox.Pop() { - count++ - goroutine.Try(func() { s.readMail(mail) }, s.catchPanic) - if time.Since(start) > s.timerMgr.Accuracy() { - if s.mailReading.CAS(0, 1) { - s.notifyNewMail <- struct{}{} - } - s.system.prometheus().RecordMailbox(s.Id(), float64(s.mailBox.Length())) - break - } - } - s.system.prometheus().RecordHand(s.Id(), count) -} - -func (s *Actor) readMail(mail *actor_msg.Mail) { - if s.Is(mail.TargetId) { - if mail.RequestId != nil { - if mail.RequestId.IsResponse() { - s.doneRequest(mail.RequestId, mail.Message()) - } else if fn, isFn := mail.Message().(actor_msg.RequestWaitMsg); isFn { - fn(mail.RequestId) - } else { - s.handler.HandleRequest(mail.SourceId, mail.TargetId, mail.RequestId, mail.Message()) - } - } else if ev, isEvent := mail.Message().(*actor_msg.MsgEvent); isEvent { - s.handler.HandleEvent(ev.Event) - } else if fn, isFn := mail.Message().(func()); isFn { // 函数消息 - fn() - } else { - s.handler.HandleMessage(mail.SourceId, mail.TargetId, mail.Message()) - } - } else { - s.handler.HandleMessage(mail.SourceId, mail.TargetId, mail) - } -} - -type ActorOption func(*Actor) - -func SetLocalized() ActorOption { return func(a *Actor) { a.props.Remote = false } } - -func SetLua(path string) ActorOption { - return func(a *Actor) { - l, err := lua.NewLua(path, a) - tools.AssertNil(err) - a.lua = l - } -} - -func NilActorOption() ActorOption { return func(a *Actor) {} } -func SetInitErrExit() ActorOption { return func(a *Actor) { a.props.InitErrExit = true } } - -func SetTimerAccuracy(accuracy time.Duration, wheelLen ...time.Duration) ActorOption { - const MinAccuracy = time.Second / 30 // 最小精度 - const MaxAccuracy = time.Second / 1 // 最大精度 - - tools.AssertTrue(accuracy >= MinAccuracy, "the timer accuracy is too small") - if accuracy > MaxAccuracy { - log.WarnStack(1, "the minimum accuracy is 1 second") - accuracy = MaxAccuracy - } - - if len(wheelLen) > 0 { - tools.AssertTrue(wheelLen[0]/accuracy > 8, "may be you don't need timer wheel?") - } - - return func(a *Actor) { - a.props.TimerAccuracy = accuracy - if len(wheelLen) > 0 { - a.props.TimerWheelLen = wheelLen[0] - } - } -} diff --git a/src/core/actor/actor_handler.go b/src/core/actor/actor_handler.go deleted file mode 100644 index 47d6d1d..0000000 --- a/src/core/actor/actor_handler.go +++ /dev/null @@ -1,41 +0,0 @@ -package actor - -import ( - "core/actor/actor_msg" - "core/log" -) - -type IActorHandler interface { - setActor(actor *Actor) - Actor() *Actor - - OnStart() error - OnStop() (stopOver bool) - - HandleEvent(event interface{}) // 事件消息 - HandleMessage(sourceId, targetId, msg interface{}) // 普通消息(只管发送) - HandleRequest(sourceId, targetId, requestId, msg interface{}) // 请求消息(需要应答) -} - -var _ IActorHandler = (*ActorHanlerBase)(nil) // -type ActorHanlerBase struct { - actor *Actor -} - -func (s *ActorHanlerBase) setActor(actor *Actor) { s.actor = actor } -func (s *ActorHanlerBase) Actor() *Actor { return s.actor } -func (s *ActorHanlerBase) OnStart() error { return nil } -func (s *ActorHanlerBase) OnStop() bool { return true } - -func (s *ActorHanlerBase) HandleMessage(sourceId, targetId, msg interface{}) { - log.KV("actor", s.Actor()).KV("msg", msg).Warn("not implement HandleMessage") -} - -func (s *ActorHanlerBase) HandleRequest(sourceId, targetId, requestId, msg interface{}) { - log.KV("actor", s.Actor()).Warn("not implement HandleRequest") - s.Actor().Response(requestId, &actor_msg.RequestDeadLetter{Err: "not implement HandleRequest"}) -} - -func (s *ActorHanlerBase) HandleEvent(event interface{}) { - log.KV("actor", s.Actor()).Warn("not implement HandleEvent") -} diff --git a/src/core/actor/actor_msg/actor_msg.go b/src/core/actor/actor_msg/actor_msg.go deleted file mode 100644 index 3d5bb28..0000000 --- a/src/core/actor/actor_msg/actor_msg.go +++ /dev/null @@ -1,70 +0,0 @@ -package actor_msg - -import ( - "errors" - - "google.golang.org/protobuf/proto" - "google.golang.org/protobuf/runtime/protoimpl" -) - -func NormalMail(sourceId, targetId *ActorId, requestId *RequestId, msg interface{}) *Mail { - return &Mail{SourceId: sourceId, TargetId: targetId, RequestId: requestId, msg: msg} -} - -func BroadcastMail(sourceId *ActorId, kind string, msg interface{}) *Mail { - return &Mail{SourceId: sourceId, msg: msg, BroadcastKind: kind} -} - -type Mail struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - SourceId *ActorId `protobuf:"bytes,1,opt,name=SourceId,proto3" json:"SourceId,omitempty"` - TargetId *ActorId `protobuf:"bytes,2,opt,name=TargetId,proto3" json:"TargetId,omitempty"` - RequestId *RequestId `protobuf:"bytes,3,opt,name=RequestId,proto3" json:"RequestId,omitempty"` - MsgName string `protobuf:"bytes,4,opt,name=MsgName,proto3" json:"MsgName,omitempty"` - Msg []byte `protobuf:"bytes,5,opt,name=Msg,proto3" json:"Msg,omitempty"` - BroadcastKind string `protobuf:"bytes,6,opt,name=BroadcastKind,proto3" json:"BroadcastKind,omitempty"` - msg interface{} -} - -func (mail *Mail) Message() interface{} { return mail.msg } - -func (mail *Mail) Marshal() ([]byte, error) { - actMsg, isPB := mail.msg.(proto.Message) - if !isPB { - return nil, errors.New("only support protobuf message") - } - - data, err := proto.Marshal(actMsg) - if err != nil { - return nil, err - } - mail.Msg = data - mail.MsgName = MsgName(mail.msg) - - data, err = proto.Marshal(mail) - if err != nil { - return nil, err - } - return data, nil -} - -func (mail *Mail) Unmarshal(data []byte) error { - if err := proto.Unmarshal(data, mail); err != nil { - return err - } - - tp, err := FindMsgByName(mail.MsgName) - if err != nil { - return err - } - - actMsg := tp.New().Interface() - if err = proto.Unmarshal(mail.Msg, actMsg); err != nil { - return err - } - mail.msg = actMsg - return nil -} diff --git a/src/core/actor/actor_msg/actor_msg.pb.go b/src/core/actor/actor_msg/actor_msg.pb.go deleted file mode 100644 index 0dfdeb7..0000000 --- a/src/core/actor/actor_msg/actor_msg.pb.go +++ /dev/null @@ -1,964 +0,0 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.26.0 -// protoc v3.17.3 -// source: actor_msg.proto - -package actor_msg - -import ( - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" - reflect "reflect" - sync "sync" -) - -import proto "google.golang.org/protobuf/proto" - -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) -) - -func (x *Mail) Reset() { - *x = Mail{} - if protoimpl.UnsafeEnabled { - mi := &file_actor_msg_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *Mail) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (x *Mail) FromDB(data []byte) error { - return proto.Unmarshal(data, x) -} - -func (x *Mail) ToDB() ([]byte, error) { - return proto.Marshal(x) -} - -func (*Mail) ProtoMessage() {} - -func (x *Mail) ProtoReflect() protoreflect.Message { - mi := &file_actor_msg_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 Mail.ProtoReflect.Descriptor instead. -func (*Mail) Descriptor() ([]byte, []int) { - return file_actor_msg_proto_rawDescGZIP(), []int{0} -} - -func (x *Mail) GetSourceId() *ActorId { - if x != nil { - return x.SourceId - } - return nil -} - -func (x *Mail) GetTargetId() *ActorId { - if x != nil { - return x.TargetId - } - return nil -} - -func (x *Mail) GetRequestId() *RequestId { - if x != nil { - return x.RequestId - } - return nil -} - -func (x *Mail) GetMsgName() string { - if x != nil { - return x.MsgName - } - return "" -} - -func (x *Mail) GetMsg() []byte { - if x != nil { - return x.Msg - } - return nil -} - -func (x *Mail) GetBroadcastKind() string { - if x != nil { - return x.BroadcastKind - } - return "" -} - -func (x *Mail) SetSourceId(val *ActorId) { - if x != nil { - x.SourceId = val - } -} -func (x *Mail) SetTargetId(val *ActorId) { - if x != nil { - x.TargetId = val - } -} -func (x *Mail) SetRequestId(val *RequestId) { - if x != nil { - x.RequestId = val - } -} -func (x *Mail) SetMsgName(val string) { - if x != nil { - x.MsgName = val - } -} -func (x *Mail) SetMsg(val []byte) { - if x != nil { - x.Msg = val - } -} -func (x *Mail) SetBroadcastKind(val string) { - if x != nil { - x.BroadcastKind = val - } -} - -type RequestId struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Id int64 `protobuf:"varint,1,opt,name=Id,proto3" json:"Id,omitempty"` - State bool `protobuf:"varint,2,opt,name=State,proto3" json:"State,omitempty"` //true=req false=resp - SourceId *ActorId `protobuf:"bytes,3,opt,name=SourceId,proto3" json:"SourceId,omitempty"` - TargetId *ActorId `protobuf:"bytes,4,opt,name=TargetId,proto3" json:"TargetId,omitempty"` -} - -func (x *RequestId) Reset() { - *x = RequestId{} - if protoimpl.UnsafeEnabled { - mi := &file_actor_msg_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *RequestId) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (x *RequestId) FromDB(data []byte) error { - return proto.Unmarshal(data, x) -} - -func (x *RequestId) ToDB() ([]byte, error) { - return proto.Marshal(x) -} - -func (*RequestId) ProtoMessage() {} - -func (x *RequestId) ProtoReflect() protoreflect.Message { - mi := &file_actor_msg_proto_msgTypes[1] - 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 RequestId.ProtoReflect.Descriptor instead. -func (*RequestId) Descriptor() ([]byte, []int) { - return file_actor_msg_proto_rawDescGZIP(), []int{1} -} - -func (x *RequestId) GetId() int64 { - if x != nil { - return x.Id - } - return 0 -} - -func (x *RequestId) GetState() bool { - if x != nil { - return x.State - } - return false -} - -func (x *RequestId) GetSourceId() *ActorId { - if x != nil { - return x.SourceId - } - return nil -} - -func (x *RequestId) GetTargetId() *ActorId { - if x != nil { - return x.TargetId - } - return nil -} - -func (x *RequestId) SetId(val int64) { - if x != nil { - x.Id = val - } -} -func (x *RequestId) SetState(val bool) { - if x != nil { - x.State = val - } -} -func (x *RequestId) SetSourceId(val *ActorId) { - if x != nil { - x.SourceId = val - } -} -func (x *RequestId) SetTargetId(val *ActorId) { - if x != nil { - x.TargetId = val - } -} - -type RequestDeadLetter struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Err string `protobuf:"bytes,1,opt,name=Err,proto3" json:"Err,omitempty"` -} - -func (x *RequestDeadLetter) Reset() { - *x = RequestDeadLetter{} - if protoimpl.UnsafeEnabled { - mi := &file_actor_msg_proto_msgTypes[2] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *RequestDeadLetter) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (x *RequestDeadLetter) FromDB(data []byte) error { - return proto.Unmarshal(data, x) -} - -func (x *RequestDeadLetter) ToDB() ([]byte, error) { - return proto.Marshal(x) -} - -func (*RequestDeadLetter) ProtoMessage() {} - -func (x *RequestDeadLetter) ProtoReflect() protoreflect.Message { - mi := &file_actor_msg_proto_msgTypes[2] - 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 RequestDeadLetter.ProtoReflect.Descriptor instead. -func (*RequestDeadLetter) Descriptor() ([]byte, []int) { - return file_actor_msg_proto_rawDescGZIP(), []int{2} -} - -func (x *RequestDeadLetter) GetErr() string { - if x != nil { - return x.Err - } - return "" -} - -func (x *RequestDeadLetter) SetErr(val string) { - if x != nil { - x.Err = val - } -} - -// actor是否已经初始化结束判断 -type MsgActorReady struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields -} - -func (x *MsgActorReady) Reset() { - *x = MsgActorReady{} - if protoimpl.UnsafeEnabled { - mi := &file_actor_msg_proto_msgTypes[3] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *MsgActorReady) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (x *MsgActorReady) FromDB(data []byte) error { - return proto.Unmarshal(data, x) -} - -func (x *MsgActorReady) ToDB() ([]byte, error) { - return proto.Marshal(x) -} - -func (*MsgActorReady) ProtoMessage() {} - -func (x *MsgActorReady) ProtoReflect() protoreflect.Message { - mi := &file_actor_msg_proto_msgTypes[3] - 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 MsgActorReady.ProtoReflect.Descriptor instead. -func (*MsgActorReady) Descriptor() ([]byte, []int) { - return file_actor_msg_proto_rawDescGZIP(), []int{3} -} - -// 请求所有注册到etc的actor列表 -type MsgRemoteActors struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields -} - -func (x *MsgRemoteActors) Reset() { - *x = MsgRemoteActors{} - if protoimpl.UnsafeEnabled { - mi := &file_actor_msg_proto_msgTypes[4] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *MsgRemoteActors) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (x *MsgRemoteActors) FromDB(data []byte) error { - return proto.Unmarshal(data, x) -} - -func (x *MsgRemoteActors) ToDB() ([]byte, error) { - return proto.Marshal(x) -} - -func (*MsgRemoteActors) ProtoMessage() {} - -func (x *MsgRemoteActors) ProtoReflect() protoreflect.Message { - mi := &file_actor_msg_proto_msgTypes[4] - 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 MsgRemoteActors.ProtoReflect.Descriptor instead. -func (*MsgRemoteActors) Descriptor() ([]byte, []int) { - return file_actor_msg_proto_rawDescGZIP(), []int{4} -} - -// 内部系统停止 -type MsgSystemStop struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields -} - -func (x *MsgSystemStop) Reset() { - *x = MsgSystemStop{} - if protoimpl.UnsafeEnabled { - mi := &file_actor_msg_proto_msgTypes[5] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *MsgSystemStop) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (x *MsgSystemStop) FromDB(data []byte) error { - return proto.Unmarshal(data, x) -} - -func (x *MsgSystemStop) ToDB() ([]byte, error) { - return proto.Marshal(x) -} - -func (*MsgSystemStop) ProtoMessage() {} - -func (x *MsgSystemStop) ProtoReflect() protoreflect.Message { - mi := &file_actor_msg_proto_msgTypes[5] - 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 MsgSystemStop.ProtoReflect.Descriptor instead. -func (*MsgSystemStop) Descriptor() ([]byte, []int) { - return file_actor_msg_proto_rawDescGZIP(), []int{5} -} - -type ActorId struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Id string `protobuf:"bytes,1,opt,name=Id,proto3" json:"Id,omitempty"` - Host string `protobuf:"bytes,2,opt,name=Host,proto3" json:"Host,omitempty"` - Kind string `protobuf:"bytes,3,opt,name=Kind,proto3" json:"Kind,omitempty"` -} - -func (x *ActorId) Reset() { - *x = ActorId{} - if protoimpl.UnsafeEnabled { - mi := &file_actor_msg_proto_msgTypes[6] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ActorId) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (x *ActorId) FromDB(data []byte) error { - return proto.Unmarshal(data, x) -} - -func (x *ActorId) ToDB() ([]byte, error) { - return proto.Marshal(x) -} - -func (*ActorId) ProtoMessage() {} - -func (x *ActorId) ProtoReflect() protoreflect.Message { - mi := &file_actor_msg_proto_msgTypes[6] - 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 ActorId.ProtoReflect.Descriptor instead. -func (*ActorId) Descriptor() ([]byte, []int) { - return file_actor_msg_proto_rawDescGZIP(), []int{6} -} - -func (x *ActorId) GetId() string { - if x != nil { - return x.Id - } - return "" -} - -func (x *ActorId) GetHost() string { - if x != nil { - return x.Host - } - return "" -} - -func (x *ActorId) GetKind() string { - if x != nil { - return x.Kind - } - return "" -} - -func (x *ActorId) SetId(val string) { - if x != nil { - x.Id = val - } -} -func (x *ActorId) SetHost(val string) { - if x != nil { - x.Host = val - } -} -func (x *ActorId) SetKind(val string) { - if x != nil { - x.Kind = val - } -} - -type EMeshUpdate struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - ActorId *ActorId `protobuf:"bytes,1,opt,name=ActorId,proto3" json:"ActorId,omitempty"` - Add bool `protobuf:"varint,2,opt,name=Add,proto3" json:"Add,omitempty"` -} - -func (x *EMeshUpdate) Reset() { - *x = EMeshUpdate{} - if protoimpl.UnsafeEnabled { - mi := &file_actor_msg_proto_msgTypes[7] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *EMeshUpdate) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (x *EMeshUpdate) FromDB(data []byte) error { - return proto.Unmarshal(data, x) -} - -func (x *EMeshUpdate) ToDB() ([]byte, error) { - return proto.Marshal(x) -} - -func (*EMeshUpdate) ProtoMessage() {} - -func (x *EMeshUpdate) ProtoReflect() protoreflect.Message { - mi := &file_actor_msg_proto_msgTypes[7] - 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 EMeshUpdate.ProtoReflect.Descriptor instead. -func (*EMeshUpdate) Descriptor() ([]byte, []int) { - return file_actor_msg_proto_rawDescGZIP(), []int{7} -} - -func (x *EMeshUpdate) GetActorId() *ActorId { - if x != nil { - return x.ActorId - } - return nil -} - -func (x *EMeshUpdate) GetAdd() bool { - if x != nil { - return x.Add - } - return false -} - -func (x *EMeshUpdate) SetActorId(val *ActorId) { - if x != nil { - x.ActorId = val - } -} -func (x *EMeshUpdate) SetAdd(val bool) { - if x != nil { - x.Add = val - } -} - -type ENewActor struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - ActorId *ActorId `protobuf:"bytes,1,opt,name=ActorId,proto3" json:"ActorId,omitempty"` -} - -func (x *ENewActor) Reset() { - *x = ENewActor{} - if protoimpl.UnsafeEnabled { - mi := &file_actor_msg_proto_msgTypes[8] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ENewActor) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (x *ENewActor) FromDB(data []byte) error { - return proto.Unmarshal(data, x) -} - -func (x *ENewActor) ToDB() ([]byte, error) { - return proto.Marshal(x) -} - -func (*ENewActor) ProtoMessage() {} - -func (x *ENewActor) ProtoReflect() protoreflect.Message { - mi := &file_actor_msg_proto_msgTypes[8] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use ENewActor.ProtoReflect.Descriptor instead. -func (*ENewActor) Descriptor() ([]byte, []int) { - return file_actor_msg_proto_rawDescGZIP(), []int{8} -} - -func (x *ENewActor) GetActorId() *ActorId { - if x != nil { - return x.ActorId - } - return nil -} - -func (x *ENewActor) SetActorId(val *ActorId) { - if x != nil { - x.ActorId = val - } -} - -type EDelActor struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - ActorId *ActorId `protobuf:"bytes,1,opt,name=ActorId,proto3" json:"ActorId,omitempty"` -} - -func (x *EDelActor) Reset() { - *x = EDelActor{} - if protoimpl.UnsafeEnabled { - mi := &file_actor_msg_proto_msgTypes[9] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *EDelActor) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (x *EDelActor) FromDB(data []byte) error { - return proto.Unmarshal(data, x) -} - -func (x *EDelActor) ToDB() ([]byte, error) { - return proto.Marshal(x) -} - -func (*EDelActor) ProtoMessage() {} - -func (x *EDelActor) ProtoReflect() protoreflect.Message { - mi := &file_actor_msg_proto_msgTypes[9] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use EDelActor.ProtoReflect.Descriptor instead. -func (*EDelActor) Descriptor() ([]byte, []int) { - return file_actor_msg_proto_rawDescGZIP(), []int{9} -} - -func (x *EDelActor) GetActorId() *ActorId { - if x != nil { - return x.ActorId - } - return nil -} - -func (x *EDelActor) SetActorId(val *ActorId) { - if x != nil { - x.ActorId = val - } -} - -var File_actor_msg_proto protoreflect.FileDescriptor - -var file_actor_msg_proto_rawDesc = []byte{ - 0x0a, 0x0f, 0x61, 0x63, 0x74, 0x6f, 0x72, 0x5f, 0x6d, 0x73, 0x67, 0x2e, 0x70, 0x72, 0x6f, 0x74, - 0x6f, 0x12, 0x09, 0x61, 0x63, 0x74, 0x6f, 0x72, 0x5f, 0x6d, 0x73, 0x67, 0x22, 0xec, 0x01, 0x0a, - 0x04, 0x4d, 0x61, 0x69, 0x6c, 0x12, 0x2e, 0x0a, 0x08, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x49, - 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x61, 0x63, 0x74, 0x6f, 0x72, 0x5f, - 0x6d, 0x73, 0x67, 0x2e, 0x41, 0x63, 0x74, 0x6f, 0x72, 0x49, 0x64, 0x52, 0x08, 0x53, 0x6f, 0x75, - 0x72, 0x63, 0x65, 0x49, 0x64, 0x12, 0x2e, 0x0a, 0x08, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x49, - 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x61, 0x63, 0x74, 0x6f, 0x72, 0x5f, - 0x6d, 0x73, 0x67, 0x2e, 0x41, 0x63, 0x74, 0x6f, 0x72, 0x49, 0x64, 0x52, 0x08, 0x54, 0x61, 0x72, - 0x67, 0x65, 0x74, 0x49, 0x64, 0x12, 0x32, 0x0a, 0x09, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, - 0x49, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x61, 0x63, 0x74, 0x6f, 0x72, - 0x5f, 0x6d, 0x73, 0x67, 0x2e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x49, 0x64, 0x52, 0x09, - 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x49, 0x64, 0x12, 0x18, 0x0a, 0x07, 0x4d, 0x73, 0x67, - 0x4e, 0x61, 0x6d, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x4d, 0x73, 0x67, 0x4e, - 0x61, 0x6d, 0x65, 0x12, 0x10, 0x0a, 0x03, 0x4d, 0x73, 0x67, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0c, - 0x52, 0x03, 0x4d, 0x73, 0x67, 0x12, 0x24, 0x0a, 0x0d, 0x42, 0x72, 0x6f, 0x61, 0x64, 0x63, 0x61, - 0x73, 0x74, 0x4b, 0x69, 0x6e, 0x64, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x42, 0x72, - 0x6f, 0x61, 0x64, 0x63, 0x61, 0x73, 0x74, 0x4b, 0x69, 0x6e, 0x64, 0x22, 0x91, 0x01, 0x0a, 0x09, - 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x49, 0x64, 0x12, 0x0e, 0x0a, 0x02, 0x49, 0x64, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x02, 0x49, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x53, 0x74, 0x61, - 0x74, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, 0x05, 0x53, 0x74, 0x61, 0x74, 0x65, 0x12, - 0x2e, 0x0a, 0x08, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x49, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, - 0x0b, 0x32, 0x12, 0x2e, 0x61, 0x63, 0x74, 0x6f, 0x72, 0x5f, 0x6d, 0x73, 0x67, 0x2e, 0x41, 0x63, - 0x74, 0x6f, 0x72, 0x49, 0x64, 0x52, 0x08, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x49, 0x64, 0x12, - 0x2e, 0x0a, 0x08, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x49, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, - 0x0b, 0x32, 0x12, 0x2e, 0x61, 0x63, 0x74, 0x6f, 0x72, 0x5f, 0x6d, 0x73, 0x67, 0x2e, 0x41, 0x63, - 0x74, 0x6f, 0x72, 0x49, 0x64, 0x52, 0x08, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x49, 0x64, 0x22, - 0x25, 0x0a, 0x11, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x44, 0x65, 0x61, 0x64, 0x4c, 0x65, - 0x74, 0x74, 0x65, 0x72, 0x12, 0x10, 0x0a, 0x03, 0x45, 0x72, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x03, 0x45, 0x72, 0x72, 0x22, 0x0f, 0x0a, 0x0d, 0x4d, 0x73, 0x67, 0x41, 0x63, 0x74, - 0x6f, 0x72, 0x52, 0x65, 0x61, 0x64, 0x79, 0x22, 0x11, 0x0a, 0x0f, 0x4d, 0x73, 0x67, 0x52, 0x65, - 0x6d, 0x6f, 0x74, 0x65, 0x41, 0x63, 0x74, 0x6f, 0x72, 0x73, 0x22, 0x0f, 0x0a, 0x0d, 0x4d, 0x73, - 0x67, 0x53, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x53, 0x74, 0x6f, 0x70, 0x22, 0x41, 0x0a, 0x07, 0x41, - 0x63, 0x74, 0x6f, 0x72, 0x49, 0x64, 0x12, 0x0e, 0x0a, 0x02, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x02, 0x49, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x48, 0x6f, 0x73, 0x74, 0x18, 0x02, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x48, 0x6f, 0x73, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x4b, 0x69, - 0x6e, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x4b, 0x69, 0x6e, 0x64, 0x22, 0x4d, - 0x0a, 0x0b, 0x45, 0x4d, 0x65, 0x73, 0x68, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x12, 0x2c, 0x0a, - 0x07, 0x41, 0x63, 0x74, 0x6f, 0x72, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x12, - 0x2e, 0x61, 0x63, 0x74, 0x6f, 0x72, 0x5f, 0x6d, 0x73, 0x67, 0x2e, 0x41, 0x63, 0x74, 0x6f, 0x72, - 0x49, 0x64, 0x52, 0x07, 0x41, 0x63, 0x74, 0x6f, 0x72, 0x49, 0x64, 0x12, 0x10, 0x0a, 0x03, 0x41, - 0x64, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, 0x03, 0x41, 0x64, 0x64, 0x22, 0x39, 0x0a, - 0x09, 0x45, 0x4e, 0x65, 0x77, 0x41, 0x63, 0x74, 0x6f, 0x72, 0x12, 0x2c, 0x0a, 0x07, 0x41, 0x63, - 0x74, 0x6f, 0x72, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x61, 0x63, - 0x74, 0x6f, 0x72, 0x5f, 0x6d, 0x73, 0x67, 0x2e, 0x41, 0x63, 0x74, 0x6f, 0x72, 0x49, 0x64, 0x52, - 0x07, 0x41, 0x63, 0x74, 0x6f, 0x72, 0x49, 0x64, 0x22, 0x39, 0x0a, 0x09, 0x45, 0x44, 0x65, 0x6c, - 0x41, 0x63, 0x74, 0x6f, 0x72, 0x12, 0x2c, 0x0a, 0x07, 0x41, 0x63, 0x74, 0x6f, 0x72, 0x49, 0x64, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x61, 0x63, 0x74, 0x6f, 0x72, 0x5f, 0x6d, - 0x73, 0x67, 0x2e, 0x41, 0x63, 0x74, 0x6f, 0x72, 0x49, 0x64, 0x52, 0x07, 0x41, 0x63, 0x74, 0x6f, - 0x72, 0x49, 0x64, 0x42, 0x0e, 0x5a, 0x0c, 0x2e, 0x2e, 0x2f, 0x61, 0x63, 0x74, 0x6f, 0x72, 0x5f, - 0x6d, 0x73, 0x67, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, -} - -var ( - file_actor_msg_proto_rawDescOnce sync.Once - file_actor_msg_proto_rawDescData = file_actor_msg_proto_rawDesc -) - -func file_actor_msg_proto_rawDescGZIP() []byte { - file_actor_msg_proto_rawDescOnce.Do(func() { - file_actor_msg_proto_rawDescData = protoimpl.X.CompressGZIP(file_actor_msg_proto_rawDescData) - }) - return file_actor_msg_proto_rawDescData -} - -var file_actor_msg_proto_msgTypes = make([]protoimpl.MessageInfo, 10) -var file_actor_msg_proto_goTypes = []interface{}{ - (*Mail)(nil), // 0: actor_msg.Mail - (*RequestId)(nil), // 1: actor_msg.RequestId - (*RequestDeadLetter)(nil), // 2: actor_msg.RequestDeadLetter - (*MsgActorReady)(nil), // 3: actor_msg.MsgActorReady - (*MsgRemoteActors)(nil), // 4: actor_msg.MsgRemoteActors - (*MsgSystemStop)(nil), // 5: actor_msg.MsgSystemStop - (*ActorId)(nil), // 6: actor_msg.ActorId - (*EMeshUpdate)(nil), // 7: actor_msg.EMeshUpdate - (*ENewActor)(nil), // 8: actor_msg.ENewActor - (*EDelActor)(nil), // 9: actor_msg.EDelActor -} -var file_actor_msg_proto_depIdxs = []int32{ - 6, // 0: actor_msg.Mail.SourceId:type_name -> actor_msg.ActorId - 6, // 1: actor_msg.Mail.TargetId:type_name -> actor_msg.ActorId - 1, // 2: actor_msg.Mail.RequestId:type_name -> actor_msg.RequestId - 6, // 3: actor_msg.RequestId.SourceId:type_name -> actor_msg.ActorId - 6, // 4: actor_msg.RequestId.TargetId:type_name -> actor_msg.ActorId - 6, // 5: actor_msg.EMeshUpdate.ActorId:type_name -> actor_msg.ActorId - 6, // 6: actor_msg.ENewActor.ActorId:type_name -> actor_msg.ActorId - 6, // 7: actor_msg.EDelActor.ActorId:type_name -> actor_msg.ActorId - 8, // [8:8] is the sub-list for method output_type - 8, // [8:8] is the sub-list for method input_type - 8, // [8:8] is the sub-list for extension type_name - 8, // [8:8] is the sub-list for extension extendee - 0, // [0:8] is the sub-list for field type_name -} - -func init() { file_actor_msg_proto_init() } -func file_actor_msg_proto_init() { - if File_actor_msg_proto != nil { - return - } - if !protoimpl.UnsafeEnabled { - file_actor_msg_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Mail); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_actor_msg_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*RequestId); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_actor_msg_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*RequestDeadLetter); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_actor_msg_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*MsgActorReady); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_actor_msg_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*MsgRemoteActors); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_actor_msg_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*MsgSystemStop); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_actor_msg_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ActorId); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_actor_msg_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*EMeshUpdate); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_actor_msg_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ENewActor); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_actor_msg_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*EDelActor); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - } - type x struct{} - out := protoimpl.TypeBuilder{ - File: protoimpl.DescBuilder{ - GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_actor_msg_proto_rawDesc, - NumEnums: 0, - NumMessages: 10, - NumExtensions: 0, - NumServices: 0, - }, - GoTypes: file_actor_msg_proto_goTypes, - DependencyIndexes: file_actor_msg_proto_depIdxs, - MessageInfos: file_actor_msg_proto_msgTypes, - }.Build() - File_actor_msg_proto = out.File - file_actor_msg_proto_rawDesc = nil - file_actor_msg_proto_goTypes = nil - file_actor_msg_proto_depIdxs = nil -} diff --git a/src/core/actor/actor_msg/actor_msg.proto b/src/core/actor/actor_msg/actor_msg.proto deleted file mode 100644 index bf0ba31..0000000 --- a/src/core/actor/actor_msg/actor_msg.proto +++ /dev/null @@ -1,65 +0,0 @@ -syntax = "proto3"; - -package actor_msg; -option go_package = "../actor_msg"; - -message Mail -{ - ActorId SourceId = 1; - ActorId TargetId = 2; - RequestId RequestId = 3; - string MsgName = 4; - bytes Msg = 5; - string BroadcastKind = 6; -} - -message RequestId -{ - int64 Id = 1; - bool State = 2; //true=req false=resp - ActorId SourceId = 3; - ActorId TargetId = 4; -} - -message RequestDeadLetter -{ - string Err = 1; -} - -// actor是否已经初始化结束判断 -message MsgActorReady -{ -} - -// 请求所有注册到etc的actor列表 -message MsgRemoteActors -{ -} - -// 内部系统停止 -message MsgSystemStop -{ -} - -message ActorId -{ - string Id = 1; - string Host = 2; - string Kind = 3; -} - -message EMeshUpdate -{ - ActorId ActorId = 1; - bool Add = 2; -} - -message ENewActor -{ - ActorId ActorId = 1; -} - -message EDelActor -{ - ActorId ActorId = 1; -} diff --git a/src/core/actor/actor_msg/event.go b/src/core/actor/actor_msg/event.go deleted file mode 100644 index 3d8e209..0000000 --- a/src/core/actor/actor_msg/event.go +++ /dev/null @@ -1,3 +0,0 @@ -package actor_msg - -type MsgEvent struct{ Event interface{} } // 事件包装 diff --git a/src/core/actor/actor_msg/request_id.go b/src/core/actor/actor_msg/request_id.go deleted file mode 100644 index fbf655b..0000000 --- a/src/core/actor/actor_msg/request_id.go +++ /dev/null @@ -1,33 +0,0 @@ -package actor_msg - -import ( - "sync/atomic" - "time" -) - -type RequestWaitMsg func(requestId interface{}) - -var _reqid = time.Now().UnixNano() - -const ( - IsRequest = true - IsResponse = false -) - -func NewRequestId(sourceId, targetId *ActorId) *RequestId { - return &RequestId{ - Id: atomic.AddInt64(&_reqid, 1), - State: IsRequest, - SourceId: sourceId, - TargetId: targetId, - } -} - -func (r *RequestId) IsRequest() bool { return r != nil && r.State == IsRequest } //nolint:gosimple -func (r *RequestId) IsResponse() bool { return r != nil && r.State == IsResponse } //nolint:gosimple -func (r *RequestId) SetResponse() *RequestId { - if r != nil { - r.State = IsResponse - } - return r -} diff --git a/src/core/actor/actor_request.go b/src/core/actor/actor_request.go deleted file mode 100644 index d4a87f1..0000000 --- a/src/core/actor/actor_request.go +++ /dev/null @@ -1,94 +0,0 @@ -package actor - -import ( - "errors" - "fmt" - "time" - - "core/actor/actor_msg" - "core/log" - "core/tools" -) - -const ( - DefaultReqTimeout = time.Second * 10 -) - -type RequestCallback func(resp interface{}, err error) - -type waitActor struct{ ActorHanlerBase } //RequestWait期间实际发出请求的actor处于阻塞状态,由waitActor代理resp -func (s *waitActor) OnStop() bool { return false } - -type request struct { - id *actor_msg.RequestId - callback RequestCallback - timeoutId int64 - result interface{} - respErr error -} - -func (s *Actor) Request(targetId interface{}, msg interface{}, callback RequestCallback, timeout ...time.Duration) { - interval := DefaultReqTimeout - if len(timeout) > 0 { - interval = timeout[0] - } - - s.Send(s.id, func() { - req := s.newRequest(targetId, callback) - s.system.send(s.id, targetId, req.id, msg) - if interval > 0 { - req.timeoutId = s.AddTimer(interval, 1, func(dt int64) { s.Response(req.id, &actor_msg.RequestDeadLetter{Err: "Request timeout"}) }) - } - }) -} - -func (s *Actor) RequestWait(targetId interface{}, msg interface{}, timeout ...time.Duration) (result interface{}, err error) { - waiter := &waitActor{} - s.system.NewActor(KIND_WAIT_REQ, fmt.Sprintf("%s_%s_%s", KIND_WAIT_REQ, s.id.Id, tools.UUID()), waiter, SetLocalized()) - - respC := make(chan struct{}) - waiter.Actor().Request(targetId, msg, func(resp interface{}, e error) { - result, err = resp, e - respC <- struct{}{} - waiter.Actor().StopNow() - }, timeout...) - <-respC // 阻塞等待waiter返回结果 - return -} - -func (s *Actor) Response(requestId, msg interface{}) { - reqId := requestId.(*actor_msg.RequestId) - s.system.send(s.id, reqId.SourceId, reqId.SetResponse(), msg) -} - -func (s *Actor) newRequest(targetId interface{}, callback RequestCallback) (req *request) { - switch _targetId := targetId.(type) { - case string: - req = &request{id: actor_msg.NewRequestId(s.id, &actor_msg.ActorId{Id: _targetId}), callback: callback} - case *actor_msg.ActorId: - req = &request{id: actor_msg.NewRequestId(s.id, _targetId), callback: callback} - } - s.requests[req.id.Id] = req - return req -} - -func (s *Actor) doneRequest(requestId *actor_msg.RequestId, msg interface{}) { - req, ok := s.requests[requestId.Id] - if !ok { - log.KV("actor", s).KV("requestId", requestId).Warn("can not find request") - return - } - - s.CancelTimer(req.timeoutId) - delete(s.requests, requestId.Id) - - switch r := msg.(type) { - case *actor_msg.RequestDeadLetter: - req.respErr = errors.New(r.Err) - case error: - req.respErr = r - default: - req.result = msg - } - req.callback(req.result, req.respErr) -} diff --git a/src/core/actor/actor_system.go b/src/core/actor/actor_system.go deleted file mode 100644 index e7eb6d0..0000000 --- a/src/core/actor/actor_system.go +++ /dev/null @@ -1,320 +0,0 @@ -package actor - -import ( - "encoding/json" - "os" - "os/signal" - "sync" - "syscall" - "time" - - "core/actor/actor_msg" - "core/actor/cmd" - "core/actor/event" - "core/actor/monitor" - "core/goroutine" - "core/log" - "core/prometheus" - "core/tools" -) - -const ( - KIND_WAIT_REQ = "$reqwait" - KIND_SYSTEM = "$system" - - ID_SYSTEM = "$system" - ID_REMOTE = "$remote" - ID_MESH = "$mesh" -) - -func NewActorSystem(ops ...SystemOption) *ActorSystem { - sys := &ActorSystem{ - locals: make(map[string]*Actor), - remotes: make(map[string]*actor_msg.ActorId), - - mesh: &BaseMeshProvider{}, - remote: &BaseRemoteProvider{}, - command: cmd.NewCommand(), - dispatcher: event.NewEventDispatcher(), - monitor: monitor.NewPrometheus(), - exitSignal: make(chan os.Signal, 1), - } - - for _, op := range ops { - tools.AssertNil(op(sys)) - } - sys.monitor.Init(KIND_WAIT_REQ) - - sysActor := newActor(KIND_SYSTEM, ID_SYSTEM, sys, sys, SetLocalized(), SetInitErrExit()) - sys.NewActor(KIND_SYSTEM, ID_REMOTE, sys.remote, SetLocalized(), SetInitErrExit()) - sys.NewActor(KIND_SYSTEM, ID_MESH, sys.mesh, SetLocalized(), SetInitErrExit()) - - sys.cmd().Regist(sysActor, "stop", func(param string) ([]byte, error) { - sys.Stop() - return []byte("stop"), nil - }) - - goroutine.GoLogic(func() { - goroutine.Try(func() { sysActor.loop() }, nil) - sys.event().CancelAll(sysActor.Id()) - }, nil) - - _, err := sysActor.RequestWait(sysActor.Id(), &actor_msg.MsgActorReady{}) - tools.AssertNil(err) - - _, err = sysActor.RequestWait(sys.remote.Actor().Id(), &actor_msg.MsgActorReady{}) - tools.AssertNil(err) - - _, err = sysActor.RequestWait(sys.mesh.Actor().Id(), &actor_msg.MsgActorReady{}) - tools.AssertNil(err) - return sys -} - -type ActorSystem struct { - ActorHanlerBase - dispatcher *event.EventDispatcher // 事件分发 - locals map[string]*Actor // 所有本地actor - remotes map[string]*actor_msg.ActorId // 注册到服务发现上的所有actor - mesh IMeshProvider // 服务发现 - remote IRemoteProvider // 远程通信 - command *cmd.Command // 命令模式 - monitor *monitor.Prometheus // 监控 - exitOnce sync.Once - exitSignal chan os.Signal -} - -func (s *ActorSystem) OnStart() error { - s.event().Regist(s.Actor(), (*actor_msg.EMeshUpdate)(nil)) - s.Actor().RegistCmd("actor_info", s.actorinfo) - return nil -} - -func (s *ActorSystem) OnStop() bool { return false } - -func (s *ActorSystem) HandleEvent(event interface{}) { - switch e := event.(type) { - case *actor_msg.EMeshUpdate: - if e.Add { - s.remotes[e.ActorId.Id] = e.ActorId - } else { - delete(s.remotes, e.ActorId.Id) - } - } -} - -func (s *ActorSystem) HandleRequest(sourceId, targetId, requestId, msg interface{}) { - switch msg.(type) { - case *actor_msg.MsgRemoteActors: - var ret []string - for actorId := range s.remotes { - ret = append(ret, actorId) - } - s.Actor().Response(requestId, ret) - case *actor_msg.MsgActorReady: - s.Actor().Response(requestId, msg) - case *actor_msg.MsgSystemStop: - s.stop(requestId) - default: - s.Actor().Response(requestId, &actor_msg.RequestDeadLetter{Err: "not regist handler"}) - } -} - -func (s *ActorSystem) HandleMessage(sourceId, targetId, msg interface{}) { - if !s.Actor().Is(targetId) { - s.handleMsg(msg.(*actor_msg.Mail)) - return - } - - switch message := msg.(type) { - case *Actor: - s.newActor(message) - default: - log.KV("msg", actor_msg.MsgName(message)).Warn("no such case type") - } -} - -func (s *ActorSystem) NewActor(kind, id string, handler IActorHandler, ops ...ActorOption) { - s.send(s.Actor().Id(), s.Actor().Id(), nil, newActor(kind, id, s, handler, ops...)) -} - -func (s *ActorSystem) Stop() { - s.exitOnce.Do(func() { close(s.exitSignal) }) -} - -func (s *ActorSystem) WaitStop() { - <-s.exitSignal - s.onStop() -} - -func (s *ActorSystem) RemoteActors() []string { - result, err := s.Actor().RequestWait(s.Actor().Id(), &actor_msg.MsgRemoteActors{}) - if err != nil { - return nil - } - return result.([]string) -} - -func (s *ActorSystem) onStop() { - _, err := s.Actor().RequestWait(s.Actor().Id(), &actor_msg.MsgSystemStop{}, time.Hour*24) - tools.AssertNil(err) - - _, err = s.Actor().RequestWait(s.mesh.Actor().Id(), &actor_msg.MsgSystemStop{}) - tools.AssertNil(err) - - _, err = s.Actor().RequestWait(s.remote.Actor().Id(), &actor_msg.MsgSystemStop{}) - tools.AssertNil(err) - - s.Actor().StopNow() - log.InfoStack(1, "actor system stopped") -} - -func (s *ActorSystem) address() string { return s.remote.Address() } - -func (s *ActorSystem) send(sourceId *actor_msg.ActorId, targetId interface{}, requestId *actor_msg.RequestId, msg interface{}) { - switch _targetId := targetId.(type) { - case string: - targetId = &actor_msg.ActorId{Id: _targetId} - } - s.Actor().push(actor_msg.NormalMail(sourceId, targetId.(*actor_msg.ActorId), requestId, msg)) -} - -func (s *ActorSystem) broadcast(sourceId *actor_msg.ActorId, kind string, msg interface{}) { - s.Actor().push(actor_msg.BroadcastMail(sourceId, kind, msg)) -} - -func (s *ActorSystem) cmd() *cmd.Command { return s.command } -func (s *ActorSystem) prometheus() *monitor.Prometheus { return s.monitor } -func (s *ActorSystem) event() *event.EventDispatcher { return s.dispatcher } - -func (s *ActorSystem) handleMsg(mail *actor_msg.Mail) { - if mail.BroadcastKind != "" { - s._broadcast(mail) - } else { - s.forward(mail) - } -} - -func (s *ActorSystem) _broadcast(mail *actor_msg.Mail) { - consume := make(map[string]bool) - for actorId, local := range s.locals { - if local.Kind() == mail.BroadcastKind { - consume[actorId] = true - s.forward(actor_msg.NormalMail(mail.SourceId, local.Id(), nil, mail.Message())) - } - } - - for _, remote := range s.remotes { - if remote.Kind == mail.BroadcastKind && !consume[remote.Id] { - s.forward(actor_msg.NormalMail(mail.SourceId, remote, nil, mail.Message())) - } - } -} - -func (s *ActorSystem) forward(mail *actor_msg.Mail) { - if local, ok := s.locals[mail.TargetId.Id]; ok { //本地 - local.push(mail) - } else { //远端 - s.sendRemote(mail) - } -} - -func (s *ActorSystem) sendRemote(mail *actor_msg.Mail) { - if mail.RequestId.IsResponse() { - if mail.RequestId.SourceId.Host != s.address() { - s.locals[ID_REMOTE].push(mail) - } else { - log.KV("mail", mail).Error("resp not find actor") - } - return - } - - if _, ok := s.remotes[mail.TargetId.Id]; ok { - s.locals[ID_REMOTE].push(mail) - } else { - log.KV("mail", mail).Error("remote not find") - if mail.RequestId.IsRequest() { - s.Actor().Response(mail.RequestId, &actor_msg.RequestDeadLetter{Err: "remote not find"}) - } - } -} - -func (s *ActorSystem) stop(requestId interface{}) { - var timerId int64 - s.Actor().Send(s.Actor().Id(), func() { - timerId = s.Actor().AddTimer(time.Second, -1, func(dt int64) { - onlyCore := true - for _, local := range s.locals { - local.SuspendStop() - onlyCore = onlyCore && (local.Kind() == KIND_SYSTEM || local.Kind() == KIND_WAIT_REQ) - } - if onlyCore { - s.Actor().Response(requestId, &actor_msg.MsgSystemStop{}) - s.Actor().CancelTimer(timerId) - } - }) - }) -} - -func (s *ActorSystem) newActor(actor *Actor) { - if _, ok := s.locals[actor.Id().Id]; ok { - log.KV("actor", actor).Error("actor with same id") - return - } - s.locals[actor.Id().Id] = actor - - goroutine.GoLogic(func() { - defer s.Actor().Send(s.Actor().Id(), func() { - delete(s.locals, actor.Id().Id) - s.event().CancelAll(actor.Id()) - }) - goroutine.Try(func() { actor.loop() }, nil) - }, nil) -} - -func (s *ActorSystem) actorinfo(params string) ([]byte, error) { - var actors []*actor_msg.ActorId - for _, remote := range s.remotes { - actors = append(actors, remote) - } - for _, local := range s.locals { - actors = append(actors, local.Id()) - } - return json.Marshal(actors) -} - -type SystemOption func(*ActorSystem) error - -func WithCMD(filename string) SystemOption { - return func(system *ActorSystem) error { - system.command.Start(filename) - return nil - } -} - -func WithRemote(remote IRemoteProvider) SystemOption { - return func(system *ActorSystem) error { - system.remote = remote - return nil - } -} - -func WithMesh(mesh IMeshProvider) SystemOption { - return func(system *ActorSystem) error { - system.mesh = mesh - return nil - } -} - -func WithPrometheus(registry *prometheus.Prometheus) SystemOption { - return func(system *ActorSystem) error { - system.monitor.ResetRegistry(registry) - return nil - } -} - -func WithStopSignal() SystemOption { - return func(system *ActorSystem) error { - signal.Notify(system.exitSignal, syscall.SIGHUP, syscall.SIGINT, syscall.SIGTERM, syscall.SIGQUIT) - return nil - } -} diff --git a/src/core/actor/cluster.go b/src/core/actor/cluster.go deleted file mode 100644 index 5cd9944..0000000 --- a/src/core/actor/cluster.go +++ /dev/null @@ -1,49 +0,0 @@ -package actor - -import ( - "core/actor/actor_msg" -) - -type IMeshProvider interface{ IActorHandler } //服务发现 -func NewBaseMeshProvider() *BaseMeshProvider { return &BaseMeshProvider{} } // -type BaseMeshProvider struct{ ActorHanlerBase } // -func (s *BaseMeshProvider) OnStop() bool { return false } -func (s *BaseMeshProvider) HandleRequest(sourceId, targetId, requestId, msg interface{}) { - switch msg.(type) { - case *actor_msg.MsgActorReady: - s.Actor().Response(requestId, msg) - case *actor_msg.MsgSystemStop: - s.Actor().Response(requestId, msg) - s.Actor().StopNow() - default: - s.Actor().Response(requestId, &actor_msg.RequestDeadLetter{Err: "not regist handler"}) - } -} - -// IRemoteProvider 远程消息发送 -type IRemoteProvider interface { - IActorHandler - Address() string - OnRecv(mail *actor_msg.Mail) -} - -func NewBaseRemoteProvider(addr string) *BaseRemoteProvider { return &BaseRemoteProvider{addr: addr} } // -type BaseRemoteProvider struct { - ActorHanlerBase - addr string -} - -func (s *BaseRemoteProvider) OnRecv(mail *actor_msg.Mail) { s.actor.System().Actor().push(mail) } -func (s *BaseRemoteProvider) Address() string { return s.addr } -func (s *BaseRemoteProvider) OnStop() bool { return false } -func (s *BaseRemoteProvider) HandleRequest(sourceId, targetId, requestId, msg interface{}) { - switch msg.(type) { - case *actor_msg.MsgActorReady: - s.Actor().Response(requestId, msg) - case *actor_msg.MsgSystemStop: - s.Actor().Response(requestId, msg) - s.Actor().StopNow() - default: - s.Actor().Response(requestId, &actor_msg.RequestDeadLetter{Err: "not regist handler"}) - } -} diff --git a/src/core/actor/cluster/mesh_provider/etcd/mesh.go b/src/core/actor/cluster/mesh_provider/etcd/mesh.go deleted file mode 100644 index 38aa90a..0000000 --- a/src/core/actor/cluster/mesh_provider/etcd/mesh.go +++ /dev/null @@ -1,260 +0,0 @@ -package etcd - -import ( - "context" - "encoding/json" - "fmt" - "strings" - "sync" - "time" - - clientv3 "go.etcd.io/etcd/client/v3" - "go.uber.org/atomic" - - "core/actor" - "core/actor/actor_msg" - "core/goroutine" - "core/log" - "core/tools" -) - -const ( - ETCD_TIMEOUT = 5 * time.Second //etcd连接超时 - ETCD_GRANT_TTL = 6 //etcd alive seconds - InvalidLeaseId = -1 -) - -type Mesh struct { - *actor.BaseMeshProvider - - endpoints string - prefix string - etcdCliet *clientv3.Client - leaseId atomic.Int64 // 租约 - revision int64 // 当前监听版本号 - registErr atomic.Bool // 注册错误(当任意注册发生错误,则全部推倒重来) - - localActors sync.Map // 本地需要注册的actors - remoteActors *sync.Map // 注册到etcd的actors - - stopCh chan struct{} - initWG sync.WaitGroup - initOnce sync.Once -} - -func NewMesh(endpoints, prefix string) *Mesh { - client, err := clientv3.New(clientv3.Config{Endpoints: strings.Split(endpoints, "_"), DialTimeout: ETCD_TIMEOUT}) - tools.AssertNil(err) - etcd := &Mesh{ - BaseMeshProvider: actor.NewBaseMeshProvider(), - etcdCliet: client, - endpoints: endpoints, - prefix: prefix, - remoteActors: &sync.Map{}, - stopCh: make(chan struct{}), - } - etcd.setLeaseID(InvalidLeaseId) - return etcd -} - -func (s *Mesh) OnStart() error { - log.KV("endpoints", s.endpoints).KV("prefix", s.prefix).Info("etcd start") - s.Actor().Event().Regist(s.Actor(), (*actor_msg.ENewActor)(nil), (*actor_msg.EDelActor)(nil)) - - s.initWG.Add(1) - goroutine.GoLogic(func() { - for { - select { - case <-s.stopCh: - log.KV("endpoints", s.endpoints).KV("prefix", s.prefix).Info("etcd stop") - return - default: - goroutine.Try(s.run, nil) - } - time.Sleep(time.Second) - } - }, nil) - s.initWG.Wait() - return nil -} - -func (s *Mesh) HandleEvent(event interface{}) { - switch ev := event.(type) { - case *actor_msg.ENewActor: - s.registService(ev.ActorId) - case *actor_msg.EDelActor: - s.unregistService(ev.ActorId) - } -} - -func (s *Mesh) HandleRequest(sourceId, targetId, requestId, msg interface{}) { - switch msg.(type) { - case *actor_msg.MsgActorReady: - s.Actor().Response(requestId, msg) - case *actor_msg.MsgSystemStop: - s.etcdCliet.Close() - close(s.stopCh) - s.Actor().Response(requestId, msg) - s.Actor().StopNow() - default: - s.Actor().Response(requestId, &actor_msg.RequestDeadLetter{Err: "not regist handler"}) - } -} - -func (s *Mesh) registService(pid *actor_msg.ActorId) { - key := fmt.Sprintf("%s/%s/%s", s.prefix, pid.Kind, pid.Id) - s.localActors.Store(key, pid) - - leaseId := s.getLeaseID() - if leaseId == InvalidLeaseId { - log.KV("actor", pid).Warn("etcd has not lease") - return - } - - val, _ := json.Marshal(pid) - if _, err := s.etcdCliet.Put(context.TODO(), key, string(val), clientv3.WithLease(leaseId)); err != nil { - s.registErr.Store(true) - log.KV("error", s.registErr).KV("actor", pid).Warn("regist etcd failed") - } -} - -func (s *Mesh) unregistService(pid *actor_msg.ActorId) { - key := fmt.Sprintf("%s/%s/%s", s.prefix, pid.Kind, pid.Id) - s.localActors.Delete(key) - - if _, err := s.etcdCliet.Delete(context.TODO(), key); err != nil { - log.KV("error", err).KV("key", key).Error("unregist etcd failed") - } -} - -//nolint:govet -func (s *Mesh) keepAlive() (<-chan *clientv3.LeaseKeepAliveResponse, context.CancelFunc, clientv3.WatchChan, context.CancelFunc, bool) { - log.Info("etcd keepAlive start") - s.setLeaseID(InvalidLeaseId) - - ctx, _ := context.WithTimeout(context.TODO(), ETCD_TIMEOUT) - lease, err := s.etcdCliet.Grant(ctx, ETCD_GRANT_TTL) - if err != nil { - log.KV("err", err).Error("etcd keepAlive create lease failed") - return nil, nil, nil, nil, false - } - - ctx, cancelAlive := context.WithCancel(context.TODO()) - alive, err := s.etcdCliet.KeepAlive(ctx, lease.ID) - if err != nil { - log.KV("err", err).Error("etcd keepAlive failed") - return nil, nil, nil, nil, false - } - - s.setLeaseID(lease.ID) - s.syncLocalToEtcd() - - ctx, cancelWatch := context.WithCancel(context.TODO()) - watch := s.etcdCliet.Watch(ctx, s.prefix, clientv3.WithPrefix(), clientv3.WithPrevKV()) - if err = s.initAlreadyInEtcd(); err != nil { - return alive, cancelAlive, nil, nil, false - } - - s.registErr.Store(false) - s.initOnce.Do(s.initWG.Done) - log.KV("lease", s.getLeaseID()).Info("etcd keepAlive success!") - return alive, cancelAlive, watch, cancelWatch, true -} - -func (s *Mesh) getLeaseID() clientv3.LeaseID { return (clientv3.LeaseID)(s.leaseId.Load()) } -func (s *Mesh) setLeaseID(leaseID clientv3.LeaseID) { s.leaseId.Store((int64)(leaseID)) } - -// 把本地所有actor注册到etcd上 -func (s *Mesh) syncLocalToEtcd() { - s.localActors.Range(func(key, value interface{}) bool { - s.registService(value.(*actor_msg.ActorId)) - return true - }) -} - -func (s *Mesh) run() { - alive, cancelAlive, watch, cancelWatch, ok := s.keepAlive() - defer func() { - if cancelAlive != nil { - cancelAlive() - } - if cancelWatch != nil { - cancelWatch() - } - }() - - if !ok { - return - } - - ticker := time.NewTicker(time.Second * 5) //间隔检查注册错误 - defer ticker.Stop() - for { - select { - case <-ticker.C: - if s.registErr.Load() { - return - } - case <-s.stopCh: - return - case resp := <-alive: - if resp == nil { - return - } - case watchResp := <-watch: - if err := watchResp.Err(); err != nil { - log.KV("error", err).Warn("watch etcd error") - return - } - - revision := watchResp.Header.GetRevision() - if s.revision > revision { - log.KV("last", s.revision).KV("revision", revision).Debug("watch etcd revision") - break - } - - s.revision = revision - for _, ev := range watchResp.Events { - s.unmarshalEvent(string(ev.Kv.Key), ev.Kv.Value, ev.Type == clientv3.EventTypePut) - } - } - } -} - -func (s *Mesh) initAlreadyInEtcd() error { - resp, err := clientv3.NewKV(s.etcdCliet).Get(context.Background(), s.prefix, clientv3.WithPrefix()) - if err != nil { - log.KV("err", err).Error("get etcd failed") - return err - } - s.revision = resp.Header.GetRevision() - - olds := s.remoteActors - s.remoteActors = &sync.Map{} - for _, kv := range resp.Kvs { - s.unmarshalEvent(string(kv.Key), kv.Value, true) - } - olds.Range(func(key, old any) bool { - if _, ok := s.remoteActors.Load(key); !ok { - s.Actor().Event().Dispatch(s.Actor(), &actor_msg.EMeshUpdate{ActorId: old.(*actor_msg.ActorId), Add: false}) - } - return true - }) - return nil -} - -func (s *Mesh) unmarshalEvent(key string, data []byte, add bool) { - if add { - pid := &actor_msg.ActorId{} - if err := json.Unmarshal(data, pid); err != nil { - log.KV("value", string(data)).KV("key", key).KV("add", add).Error("unmarshalEvent error") - } - s.remoteActors.Store(key, pid) - s.Actor().Event().Dispatch(s.Actor(), &actor_msg.EMeshUpdate{ActorId: pid, Add: true}) - } else { - if old, has := s.remoteActors.Load(key); has { - s.remoteActors.Delete(key) - s.Actor().Event().Dispatch(s.Actor(), &actor_msg.EMeshUpdate{ActorId: old.(*actor_msg.ActorId), Add: false}) - } - } -} diff --git a/src/core/actor/cluster/remote_provider/nats/remote.go b/src/core/actor/cluster/remote_provider/nats/remote.go deleted file mode 100644 index 4683972..0000000 --- a/src/core/actor/cluster/remote_provider/nats/remote.go +++ /dev/null @@ -1,104 +0,0 @@ -package nats - -import ( - "core/actor" - "core/actor/actor_msg" - "core/log" - "core/tools" -) - -func NewRemote(nats_addr, name string) *Remote { - conn, err := nats.Connect(nats_addr, nats.Name(name)) - tools.AssertNil(err) - nats := &Remote{ - BaseRemoteProvider: actor.NewBaseRemoteProvider(tools.UUID()), - conn: conn, - subs: make(map[string]*nats.Subscription), - } - return nats -} - -type Remote struct { - *actor.BaseRemoteProvider - conn *nats.Conn - subs map[string]*nats.Subscription -} - -func (this *Remote) OnStart() error { - this.subscribe(this.Address()) - this.Actor().Event().Regist(this.Actor(), (*actor_msg.ENewActor)(nil), (*actor_msg.EDelActor)(nil)) - return nil -} - -func (this *Remote) HandleEvent(event interface{}) { - switch e := event.(type) { - case *actor_msg.ENewActor: - this.subscribe(e.ActorId.Id) - case *actor_msg.EDelActor: - this.unsubscribe(e.ActorId.Id) - } -} - -func (this *Remote) HandleMessage(sourceId, targetId, msg interface{}) { - if !this.Actor().Is(targetId) { - mail := msg.(*actor_msg.Mail) - if err := this.send(mail); err != nil { - log.KV("err", err).KV("mail", mail).Error("send remote failed") - if mail.RequestId.IsRequest() { - this.Actor().Response(mail.RequestId, &actor_msg.RequestDeadLetter{Err: err.Error()}) - } - } - } else { - log.KV("source", sourceId).KV("target", targetId).KV("msg", msg).Error("msg handler not define") - } -} - -func (this *Remote) HandleRequest(sourceId, targetId, requestId, msg interface{}) { - switch msg.(type) { - case *actor_msg.MsgActorReady: - this.Actor().Response(requestId, msg) - case *actor_msg.MsgSystemStop: - if this.conn != nil { - this.conn.Drain() //nolint:errcheck - this.conn.Close() - } - this.Actor().Response(requestId, msg) - this.Actor().StopNow() - default: - this.Actor().Response(requestId, &actor_msg.RequestDeadLetter{Err: "not regist handler"}) - } -} - -func (this *Remote) subscribe(subj string) { - sub, err := this.conn.Subscribe(subj, this.recv) - tools.AssertNil(err) - this.subs[subj] = sub -} - -func (this *Remote) unsubscribe(subj string) { - if sub, ok := this.subs[subj]; ok { - sub.Unsubscribe() //nolint:errcheck - delete(this.subs, subj) - } -} - -func (this *Remote) send(mail *actor_msg.Mail) error { - addr := mail.TargetId.Id - if mail.RequestId.IsResponse() { - addr = mail.RequestId.SourceId.Host - } - data, err := mail.Marshal() - if err != nil { - return err - } - return this.conn.Publish(addr, data) -} - -func (this *Remote) recv(nm *nats.Msg) { - mail := &actor_msg.Mail{} - if err := mail.Unmarshal(nm.Data); err != nil { - log.KV("sub", nm.Subject).KV("err", err).Error("unmarshal mail failed") - return - } - this.OnRecv(mail) -} diff --git a/src/core/actor/cluster/remote_provider/prs/remote.go b/src/core/actor/cluster/remote_provider/prs/remote.go deleted file mode 100644 index f4cf347..0000000 --- a/src/core/actor/cluster/remote_provider/prs/remote.go +++ /dev/null @@ -1,220 +0,0 @@ -package prs - -import ( - "errors" - "strings" - "time" - - cmap "github.com/orcaman/concurrent-map" - - "core/actor" - "core/actor/actor_msg" - "core/goroutine" - "core/log" - "core/network" - "core/tools" -) - -func NewRemote(addr string) *Remote { - mgr := &Remote{ - BaseRemoteProvider: actor.NewBaseRemoteProvider(addr), - sessions: cmap.New(), - clients: cmap.New(), - remotes: map[string]string{}, - sameHosts: map[string]map[string]bool{}, - stopCh: make(chan struct{}), - } - return mgr -} - -type Remote struct { - *actor.BaseRemoteProvider - - listener network.INetListener - - stopCh chan struct{} - sessions cmap.ConcurrentMap //host=>session - clients cmap.ConcurrentMap //host=>client - remotes map[string]string //注册到服务发现上的所有actor actorId=>host - sameHosts map[string]map[string]bool //地址相同的actor分类 host=>actorIds -} - -func (this *Remote) OnStart() error { - listener := network.NewTcpListener( - this.Address(), - func() network.ICodec { return &network.StreamCodec{} }, - func() network.INetHandler { return &RemoteHandler{remote: this} }, - ) - - err := listener.Listen() - tools.AssertNil(err) - - this.listener = listener - goroutine.GoLogic(this.keepAlive, nil) - - this.Actor().Event().Regist(this.Actor(), (*actor_msg.EMeshUpdate)(nil)) - return nil -} - -func (this *Remote) HandleEvent(event interface{}) { - switch e := event.(type) { - case *actor_msg.EMeshUpdate: - this.onRemoteUpdate(e) - } -} - -func (this *Remote) HandleMessage(sourceId, targetId, msg interface{}) { - if !this.Actor().Is(targetId) { - mail := msg.(*actor_msg.Mail) - if err := this.send(mail); err != nil { - log.KV("err", err).KV("mail", mail).Error("send remote failed") - if mail.RequestId.IsRequest() { - this.Actor().Response(mail.RequestId, &actor_msg.RequestDeadLetter{Err: err.Error()}) - } - } - } else { - log.KV("source", sourceId).KV("target", targetId).KV("msg", msg).Error("msg handler not define") - } -} - -func (this *Remote) HandleRequest(sourceId, targetId, requestId, msg interface{}) { - switch msg.(type) { - case *actor_msg.MsgActorReady: - this.Actor().Response(requestId, msg) - case *actor_msg.MsgSystemStop: - close(this.stopCh) - this.listener.Stop() - this.Actor().Response(requestId, msg) - this.Actor().StopNow() - default: - this.Actor().Response(requestId, &actor_msg.RequestDeadLetter{Err: "not regist handler"}) - } -} - -func (this *Remote) newClient(host string) { - log.KV("host", host).Debug("start remote connect") - cli := network.NewTcpClient( - host, - func() network.ICodec { return &network.StreamCodec{} }, - func() network.INetHandler { return &RemoteHandler{remote: this, peerHost: host} }, - ) - this.clients.Set(host, cli) - cli.Connect(true) //nolint:errcheck -} - -func (this *Remote) stopClient(host string) { - log.KV("host", host).Debug("stop remote connect") - if cli, ok := this.clients.Pop(host); ok { - cli.(network.INetClient).Stop() - } -} - -func (this *Remote) keepAlive() { - ticker := time.NewTicker(time.Second * 15) - defer ticker.Stop() - - ping := []byte("$ping") - for { - select { - case <-this.stopCh: - this.clients.IterCb(func(key string, v interface{}) { v.(network.INetClient).Stop() }) - return - case <-ticker.C: - this.clients.IterCb(func(key string, v interface{}) { v.(network.INetClient).SendMsg(ping) }) //nolint:errcheck - } - } -} - -func (this *Remote) send(mail *actor_msg.Mail) error { - addr := this.remotes[mail.TargetId.Id] - if mail.RequestId.IsResponse() { - addr = mail.RequestId.SourceId.Host - } - session, ok := this.sessions.Get(addr) - if !ok { - return errors.New("remote addr not found") - } - data, err := mail.Marshal() - if err != nil { - return err - } - session.(*RemoteHandler).SendMsg(data) - return nil -} - -func (this *Remote) onRemoteUpdate(e *actor_msg.EMeshUpdate) { - if !e.Add { - this.delRemoteActor(e.ActorId.Id) - } else { - if remote, ok := this.remotes[e.ActorId.Id]; ok { - if remote != e.ActorId.Host { //actor地址修改了 - this.delRemoteActor(e.ActorId.Id) - } - } - - this.remotes[e.ActorId.Id] = e.ActorId.Host - if e.ActorId.Host >= this.BaseRemoteProvider.Address() { - return - } - - actors := this.sameHosts[e.ActorId.Host] - if len(actors) > 0 { //已有client - actors[e.ActorId.Id] = true - return - } - this.sameHosts[e.ActorId.Host] = map[string]bool{e.ActorId.Id: true} - this.newClient(e.ActorId.Host) - } -} - -func (this *Remote) delRemoteActor(actorId string) { - host := this.remotes[actorId] - delete(this.remotes, actorId) - - if actors, ok := this.sameHosts[host]; ok { - delete(actors, actorId) - if len(actors) == 0 { - delete(this.sameHosts, host) - this.stopClient(host) - } - } -} - -// /////////////////////////////////////// RemoteHandler ///////////////////////////////////////////// -type RemoteHandler struct { - network.BaseNetHandler - remote *Remote - peerHost string -} - -func (s *RemoteHandler) OnSessionCreated() { - if s.peerHost != "" { - s.remote.sessions.Set(s.peerHost, s) - s.SendMsg([]byte("$regist_" + s.remote.Address())) - } -} - -func (s *RemoteHandler) OnSessionClosed() { s.remote.sessions.Remove(s.peerHost) } - -func (s *RemoteHandler) OnRecv(msgId int32, data interface{}) { - if s.remote == nil { - s.Stop() - return - } - - str := string(data.([]byte)) - if strings.HasPrefix(str, "$regist_") { - host := strings.TrimLeft(str, "$regist_") - s.peerHost = host - s.remote.sessions.Set(host, s) - } else if str == "$ping" { - //do nothing - } else { - mail := &actor_msg.Mail{} - if err := mail.Unmarshal(data.([]byte)); err != nil { - log.KV("host", s.peerHost).Error("unmarshal mail failed") - return - } - s.remote.OnRecv(mail) - } -} diff --git a/src/core/actor/cmd/cmd.go b/src/core/actor/cmd/cmd.go deleted file mode 100644 index 16549d8..0000000 --- a/src/core/actor/cmd/cmd.go +++ /dev/null @@ -1,122 +0,0 @@ -package cmd - -import ( - "context" - "encoding/json" - "errors" - "net" - "os" - "sync" - "time" - - "core/actor/actor_msg" - "core/goroutine" - "core/log" - "core/tools" -) - -func NewCommand() *Command { - cmd := &Command{} - cmd.cmds.LoadOrStore(cmd.key("", "help"), &Cmd{actor: nil, Cmd: "help", ActorId: "", fn: func(param string) ([]byte, error) { - var cmds []*Cmd - cmd.cmds.Range(func(_, cmd interface{}) bool { - cmds = append(cmds, cmd.(*Cmd)) - return true - }) - return json.Marshal(cmds) - }}) - return cmd -} - -type Command struct { - cmds sync.Map -} - -func (c *Command) Regist(actor IActor, cmd string, fn Func) { - if _, load := c.cmds.LoadOrStore(c.key(actor.Id().Id, cmd), &Cmd{actor: actor, Cmd: cmd, ActorId: actor.Id().Id, fn: fn}); load { - log.KV("actor", actor).KV("cmd", cmd).WarnStack(2, "regist cmd repeated") - } -} - -func (c *Command) Start(filename string) { - _ = os.Remove(filename) - addr, err := net.ResolveUnixAddr("unix", filename) - tools.AssertNil(err) - - ln, err := net.ListenUnix("unix", addr) - tools.AssertNil(err) - - log.KV("filename", filename).KV("addr", addr).Info("actor cmd start") - goroutine.GoLogic(func() { - for { - conn, err := ln.AcceptUnix() - tools.AssertNil(err) - goroutine.GoLogic(func() { c.handleUnixConn(conn) }, nil) - } - }, nil) -} - -func (c *Command) handleUnixConn(conn *net.UnixConn) { - defer conn.Close() - for { - msg, err := Receive(conn, time.Minute) - if err != nil { - log.KV("err", err).Info("cmd finish") - return - } - - log.KV("cmd", msg.MsgName).KV("param", string(msg.Msg)).Info("cmd start") - text, err := c.exec(msg) - resp := "ok" - if err != nil { - resp = err.Error() - log.KV("cmd", msg.MsgName).KV("text", text).KV("err", err).Info("exec error") - } - - if err = Send(conn, "resp", resp, text); err != nil { - log.KV("cmd", msg.MsgName).KV("err", err).Info("send cmd resp error") - return - } - } -} - -func (c *Command) exec(mail *actor_msg.Mail) (text []byte, err error) { - ins, exist := c.cmds.Load(c.key(mail.TargetId.Id, mail.MsgName)) - if !exist { - return nil, errors.New("cmd not found") - } - cmd := ins.(*Cmd) - return cmd.exec(string(mail.Msg)) -} - -func (c *Command) key(actorId, cmd string) string { return cmd + ":" + actorId } - -type IActor interface { - Id() *actor_msg.ActorId - Send(targetId interface{}, msg interface{}) -} - -type Func func(param string) ([]byte, error) -type Cmd struct { - Cmd string - ActorId string - actor IActor - fn Func -} - -var timeoutErr = errors.New("exec time out") - -func (cmd Cmd) exec(params string) (text []byte, err error) { - if cmd.actor == nil { - return cmd.fn(params) - } - - err = timeoutErr - wait, done := context.WithTimeout(context.Background(), time.Minute*30) - cmd.actor.Send(cmd.actor.Id(), func() { - text, err = cmd.fn(params) - done() - }) - <-wait.Done() - return -} diff --git a/src/core/actor/cmd/conn.go b/src/core/actor/cmd/conn.go deleted file mode 100644 index a33288a..0000000 --- a/src/core/actor/cmd/conn.go +++ /dev/null @@ -1,49 +0,0 @@ -package cmd - -import ( - "encoding/binary" - "io" - "net" - "time" - - "google.golang.org/protobuf/proto" - - "core/actor/actor_msg" -) - -func Send(conn *net.UnixConn, actorId, cmd string, param []byte) error { - mail := &actor_msg.Mail{TargetId: &actor_msg.ActorId{Id: actorId}, MsgName: cmd, Msg: param} - payload, err := proto.Marshal(mail) - if err != nil { - return err - } - - data := make([]byte, 4+len(payload)) - binary.BigEndian.PutUint32(data, uint32(len(payload))) - copy(data[4:], payload) - if _, err = conn.Write(data); err != nil { - return err - } - return nil -} - -func Receive(conn *net.UnixConn, timeout time.Duration) (mail *actor_msg.Mail, err error) { - if err = conn.SetReadDeadline(time.Now().Add(timeout)); err != nil { - return - } - - header := make([]byte, 4) - if _, err = io.ReadFull(conn, header); err != nil { - return - } - - length := binary.BigEndian.Uint32(header) - data := make([]byte, length) - if _, err = io.ReadFull(conn, data); err != nil { - return - } - - mail = &actor_msg.Mail{} - err = proto.Unmarshal(data, mail) - return -} diff --git a/src/core/actor/event/event.go b/src/core/actor/event/event.go deleted file mode 100644 index c50a2b9..0000000 --- a/src/core/actor/event/event.go +++ /dev/null @@ -1,71 +0,0 @@ -package event - -import ( - "reflect" - "sync" - - "core/actor/actor_msg" -) - -type IActor interface { - Id() *actor_msg.ActorId - Send(targetId interface{}, msg interface{}) -} - -func NewEventDispatcher() *EventDispatcher { - return &EventDispatcher{listeners: make(map[reflect.Type]map[string]bool)} -} - -type EventDispatcher struct { - sync.RWMutex - listeners map[reflect.Type]map[string]bool -} - -// Regist 注册actor事件 -func (this *EventDispatcher) Regist(actor IActor, events ...interface{}) { - this.Lock() - defer this.Unlock() - - for _, event := range events { - rtype := reflect.TypeOf(event) - if this.listeners[rtype] == nil { - this.listeners[rtype] = make(map[string]bool) - } - this.listeners[rtype][actor.Id().Id] = true - } -} - -// Cancel 取消actor事件 -func (this *EventDispatcher) Cancel(actorId *actor_msg.ActorId, events ...interface{}) { - this.Lock() - defer this.Unlock() - - for _, event := range events { - rtype := reflect.TypeOf(event) - delete(this.listeners[rtype], actorId.Id) - } -} - -// CancelAll 取消actor事件 -func (this *EventDispatcher) CancelAll(actorId *actor_msg.ActorId) { - this.Lock() - defer this.Unlock() - - for _, actors := range this.listeners { - delete(actors, actorId.Id) - } -} - -// Dispatch 事件触发 -func (this *EventDispatcher) Dispatch(sourceActor IActor, event interface{}) { - rtype := reflect.TypeOf(event) - - this.RLock() - defer this.RUnlock() - - if listeners := this.listeners[rtype]; listeners != nil { - for actorId := range listeners { - sourceActor.Send(actorId, &actor_msg.MsgEvent{Event: event}) - } - } -} diff --git a/src/core/actor/lua/lua.go b/src/core/actor/lua/lua.go deleted file mode 100644 index 93d78a2..0000000 --- a/src/core/actor/lua/lua.go +++ /dev/null @@ -1,131 +0,0 @@ -package lua - -import ( - "path" - "runtime" - "time" - - lua "github.com/yuin/gopher-lua" - - "core/actor/timer" - "core/log" - "core/tools" -) - -type IActor interface { - AddTimer(interval time.Duration, trigger_times int32, callback timer.FuncCallback) int64 // 非线程安全 - CancelTimer(timerId int64) // 非线程安全 -} - -func NewLua(luaPath string, actor IActor) (*Lua, error) { - l := &Lua{actor: actor, luaState: lua.NewState()} - l.luaState.OpenLibs() - if err := l.load(luaPath); err != nil { - return nil, err - } - l.register2Lua() - return l, nil -} - -type Lua struct { - luaState *lua.LState - actor IActor -} - -func (s *Lua) load(luaPath string) error { - err := s.luaState.DoFile(luaPath) - if err != nil { - return err - } - - dir, _ := path.Split(luaPath) - err = s.luaState.CallByParam(lua.P{ - Fn: s.luaState.GetGlobal("main"), - NRet: 0, - Protect: true, - }, lua.LString(dir)) - return err -} - -func (s *Lua) Regist(fname string, f lua.LGFunction) { - s.luaState.Register(fname, f) -} - -func (s *Lua) CallFn(name string, ret int, args ...lua.LValue) []lua.LValue { - err := s.luaState.CallByParam(lua.P{ - Fn: s.luaState.GetGlobal(name), - NRet: ret, - Protect: true, - }, args...) - tools.AssertNil(err) - var res []lua.LValue - for i := -1; i >= -ret; i-- { - res = append(res, s.luaState.Get(i)) - } - s.luaState.Pop(ret) - return res -} - -func (s *Lua) register2Lua() { - s.Regist("govn", s.lGoVersion) - s.Regist("debug", s.lDebug) - s.Regist("warn", s.lWarn) - s.Regist("error", s.lError) - s.Regist("addtimer", s.lAddTimer) - s.Regist("canceltimer", s.lCancelTimer) -} - -func (s *Lua) lGoVersion(l *lua.LState) int { - v := runtime.Version() - l.Push(lua.LString(v)) - return 1 -} - -func (s *Lua) lDebug(l *lua.LState) int { - str := l.ToString(-1) - l.Pop(1) - log.Debug(str) - return 0 -} -func (s *Lua) lWarn(l *lua.LState) int { - str := l.ToString(-1) - l.Pop(1) - log.Warn(str) - return 0 -} -func (s *Lua) lError(l *lua.LState) int { - str := l.ToString(-1) - l.Pop(1) - log.Error(str) - return 0 -} - -func (s *Lua) lAddTimer(l *lua.LState) int { - interval := l.ToInt64(-1) - count := l.ToInt(-2) - callback := l.ToFunction(-3) - l.Pop(3) - - if count == 0 || interval < 0 { - log.KV("count", count).KV("interval", interval).Error("val error") - return 0 - } - - id := s.actor.AddTimer(time.Duration(interval), int32(count), func(dt int64) { - err := l.CallByParam(lua.P{ - Fn: callback, - NRet: 0, - Protect: true, - }) - tools.AssertNil(err) - }) - l.Push(lua.LNumber(id)) - return 1 -} - -func (s *Lua) lCancelTimer(l *lua.LState) int { - timerId := l.ToInt64(-1) - l.Pop(1) - s.actor.CancelTimer(timerId) - return 0 -} diff --git a/src/core/actor/monitor/prometheus.go b/src/core/actor/monitor/prometheus.go deleted file mode 100644 index 20cad13..0000000 --- a/src/core/actor/monitor/prometheus.go +++ /dev/null @@ -1,59 +0,0 @@ -package monitor - -import ( - "core/actor/actor_msg" - "core/prometheus" -) - -func NewPrometheus() *Prometheus { - return &Prometheus{registry: prometheus.Default()} -} - -type Prometheus struct { - registry *prometheus.Prometheus - - ignoreKind string - - panic_count *prometheus.CounterVec //panic次数 - hand_count *prometheus.CounterVec //处理message条数 - state_gauge *prometheus.GaugeVec //actor状态 - state_mailbox *prometheus.GaugeVec //邮箱中邮件数量 -} - -func (s *Prometheus) Init(ignoreKind string) *Prometheus { - const Subsystem = "actor" - s.ignoreKind = ignoreKind - s.panic_count = s.registry.RegCounter(Subsystem, "panic", []string{"id", "kind"}) - s.hand_count = s.registry.RegCounter(Subsystem, "hand", []string{"id", "kind"}) - s.state_gauge = s.registry.RegGauge(Subsystem, "running", []string{"id", "kind"}) - s.state_mailbox = s.registry.RegGauge(Subsystem, "mailbox", []string{"id", "kind"}) - return s -} - -func (s *Prometheus) ResetRegistry(registry *prometheus.Prometheus) { s.registry = registry } -func (s *Prometheus) Registry() *prometheus.Prometheus { return s.registry } -func (s *Prometheus) RecordPanic(ac *actor_msg.ActorId) { s.panic_count.Inc(ac.Id, ac.Kind) } -func (s *Prometheus) RecordHand(ac *actor_msg.ActorId, count int) { - if ac.Kind != s.ignoreKind { - s.hand_count.Add(float64(count), ac.Id, ac.Kind) - } -} - -const ( - PActorState_New = iota - PActorState_Init - PActorState_Run - PActorState_Stop -) - -func (s *Prometheus) RecordState(ac *actor_msg.ActorId, state float64) { - if ac.Kind != s.ignoreKind { - s.state_gauge.Set(state, ac.Id, ac.Kind) - } -} - -func (s *Prometheus) RecordMailbox(ac *actor_msg.ActorId, state float64) { - if ac.Kind != s.ignoreKind { - s.state_mailbox.Set(state, ac.Id, ac.Kind) - } -} diff --git a/src/core/actor/timer/time_wheel.go b/src/core/actor/timer/time_wheel.go deleted file mode 100644 index d58913a..0000000 --- a/src/core/actor/timer/time_wheel.go +++ /dev/null @@ -1,87 +0,0 @@ -package timer - -import ( - "time" - - "core/abtime" - "core/goroutine" -) - -// 一个简单的单轮盘时间轮,外部依赖timeMgr对delay的分割处理 -type slotInfo []*Timer -type wheel struct { - index int // 更新槽位坐标 - slots []slotInfo // 轮槽位 - interval int64 // 间隔时间 - lasttime int64 // 最后一次更新的时间戳 - size int64 -} - -func newWheel(size int, inter int64) *wheel { - w := &wheel{ - index: 0, - interval: inter, - size: int64(size), - slots: make([]slotInfo, size), - lasttime: abtime.Now().UnixNano(), - } - return w -} - -func (s *wheel) reset() { - s.index = 0 - s.slots = make([]slotInfo, s.size) - s.lasttime = abtime.Now().UnixNano() -} - -func (s *wheel) limit() int64 { - if pass := time.Now().UnixNano() - s.lasttime; pass >= 0 { - if lastSize := s.size - pass/s.interval - 1; lastSize > 0 { - return lastSize * s.interval - } - } - return -1 -} - -func (s *wheel) addTimer(timer *Timer) { - diff := timer.next_triggertime - s.lasttime - if diff < 0 { - diff = 0 - } - - inc := int(diff / s.interval) - fitPos := s.index + inc // 算出需要安置的槽位 - if fitPos >= len(s.slots) { - fitPos = fitPos - len(s.slots) - } - - if s.slots[fitPos] == nil { - s.slots[fitPos] = make(slotInfo, 0) - } - s.slots[fitPos] = append(s.slots[fitPos], timer) -} - -func (s *wheel) update() { - timers := s.slots[s.index] - - s.slots[s.index] = nil - s.index++ - if s.index >= len(s.slots) { - s.index = 0 - } - s.lasttime += s.interval - - for _, timer := range timers { - if !timer.disabled { - goroutine.Try(func() { timer.func_callback(timer.interval) }, nil) - if timer.trigger_times > 0 { - timer.trigger_times-- - } - if timer.trigger_times > 0 || timer.trigger_times < 0 { - timer.next_triggertime += timer.interval - s.addTimer(timer) - } - } - } - -} diff --git a/src/core/actor/timer/timer.go b/src/core/actor/timer/timer.go deleted file mode 100644 index 2b62b1d..0000000 --- a/src/core/actor/timer/timer.go +++ /dev/null @@ -1,30 +0,0 @@ -package timer - -import ( - "time" -) - -type Timer struct { - timeid int64 // 计时器id - interval int64 // 时间间隔 - next_triggertime int64 // 下一次执行的时间戳 - func_callback FuncCallback // 到时回调 - trigger_times int32 // 执行次数 - disabled bool // 失效标记 -} - -//trigger_times:-1=无限次 -func newTimer(interval time.Duration, firstTime time.Time, times int32, callback FuncCallback) *Timer { - timer := &Timer{ - interval: interval.Nanoseconds(), - next_triggertime: firstTime.UnixNano(), - trigger_times: times, - func_callback: callback, - disabled: false, - } - return timer -} - -func (s *Timer) Priority() int64 { - return s.next_triggertime -} diff --git a/src/core/actor/timer/timer_mgr.go b/src/core/actor/timer/timer_mgr.go deleted file mode 100644 index eeeda1f..0000000 --- a/src/core/actor/timer/timer_mgr.go +++ /dev/null @@ -1,119 +0,0 @@ -package timer - -import ( - "time" - - "core/container/unsafe/priority_queue" - "core/goroutine" - "core/log" - "go.uber.org/atomic" -) - -type FuncCallback func(dt int64) -type TimerMgr struct { - timers *priority_queue.Heap[*Timer] - timerMap map[int64]*Timer - wheel *wheel //时间轮 - timeid atomic.Int64 //自增id - accuracy time.Duration //计时器精度 -} - -func NewTimerMgr(accuracy time.Duration, wheelLength time.Duration) *TimerMgr { - s := &TimerMgr{ - timerMap: make(map[int64]*Timer), - timers: newTimerQueue(), - accuracy: accuracy, - } - s.timeid.Store(time.Now().UnixNano()) - if accuracy > 0 && wheelLength/accuracy > 2 { - s.wheel = newWheel(int(wheelLength/accuracy), int64(accuracy)) - s.AddTimer(s.accuracy, time.Now().Add(s.accuracy), -1, func(int64) { s.wheel.update() }, true) - } - return s -} - -func (s *TimerMgr) Accuracy() time.Duration { return s.accuracy } - -func (s *TimerMgr) Reset() { - s.timers = newTimerQueue() - if s.wheel != nil { - s.wheel.reset() - } - s.timerMap = make(map[int64]*Timer) -} -func newTimerQueue() *priority_queue.Heap[*Timer] { - return priority_queue.NewQueue[*Timer](priority_queue.MIN_HEAP, priority_queue.QUAD) -} - -func (s *TimerMgr) AddTimer(interval time.Duration, firstTime time.Time, times int32, callback FuncCallback, forceHeap bool) int64 { - if times == 0 || callback == nil { - log.KV("times", times).KV("callback", callback).WarnStack(2, "param error") - return 0 - } - - timer := newTimer(interval, firstTime, times, callback) - if timer.interval < s.accuracy.Nanoseconds() { - if timer.trigger_times < 0 || timer.trigger_times > 1 { - log.KV("accuracy", s.accuracy).KV("interval", timer.interval).WarnStack(2, "timer interval is too small") - } - timer.interval = s.accuracy.Nanoseconds() - } - - timer.timeid = s.timeid.Inc() - - // 时间范围小于时间轮计时范围,优先丢给时间轮处理,否则丢给时间堆处理 - if s.wheel != nil && timer.interval < s.wheel.limit() && !forceHeap { - s.wheel.addTimer(timer) - } else { - s.timers.Push(timer) - } - s.timerMap[timer.timeid] = timer - return timer.timeid -} - -func (s *TimerMgr) CancelTimer(timeid int64) { - if timer, ok := s.timerMap[timeid]; ok { - timer.disabled = true // 到期判断有效性 - } -} - -func (s *TimerMgr) Update(now int64, catch func(ex interface{})) { - for { - timer := s.timers.Peek() - if timer == nil { - break - } - if !timer.disabled && timer.interval > 0 { - // 检查执行时间是否到了 - delayTime := now - timer.next_triggertime - if delayTime < 0 { - break - } - - overtimes := (delayTime + timer.interval) / timer.interval - for i := 0; i < int(overtimes); i++ { - if timer.trigger_times == 0 { - break - } - if timer.trigger_times == 1 { - // 最后一次,间隔+delay - goroutine.Try(func() { timer.func_callback(timer.interval + delayTime) }, catch) - } else { - // 不是最后一次,按照固定间隔执行 - goroutine.Try(func() { timer.func_callback(timer.interval) }, catch) - } - - if timer.trigger_times > 0 { - timer.trigger_times-- - } - } - - // 还有次数,继续加入优先队列 - if timer.trigger_times != 0 && !timer.disabled { - timer.next_triggertime += timer.interval * overtimes - s.timers.Push(timer) - } - } - s.timers.Pop() - } -} diff --git a/src/core/actor/timer/timer_test.go b/src/core/actor/timer/timer_test.go deleted file mode 100644 index c03940c..0000000 --- a/src/core/actor/timer/timer_test.go +++ /dev/null @@ -1,56 +0,0 @@ -package timer - -import ( - "fmt" - "testing" - "time" -) - -func TestTimerMgr(t *testing.T) { - tt := time.Millisecond * 100 - tt1 := time.Now().UnixNano() / int64(time.Millisecond) - fmt.Println("begin -------------------------", tt1) - timer := time.NewTimer(tt) - timer2 := time.NewTimer(time.Second * 1) - - cout := 0 - timerMgr := NewTimerMgr(time.Second/30, 24*time.Hour) - timerMgr.AddTimer(1000, time.Now().Add(1000), 10, func(dt int64) { - cout++ - fmt.Printf("dt:%v count:%v \n", dt, cout) - }, false) - for { - select { - case <-timer.C: - timer.Reset(tt) - timerMgr.Update(time.Now().UnixNano(), nil) - case <-timer2.C: - timer2.Reset(time.Second * 1) - tt2 := time.Now().UnixNano() / int64(time.Millisecond) - fmt.Println("end -------------------------", tt2, tt2-tt1) - tt1 = tt2 - } - } -} - -func TestTimerMgr2(t *testing.T) { - dt := time.Millisecond * 100 - - timerMgr := NewTimerMgr(dt, 24*time.Hour) - addTimer := func(interval time.Duration, trigger_times int32, callback FuncCallback) int64 { - return timerMgr.AddTimer(interval, time.Now().Add(interval), trigger_times, callback, false) - } - - addTimer(time.Second, 1, func(dt int64) { - println(time.Now().Format(time.RFC3339Nano), "111111") - time.Sleep(time.Second) - addTimer(time.Second*86399, 1, func(dt int64) { - println(time.Now().Format(time.RFC3339Nano), "22222") - }) - }) - - ticker := time.NewTicker(dt) - for range ticker.C { - timerMgr.Update(time.Now().UnixNano(), nil) - } -} diff --git a/src/core/container/unsafe/dijkstra/.gitignore b/src/core/container/unsafe/dijkstra/.gitignore deleted file mode 100644 index c17b325..0000000 --- a/src/core/container/unsafe/dijkstra/.gitignore +++ /dev/null @@ -1,28 +0,0 @@ -# Compiled Object files, Static and Dynamic libs (Shared Objects) -*.o -*.a -*.so - -# Folders -_obj -_test -.vscode - -# Architecture specific extensions/prefixes -*.[568vq] -[568vq].out - -*.cgo1.go -*.cgo2.c -_cgo_defun.c -_cgo_gotypes.go -_cgo_export.* - -_testmain.go - -*.exe -*.test -*.prof -temp* -/testdata/bench/*.txt -/testdata/bench diff --git a/src/core/container/unsafe/lru/lru.go b/src/core/container/unsafe/lru/lru.go deleted file mode 100644 index bed4627..0000000 --- a/src/core/container/unsafe/lru/lru.go +++ /dev/null @@ -1,65 +0,0 @@ -package lru - -import ( - "container/list" -) - -type node struct { - k interface{} - v interface{} -} - -type LRU struct { - maxLen int // if maxLen<=0 then no limit - lruList *list.List - datas map[interface{}]*list.Element -} - -func NewLRU(maxLen int) *LRU { - return &LRU{ - maxLen: maxLen, - lruList: list.New(), - datas: make(map[interface{}]*list.Element), - } -} - -func (lc *LRU) PushFront(k, v interface{}) { - if e, ok := lc.datas[k]; ok { - e.Value.(*node).v = v - lc.lruList.MoveToFront(e) - } else { - e := lc.lruList.PushFront(&node{k, v}) - lc.datas[k] = e - } - if lc.maxLen > 0 && lc.lruList.Len() > lc.maxLen { - lc.PopTail() - } -} - -func (lc *LRU) PopTail() (interface{}, bool) { - e := lc.lruList.Back() - if e != nil { - lc.Del(e.Value.(*node).k) - return e.Value.(*node).v, true - } - return nil, false -} - -func (lc *LRU) Del(k interface{}) { - if e, ok := lc.datas[k]; ok { - delete(lc.datas, k) - lc.lruList.Remove(e) - } -} - -func (lc *LRU) Get(k interface{}) (interface{}, bool) { - if e, ok := lc.datas[k]; ok { - lc.lruList.MoveToFront(e) - return e.Value.(*node).v, ok - } - return nil, false -} - -func (lc *LRU) Len() int { - return lc.lruList.Len() -} diff --git a/src/core/container/unsafe/lru/lru_test.go b/src/core/container/unsafe/lru/lru_test.go deleted file mode 100644 index 7b3d682..0000000 --- a/src/core/container/unsafe/lru/lru_test.go +++ /dev/null @@ -1,43 +0,0 @@ -package lru - -import ( - "fmt" - "testing" -) - -func TestLruContainer_PushFront(t *testing.T) { - lc := NewLRU(10) - for idx := 0; idx < 100; idx++ { - lc.PushFront(idx%10, idx) - } - fmt.Println(lc.Len()) - - fmt.Println(lc.Get(5)) - fmt.Println(lc.Get(4)) - - lc.Del(7) - - for idx := 0; idx < 10; idx++ { - fmt.Println(lc.PopTail()) - } - - fmt.Println(lc.Get(4)) - fmt.Println(lc.Get(5)) - - fmt.Println(lc.Len()) -} - -var glc = NewLRU(1000) -var idx int - -func BenchmarkLruContainer_PushFront(b *testing.B) { - for i := 0; i < b.N; i++ { - glc.PushFront(idx, idx) - } -} - -func BenchmarkLruContainer_Get(b *testing.B) { - for i := 0; i < b.N; i++ { - glc.Get(idx) - } -} diff --git a/src/core/container/unsafe/priority_queue/priority_queue.go b/src/core/container/unsafe/priority_queue/priority_queue.go deleted file mode 100644 index e91bf0c..0000000 --- a/src/core/container/unsafe/priority_queue/priority_queue.go +++ /dev/null @@ -1,175 +0,0 @@ -package priority_queue - -type ( - IPriorityInterface interface { - Priority() int64 - } - Heap[v IPriorityInterface] struct { - arr []v - t HEAPTYPE - c int - } -) -type HEAPTYPE int - -const ( - BINARY = 2 - QUAD = 4 -) - -const ( - MIN_HEAP HEAPTYPE = 1 // 小顶堆 - MAX_HEAP HEAPTYPE = 2 // 大顶堆 -) - -func NewQueue[v IPriorityInterface](t HEAPTYPE, c int) *Heap[v] { - h := &Heap[v]{t: t, c: c} - h.heapify() - return h -} - -// 尾部插入一个元素 -func (s *Heap[v]) Push(val v) { - s.arr = append(s.arr, val) - _up(s.arr, s.t, len(s.arr), s.c) -} - -// 查看头部元素 -func (s *Heap[v]) Peek() (ret v) { - if len(s.arr) == 0 { - return - } - return s.arr[0] -} - -// 头部弹出一个元素 -func (s *Heap[v]) Pop() (ret v) { - n := len(s.arr) - if n == 0 { - return - } - s.arr[n-1], s.arr[0] = s.arr[0], s.arr[n-1] - ret = s.arr[n-1] - s.arr = s.arr[:n-1] - _down(s.arr, s.t, 1, s.c) - return ret -} - -// 返回数量 -func (s *Heap[v]) Size() int { - return len(s.arr) -} - -// 获取数组 -func (s *Heap[v]) All() []v { - return s.arr -} - -// 堆排序 小顶:大->小 大顶:小->大 -func (s *Heap[v]) Sort() []v { - for i := len(s.arr) - 1; i >= 0; i-- { - s.arr[0], s.arr[i] = s.arr[i], s.arr[0] - _down(s.arr[:i], s.t, 1, s.c) - } - return s.arr -} - -// 改变堆的性质 -// t :1.小顶堆、2.大顶堆 -func (s *Heap[v]) Change(t HEAPTYPE) { - if s.t != t { - s.t = t - s.heapify() - } -} - -func (s *Heap[v]) heapify() { - // 默认使用自底向上方式 - _buildHeap_bottom2top(s.arr, s.t, s.c) - //_buildHeap_top2down(s.arr, s.t) -} - -// 自底向上法 建堆 -func _buildHeap_bottom2top[v IPriorityInterface](arr []v, t HEAPTYPE, c int) { - // 整体上自底向上, 每个节点自顶向下 - for i := len(arr) / 2; i > 0; i-- { - _down(arr, t, i, c) - } -} - -// 自顶向下法 建堆 -func _buildHeap_top2down[v IPriorityInterface](arr []v, t HEAPTYPE, c int) { - // 整体上自顶向下, 每个节点自底向上 - for i := 1; i <= len(arr); i++ { - _up(arr, t, i, c) - } -} - -/* -向下渗透 -arr: 使用的数组 -t: 1.小顶堆 2.大顶堆 -n: 当前数据的位置 -*/ -func _down[v IPriorityInterface](arr []v, t HEAPTYPE, n int, x int) { - _lr := func(n, x int) (int, int) { - return (n * x) - (x - 2) - 1, (n * x) - } - - l, r := _lr(n, x) - for l < len(arr) { - var _mum = l - for i := l; i < r; i++ { - if i+1 >= len(arr) { - break - } - if t == MIN_HEAP { - _mum = _min(arr, _mum, i+1) - } else { - _mum = _max(arr, _mum, i+1) - } - } - if t == MIN_HEAP && arr[n-1].Priority() > arr[_mum].Priority() || - t == MAX_HEAP && arr[n-1].Priority() < arr[_mum].Priority() { - arr[n-1], arr[_mum] = arr[_mum], arr[n-1] - n = _mum + 1 - l, r = _lr(n, x) - } else { - return - } - } -} - -/* -向上排查 -arr: 使用的数组 -t: 1.小顶堆 2.大顶堆 -n: 当前数据的位置,1 表示根 n-1 表示数组下标 -*/ -func _up[v IPriorityInterface](arr []v, t HEAPTYPE, n int, x int) { - var p int - for n > 1 { - p = (n - 2) / x - if (t == MIN_HEAP && arr[p].Priority() > arr[n-1].Priority()) || - (t == MAX_HEAP && arr[p].Priority() < arr[n-1].Priority()) { - arr[p], arr[n-1] = arr[n-1], arr[p] - n = p + 1 - } else { - return - } - } -} - -func _min[v IPriorityInterface](arr []v, i1, i2 int) int { - if arr[i1].Priority() < arr[i2].Priority() { - return i1 - } - return i2 -} - -func _max[v IPriorityInterface](arr []v, i1, i2 int) int { - if arr[i1].Priority() > arr[i2].Priority() { - return i1 - } - return i2 -} diff --git a/src/core/container/unsafe/priority_queue/proprity_queue_test.go b/src/core/container/unsafe/priority_queue/proprity_queue_test.go deleted file mode 100644 index 3dcdd41..0000000 --- a/src/core/container/unsafe/priority_queue/proprity_queue_test.go +++ /dev/null @@ -1,102 +0,0 @@ -package priority_queue - -import ( - "fmt" - "math/rand" - "testing" -) - -type TestPriorityStruct struct { - val int - score int64 -} - -func (s *TestPriorityStruct) Priority() int64 { - return s.score -} - -func TestPropertyqueue(t *testing.T) { - heap := NewQueue[*TestPriorityStruct](MIN_HEAP, BINARY) // 创建一个小顶堆 - heap.Push(&TestPriorityStruct{val: 1, score: 154}) - fmt.Printf("1最低分:%v\n", heap.Peek().Priority()) - - heap.Push(&TestPriorityStruct{val: 2, score: 410}) - fmt.Printf("2最低分:%v\n", heap.Peek().Priority()) - - heap.Push(&TestPriorityStruct{val: 3, score: 360}) - fmt.Printf("3最低分:%v\n", heap.Peek().Priority()) - - heap.Push(&TestPriorityStruct{val: 5, score: 103}) - fmt.Printf("5最低分:%v\n", heap.Peek().Priority()) - - heap.Push(&TestPriorityStruct{val: 4, score: 90}) - fmt.Printf("4最低分:%v\n", heap.Peek().Priority()) - heap.Push(&TestPriorityStruct{val: 4, score: 80}) - fmt.Printf("4最低分:%v\n", heap.Peek().Priority()) - heap.Push(&TestPriorityStruct{val: 4, score: 60}) - fmt.Printf("4最低分:%v\n", heap.Peek().Priority()) - heap.Push(&TestPriorityStruct{val: 4, score: 100}) - fmt.Printf("4最低分:%v\n", heap.Peek().Priority()) - - heap.Pop() - fmt.Printf("pop最低分:%v\n", heap.Peek().Priority()) - heap.Pop() - fmt.Printf("pop最低分:%v\n", heap.Peek().Priority()) - //heap.Pop() - //fmt.Printf("pop最低分:%v\n", heap.Peek().Priority()) - //heap.Pop() - //fmt.Printf("pop最低分:%v\n", heap.Peek().Priority()) - - heap.Change(MAX_HEAP) // 改变成大顶堆 - fmt.Printf("change最高分:%v\n", heap.Peek().Priority()) - - for _, v := range heap.All() { - fmt.Printf("[val:%v score:%v] ", v.val, v.score) - } - fmt.Printf("\n") - - // 用大顶堆排序是顺序 - for _, v := range heap.Sort() { - fmt.Printf("[val:%v score:%v] ", v.val, v.score) - } - fmt.Printf("\n") - heap.Change(MIN_HEAP) - for _, v := range heap.Sort() { - fmt.Printf("[val:%v score:%v] ", v.val, v.score) - } - fmt.Printf("\n") -} - -var arr = make([]int64, 0, 300000) - -func init() { - for i := 0; i < 300000; i++ { - arr = append(arr, int64(rand.Intn(5000)+1)) - } -} - -func BenchmarkHeap2(b *testing.B) { - heap2 := NewQueue[*TestPriorityStruct](MIN_HEAP, BINARY) - b.ResetTimer() - for i := 0; i < b.N; i++ { - for _, v := range arr { - heap2.Push(&TestPriorityStruct{val: 4, score: v}) - } - //for heap2.Size() > 0 { - // heap2.Pop() - //} - } -} - -func BenchmarkHeap4(b *testing.B) { - heap2 := NewQueue[*TestPriorityStruct](MIN_HEAP, QUAD) - b.ResetTimer() - for i := 0; i < b.N; i++ { - for _, v := range arr { - heap2.Push(&TestPriorityStruct{val: 4, score: v}) - } - //for heap2.Size() > 0 { - // heap2.Pop() - //} - } -} diff --git a/src/core/container/unsafe/quadtree/quadtree.go b/src/core/container/unsafe/quadtree/quadtree.go deleted file mode 100644 index e6f8f59..0000000 --- a/src/core/container/unsafe/quadtree/quadtree.go +++ /dev/null @@ -1,328 +0,0 @@ -package quadtree - -// Quadtree - The quadtree data structure -type Quadtree struct { - Bounds Bounds - MaxObjects int // Maximum objects a node can hold before splitting into 4 subnodes - MaxLevels int // Total max levels inside root Quadtree - Level int // Depth level, required for subnodes - Objects []Bounds - Nodes []Quadtree - Total int -} - -// Bounds - A bounding box with a x,y origin and width and height -type Bounds struct { - X float64 - Y float64 - Width float64 - Height float64 -} - -//IsPoint - Checks if a bounds object is a point or not (has no width or height) -func (b *Bounds) IsPoint() bool { - - if b.Width == 0 && b.Height == 0 { - return true - } - - return false - -} - -// Intersects - Checks if a Bounds object intersects with another Bounds -func (b *Bounds) Intersects(a Bounds) bool { - - aMaxX := a.X + a.Width - aMaxY := a.Y + a.Height - bMaxX := b.X + b.Width - bMaxY := b.Y + b.Height - - // a is left of b - if aMaxX < b.X { - return false - } - - // a is right of b - if a.X > bMaxX { - return false - } - - // a is above b - if aMaxY < b.Y { - return false - } - - // a is below b - if a.Y > bMaxY { - return false - } - - // The two overlap - return true - -} - -// TotalNodes - Retrieve the total number of sub-Quadtrees in a Quadtree -func (qt *Quadtree) TotalNodes() int { - - total := 0 - - if len(qt.Nodes) > 0 { - for i := 0; i < len(qt.Nodes); i++ { - total += 1 - total += qt.Nodes[i].TotalNodes() - } - } - - return total - -} - -// split - split the node into 4 subnodes -func (qt *Quadtree) split() { - - if len(qt.Nodes) == 4 { - return - } - - nextLevel := qt.Level + 1 - subWidth := qt.Bounds.Width / 2 - subHeight := qt.Bounds.Height / 2 - x := qt.Bounds.X - y := qt.Bounds.Y - - //top right node (0) - qt.Nodes = append(qt.Nodes, Quadtree{ - Bounds: Bounds{ - X: x + subWidth, - Y: y, - Width: subWidth, - Height: subHeight, - }, - MaxObjects: qt.MaxObjects, - MaxLevels: qt.MaxLevels, - Level: nextLevel, - Objects: make([]Bounds, 0), - Nodes: make([]Quadtree, 0, 4), - }) - - //top left node (1) - qt.Nodes = append(qt.Nodes, Quadtree{ - Bounds: Bounds{ - X: x, - Y: y, - Width: subWidth, - Height: subHeight, - }, - MaxObjects: qt.MaxObjects, - MaxLevels: qt.MaxLevels, - Level: nextLevel, - Objects: make([]Bounds, 0), - Nodes: make([]Quadtree, 0, 4), - }) - - //bottom left node (2) - qt.Nodes = append(qt.Nodes, Quadtree{ - Bounds: Bounds{ - X: x, - Y: y + subHeight, - Width: subWidth, - Height: subHeight, - }, - MaxObjects: qt.MaxObjects, - MaxLevels: qt.MaxLevels, - Level: nextLevel, - Objects: make([]Bounds, 0), - Nodes: make([]Quadtree, 0, 4), - }) - - //bottom right node (3) - qt.Nodes = append(qt.Nodes, Quadtree{ - Bounds: Bounds{ - X: x + subWidth, - Y: y + subHeight, - Width: subWidth, - Height: subHeight, - }, - MaxObjects: qt.MaxObjects, - MaxLevels: qt.MaxLevels, - Level: nextLevel, - Objects: make([]Bounds, 0), - Nodes: make([]Quadtree, 0, 4), - }) - -} - -// getIndex - Determine which quadrant the object belongs to (0-3) -func (qt *Quadtree) getIndex(pRect Bounds) int { - - index := -1 // index of the subnode (0-3), or -1 if pRect cannot completely fit within a subnode and is part of the parent node - - verticalMidpoint := qt.Bounds.X + (qt.Bounds.Width / 2) - horizontalMidpoint := qt.Bounds.Y + (qt.Bounds.Height / 2) - - //pRect can completely fit within the top quadrants - topQuadrant := (pRect.Y < horizontalMidpoint) && (pRect.Y+pRect.Height < horizontalMidpoint) - - //pRect can completely fit within the bottom quadrants - bottomQuadrant := (pRect.Y > horizontalMidpoint) - - //pRect can completely fit within the left quadrants - if (pRect.X < verticalMidpoint) && (pRect.X+pRect.Width < verticalMidpoint) { - - if topQuadrant { - index = 1 - } else if bottomQuadrant { - index = 2 - } - - } else if pRect.X > verticalMidpoint { - //pRect can completely fit within the right quadrants - - if topQuadrant { - index = 0 - } else if bottomQuadrant { - index = 3 - } - - } - - return index - -} - -// Insert - Insert the object into the node. If the node exceeds the capacity, -// it will split and add all objects to their corresponding subnodes. -func (qt *Quadtree) Insert(pRect Bounds) { - - qt.Total++ - - i := 0 - var index int - - // If we have subnodes within the Quadtree - if len(qt.Nodes) > 0 == true { - - index = qt.getIndex(pRect) - - if index != -1 { - qt.Nodes[index].Insert(pRect) - return - } - } - - // If we don't subnodes within the Quadtree - qt.Objects = append(qt.Objects, pRect) - - // If total objects is greater than max objects and level is less than max levels - if (len(qt.Objects) > qt.MaxObjects) && (qt.Level < qt.MaxLevels) { - - // split if we don't already have subnodes - if len(qt.Nodes) > 0 == false { - qt.split() - } - - // Add all objects to there corresponding subNodes - for i < len(qt.Objects) { - - index = qt.getIndex(qt.Objects[i]) - - if index != -1 { - - splice := qt.Objects[i] // Get the object out of the slice - qt.Objects = append(qt.Objects[:i], qt.Objects[i+1:]...) // Remove the object from the slice - - qt.Nodes[index].Insert(splice) - - } else { - - i++ - - } - - } - - } - -} - -// Retrieve - Return all objects that could collide with the given object -func (qt *Quadtree) Retrieve(pRect Bounds) []Bounds { - - index := qt.getIndex(pRect) - - // Array with all detected objects - returnObjects := qt.Objects - - //if we have subnodes ... - if len(qt.Nodes) > 0 { - - //if pRect fits into a subnode .. - if index != -1 { - - returnObjects = append(returnObjects, qt.Nodes[index].Retrieve(pRect)...) - - } else { - - //if pRect does not fit into a subnode, check it against all subnodes - for i := 0; i < len(qt.Nodes); i++ { - returnObjects = append(returnObjects, qt.Nodes[i].Retrieve(pRect)...) - } - - } - } - - return returnObjects - -} - -// RetrievePoints - Return all points that collide -func (qt *Quadtree) RetrievePoints(find Bounds) []Bounds { - - var foundPoints []Bounds - potentials := qt.Retrieve(find) - for o := 0; o < len(potentials); o++ { - - // X and Ys are the same and it has no Width and Height (Point) - xyMatch := potentials[o].X == float64(find.X) && potentials[o].Y == float64(find.Y) - if xyMatch && potentials[o].IsPoint() { - foundPoints = append(foundPoints, find) - } - } - - return foundPoints - -} - -// RetrieveIntersections - Bring back all the bounds in a Quadtree that intersect with a provided bounds -func (qt *Quadtree) RetrieveIntersections(find Bounds) []Bounds { - - var foundIntersections []Bounds - - potentials := qt.Retrieve(find) - for o := 0; o < len(potentials); o++ { - if potentials[o].Intersects(find) { - foundIntersections = append(foundIntersections, potentials[o]) - } - } - - return foundIntersections - -} - -//Clear - Clear the Quadtree -func (qt *Quadtree) Clear() { - - qt.Objects = []Bounds{} - - if len(qt.Nodes)-1 > 0 { - for i := 0; i < len(qt.Nodes); i++ { - qt.Nodes[i].Clear() - } - } - - qt.Nodes = []Quadtree{} - qt.Total = 0 - -} diff --git a/src/core/container/unsafe/quadtree/quadtree_test.go b/src/core/container/unsafe/quadtree/quadtree_test.go deleted file mode 100644 index f4f933c..0000000 --- a/src/core/container/unsafe/quadtree/quadtree_test.go +++ /dev/null @@ -1,399 +0,0 @@ -package quadtree - -import ( - "math/rand" - "testing" - "time" -) - -func TestQuadtreeCreation(t *testing.T) { - //x, y, width, height - qt := setupQuadtree(0, 0, 640, 480) - if qt.Bounds.Width != 640 && qt.Bounds.Height != 480 { - t.Errorf("Quadtree was not created correctly") - } -} - -func TestSplit(t *testing.T) { - - //x, y, width, height - qt := setupQuadtree(0, 0, 640, 480) - qt.split() - if len(qt.Nodes) != 4 { - t.Error("Quadtree did not split correctly, expected 4 nodes got", len(qt.Nodes)) - } - - qt.split() - if len(qt.Nodes) != 4 { - t.Error("Quadtree should not split itself more than once", len(qt.Nodes)) - } - -} - -func TestTotalSubnodes(t *testing.T) { - - //x, y, width, height - qt := setupQuadtree(0, 0, 640, 480) - qt.split() - for i := 0; i < len(qt.Nodes); i++ { - qt.Nodes[i].split() - } - - total := qt.TotalNodes() - if total != 20 { - t.Error("Quadtree did not split correctly, expected 20 nodes got", total) - } - -} - -func TestQuadtreeInsert(t *testing.T) { - - rand.Seed(time.Now().UTC().UnixNano()) // Seed Random properly - - qt := setupQuadtree(0, 0, 640, 480) - - grid := 10.0 - gridh := qt.Bounds.Width / grid - gridv := qt.Bounds.Height / grid - var randomObject Bounds - numObjects := 1000 - - for i := 0; i < numObjects; i++ { - - x := randMinMax(0, gridh) * grid - y := randMinMax(0, gridv) * grid - - randomObject = Bounds{ - X: x, - Y: y, - Width: randMinMax(1, 4) * grid, - Height: randMinMax(1, 4) * grid, - } - - index := qt.getIndex(randomObject) - if index < -1 || index > 3 { - t.Errorf("The index should be -1 or between 0 and 3, got %d \n", index) - } - - qt.Insert(randomObject) - - } - - if qt.Total != numObjects { - t.Errorf("Error: Should have totalled %d, got %d \n", numObjects, qt.Total) - } else { - t.Logf("Success: Total objects in the Quadtree is %d (as expected) \n", qt.Total) - } - -} - -func TestCorrectQuad(t *testing.T) { - - qt := setupQuadtree(0, 0, 100, 100) - - var index int - pass := true - - topRight := Bounds{ - X: 99, - Y: 99, - Width: 0, - Height: 0, - } - qt.Insert(topRight) - index = qt.getIndex(topRight) - if index == 0 { - t.Errorf("The index should be 0, got %d \n", index) - pass = false - } - - topLeft := Bounds{ - X: 99, - Y: 1, - Width: 0, - Height: 0, - } - qt.Insert(topLeft) - index = qt.getIndex(topLeft) - if index == 1 { - t.Errorf("The index should be 1, got %d \n", index) - pass = false - } - - bottomLeft := Bounds{ - X: 1, - Y: 1, - Width: 0, - Height: 0, - } - qt.Insert(bottomLeft) - index = qt.getIndex(bottomLeft) - if index == 2 { - t.Errorf("The index should be 2, got %d \n", index) - pass = false - } - - bottomRight := Bounds{ - X: 1, - Y: 51, - Width: 0, - Height: 0, - } - qt.Insert(bottomRight) - index = qt.getIndex(bottomRight) - if index == 3 { - t.Errorf("The index should be 3, got %d \n", index) - pass = false - } - - if pass == true { - t.Log("Success: The points were inserted into the correct quadrants") - } - -} - -func TestQuadtreeRetrieval(t *testing.T) { - - rand.Seed(time.Now().UTC().UnixNano()) // Seed Random properly - - qt := setupQuadtree(0, 0, 640, 480) - - var randomObject Bounds - numObjects := 100 - - for i := 0; i < numObjects; i++ { - - randomObject = Bounds{ - X: float64(i), - Y: float64(i), - Width: 0, - Height: 0, - } - - qt.Insert(randomObject) - - } - - for j := 0; j < numObjects; j++ { - - Cursor := Bounds{ - X: float64(j), - Y: float64(j), - Width: 0, - Height: 0, - } - - objects := qt.Retrieve(Cursor) - - found := false - - if len(objects) >= numObjects { - t.Error("Objects should not be equal to or bigger than the number of retrieved objects") - } - - for o := 0; o < len(objects); o++ { - if objects[o].X == float64(j) && objects[o].Y == float64(j) { - found = true - } - } - if found != true { - t.Error("Error finding the correct point") - } - - } - -} - -func TestQuadtreeRandomPointRetrieval(t *testing.T) { - - rand.Seed(time.Now().UTC().UnixNano()) // Seed Random properly - - qt := setupQuadtree(0, 0, 640, 480) - - numObjects := 1000 - - for i := 1; i < numObjects+1; i++ { - - randomObject := Bounds{ - X: float64(i), - Y: float64(i), - Width: 0, - Height: 0, - } - - qt.Insert(randomObject) - - } - - failure := false - iterations := 20 - for j := 1; j < iterations+1; j++ { - - Cursor := Bounds{ - X: float64(j), - Y: float64(j), - Width: 0, - Height: 0, - } - - point := qt.RetrievePoints(Cursor) - - for k := 0; k < len(point); k++ { - if point[k].X == 0 { - failure = true - } - if point[k].Y == 0 { - failure = true - } - if failure { - t.Error("Point was incorrectly retrieved", point) - } - if point[k].IsPoint() == false { - t.Error("Point should have width and height of 0") - } - } - - } - - if failure == false { - t.Logf("Success: All the points were retrieved correctly", iterations, numObjects) - } - -} - -func TestIntersectionRetrieval(t *testing.T) { - qt := setupQuadtree(0, 0, 640, 480) - qt.Insert(Bounds{ - X: 1, - Y: 1, - Width: 10, - Height: 10, - }) - qt.Insert(Bounds{ - X: 5, - Y: 5, - Width: 10, - Height: 10, - }) - qt.Insert(Bounds{ - X: 10, - Y: 10, - Width: 10, - Height: 10, - }) - qt.Insert(Bounds{ - X: 15, - Y: 15, - Width: 10, - Height: 10, - }) - inter := qt.RetrieveIntersections(Bounds{ - X: 5, - Y: 5, - Width: 2.5, - Height: 2.5, - }) - if len(inter) != 2 { - t.Error("Should have two intersections") - } -} - -func TestQuadtreeClear(t *testing.T) { - - rand.Seed(time.Now().UTC().UnixNano()) // Seed Random properly - - qt := setupQuadtree(0, 0, 640, 480) - - grid := 10.0 - gridh := qt.Bounds.Width / grid - gridv := qt.Bounds.Height / grid - var randomObject Bounds - numObjects := 1000 - - for i := 0; i < numObjects; i++ { - - x := randMinMax(0, gridh) * grid - y := randMinMax(0, gridv) * grid - - randomObject = Bounds{ - X: x, - Y: y, - Width: randMinMax(1, 4) * grid, - Height: randMinMax(1, 4) * grid, - } - - index := qt.getIndex(randomObject) - if index < -1 || index > 3 { - t.Errorf("The index should be -1 or between 0 and 3, got %d \n", index) - } - - qt.Insert(randomObject) - - } - - qt.Clear() - - if qt.Total != 0 { - t.Errorf("Error: The Quadtree should be cleared") - } else { - t.Logf("Success: The Quadtree was cleared correctly") - } - -} - -// Benchmarks - -func BenchmarkInsertOneThousand(b *testing.B) { - - qt := setupQuadtree(0, 0, 640, 480) - - grid := 10.0 - gridh := qt.Bounds.Width / grid - gridv := qt.Bounds.Height / grid - var randomObject Bounds - numObjects := 1000 - - for n := 0; n < b.N; n++ { - for i := 0; i < numObjects; i++ { - - x := randMinMax(0, gridh) * grid - y := randMinMax(0, gridv) * grid - - randomObject = Bounds{ - X: x, - Y: y, - Width: randMinMax(1, 4) * grid, - Height: randMinMax(1, 4) * grid, - } - - qt.Insert(randomObject) - - } - } - -} - -// Convenience Functions - -func setupQuadtree(x float64, y float64, width float64, height float64) *Quadtree { - - return &Quadtree{ - Bounds: Bounds{ - X: x, - Y: y, - Width: width, - Height: height, - }, - MaxObjects: 4, - MaxLevels: 8, - Level: 0, - Objects: make([]Bounds, 0), - Nodes: make([]Quadtree, 0), - } - -} - -func randMinMax(min float64, max float64) float64 { - val := min + (rand.Float64() * (max - min)) - return val -} diff --git a/src/core/container/unsafe/randx/selector.go b/src/core/container/unsafe/randx/selector.go deleted file mode 100644 index 67d1284..0000000 --- a/src/core/container/unsafe/randx/selector.go +++ /dev/null @@ -1,43 +0,0 @@ -package randx - -import ( - "math/rand" -) - -func NewSelector() *Selector { - return &Selector{} -} - -type elem struct { - v interface{} - end int32 -} - -type Selector struct { - elems []*elem - end int32 -} - -func (s *Selector) Reset() { - s.elems = nil - s.end = 0 -} - -func (s *Selector) AddElem(v interface{}, rate int32) { - if rate > 0 { - s.end += rate - s.elems = append(s.elems, &elem{v: v, end: s.end}) - } -} - -func (s *Selector) Choose() interface{} { - if s.end > 0 { - r := rand.Int31n(s.end) - for _, e := range s.elems { - if r < e.end { - return e.v - } - } - } - return nil -} diff --git a/src/core/container/unsafe/ring_queue/ring_queue.go b/src/core/container/unsafe/ring_queue/ring_queue.go deleted file mode 100644 index ffa022b..0000000 --- a/src/core/container/unsafe/ring_queue/ring_queue.go +++ /dev/null @@ -1,122 +0,0 @@ -package ring_queue - -const minQueueLen = 2 - -// 先进先出 -type Queue[T any] struct { - buf []T - bufLen int - head, tail, count int -} - -// 容量是2的n次幂,非线程安全,适当的初始容量大小可以减少内存分配次数 -// 对比QueArray有一倍左右的性能提升 -func NewQueue[T any]() *Queue[T] { - return &Queue[T]{buf: make([]T, minQueueLen), bufLen: minQueueLen} -} - -func (q *Queue[T]) Length() int { - return q.count -} - -// 2倍缩放 -func (q *Queue[T]) resize() { - if q.count < minQueueLen { - return - } - - if q.count == q.bufLen || (q.count<<2) == q.bufLen { - newBuf := make([]T, q.count<<1) - if q.tail > q.head { - copy(newBuf, q.buf[q.head:q.tail]) - } else { - n := copy(newBuf, q.buf[q.head:]) - copy(newBuf[n:], q.buf[:q.tail]) - } - q.head = 0 - q.tail = q.count - q.buf = newBuf - q.bufLen = len(newBuf) - } -} - -// 追加到队尾 -func (q *Queue[T]) Push(elem T) { - q.resize() - - q.buf[q.tail] = elem - q.tail = (q.tail + 1) & (q.bufLen - 1) - q.count++ -} - -func (q *Queue[T]) Append(elems []T) { - for _, elem := range elems { - q.Push(elem) - } -} - -// 弹出队头 -func (q *Queue[T]) Pop() (ret T) { - if q.count <= 0 { - return - } - temp := q.buf[q.head] - q.buf[q.head] = ret - ret = temp - - q.head = (q.head + 1) & (q.bufLen - 1) - q.count-- - - q.resize() - return -} - -func (q *Queue[T]) Clear() { - q.head = 0 - q.tail = 0 - q.count = 0 -} - -// 返回队头 -func (q *Queue[T]) Front() (ret T) { - if q.count <= 0 { - return - } - return q.buf[q.head] -} - -// 返回队头 -func (q *Queue[T]) Back() (ret T) { - if q.count <= 0 { - return - } - return q.Get(q.count - 1) -} - -// 正数队头遍历,负数队尾遍历 -func (q *Queue[T]) Get(i int) (ret T) { - if i < 0 { - i += q.count - } - - if i < 0 || i >= q.count { - return - } - return q.buf[(q.head+i)&(q.bufLen-1)] -} - -type QueArray[T any] struct { - array []T -} - -func (s *QueArray[T]) Push(elem T) { - s.array = append(s.array, elem) -} - -func (s *QueArray[T]) Pop() (ret T) { - if len(s.array) > 0 { - ret = s.array[0] - s.array = s.array[1:] - } - return -} diff --git a/src/core/container/unsafe/ring_queue/ring_queue_test.go b/src/core/container/unsafe/ring_queue/ring_queue_test.go deleted file mode 100644 index d269148..0000000 --- a/src/core/container/unsafe/ring_queue/ring_queue_test.go +++ /dev/null @@ -1,28 +0,0 @@ -package ring_queue - -import ( - "fmt" - "testing" -) - -/* -BenchmarkQueue_Ring -BenchmarkQueue_Ring-8 30336562 39.7 ns/op -BenchmarkQueue_Array -BenchmarkQueue_Array-8 13819460 86.4 ns/op -*/ - -func TestQueue_Ring(t *testing.T) { - a := []int{1, 2, 3} - var que = NewQueue[int]() - que.Append(a) - fmt.Println(que.Pop()) -} - -func BenchmarkQueue_Ring(b *testing.B) { - var que = NewQueue[int]() - for idx := 0; idx < b.N; idx++ { - que.Push(idx) - que.Pop() - } -} diff --git a/src/core/container/unsafe/skiplist/README.md b/src/core/container/unsafe/skiplist/README.md deleted file mode 100644 index f402415..0000000 --- a/src/core/container/unsafe/skiplist/README.md +++ /dev/null @@ -1,86 +0,0 @@ -skiplist -=============== - -reference from redis [zskiplist](https://github.com/antirez/redis) - - -Usage -=============== - -~~~Go - -package main - -import ( - "fmt" - "github.com/gansidui/skiplist" - "log" -) - -type User struct { - score float64 - id string -} - -func (u *User) Less(other interface{}) bool { - if u.score > other.(*User).score { - return true - } - if u.score == other.(*User).score && len(u.id) > len(other.(*User).id) { - return true - } - return false -} - -func main() { - us := make([]*User, 7) - us[0] = &User{6.6, "hi"} - us[1] = &User{4.4, "hello"} - us[2] = &User{2.2, "world"} - us[3] = &User{3.3, "go"} - us[4] = &User{1.1, "skip"} - us[5] = &User{2.2, "list"} - us[6] = &User{3.3, "lang"} - - // insert - sl := skiplist.New() - for i := 0; i < len(us); i++ { - sl.Insert(us[i]) - } - - // traverse - for e := sl.Front(); e != nil; e = e.Next() { - fmt.Println(e.Value.(*User).id, "-->", e.Value.(*User).score) - } - fmt.Println() - - // rank - rank1 := sl.GetRank(&User{2.2, "list"}) - rank2 := sl.GetRank(&User{6.6, "hi"}) - if rank1 != 6 || rank2 != 1 { - log.Fatal() - } - if e := sl.GetElementByRank(2); e.Value.(*User).score != 4.4 || e.Value.(*User).id != "hello" { - log.Fatal() - } -} - -/* output: - -hi --> 6.6 -hello --> 4.4 -lang --> 3.3 -go --> 3.3 -world --> 2.2 -list --> 2.2 -skip --> 1.1 - -*/ - -~~~ - - -License -=============== - -MIT \ No newline at end of file diff --git a/src/core/container/unsafe/skiplist/element.go b/src/core/container/unsafe/skiplist/element.go deleted file mode 100644 index 9ca70e7..0000000 --- a/src/core/container/unsafe/skiplist/element.go +++ /dev/null @@ -1,40 +0,0 @@ -package skiplist - -type Interface interface { - Less(other interface{}) bool -} - -type skiplistLevel struct { - forward *Element - span int -} - -type Element struct { - Value Interface - backward *Element - level []*skiplistLevel -} - -// Next returns the next skiplist element or nil. -func (e *Element) Next() *Element { - return e.level[0].forward -} - -// Prev returns the previous skiplist element of nil. -func (e *Element) Prev() *Element { - return e.backward -} - -// newElement returns an initialized element. -func newElement(level int, v Interface) *Element { - slLevels := make([]*skiplistLevel, level) - for i := 0; i < level; i++ { - slLevels[i] = new(skiplistLevel) - } - - return &Element{ - Value: v, - backward: nil, - level: slLevels, - } -} diff --git a/src/core/container/unsafe/skiplist/skiplist.go b/src/core/container/unsafe/skiplist/skiplist.go deleted file mode 100644 index b251dfb..0000000 --- a/src/core/container/unsafe/skiplist/skiplist.go +++ /dev/null @@ -1,235 +0,0 @@ -package skiplist - -import ( - "math/rand" -) - -const SKIPLIST_MAXLEVEL = 32 -const SKIPLIST_BRANCH = 4 - -type SkipList struct { - header *Element - tail *Element - update []*Element - rank []int - length int - level int -} - -// New returns an initialized skiplist. -func New() *SkipList { - return &SkipList{ - header: newElement(SKIPLIST_MAXLEVEL, nil), - tail: nil, - update: make([]*Element, SKIPLIST_MAXLEVEL), - rank: make([]int, SKIPLIST_MAXLEVEL), - length: 0, - level: 1, - } -} - -// Init initializes or clears skiplist sl. -func (sl *SkipList) Init() *SkipList { - sl.header = newElement(SKIPLIST_MAXLEVEL, nil) - sl.tail = nil - sl.update = make([]*Element, SKIPLIST_MAXLEVEL) - sl.rank = make([]int, SKIPLIST_MAXLEVEL) - sl.length = 0 - sl.level = 1 - return sl -} - -// Front returns the first elements of skiplist sl or nil. -func (sl *SkipList) Front() *Element { - return sl.header.level[0].forward -} - -// Back returns the last elements of skiplist sl or nil. -func (sl *SkipList) Back() *Element { - return sl.tail -} - -// Len returns the numbler of elements of skiplist sl. -func (sl *SkipList) Len() int { - return sl.length -} - -// Insert inserts v, increments sl.length, and returns a new element of wrap v. -func (sl *SkipList) Insert(v Interface) *Element { - x := sl.header - for i := sl.level - 1; i >= 0; i-- { - // store rank that is crossed to reach the insert position - if i == sl.level-1 { - sl.rank[i] = 0 - } else { - sl.rank[i] = sl.rank[i+1] - } - for x.level[i].forward != nil && x.level[i].forward.Value.Less(v) { - sl.rank[i] += x.level[i].span - x = x.level[i].forward - } - sl.update[i] = x - } - - // ensure that the v is unique, the re-insertion of v should never happen since the - // caller of sl.Insert() should test in the hash table if the element is already inside or not. - level := randomLevel() - if level > sl.level { - for i := sl.level; i < level; i++ { - sl.rank[i] = 0 - sl.update[i] = sl.header - sl.update[i].level[i].span = sl.length - } - sl.level = level - } - - x = newElement(level, v) - for i := 0; i < level; i++ { - x.level[i].forward = sl.update[i].level[i].forward - sl.update[i].level[i].forward = x - - // update span covered by update[i] as x is inserted here - x.level[i].span = sl.update[i].level[i].span - sl.rank[0] + sl.rank[i] - sl.update[i].level[i].span = sl.rank[0] - sl.rank[i] + 1 - } - - // increment span for untouched levels - for i := level; i < sl.level; i++ { - sl.update[i].level[i].span++ - } - - if sl.update[0] == sl.header { - x.backward = nil - } else { - x.backward = sl.update[0] - } - if x.level[0].forward != nil { - x.level[0].forward.backward = x - } else { - sl.tail = x - } - sl.length++ - - return x -} - -// deleteElement deletes e from its skiplist, and decrements sl.length. -func (sl *SkipList) deleteElement(e *Element, update []*Element) { - for i := 0; i < sl.level; i++ { - if update[i].level[i].forward == e { - update[i].level[i].span += e.level[i].span - 1 - update[i].level[i].forward = e.level[i].forward - } else { - update[i].level[i].span -= 1 - } - } - - if e.level[0].forward != nil { - e.level[0].forward.backward = e.backward - } else { - sl.tail = e.backward - } - - for sl.level > 1 && sl.header.level[sl.level-1].forward == nil { - sl.level-- - } - sl.length-- -} - -// Remove removes e from sl if e is an element of skiplist sl. -// It returns the element value e.Value. -func (sl *SkipList) Remove(e *Element) interface{} { - x := sl.find(e.Value) // x.Value >= e.Value - if x == e && !e.Value.Less(x.Value) { // e.Value >= x.Value - sl.deleteElement(x, sl.update) - return x.Value - } - - return nil -} - -// Delete deletes an element e that e.Value == v, and returns e.Value or nil. -func (sl *SkipList) Delete(v Interface) interface{} { - x := sl.find(v) // x.Value >= v - if x != nil && !v.Less(x.Value) { // v >= x.Value - sl.deleteElement(x, sl.update) - return x.Value - } - - return nil -} - -// Find finds an element e that e.Value == v, and returns e or nil. -func (sl *SkipList) Find(v Interface) *Element { - x := sl.find(v) // x.Value >= v - if x != nil && !v.Less(x.Value) { // v >= x.Value - return x - } - - return nil -} - -// find finds the first element e that e.Value >= v, and returns e or nil. -func (sl *SkipList) find(v Interface) *Element { - x := sl.header - for i := sl.level - 1; i >= 0; i-- { - for x.level[i].forward != nil && x.level[i].forward.Value.Less(v) { - x = x.level[i].forward - } - sl.update[i] = x - } - - return x.level[0].forward -} - -// GetRank finds the rank for an element e that e.Value == v, -// Returns 0 when the element cannot be found, rank otherwise. -// Note that the rank is 1-based due to the span of sl.header to the first element. -func (sl *SkipList) GetRank(v Interface) int { - x := sl.header - rank := 0 - for i := sl.level - 1; i >= 0; i-- { - for x.level[i].forward != nil && x.level[i].forward.Value.Less(v) { - rank += x.level[i].span - x = x.level[i].forward - } - if x.level[i].forward != nil && !x.level[i].forward.Value.Less(v) && !v.Less(x.level[i].forward.Value) { - rank += x.level[i].span - return rank - } - } - - return 0 -} - -// GetElementByRank finds an element by ites rank. The rank argument needs bo be 1-based. -// Note that is the first element e that GetRank(e.Value) == rank, and returns e or nil. -func (sl *SkipList) GetElementByRank(rank int) *Element { - x := sl.header - traversed := 0 - for i := sl.level - 1; i >= 0; i-- { - for x.level[i].forward != nil && traversed+x.level[i].span <= rank { - traversed += x.level[i].span - x = x.level[i].forward - } - if traversed == rank { - return x - } - } - - return nil -} - -// randomLevel returns a random level. -func randomLevel() int { - level := 1 - for (rand.Int31()&0xFFFF)%SKIPLIST_BRANCH == 0 { - level += 1 - } - - if level < SKIPLIST_MAXLEVEL { - return level - } else { - return SKIPLIST_MAXLEVEL - } -} diff --git a/src/core/container/unsafe/skiplist/skiplist_test.go b/src/core/container/unsafe/skiplist/skiplist_test.go deleted file mode 100644 index 78e055e..0000000 --- a/src/core/container/unsafe/skiplist/skiplist_test.go +++ /dev/null @@ -1,320 +0,0 @@ -package skiplist - -import ( - "fmt" - "math/rand" - "sort" - "testing" -) - -type Int int - -func (i Int) Less(other interface{}) bool { - return i < other.(Int) -} - -func (i Int) Print() { - fmt.Println(i) -} - -func TestInt(t *testing.T) { - sl := New() - if sl.Len() != 0 || sl.Front() != nil && sl.Back() != nil { - t.Fatal() - } - - testData := []Int{Int(1), Int(2), Int(3)} - - sl.Insert(testData[0]) - if sl.Len() != 1 || sl.Front().Value.(Int) != testData[0] || sl.Back().Value.(Int) != testData[0] { - t.Fatal() - } - - sl.Insert(testData[2]) - if sl.Len() != 2 || sl.Front().Value.(Int) != testData[0] || sl.Back().Value.(Int) != testData[2] { - t.Fatal() - } - - sl.Insert(testData[1]) - if sl.Len() != 3 || sl.Front().Value.(Int) != testData[0] || sl.Back().Value.(Int) != testData[2] { - t.Fatal() - } - - sl.Insert(Int(-999)) - sl.Insert(Int(-888)) - sl.Insert(Int(888)) - sl.Insert(Int(999)) - sl.Insert(Int(1000)) - - expect := []Int{Int(-999), Int(-888), Int(1), Int(2), Int(3), Int(888), Int(999), Int(1000)} - ret := make([]Int, 0) - - for e := sl.Front(); e != nil; e = e.Next() { - ret = append(ret, e.Value.(Int)) - } - for i := 0; i < len(ret); i++ { - if ret[i] != expect[i] { - t.Fatal() - } - } - - e := sl.Find(Int(2)) - if e == nil || e.Value.(Int) != 2 { - t.Fatal() - } - - ret = make([]Int, 0) - for ; e != nil; e = e.Next() { - ret = append(ret, e.Value.(Int)) - } - for i := 0; i < len(ret); i++ { - if ret[i] != expect[i+3] { - t.Fatal() - } - } - - sl.Remove(sl.Find(Int(2))) - sl.Delete(Int(888)) - sl.Delete(Int(1000)) - - expect = []Int{Int(-999), Int(-888), Int(1), Int(3), Int(999)} - ret = make([]Int, 0) - - for e := sl.Back(); e != nil; e = e.Prev() { - ret = append(ret, e.Value.(Int)) - } - - for i := 0; i < len(ret); i++ { - if ret[i] != expect[len(ret)-i-1] { - t.Fatal() - } - } - - if sl.Front().Value.(Int) != -999 { - t.Fatal() - } - - sl.Remove(sl.Front()) - if sl.Front().Value.(Int) != -888 || sl.Back().Value.(Int) != 999 { - t.Fatal() - } - - sl.Remove(sl.Back()) - if sl.Front().Value.(Int) != -888 || sl.Back().Value.(Int) != 3 { - t.Fatal() - } - - if e = sl.Insert(Int(2)); e.Value.(Int) != 2 { - t.Fatal() - } - sl.Delete(Int(-888)) - - if r := sl.Delete(Int(123)); r != nil { - t.Fatal() - } - - if sl.Len() != 3 { - t.Fatal() - } - - sl.Insert(Int(2)) - sl.Insert(Int(2)) - sl.Insert(Int(1)) - - if e = sl.Find(Int(2)); e == nil { - t.Fatal() - } - - expect = []Int{Int(2), Int(2), Int(2), Int(3)} - ret = make([]Int, 0) - for ; e != nil; e = e.Next() { - ret = append(ret, e.Value.(Int)) - } - for i := 0; i < len(ret); i++ { - if ret[i] != expect[i] { - t.Fatal() - } - } - - sl2 := sl.Init() - if sl.Len() != 0 || sl.Front() != nil || sl.Back() != nil || - sl2.Len() != 0 || sl2.Front() != nil || sl2.Back() != nil { - t.Fatal() - } - - // for i := 0; i < 100; i++ { - // sl.Insert(Int(rand.Intn(200))) - // } - // output(sl) -} - -func TestRank(t *testing.T) { - sl := New() - - for i := 1; i <= 10; i++ { - sl.Insert(Int(i)) - } - - for i := 1; i <= 10; i++ { - if sl.GetRank(Int(i)) != i { - t.Fatal() - } - } - - for i := 1; i <= 10; i++ { - if sl.GetElementByRank(i).Value != Int(i) { - t.Fatal() - } - } - - if sl.GetRank(Int(0)) != 0 || sl.GetRank(Int(11)) != 0 { - t.Fatal() - } - - if sl.GetElementByRank(11) != nil || sl.GetElementByRank(12) != nil { - t.Fatal() - } - - expect := []Int{Int(7), Int(8), Int(9), Int(10)} - for e, i := sl.GetElementByRank(7), 0; e != nil; e, i = e.Next(), i+1 { - if e.Value != expect[i] { - t.Fatal() - } - } - - sl = sl.Init() - mark := make(map[int]bool) - ss := make([]int, 0) - - for i := 1; i <= 100000; i++ { - x := rand.Int() - if !mark[x] { - mark[x] = true - sl.Insert(Int(x)) - ss = append(ss, x) - } - } - sort.Ints(ss) - - for i := 0; i < len(ss); i++ { - if sl.GetElementByRank(i+1).Value != Int(ss[i]) || sl.GetRank(Int(ss[i])) != i+1 { - t.Fatal() - } - } - - // output(sl) -} - -func BenchmarkIntInsertOrder(b *testing.B) { - b.StopTimer() - sl := New() - b.StartTimer() - - for i := 0; i < b.N; i++ { - sl.Insert(Int(i)) - } -} - -func BenchmarkIntInsertRandom(b *testing.B) { - b.StopTimer() - sl := New() - b.StartTimer() - - for i := 0; i < b.N; i++ { - sl.Insert(Int(rand.Int())) - } -} - -func BenchmarkIntDeleteOrder(b *testing.B) { - b.StopTimer() - sl := New() - for i := 0; i < 1000000; i++ { - sl.Insert(Int(i)) - } - b.StartTimer() - - for i := 0; i < b.N; i++ { - sl.Delete(Int(i)) - } -} - -func BenchmarkIntDeleteRandome(b *testing.B) { - b.StopTimer() - sl := New() - for i := 0; i < 1000000; i++ { - sl.Insert(Int(rand.Int())) - } - b.StartTimer() - - for i := 0; i < b.N; i++ { - sl.Delete(Int(rand.Int())) - } -} - -func BenchmarkIntFindOrder(b *testing.B) { - b.StopTimer() - sl := New() - for i := 0; i < 1000000; i++ { - sl.Insert(Int(i)) - } - b.StartTimer() - - for i := 0; i < b.N; i++ { - sl.Find(Int(i)) - } -} - -func BenchmarkIntFindRandom(b *testing.B) { - b.StopTimer() - sl := New() - for i := 0; i < 1000000; i++ { - sl.Insert(Int(rand.Int())) - } - b.StartTimer() - - for i := 0; i < b.N; i++ { - sl.Find(Int(rand.Int())) - } -} - -func BenchmarkIntRankOrder(b *testing.B) { - b.StopTimer() - sl := New() - for i := 0; i < 1000000; i++ { - sl.Insert(Int(i)) - } - b.StartTimer() - - for i := 0; i < b.N; i++ { - sl.GetRank(Int(i)) - } -} - -func BenchmarkIntRankRandom(b *testing.B) { - b.StopTimer() - sl := New() - for i := 0; i < 1000000; i++ { - sl.Insert(Int(rand.Int())) - } - b.StartTimer() - - for i := 0; i < b.N; i++ { - sl.GetRank(Int(rand.Int())) - } -} - -func output(sl *SkipList) { - var x *Element - for i := 0; i < SKIPLIST_MAXLEVEL; i++ { - fmt.Printf("LEVEL[%v]: ", i) - count := 0 - x = sl.header.level[i].forward - for x != nil { - // fmt.Printf("%v -> ", x.Value) - count++ - x = x.level[i].forward - } - // fmt.Println("NIL") - fmt.Println("count==", count) - } -} diff --git a/src/core/dispatcher/dispatcher.go b/src/core/dispatcher/dispatcher.go deleted file mode 100644 index 19061d1..0000000 --- a/src/core/dispatcher/dispatcher.go +++ /dev/null @@ -1,73 +0,0 @@ -package dispatcher - -import ( - "reflect" - "sync" - - "core/goroutine" - "core/log" -) - -// 单线程事件机制 -type IListener interface{ OnEvent(interface{}) } -type IDispatcher interface { - Dispatch(event interface{}) - AddListener(event interface{}, listener IListener) - RemoveListener(event interface{}, listener IListener) - RemoveListenerAll(listener IListener) -} - -type Dispatcher struct{ listeners sync.Map } - -func (s *Dispatcher) Dispatch(event interface{}) { - etype := reflect.TypeOf(event) - if list, ok := s.listeners.Load(etype); ok { - for _, l := range list.([]IListener) { - goroutine.Try(func() { l.OnEvent(event) }, nil) - } - } -} - -func (s *Dispatcher) AddListener(event interface{}, listener IListener) { - etype := reflect.TypeOf(event) - if _, ok := s.listeners.Load(etype); !ok { - s.listeners.Store(etype, []IListener{}) - } - - ls, _ := s.listeners.Load(etype) - list := ls.([]IListener) - for _, l := range list { - if l == listener { - log.KV("etype", etype.Name()).ErrorStack(1, "AddListener repeated") - return - } - } - s.listeners.Store(etype, append(list, listener)) -} - -func (s *Dispatcher) RemoveListener(event interface{}, listener IListener) { - s.removeListener(reflect.TypeOf(event), listener) -} - -func (s *Dispatcher) RemoveListenerAll(listener IListener) { - s.listeners.Range(func(tp, value interface{}) bool { - s.removeListener(tp, listener) - return true - }) -} - -func (s *Dispatcher) removeListener(etype interface{}, listener IListener) { - ls, ok := s.listeners.Load(etype) - if !ok { - return - } - - list := ls.([]IListener) - for i := range list { - if list[i] == listener { - list = append(list[:i], list[i+1:]...) - break - } - } - s.listeners.Store(etype, list) -} diff --git a/src/core/douyin/tk.go b/src/core/douyin/tk.go new file mode 100644 index 0000000..70d95a2 --- /dev/null +++ b/src/core/douyin/tk.go @@ -0,0 +1,290 @@ +package douyin + +import ( + "bytes" + "encoding/json" + "errors" + "fmt" + "io/ioutil" + "net/http" + "sync" + "time" + + log "github.com/sirupsen/logrus" +) + +type IApp interface { + StartRefreshToken() + GetRoomId(token string) (string, string, string, error) + StartTask(roomid string, msg_type string) (string, error) + StopTask(roomid string, msg_type string) (string, error) +} + +func NewApp(appid, secret string) IApp { + return &App{ + appid: appid, + secret: secret, + } +} + +type App struct { + appid string + secret string + accessToken string + refreshTokenChan chan string + refreshTokenMutex sync.Mutex +} + +func (s *App) StartRefreshToken() { + go func() { + s.refreshTokenChan = make(chan string, 1) + for { + var err error + s.accessToken, err = s.getAccessToken() + if err != nil { + // handle error + log.Errorf("Failed to refresh access token: %v", err) + } + select { + case m := <-s.refreshTokenChan: + log.Info(m) + // Timeout + case <-time.After(time.Hour): // + log.Info("RefreshToken after a hour") + } + + } + }() +} + +func (s *App) StartTask(roomid string, msg_type string) (string, error) { + url := "https://webcast.bytedance.com/api/live_data/task/start" + data := map[string]string{ + "roomid": roomid, + "appid": s.appid, + "msg_type": msg_type, + } + jsonData, err := json.Marshal(data) + if err != nil { + return "", err + } + req, err := http.NewRequest("POST", url, bytes.NewBuffer(jsonData)) + if err != nil { + return "", err + } + req.Header.Set("access-token", s.accessToken) + req.Header.Set("content-type", "application/json") + client := &http.Client{} + resp, err := client.Do(req) + if err != nil { + return "", err + } + defer resp.Body.Close() + body, err := ioutil.ReadAll(resp.Body) + if err != nil { + return "", err + } + var result map[string]interface{} + err = json.Unmarshal(body, &result) + if err != nil { + return "", err + } + if result["err_no"].(float64) != 0 { + if int64(result["err_no"].(float64)) == 40022 { + s.needRefreshToken(fmt.Sprintf("RefreshToken:StartTask%f%v", result["err_no"].(float64), result["err_msg"].(string))) + } + return "", errors.New(result["err_msg"].(string)) + } + return result["data"].(map[string]interface{})["task_id"].(string), nil +} + +func (s *App) StopTask(roomid string, msg_type string) (string, error) { + url := "https://webcast.bytedance.com/api/live_data/task/stop" + data := map[string]string{ + "roomid": roomid, + "appid": s.appid, + "msg_type": msg_type, + } + jsonData, err := json.Marshal(data) + if err != nil { + return "", err + } + req, err := http.NewRequest("POST", url, bytes.NewBuffer(jsonData)) + if err != nil { + return "", err + } + req.Header.Set("access-token", s.accessToken) + req.Header.Set("content-type", "application/json") + client := &http.Client{} + resp, err := client.Do(req) + if err != nil { + return "", err + } + defer resp.Body.Close() + body, err := ioutil.ReadAll(resp.Body) + if err != nil { + return "", err + } + var result map[string]interface{} + err = json.Unmarshal(body, &result) + if err != nil { + return "", err + } + if result["err_no"].(float64) != 0 { + if int64(result["err_no"].(float64)) == 40022 { + s.needRefreshToken(fmt.Sprintf("RefreshToken:StopTask%f%v", result["err_no"].(float64), result["err_msg"].(string))) + } + return "", errors.New(result["err_msg"].(string)) + } + return "", nil +} + +func (s *App) SendGiftPostRequest(roomid string, appid string, sec_gift_id_list []string) ([]string, error) { + url := "https://webcast.bytedance.com/api/gift/top_gift" + data := map[string]interface{}{ + "room_id": roomid, + "app_id": appid, + "sec_gift_id_list": sec_gift_id_list, + } + jsonData, err := json.Marshal(data) + if err != nil { + return nil, err + } + req, err := http.NewRequest("POST", url, bytes.NewBuffer(jsonData)) + if err != nil { + return nil, err + } + req.Header.Set("x-token", s.accessToken) + req.Header.Set("content-type", "application/json") + client := &http.Client{} + resp, err := client.Do(req) + if err != nil { + return nil, err + } + defer resp.Body.Close() + body, err := ioutil.ReadAll(resp.Body) + if err != nil { + return nil, err + } + var result map[string]interface{} + err = json.Unmarshal(body, &result) + if err != nil { + return nil, err + } + if errcode, ok := result["errcode"]; ok { + if errcode.(float64) != 0 { + if int64(errcode.(float64)) == 40022 { + s.needRefreshToken(fmt.Sprintf("RefreshToken:SendGiftPostRequest%f%v", result["errcode"].(float64), result["err_msg"].(string))) + } + return nil, errors.New(result["errmsg"].(string)) + } + } + + success_top_gift_id_list := result["data"].(map[string]interface{})["success_top_gift_id_list"].([]interface{}) + var res []string + for _, v := range success_top_gift_id_list { + res = append(res, v.(string)) + } + return res, nil +} + +func (s *App) GetRoomId(token string) (string, string, string, error) { + url := "http://webcast.bytedance.com/api/webcastmate/info" + data := map[string]string{ + "token": token, + } + jsonData, err := json.Marshal(data) + if err != nil { + return "", "", "", err + } + req, err := http.NewRequest("POST", url, bytes.NewBuffer(jsonData)) + if err != nil { + return "", "", "", err + } + req.Header.Set("X-Token", s.accessToken) + req.Header.Set("Content-Type", "application/json") + client := &http.Client{} + resp, err := client.Do(req) + if err != nil { + return "", "", "", err + } + defer resp.Body.Close() + body, err := ioutil.ReadAll(resp.Body) + if err != nil { + return "", "", "", err + } + var result = &struct { + Data struct { + Info struct { + RoomId string `json:"room_id"` + Uid string `json:"anchor_open_id"` + Nickname string `json:"nick_name"` + } `json:"info"` + } `json:"data"` + ErrCode int64 `json:"errcode"` + ErrMsg string `json:"errmsg"` + }{} + err = json.Unmarshal(body, result) + if err != nil { + return "", "", "", err + } + if result.ErrCode != 0 { + if result.ErrCode == 40022 { + s.needRefreshToken(fmt.Sprintf("RefreshToken:GetRoomId%d%s", result.ErrCode, result.ErrMsg)) + } + return "", "", "", errors.New(result.ErrMsg) + } + if result.Data.Info.RoomId == "" { + return "", "", "", errors.New("no data in response") + } + + roomId := result.Data.Info.RoomId + uid := result.Data.Info.Uid + nickname := result.Data.Info.Nickname + return roomId, uid, nickname, nil +} + +func (s *App) needRefreshToken(reason string) { + s.refreshTokenMutex.Lock() + defer s.refreshTokenMutex.Unlock() + if len(s.refreshTokenChan) == 0 { + s.refreshTokenChan <- reason + } +} + +// 新建一个golang func,参数appid secret grant_type 发送以json格式http请求返回asccess_token +func (s *App) getAccessToken() (string, error) { + url := "https://developer.toutiao.com/api/apps/v2/token" + data := map[string]string{ + "appid": s.appid, + "secret": s.secret, + "grant_type": "client_credential", + } + jsonData, err := json.Marshal(data) + if err != nil { + return "", err + } + resp, err := http.Post(url, "application/json", bytes.NewBuffer(jsonData)) + if err != nil { + return "", err + } + defer resp.Body.Close() + body, err := ioutil.ReadAll(resp.Body) + if err != nil { + return "", err + } + var result map[string]interface{} + err = json.Unmarshal(body, &result) + if err != nil { + return "", err + } + if result["err_no"].(float64) != 0 { + return "", errors.New(result["err_tips"].(string)) + } + s.accessToken = result["data"].(map[string]interface{})["access_token"].(string) + return s.accessToken, nil +} + +func (s *App) GetAccessToken() string { + return s.accessToken +} diff --git a/src/core/encrypted/3des.go b/src/core/encrypted/3des.go deleted file mode 100644 index 567a241..0000000 --- a/src/core/encrypted/3des.go +++ /dev/null @@ -1,51 +0,0 @@ -/* - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . -*/ - -package encrypted - -import ( - "crypto/des" -) - -type encriypted_3des struct { -} - -func (this *encriypted_3des) Encrypt(src []byte, key []byte) (result []byte) { - if len(key) != 24 { - return - } - - block, err := des.NewTripleDESCipher(key) - - if err != nil { - return - } - - return BlockEncrypt(block, src, key) -} - -func (this *encriypted_3des) Decrypt(src []byte, key []byte) (result []byte) { - if len(key) != 24 { - return - } - - block, err := des.NewTripleDESCipher(key) - - if err != nil { - return - } - - return BlockDecrypt(block, src, key) -} diff --git a/src/core/encrypted/aes.go b/src/core/encrypted/aes.go deleted file mode 100644 index 6ce1791..0000000 --- a/src/core/encrypted/aes.go +++ /dev/null @@ -1,69 +0,0 @@ -/* - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . -*/ - -package encrypted - -import ( - "crypto/aes" -) - -type encriypted_aes struct { - keyLen int -} - -func newEncriypted_aes(bit int) *encriypted_aes { - aes := &encriypted_aes{} - - switch bit { - case 128: - aes.keyLen = 16 - case 192: - aes.keyLen = 24 - case 256: - aes.keyLen = 32 - default: - return nil - } - - return aes -} - -func (this *encriypted_aes) Encrypt(src []byte, key []byte) (result []byte) { - if len(key) != this.keyLen { - return - } - - block, err := aes.NewCipher(key) - - if err != nil { - return - } - - return BlockEncrypt(block, src, key) -} - -func (this *encriypted_aes) Decrypt(src []byte, key []byte) (result []byte) { - if len(key) != this.keyLen { - return - } - - block, err := aes.NewCipher(key) - - if err != nil { - return - } - - return BlockDecrypt(block, src, key) -} diff --git a/src/core/encrypted/block.go b/src/core/encrypted/block.go deleted file mode 100644 index 39809e1..0000000 --- a/src/core/encrypted/block.go +++ /dev/null @@ -1,84 +0,0 @@ -/* - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . -*/ - -package encrypted - -import ( - "bytes" - "crypto/cipher" -) - -func BlockEncrypt(block cipher.Block, src []byte, key []byte) (result []byte) { - if block == nil || len(src) <= 0 || len(key) <= 0 { - return - } - - rg := NewAbRandGenerator(uint32(key[0])) - - if rg == nil { - return - } - - blockMode := cipher.NewCBCEncrypter(block, rg.Key(block.BlockSize())) - - if blockMode == nil { - return - } - - plainData := PKCS7Padding(src, block.BlockSize()) - - if plainData == nil { - return - } - - result = make([]byte, len(plainData)) - blockMode.CryptBlocks(result, plainData) - return -} - -func BlockDecrypt(block cipher.Block, src []byte, key []byte) (result []byte) { - if block == nil || len(src) <= 0 || len(key) <= 0 { - return - } - - rg := NewAbRandGenerator(uint32(key[0])) - if rg == nil { - return - } - - blockMode := cipher.NewCBCDecrypter(block, rg.Key(block.BlockSize())) - if blockMode == nil { - return - } - plainData := make([]byte, len(src)) - blockMode.CryptBlocks(plainData, src) - return PKCS7UnPadding(plainData, block.BlockSize()) -} - -func PKCS7Padding(ciphertext []byte, blockSize int) []byte { - padding := blockSize - len(ciphertext)%blockSize - padtext := bytes.Repeat([]byte{byte(padding)}, padding) - return append(ciphertext, padtext...) -} - -func PKCS7UnPadding(plantText []byte, blockSize int) []byte { - length := len(plantText) - unpadding := int(plantText[length-1]) - finalLen := length - unpadding - if len(plantText) < finalLen { - finalLen = len(plantText) - } - return plantText[:finalLen] -} diff --git a/src/core/encrypted/factory.go b/src/core/encrypted/factory.go deleted file mode 100644 index 4f505de..0000000 --- a/src/core/encrypted/factory.go +++ /dev/null @@ -1,60 +0,0 @@ -/* - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . -*/ - -package encrypted - -type EncryptedInterface interface { - Encrypt(src []byte, key []byte) []byte - Decrypt(src []byte, key []byte) []byte -} - -func NewEncryptedObj(t string) EncryptedInterface { - switch t { - case "rsa": - return &encriypted_rsa{} - case "url": - return &encriypted_url{} - case "3des": - return &encriypted_3des{} - case "aes128": - return newEncriypted_aes(128) - case "aes192": - return newEncriypted_aes(192) - case "aes256": - return newEncriypted_aes(256) - } - - return nil -} - -func NewEncryptedKey(t string, seed uint32) (key []byte) { - rg := NewAbRandGenerator(seed) - if rg == nil { - return - } - - switch t { - case "3des": - return rg.Key(24) - case "aes128": - return rg.Key(16) - case "aes192": - return rg.Key(24) - case "aes256": - return rg.Key(32) - } - - return -} diff --git a/src/core/encrypted/none.go b/src/core/encrypted/none.go deleted file mode 100644 index 1d2417c..0000000 --- a/src/core/encrypted/none.go +++ /dev/null @@ -1,27 +0,0 @@ -/* - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . -*/ - -package encrypted - -type encriypted_none struct { -} - -func (this *encriypted_none) Encrypt(src []byte, key []byte) []byte { - return src -} - -func (this *encriypted_none) Decrypt(src []byte, key []byte) []byte { - return src -} diff --git a/src/core/encrypted/rand.go b/src/core/encrypted/rand.go deleted file mode 100644 index 645b280..0000000 --- a/src/core/encrypted/rand.go +++ /dev/null @@ -1,53 +0,0 @@ -package encrypted - -import ( - "math" - "sync" -) - -type AbRandGenerator struct { - mu sync.Mutex - seed uint32 - s1 uint32 - s2 uint32 - s3 uint32 - s4 uint32 -} - -func NewAbRandGenerator(seed uint32) *AbRandGenerator { - return &AbRandGenerator{ - seed: seed, - s1: seed + 2, - s2: seed + 8, - s3: seed + 16, - s4: seed + 128, - } -} - -func (this *AbRandGenerator) Seed() uint32 { - return this.seed -} - -func (this *AbRandGenerator) Rand() uint32 { - this.mu.Lock() - b := (((this.s1 << 6) ^ this.s1) >> 13) - this.s1 = (((this.s1 & 0xFFFFFFFE) << 18) ^ b) - b = (((this.s2 << 2) ^ this.s2) >> 27) - this.s2 = (((this.s2 & 0xFFFFFFF8) << 2) ^ b) - b = (((this.s3 << 13) ^ this.s3) >> 21) - this.s3 = (((this.s3 & 0xFFFFFFF0) << 7) ^ b) - b = (((this.s4 << 3) ^ this.s4) >> 12) - this.s4 = (((this.s4 & 0xFFFFFF80) << 13) ^ b) - b = this.s1 ^ this.s2 ^ this.s3 ^ this.s4 - this.mu.Unlock() - return b -} - -func (this *AbRandGenerator) Key(len int) []byte { - var key []byte - for i := 0; i < len; i++ { - key = append(key, byte(this.Rand()%math.MaxUint8)) - } - - return key -} diff --git a/src/core/encrypted/rsa.go b/src/core/encrypted/rsa.go deleted file mode 100644 index bd4a399..0000000 --- a/src/core/encrypted/rsa.go +++ /dev/null @@ -1,124 +0,0 @@ -/* - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . -*/ - -package encrypted - -import ( - "crypto/rand" - "crypto/rsa" - "crypto/x509" - "encoding/base64" - "encoding/pem" -) - -type encriypted_rsa struct { -} - -func GetRSAPublKey(key []byte) *rsa.PublicKey { - block, _ := pem.Decode(key) - - if block == nil { - return nil - } - - publ, err := x509.ParsePKIXPublicKey(block.Bytes) - - if err != nil { - return nil - } - - return publ.(*rsa.PublicKey) -} - -func GetRSAPrivKey(key []byte) *rsa.PrivateKey { - block, _ := pem.Decode(key) - - if block == nil { - return nil - } - - priv, err := x509.ParsePKCS1PrivateKey(block.Bytes) - - if err != nil { - return nil - } - - return priv -} - -func (this *encriypted_rsa) Encrypt(src []byte, key []byte) (result []byte) { - publ := GetRSAPublKey(key) - - if publ == nil { - return - } - - data, err := rsa.EncryptPKCS1v15(rand.Reader, publ, src) - - if err != nil { - return - } - - return data -} - -func (this *encriypted_rsa) Decrypt(src []byte, key []byte) (result []byte) { - priv := GetRSAPrivKey(key) - - if priv == nil { - return - } - - data, err := rsa.DecryptPKCS1v15(rand.Reader, priv, src) - - if err != nil { - return - } - - return data -} - -func RSAEncryptWithBase64(key []byte, src []byte) (result []byte) { - rsaObj := NewEncryptedObj("rsa") - - if rsaObj == nil { - return - } - - encodeData := rsaObj.Encrypt(src, key) - - result = make([]byte, base64.URLEncoding.EncodedLen(len(encodeData))) - base64.URLEncoding.Encode(result, encodeData) - return -} - -func RSADecryptWithBase64(key []byte, src []byte) (result []byte) { - encodeData := make([]byte, base64.URLEncoding.DecodedLen(len(src))) - n, err := base64.URLEncoding.Decode(encodeData, src) - - if err != nil { - return nil - } - - encodeData = encodeData[:n] - - rsaObj := NewEncryptedObj("rsa") - - if rsaObj == nil { - return - } - - return rsaObj.Decrypt(encodeData, key) -} diff --git a/src/core/encrypted/rsakey.go b/src/core/encrypted/rsakey.go deleted file mode 100644 index 764370d..0000000 --- a/src/core/encrypted/rsakey.go +++ /dev/null @@ -1,58 +0,0 @@ -/* - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . -*/ - -package encrypted - -const RSA_PRIVATE_KEY = ` ------BEGIN RSA PRIVATE KEY----- -MIIEowIBAAKCAQEAv+fLU1pfQajwtavfRZN5FuMMipzBUnnMIQjrr4ltqqqpO35E -WhnMlj19D3zgb8nr+rdrv4TLxsxTARMn8605uSj4g+BN4M6cGQ/eK2P2ZqhBQrs7 -2nnWU0EIj0+WYx0z3bMkyCAbTutGNtQR3MAVRUICN1zwv0fJq8wxKnTtO3l9nvWn -FZQB0QBrAjpS5Dtf8wsi2an//Ycld8ujQC/5+EaeIw7p4pJEpUNP4FD0MYKjSv3W -lTsMuy7tZ39UGC3JiNCTN0ivLTZfOCseu8c6xbyL2y1MvSJK/G8PCB2R28sT+DiI -zI8xQEK1ynXauIRdJT4CU4Af1syvOyZr4zBCcwIDAQABAoIBADrgl+4z3OPdPDTQ -zYigLVeLQ47Hdzyhp7I+9Wh+xonFIHTjUX8/SRiTNupoisdhcSgT3Ff/GzIcAB9l -TC2j6QDZBB4Z1GrzmMrLpoMzgSaP2q3pmfx2wv36BvFJHr+79uy/CLrpttcosfsi -Z3SN7ji4fsuTlT1qfgJafH8lLp+/J3yn5+8Dy6Dl9vDc4u4LI0DEqJ77C+jaDZ11 -mMR4uGlUNmTo7XCcJYVVZM1aGWB4C2NiaBE7HWAZUCa5zJfD6vxOPsY234Rn9ejG -d73Psaltduf2bWmEXZIohlOA+MQ242LB1wbpbiWZj3lOY0aIAh7S8bOujNqBii0E -7uARLnECgYEA3hEL3vf21vz4ZAsvCnbovM1W/Vu5cwhUgabqYTwnHHmDOE76l0xK -u7ZEf0+OsUfgYHLiHdYrFd+6UJ7LV93jx9ffvOCDSl3Iq7KH/lHuFaDOJFDXikhR -9AfUx1PzbTHO6P64ubt8BXr2iGW5sUYsB+K+htXfghlYrk7mxbWAAtsCgYEA3Tri -Mt+gNvp2G+/Gv/RyB8TAY7rg8VZXskxdH50DxiGsKmT6E+avwaXj1Yi9L0+fo+GS -GNNkkpqKI4ztcLEYtkB9ZXCBtuoli6/0BLfTUhLTLe+WYcIjLBSfQ8tyi8b0V8UX -iZeLEP7CokLbcxA+BUr9REb93tMhannM4qEj9kkCgYBQjKZdrlwfB4uh3lyl0xQA -yArxw7+09iSREtaZhpQ5Q+pRFnTXRJknFaoq89SygXvmAEX8xJ7ERG70p2Ti7l2d -M7S4cketRe9wOEYT/ev6dGXRznEge7MebWjFFLKLvTFsWljvJg6KflvGhf+hSe7W -vWyWxCVar473Sy9yL6/LWQKBgQCVL9dIXVuql548WqbZ3ZtkN79Rwb1dok9DUpHd -9sGLxDtY331xHDjbyuXoouyJUhWiq0Qdb7i70HFlZezc+OBkTvsBBCzFUAL/vyk8 -YUala0J0EMSFqiiT2lhInJLjRciSw7uKsuI6FMLmL1XTs1lPsnE2sPUUZaZ8KiUL -k4Uv2QKBgAgEuDp6XErnZHNdnJLs+dJn6F8VuQf0UWFDdlxyJ+ovrWtKWUota1KM -YGBz4i+0QTR2aK6BUoK6HhmNHvzBaZ0QNv4WzZIIwUPwWJT+ThdLIB1F8yeFYoPw -gBDFwEbEoNE0U1Gl2sztUxVR5BVpKvBecezxA3XXqHNAkQVAgXLm ------END RSA PRIVATE KEY----- -` - -const RSA_PUBLIC_KEY = ` ------BEGIN PUBLIC KEY----- -MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAv+fLU1pfQajwtavfRZN5 -FuMMipzBUnnMIQjrr4ltqqqpO35EWhnMlj19D3zgb8nr+rdrv4TLxsxTARMn8605 -uSj4g+BN4M6cGQ/eK2P2ZqhBQrs72nnWU0EIj0+WYx0z3bMkyCAbTutGNtQR3MAV -RUICN1zwv0fJq8wxKnTtO3l9nvWnFZQB0QBrAjpS5Dtf8wsi2an//Ycld8ujQC/5 -+EaeIw7p4pJEpUNP4FD0MYKjSv3WlTsMuy7tZ39UGC3JiNCTN0ivLTZfOCseu8c6 -xbyL2y1MvSJK/G8PCB2R28sT+DiIzI8xQEK1ynXauIRdJT4CU4Af1syvOyZr4zBC -cwIDAQAB ------END PUBLIC KEY----- -` diff --git a/src/core/encrypted/url.go b/src/core/encrypted/url.go deleted file mode 100644 index c8b1351..0000000 --- a/src/core/encrypted/url.go +++ /dev/null @@ -1,34 +0,0 @@ -package encrypted - -import ( - "encoding/base64" -) - -type encriypted_url struct { -} - -func (this *encriypted_url) Encrypt(src []byte, key []byte) []byte { - return URLEncoding(src) -} - -func (this *encriypted_url) Decrypt(src []byte, key []byte) []byte { - return URLDecoding(src) -} - -func URLEncoding(data []byte) []byte { - dst := make([]byte, base64.URLEncoding.EncodedLen(len(data))) - base64.URLEncoding.Encode(dst, data) - return dst -} - -func URLDecoding(data []byte) []byte { - dst := make([]byte, base64.URLEncoding.DecodedLen(len(data))) - - n, err := base64.URLEncoding.Decode(dst, data) - - if err != nil { - return nil - } - - return dst[:n] -} diff --git a/src/core/go.mod b/src/core/go.mod index 84ab34a..b9c0ef7 100644 --- a/src/core/go.mod +++ b/src/core/go.mod @@ -4,22 +4,11 @@ go 1.22.1 require ( github.com/bwmarrin/snowflake v0.3.0 - github.com/elliotchance/orderedmap v1.4.0 - github.com/go-sql-driver/mysql v1.6.0 github.com/google/uuid v1.3.0 - github.com/lestrrat-go/file-rotatelogs v2.4.0+incompatible - github.com/orcaman/concurrent-map v1.0.0 github.com/panjf2000/ants/v2 v2.5.0 - github.com/prometheus/client_golang v1.12.2 - github.com/yuin/gopher-lua v0.0.0-20220504180219-658193537a64 - go.etcd.io/etcd/client/v3 v3.5.4 + github.com/sirupsen/logrus v1.9.3 go.uber.org/atomic v1.9.0 - go.uber.org/zap v1.21.0 google.golang.org/protobuf v1.33.0 - xorm.io/xorm v1.3.1 ) -require ( - github.com/arl/go-detour v0.1.3 - github.com/arl/gogeo v0.0.0-20200405111831-9d419f5f7a90 -) +require golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8 // indirect diff --git a/src/core/go.sum b/src/core/go.sum index f2e69c8..18a0aff 100644 --- a/src/core/go.sum +++ b/src/core/go.sum @@ -1,1064 +1,32 @@ -cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= -cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= -cloud.google.com/go v0.38.0/go.mod h1:990N+gfupTy94rShfmMCWGDn0LpTmnzTp2qbd1dvSRU= -cloud.google.com/go v0.44.1/go.mod h1:iSa0KzasP4Uvy3f1mN/7PiObzGgflwredwwASm/v6AU= -cloud.google.com/go v0.44.2/go.mod h1:60680Gw3Yr4ikxnPRS/oxxkBccT6SA1yMk63TGekxKY= -cloud.google.com/go v0.45.1/go.mod h1:RpBamKRgapWJb87xiFSdk4g1CME7QZg3uwTez+TSTjc= -cloud.google.com/go v0.46.3/go.mod h1:a6bKKbmY7er1mI7TEI4lsAkts/mkhTSZK8w33B4RAg0= -cloud.google.com/go v0.50.0/go.mod h1:r9sluTvynVuxRIOHXQEHMFffphuXHOMZMycpNR5e6To= -cloud.google.com/go v0.52.0/go.mod h1:pXajvRH/6o3+F9jDHZWQ5PbGhn+o8w9qiu/CffaVdO4= -cloud.google.com/go v0.53.0/go.mod h1:fp/UouUEsRkN6ryDKNW/Upv/JBKnv6WDthjR6+vze6M= -cloud.google.com/go v0.54.0/go.mod h1:1rq2OEkV3YMf6n/9ZvGWI3GWw0VoqH/1x2nd8Is/bPc= -cloud.google.com/go v0.56.0/go.mod h1:jr7tqZxxKOVYizybht9+26Z/gUq7tiRzu+ACVAMbKVk= -cloud.google.com/go v0.57.0/go.mod h1:oXiQ6Rzq3RAkkY7N6t3TcE6jE+CIBBbA36lwQ1JyzZs= -cloud.google.com/go v0.62.0/go.mod h1:jmCYTdRCQuc1PHIIJ/maLInMho30T/Y0M4hTdTShOYc= -cloud.google.com/go v0.65.0/go.mod h1:O5N8zS7uWy9vkA9vayVHs65eM1ubvY4h553ofrNHObY= -cloud.google.com/go/bigquery v1.0.1/go.mod h1:i/xbL2UlR5RvWAURpBYZTtm/cXjCha9lbfbpx4poX+o= -cloud.google.com/go/bigquery v1.3.0/go.mod h1:PjpwJnslEMmckchkHFfq+HTD2DmtT67aNFKH1/VBDHE= -cloud.google.com/go/bigquery v1.4.0/go.mod h1:S8dzgnTigyfTmLBfrtrhyYhwRxG72rYxvftPBK2Dvzc= -cloud.google.com/go/bigquery v1.5.0/go.mod h1:snEHRnqQbz117VIFhE8bmtwIDY80NLUZUMb4Nv6dBIg= -cloud.google.com/go/bigquery v1.7.0/go.mod h1://okPTzCYNXSlb24MZs83e2Do+h+VXtc4gLoIoXIAPc= -cloud.google.com/go/bigquery v1.8.0/go.mod h1:J5hqkt3O0uAFnINi6JXValWIb1v0goeZM77hZzJN/fQ= -cloud.google.com/go/datastore v1.0.0/go.mod h1:LXYbyblFSglQ5pkeyhO+Qmw7ukd3C+pD7TKLgZqpHYE= -cloud.google.com/go/datastore v1.1.0/go.mod h1:umbIZjpQpHh4hmRpGhH4tLFup+FVzqBi1b3c64qFpCk= -cloud.google.com/go/pubsub v1.0.1/go.mod h1:R0Gpsv3s54REJCy4fxDixWD93lHJMoZTyQ2kNxGRt3I= -cloud.google.com/go/pubsub v1.1.0/go.mod h1:EwwdRX2sKPjnvnqCa270oGRyludottCI76h+R3AArQw= -cloud.google.com/go/pubsub v1.2.0/go.mod h1:jhfEVHT8odbXTkndysNHCcx0awwzvfOlguIAii9o8iA= -cloud.google.com/go/pubsub v1.3.1/go.mod h1:i+ucay31+CNRpDW4Lu78I4xXG+O1r/MAHgjpRVR+TSU= -cloud.google.com/go/storage v1.0.0/go.mod h1:IhtSnM/ZTZV8YYJWCY8RULGVqBDmpoyjwiyrjsg+URw= -cloud.google.com/go/storage v1.5.0/go.mod h1:tpKbwo567HUNpVclU5sGELwQWBDZ8gh0ZeosJ0Rtdos= -cloud.google.com/go/storage v1.6.0/go.mod h1:N7U0C8pVQ/+NIKOBQyamJIeKQKkZ+mxpohlUTyfDhBk= -cloud.google.com/go/storage v1.8.0/go.mod h1:Wv1Oy7z6Yz3DshWRJFhqM/UCfaWIRTdp0RXyy7KQOVs= -cloud.google.com/go/storage v1.10.0/go.mod h1:FLPqc6j+Ki4BU591ie1oL6qBQGu2Bl/tZ9ullr3+Kg0= -dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= -gitea.com/xorm/sqlfiddle v0.0.0-20180821085327-62ce714f951a h1:lSA0F4e9A2NcQSqGqTOXqu2aRi/XEQxDCBwM8yJtE6s= -gitea.com/xorm/sqlfiddle v0.0.0-20180821085327-62ce714f951a/go.mod h1:EXuID2Zs0pAQhH8yz+DNjUbjppKQzKFAn28TMYPB6IU= -gitee.com/travelliu/dm v1.8.11192/go.mod h1:DHTzyhCrM843x9VdKVbZ+GKXGRbKM2sJ4LxihRxShkE= -github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= -github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= -github.com/Knetic/govaluate v3.0.1-0.20171022003610-9aa49832a739+incompatible/go.mod h1:r7JcOSlj0wfOMncg0iLm8Leh48TZaKVeNIfJntJ2wa0= -github.com/Masterminds/semver/v3 v3.1.1/go.mod h1:VPu/7SZ7ePZ3QOrcuXROw5FAcLl4a0cBrbBpGY/8hQs= -github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAElWljhcU= -github.com/Shopify/sarama v1.19.0/go.mod h1:FVkBWblsNy7DGZRfXLU0O9RCGt5g3g3yEuWXgklEdEo= -github.com/Shopify/toxiproxy v2.1.4+incompatible/go.mod h1:OXgGpZ6Cli1/URJOF1DMxUHB2q5Ap20/P/eIdh4G0pI= -github.com/VividCortex/gohistogram v1.0.0/go.mod h1:Pf5mBqqDxYaXu3hDrrU+w6nw50o/4+TcAqDqk/vUH7g= -github.com/afex/hystrix-go v0.0.0-20180502004556-fa1af6a1f4f5/go.mod h1:SkGFH1ia65gfNATL8TAiHDNxPzPdmEL5uirI2Uyuz6c= -github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= -github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= -github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= -github.com/alecthomas/units v0.0.0-20190717042225-c3de453c63f4/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= -github.com/alecthomas/units v0.0.0-20190924025748-f65c72e2690d/go.mod h1:rBZYJk541a8SKzHPHnH3zbiI+7dagKZ0cgpgrD7Fyho= -github.com/antihax/optional v1.0.0/go.mod h1:uupD/76wgC+ih3iEmQUL+0Ugr19nfwCT1kdvxnR2qWY= -github.com/apache/thrift v0.12.0/go.mod h1:cp2SuWMxlEZw2r+iP2GNCdIi4C1qmUzdZFSVb+bacwQ= -github.com/apache/thrift v0.13.0/go.mod h1:cp2SuWMxlEZw2r+iP2GNCdIi4C1qmUzdZFSVb+bacwQ= -github.com/arl/assertgo v0.0.0-20180702120748-a1be5afdc871 h1:2JUBLy3nbzaDmqS7OEv7sjcdrHP1bsqm3px6Dj19P78= -github.com/arl/assertgo v0.0.0-20180702120748-a1be5afdc871/go.mod h1:Mmakxe1p9nDi8UjyTqkTUqFXpVpCt3BoDFvwi3Ki/tY= -github.com/arl/go-detour v0.1.3 h1:9T/LpPp07o/nly1EA9c7FbbsqIoCR0bfUrSxGsvCkTY= -github.com/arl/go-detour v0.1.3/go.mod h1:ZH7upqVKrvnG3izJxN4p74/xujK2SOh6nGX7memU58E= -github.com/arl/gobj v0.0.0-20180702120947-e436584cd5ac h1:CmeOG7tHBJs+/dAviE0nv3xDWXaIMu6mBsunquh16KE= -github.com/arl/gobj v0.0.0-20180702120947-e436584cd5ac/go.mod h1:8OQQSn4bhKRKWCHcJJU4RgvrB4OxngwBqbDeKyjUlBw= -github.com/arl/gogeo v0.0.0-20200405111831-9d419f5f7a90 h1:ayEZgpH4t/dm9YIQyqYmVdA1/ol4LS22yobI8O+Yxus= -github.com/arl/gogeo v0.0.0-20200405111831-9d419f5f7a90/go.mod h1:4OgOjfhaGWnvN/zazoibeknXTmVCnIVlR9Q0o5NIOUU= -github.com/arl/math32 v0.2.0 h1:MWdz/6kvQcTzId/LEylyaP8eiHLY7a2+EnFTMwlVWIQ= -github.com/arl/math32 v0.2.0/go.mod h1:KMSABA6h8FPxtx+NPnIIltLE7uxrinC9xUJd5pkk5ek= -github.com/armon/circbuf v0.0.0-20150827004946-bbbad097214e/go.mod h1:3U/XgcO3hCbHZ8TKRvWD2dDTCfh9M9ya+I9JpbB7O8o= -github.com/armon/consul-api v0.0.0-20180202201655-eb2c6b5be1b6/go.mod h1:grANhF5doyWs3UAsr3K4I6qtAmlQcZDesFNEHPZAzj8= -github.com/armon/go-metrics v0.0.0-20180917152333-f0300d1749da/go.mod h1:Q73ZrmVTwzkszR9V5SSuryQ31EELlFMUz1kKyl939pY= -github.com/armon/go-radix v0.0.0-20180808171621-7fddfc383310/go.mod h1:ufUuZ+zHj4x4TnLV4JWEpy2hxWSpsRywHrMgIH9cCH8= -github.com/aryann/difflib v0.0.0-20170710044230-e206f873d14a/go.mod h1:DAHtR1m6lCRdSC2Tm3DSWRPvIPr6xNKyeHdqDQSQT+A= -github.com/aws/aws-lambda-go v1.13.3/go.mod h1:4UKl9IzQMoD+QF79YdCuzCwp8VbmG4VAQwij/eHl5CU= -github.com/aws/aws-sdk-go v1.27.0/go.mod h1:KmX6BPdI08NWTb3/sm4ZGu5ShLoqVDhKgpiN924inxo= -github.com/aws/aws-sdk-go-v2 v0.18.0/go.mod h1:JWVYvqSMppoMJC0x5wdwiImzgXTI9FuZwxzkQq9wy+g= -github.com/benbjohnson/clock v1.1.0 h1:Q92kusRqC1XV2MjkWETPvjJVqKetz1OzxZB7mHJLju8= -github.com/benbjohnson/clock v1.1.0/go.mod h1:J11/hYXuz8f4ySSvYwY0FKfm+ezbsZBKZxNJlLklBHA= -github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q= -github.com/beorn7/perks v1.0.0/go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+CedLV8= -github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM= -github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw= -github.com/bgentry/speakeasy v0.1.0/go.mod h1:+zsyZBPWlz7T6j88CTgSN5bM796AkVf0kBD4zp0CCIs= github.com/bwmarrin/snowflake v0.3.0 h1:xm67bEhkKh6ij1790JB83OujPR5CzNe8QuQqAgISZN0= github.com/bwmarrin/snowflake v0.3.0/go.mod h1:NdZxfVWX+oR6y2K0o6qAYv6gIOP9rjG0/E9WsDpxqwE= -github.com/casbin/casbin/v2 v2.1.2/go.mod h1:YcPU1XXisHhLzuxH9coDNf2FbKpjGlbCg3n9yuLkIJQ= -github.com/cenkalti/backoff v2.2.1+incompatible/go.mod h1:90ReRw6GdpyfrHakVjL/QHaoyV4aDUVVkXQJJJ3NXXM= -github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= -github.com/cespare/xxhash v1.1.0/go.mod h1:XrSqR1VqqWfGrhpAt58auRo0WTKS1nRRg3ghfAqPWnc= -github.com/cespare/xxhash/v2 v2.1.1/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= -github.com/cespare/xxhash/v2 v2.1.2 h1:YRXhKfTDauu4ajMg1TPgFO5jnlC2HCbmLXMcTG5cbYE= -github.com/cespare/xxhash/v2 v2.1.2/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= -github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI= -github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e/go.mod h1:nSuG5e5PlCu98SY8svDHJxuZscDgtXS6KTTbou5AhLI= -github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1/go.mod h1:Q3SI9o4m/ZMnBNeIyt5eFwwo7qiLfzFZmjNmxjkiQlU= -github.com/clbanning/x2j v0.0.0-20191024224557-825249438eec/go.mod h1:jMjuTZXRI4dUb/I5gc9Hdhagfvm9+RyrPryS/auMzxE= -github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= -github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc= -github.com/cncf/udpa/go v0.0.0-20201120205902-5459f2c99403/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk= -github.com/cockroachdb/apd v1.1.0/go.mod h1:8Sl8LxpKi29FqWXR16WEFZRNSz3SoPzUzeMeY4+DwBQ= -github.com/cockroachdb/datadriven v0.0.0-20190809214429-80d97fb3cbaa/go.mod h1:zn76sxSg3SzpJ0PPJaLDCu+Bu0Lg3sKTORVIj19EIF8= -github.com/codahale/hdrhistogram v0.0.0-20161010025455-3a0bb77429bd/go.mod h1:sE/e/2PUdi/liOCUjSTXgM1o87ZssimdTWN964YiIeI= -github.com/coreos/bbolt v1.3.2/go.mod h1:iRUV2dpdMOn7Bo10OQBFzIJO9kkE559Wcmn+qkEiiKk= -github.com/coreos/etcd v3.3.10+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc32PjwdhPthX9715RE= -github.com/coreos/go-semver v0.2.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk= -github.com/coreos/go-semver v0.3.0 h1:wkHLiw0WNATZnSG7epLsujiMCgPAc9xhjJ4tgnAxmfM= -github.com/coreos/go-semver v0.3.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk= -github.com/coreos/go-systemd v0.0.0-20180511133405-39ca1b05acc7/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4= -github.com/coreos/go-systemd v0.0.0-20190321100706-95778dfbb74e/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4= -github.com/coreos/go-systemd v0.0.0-20190719114852-fd7a80b32e1f/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4= -github.com/coreos/go-systemd/v22 v22.3.2 h1:D9/bQk5vlXQFZ6Kwuu6zaiXJ9oTPe68++AzAJc1DzSI= -github.com/coreos/go-systemd/v22 v22.3.2/go.mod h1:Y58oyj3AT4RCenI/lSvhwexgC+NSVTIJ3seZv2GcEnc= -github.com/coreos/pkg v0.0.0-20160727233714-3ac0863d7acf/go.mod h1:E3G3o1h8I7cfcXa63jLwjI0eiQQMgzzUDFVpN/nH/eA= -github.com/coreos/pkg v0.0.0-20180928190104-399ea9e2e55f/go.mod h1:E3G3o1h8I7cfcXa63jLwjI0eiQQMgzzUDFVpN/nH/eA= -github.com/cpuguy83/go-md2man/v2 v2.0.0-20190314233015-f79a8a8ca69d/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU= -github.com/cpuguy83/go-md2man/v2 v2.0.0/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU= -github.com/creack/pty v1.1.7/go.mod h1:lj5s0c3V2DBrqTV7llrYr5NG6My20zk30Fl46Y7DoTY= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/denisenkom/go-mssqldb v0.10.0/go.mod h1:xbL0rPBG9cCiLr28tMa8zpbdarY27NDyej4t/EjAShU= -github.com/dgrijalva/jwt-go v3.2.0+incompatible/go.mod h1:E3ru+11k8xSBh+hMPgOLZmtrrCbhqsmaPHjLKYnJCaQ= -github.com/dgryski/go-sip13 v0.0.0-20181026042036-e10d5fee7954/go.mod h1:vAd38F8PWV+bWy6jNmig1y/TA+kYO4g3RSRF0IAv0no= -github.com/dustin/go-humanize v0.0.0-20171111073723-bb3d318650d4/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk= -github.com/dustin/go-humanize v1.0.0/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk= -github.com/eapache/go-resiliency v1.1.0/go.mod h1:kFI+JgMyC7bLPUVY133qvEBtVayf5mFgVsvEsIPBvNs= -github.com/eapache/go-xerial-snappy v0.0.0-20180814174437-776d5712da21/go.mod h1:+020luEh2TKB4/GOp8oxxtq0Daoen/Cii55CzbTV6DU= -github.com/eapache/queue v1.1.0/go.mod h1:6eCeP0CKFpHLu8blIFXhExK/dRa7WDZfr6jVFPTqq+I= -github.com/edsrzf/mmap-go v1.0.0/go.mod h1:YO35OhQPt3KJa3ryjFM5Bs14WD66h8eGKpfaBNrHW5M= -github.com/elliotchance/orderedmap v1.4.0 h1:wZtfeEONCbx6in1CZyE6bELEt/vFayMvsxqI5SgsR+A= -github.com/elliotchance/orderedmap v1.4.0/go.mod h1:wsDwEaX5jEoyhbs7x93zk2H/qv0zwuhg4inXhDkYqys= -github.com/envoyproxy/go-control-plane v0.6.9/go.mod h1:SBwIajubJHhxtWwsL9s8ss4safvEdbitLhGGK48rN6g= -github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= -github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= -github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1mIlRU8Am5FuJP05cCM98= -github.com/envoyproxy/go-control-plane v0.9.9-0.20210217033140-668b12f5399d/go.mod h1:cXg6YxExXjJnVBQHBLXeUAgxn2UodCpnH306RInaBQk= -github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= -github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4= -github.com/franela/goblin v0.0.0-20200105215937-c9ffbefa60db/go.mod h1:7dvUGVsVBjqR7JHJk0brhHOZYGmfBYOrK0ZhYMEtBr4= -github.com/franela/goreq v0.0.0-20171204163338-bcd34c9993f8/go.mod h1:ZhphrRTfi2rbfLwlschooIH4+wKKDR4Pdxhh+TRoA20= -github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= -github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= -github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1/go.mod h1:vR7hzQXu2zJy9AVAgeJqvqgH9Q5CA+iKCZ2gyEVpxRU= -github.com/go-gl/glfw/v3.3/glfw v0.0.0-20191125211704-12ad95a8df72/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= -github.com/go-gl/glfw/v3.3/glfw v0.0.0-20200222043503-6f7a984d4dc4/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= -github.com/go-kit/kit v0.8.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= -github.com/go-kit/kit v0.9.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= -github.com/go-kit/kit v0.10.0/go.mod h1:xUsJbQ/Fp4kEt7AFgCuvyX4a71u8h9jB8tj/ORgOZ7o= -github.com/go-kit/log v0.1.0/go.mod h1:zbhenjAZHb184qTLMA9ZjW7ThYL0H2mk7Q6pNt4vbaY= -github.com/go-logfmt/logfmt v0.3.0/go.mod h1:Qt1PoO58o5twSAckw1HlFXLmHsOX5/0LbT9GBnD5lWE= -github.com/go-logfmt/logfmt v0.4.0/go.mod h1:3RMwSq7FuexP4Kalkev3ejPJsZTpXXBr9+V4qmtdjCk= -github.com/go-logfmt/logfmt v0.5.0/go.mod h1:wCYkCAKZfumFQihp8CzCvQ3paCTfi41vtzG1KdI/P7A= -github.com/go-sql-driver/mysql v1.4.0/go.mod h1:zAC/RDZ24gD3HViQzih4MyKcchzm+sOG5ZlKdlhCg5w= -github.com/go-sql-driver/mysql v1.6.0 h1:BCTh4TKNUYmOmMUcQ3IipzF5prigylS7XXjEkfCHuOE= -github.com/go-sql-driver/mysql v1.6.0/go.mod h1:DCzpHaOWr8IXmIStZouvnhqoel9Qv2LBy8hT2VhHyBg= -github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= -github.com/goccy/go-json v0.8.1 h1:4/Wjm0JIJaTDm8K1KcGrLHJoa8EsJ13YWeX+6Kfq6uI= -github.com/goccy/go-json v0.8.1/go.mod h1:6MelG93GURQebXPDq3khkgXZkazVtN9CRI+MGFi0w8I= -github.com/godbus/dbus/v5 v5.0.4/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA= -github.com/gofrs/uuid v3.2.0+incompatible/go.mod h1:b2aQJv3Z4Fp6yNu3cdSllBxTCLRxnplIgP/c0N/04lM= -github.com/gofrs/uuid v4.0.0+incompatible/go.mod h1:b2aQJv3Z4Fp6yNu3cdSllBxTCLRxnplIgP/c0N/04lM= -github.com/gogo/googleapis v1.1.0/go.mod h1:gf4bu3Q80BeJ6H1S1vYPm8/ELATdvryBaNFGgqEef3s= -github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= -github.com/gogo/protobuf v1.2.0/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= -github.com/gogo/protobuf v1.2.1/go.mod h1:hp+jE20tsWTFYpLwKvXlhS1hjn+gTNwPg2I6zVXpSg4= -github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q= -github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q= -github.com/golang-sql/civil v0.0.0-20190719163853-cb61b32ac6fe/go.mod h1:8vg3r2VgvsThLBIFL93Qb5yWzgyZWhEmBwUJWevAkK0= -github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= -github.com/golang/groupcache v0.0.0-20160516000752-02826c3e7903/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= -github.com/golang/groupcache v0.0.0-20190129154638-5b532d6fd5ef/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= -github.com/golang/groupcache v0.0.0-20190702054246-869f871628b6/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= -github.com/golang/groupcache v0.0.0-20191227052852-215e87163ea7/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= -github.com/golang/groupcache v0.0.0-20200121045136-8c9f03a8e57e/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= -github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= -github.com/golang/mock v1.2.0/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= -github.com/golang/mock v1.3.1/go.mod h1:sBzyDLLjw3U8JLTeZvSv8jJB+tU5PVekmnlKIyFUx0Y= -github.com/golang/mock v1.4.0/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= -github.com/golang/mock v1.4.1/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= -github.com/golang/mock v1.4.3/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= -github.com/golang/mock v1.4.4/go.mod h1:l3mdAwkq5BuhzHwde/uurv3sEJeZMXNpwsxVWU71h+4= -github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= -github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= -github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= -github.com/golang/protobuf v1.3.3/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw= -github.com/golang/protobuf v1.3.4/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw= -github.com/golang/protobuf v1.3.5/go.mod h1:6O5/vntMXwX2lRkT1hjjk0nAC1IDOTvTlVgjlRvqsdk= -github.com/golang/protobuf v1.4.0-rc.1/go.mod h1:ceaxUfeHdC40wWswd/P6IGgMaK3YpKi5j83Wpe3EHw8= -github.com/golang/protobuf v1.4.0-rc.1.0.20200221234624-67d41d38c208/go.mod h1:xKAWHe0F5eneWXFV3EuXVDTCmh+JuBKY0li0aMyXATA= -github.com/golang/protobuf v1.4.0-rc.2/go.mod h1:LlEzMj4AhA7rCAGe4KMBDvJI+AwstrUpVNzEA03Pprs= -github.com/golang/protobuf v1.4.0-rc.4.0.20200313231945-b860323f09d0/go.mod h1:WU3c8KckQ9AFe+yFwt9sWVRKCVIyN9cPHBJSNnbL67w= -github.com/golang/protobuf v1.4.0/go.mod h1:jodUvKwWbYaEsadDk5Fwe5c77LiNKVO9IDvqG2KuDX0= -github.com/golang/protobuf v1.4.1/go.mod h1:U8fpvMrcmy5pZrNK1lt4xCsGvpyWQ/VVv6QDs8UjoX8= -github.com/golang/protobuf v1.4.2/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= -github.com/golang/protobuf v1.4.3/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= -github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk= -github.com/golang/protobuf v1.5.2 h1:ROPKBNFfQgOUMifHyP+KYbvpjbdoFNs+aK7DXlji0Tw= -github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= -github.com/golang/snappy v0.0.0-20180518054509-2e65f85255db/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= -github.com/golang/snappy v0.0.1/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= -github.com/golang/snappy v0.0.4 h1:yAGX7huGHXlcLOEtBnF4w7FQwA26wojNCwOYAEhLjQM= -github.com/golang/snappy v0.0.4/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= -github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= -github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= -github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= -github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= -github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= -github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.4.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.5.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.5.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.5.3/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.5.4/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.5 h1:Khx7svrCpmxxtHBq5j2mp/xVjsi8hQMfNLvJFAlrGgU= github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.5.8 h1:e6P7q2lk1O+qJJb4BtCQXlK8vWEO8V1ZeuEdJNOqZyg= -github.com/google/go-cmp v0.5.8/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= -github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= -github.com/google/martian v2.1.0+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXiIaQGbYVAs8BPL6v8lEs= -github.com/google/martian/v3 v3.0.0/go.mod h1:y5Zk1BBys9G+gd6Jrk0W3cC1+ELVxBWuIGO+w/tUAp0= -github.com/google/pprof v0.0.0-20181206194817-3ea8567a2e57/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= -github.com/google/pprof v0.0.0-20190515194954-54271f7e092f/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= -github.com/google/pprof v0.0.0-20191218002539-d4f498aebedc/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= -github.com/google/pprof v0.0.0-20200212024743-f11f1df84d12/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= -github.com/google/pprof v0.0.0-20200229191704-1ebb73c60ed3/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= -github.com/google/pprof v0.0.0-20200430221834-fc25d7d30c6d/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= -github.com/google/pprof v0.0.0-20200708004538-1a94d8640e99/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= -github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI= -github.com/google/uuid v1.0.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/google/uuid v1.3.0 h1:t6JiXgmwXMjEs8VusXIJk2BXHsn+wx8BZdTaoZ5fu7I= github.com/google/uuid v1.3.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg= -github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5mhpdKc/us6bOk= -github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY= -github.com/gorilla/context v1.1.1/go.mod h1:kBGZzfjB9CEq2AlWe17Uuf7NDRt0dE0s8S51q0aT7Yg= -github.com/gorilla/mux v1.6.2/go.mod h1:1lud6UwP+6orDFRuTfBEV8e9/aOM/c4fVVCaMa2zaAs= -github.com/gorilla/mux v1.7.3/go.mod h1:1lud6UwP+6orDFRuTfBEV8e9/aOM/c4fVVCaMa2zaAs= -github.com/gorilla/websocket v0.0.0-20170926233335-4201258b820c/go.mod h1:E7qHFY5m1UJ88s3WnNqhKjPHQ0heANvMoAMk2YaljkQ= -github.com/gorilla/websocket v1.4.0/go.mod h1:E7qHFY5m1UJ88s3WnNqhKjPHQ0heANvMoAMk2YaljkQ= -github.com/grpc-ecosystem/go-grpc-middleware v1.0.0/go.mod h1:FiyG127CGDf3tlThmgyCl78X/SZQqEOJBCDaAfeWzPs= -github.com/grpc-ecosystem/go-grpc-middleware v1.0.1-0.20190118093823-f849b5445de4/go.mod h1:FiyG127CGDf3tlThmgyCl78X/SZQqEOJBCDaAfeWzPs= -github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0/go.mod h1:8NvIoxWQoOIhqOTXgfV/d3M/q6VIi02HzZEHgUlZvzk= -github.com/grpc-ecosystem/grpc-gateway v1.9.0/go.mod h1:vNeuVxBJEsws4ogUvrchl83t/GYV9WGTSLVdBhOQFDY= -github.com/grpc-ecosystem/grpc-gateway v1.9.5/go.mod h1:vNeuVxBJEsws4ogUvrchl83t/GYV9WGTSLVdBhOQFDY= -github.com/grpc-ecosystem/grpc-gateway v1.16.0/go.mod h1:BDjrQk3hbvj6Nolgz8mAMFbcEtjT1g+wF4CSlocrBnw= -github.com/hashicorp/consul/api v1.3.0/go.mod h1:MmDNSzIMUjNpY/mQ398R4bk2FnqQLoPndWW5VkKPlCE= -github.com/hashicorp/consul/sdk v0.3.0/go.mod h1:VKf9jXwCTEY1QZP2MOLRhb5i/I/ssyNV1vwHyQBF0x8= -github.com/hashicorp/errwrap v1.0.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4= -github.com/hashicorp/go-cleanhttp v0.5.1/go.mod h1:JpRdi6/HCYpAwUzNwuwqhbovhLtngrth3wmdIIUrZ80= -github.com/hashicorp/go-immutable-radix v1.0.0/go.mod h1:0y9vanUI8NX6FsYoO3zeMjhV/C5i9g4Q3DwcSNZ4P60= -github.com/hashicorp/go-msgpack v0.5.3/go.mod h1:ahLV/dePpqEmjfWmKiqvPkv/twdG7iPBM1vqhUKIvfM= -github.com/hashicorp/go-multierror v1.0.0/go.mod h1:dHtQlpGsu+cZNNAkkCN/P3hoUDHhCYQXV3UM06sGGrk= -github.com/hashicorp/go-rootcerts v1.0.0/go.mod h1:K6zTfqpRlCUIjkwsN4Z+hiSfzSTQa6eBIzfwKfwNnHU= -github.com/hashicorp/go-sockaddr v1.0.0/go.mod h1:7Xibr9yA9JjQq1JpNB2Vw7kxv8xerXegt+ozgdvDeDU= -github.com/hashicorp/go-syslog v1.0.0/go.mod h1:qPfqrKkXGihmCqbJM2mZgkZGvKG1dFdvsLplgctolz4= -github.com/hashicorp/go-uuid v1.0.0/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= -github.com/hashicorp/go-uuid v1.0.1/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= -github.com/hashicorp/go-version v1.2.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA= -github.com/hashicorp/go.net v0.0.1/go.mod h1:hjKkEWcCURg++eb33jQU7oqQcI9XDCnUzHA0oac0k90= -github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= -github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= -github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T20WEQ= -github.com/hashicorp/logutils v1.0.0/go.mod h1:QIAnNjmIWmVIIkWDTG1z5v++HQmx9WQRO+LraFDTW64= -github.com/hashicorp/mdns v1.0.0/go.mod h1:tL+uN++7HEJ6SQLQ2/p+z2pH24WQKWjBPkE0mNTz8vQ= -github.com/hashicorp/memberlist v0.1.3/go.mod h1:ajVTdAv/9Im8oMAAj5G31PhhMCZJV2pPBoIllUwCN7I= -github.com/hashicorp/serf v0.8.2/go.mod h1:6hOLApaqBFA1NXqRQAsxw9QxuDEvNxSQRwA/JwenrHc= -github.com/hpcloud/tail v1.0.0 h1:nfCOvKYfkgYP8hkirhJocXT2+zOD8yUNjXaWfTlyFKI= -github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU= -github.com/hudl/fargo v1.3.0/go.mod h1:y3CKSmjA+wD2gak7sUSXTAoopbhU08POFhmITJgmKTg= -github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= -github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8= -github.com/influxdata/influxdb1-client v0.0.0-20191209144304-8bf82d3c094d/go.mod h1:qj24IKcXYK6Iy9ceXlo3Tc+vtHo9lIhSX5JddghvEPo= -github.com/jackc/chunkreader v1.0.0/go.mod h1:RT6O25fNZIuasFJRyZ4R/Y2BbhasbmZXF9QQ7T3kePo= -github.com/jackc/chunkreader/v2 v2.0.0/go.mod h1:odVSm741yZoC3dpHEUXIqA9tQRhFrgOHwnPIn9lDKlk= -github.com/jackc/chunkreader/v2 v2.0.1/go.mod h1:odVSm741yZoC3dpHEUXIqA9tQRhFrgOHwnPIn9lDKlk= -github.com/jackc/pgconn v0.0.0-20190420214824-7e0022ef6ba3/go.mod h1:jkELnwuX+w9qN5YIfX0fl88Ehu4XC3keFuOJJk9pcnA= -github.com/jackc/pgconn v0.0.0-20190824142844-760dd75542eb/go.mod h1:lLjNuW/+OfW9/pnVKPazfWOgNfH2aPem8YQ7ilXGvJE= -github.com/jackc/pgconn v0.0.0-20190831204454-2fabfa3c18b7/go.mod h1:ZJKsE/KZfsUgOEh9hBm+xYTstcNHg7UPMVJqRfQxq4s= -github.com/jackc/pgconn v1.4.0/go.mod h1:Y2O3ZDF0q4mMacyWV3AstPJpeHXWGEetiFttmq5lahk= -github.com/jackc/pgconn v1.5.0/go.mod h1:QeD3lBfpTFe8WUnPZWN5KY/mB8FGMIYRdd8P8Jr0fAI= -github.com/jackc/pgconn v1.5.1-0.20200601181101-fa742c524853/go.mod h1:QeD3lBfpTFe8WUnPZWN5KY/mB8FGMIYRdd8P8Jr0fAI= -github.com/jackc/pgconn v1.8.0/go.mod h1:1C2Pb36bGIP9QHGBYCjnyhqu7Rv3sGshaQUvmfGIB/o= -github.com/jackc/pgconn v1.8.1/go.mod h1:JV6m6b6jhjdmzchES0drzCcYcAHS1OPD5xu3OZ/lE2g= -github.com/jackc/pgconn v1.9.0/go.mod h1:YctiPyvzfU11JFxoXokUOOKQXQmDMoJL9vJzHH8/2JY= -github.com/jackc/pgio v1.0.0/go.mod h1:oP+2QK2wFfUWgr+gxjoBH9KGBb31Eio69xUb0w5bYf8= -github.com/jackc/pgmock v0.0.0-20190831213851-13a1b77aafa2/go.mod h1:fGZlG77KXmcq05nJLRkk0+p82V8B8Dw8KN2/V9c/OAE= -github.com/jackc/pgmock v0.0.0-20201204152224-4fe30f7445fd/go.mod h1:hrBW0Enj2AZTNpt/7Y5rr2xe/9Mn757Wtb2xeBzPv2c= -github.com/jackc/pgpassfile v1.0.0/go.mod h1:CEx0iS5ambNFdcRtxPj5JhEz+xB6uRky5eyVu/W2HEg= -github.com/jackc/pgproto3 v1.1.0/go.mod h1:eR5FA3leWg7p9aeAqi37XOTgTIbkABlvcPB3E5rlc78= -github.com/jackc/pgproto3/v2 v2.0.0-alpha1.0.20190420180111-c116219b62db/go.mod h1:bhq50y+xrl9n5mRYyCBFKkpRVTLYJVWeCc+mEAI3yXA= -github.com/jackc/pgproto3/v2 v2.0.0-alpha1.0.20190609003834-432c2951c711/go.mod h1:uH0AWtUmuShn0bcesswc4aBTWGvw0cAxIJp+6OB//Wg= -github.com/jackc/pgproto3/v2 v2.0.0-rc3/go.mod h1:ryONWYqW6dqSg1Lw6vXNMXoBJhpzvWKnT95C46ckYeM= -github.com/jackc/pgproto3/v2 v2.0.0-rc3.0.20190831210041-4c03ce451f29/go.mod h1:ryONWYqW6dqSg1Lw6vXNMXoBJhpzvWKnT95C46ckYeM= -github.com/jackc/pgproto3/v2 v2.0.1/go.mod h1:WfJCnwN3HIg9Ish/j3sgWXnAfK8A9Y0bwXYU5xKaEdA= -github.com/jackc/pgproto3/v2 v2.0.6/go.mod h1:WfJCnwN3HIg9Ish/j3sgWXnAfK8A9Y0bwXYU5xKaEdA= -github.com/jackc/pgproto3/v2 v2.1.1/go.mod h1:WfJCnwN3HIg9Ish/j3sgWXnAfK8A9Y0bwXYU5xKaEdA= -github.com/jackc/pgservicefile v0.0.0-20200307190119-3430c5407db8/go.mod h1:vsD4gTJCa9TptPL8sPkXrLZ+hDuNrZCnj29CQpr4X1E= -github.com/jackc/pgservicefile v0.0.0-20200714003250-2b9c44734f2b/go.mod h1:vsD4gTJCa9TptPL8sPkXrLZ+hDuNrZCnj29CQpr4X1E= -github.com/jackc/pgtype v0.0.0-20190421001408-4ed0de4755e0/go.mod h1:hdSHsc1V01CGwFsrv11mJRHWJ6aifDLfdV3aVjFF0zg= -github.com/jackc/pgtype v0.0.0-20190824184912-ab885b375b90/go.mod h1:KcahbBH1nCMSo2DXpzsoWOAfFkdEtEJpPbVLq8eE+mc= -github.com/jackc/pgtype v0.0.0-20190828014616-a8802b16cc59/go.mod h1:MWlu30kVJrUS8lot6TQqcg7mtthZ9T0EoIBFiJcmcyw= -github.com/jackc/pgtype v1.2.0/go.mod h1:5m2OfMh1wTK7x+Fk952IDmI4nw3nPrvtQdM0ZT4WpC0= -github.com/jackc/pgtype v1.3.1-0.20200510190516-8cd94a14c75a/go.mod h1:vaogEUkALtxZMCH411K+tKzNpwzCKU+AnPzBKZ+I+Po= -github.com/jackc/pgtype v1.3.1-0.20200606141011-f6355165a91c/go.mod h1:cvk9Bgu/VzJ9/lxTO5R5sf80p0DiucVtN7ZxvaC4GmQ= -github.com/jackc/pgtype v1.7.0/go.mod h1:ZnHF+rMePVqDKaOfJVI4Q8IVvAQMryDlDkZnKOI75BE= -github.com/jackc/pgtype v1.8.0/go.mod h1:PqDKcEBtllAtk/2p6z6SHdXW5UB+MhE75tUol2OKexE= -github.com/jackc/pgx/v4 v4.0.0-20190420224344-cc3461e65d96/go.mod h1:mdxmSJJuR08CZQyj1PVQBHy9XOp5p8/SHH6a0psbY9Y= -github.com/jackc/pgx/v4 v4.0.0-20190421002000-1b8f0016e912/go.mod h1:no/Y67Jkk/9WuGR0JG/JseM9irFbnEPbuWV2EELPNuM= -github.com/jackc/pgx/v4 v4.0.0-pre1.0.20190824185557-6972a5742186/go.mod h1:X+GQnOEnf1dqHGpw7JmHqHc1NxDoalibchSk9/RWuDc= -github.com/jackc/pgx/v4 v4.5.0/go.mod h1:EpAKPLdnTorwmPUUsqrPxy5fphV18j9q3wrfRXgo+kA= -github.com/jackc/pgx/v4 v4.6.1-0.20200510190926-94ba730bb1e9/go.mod h1:t3/cdRQl6fOLDxqtlyhe9UWgfIi9R8+8v8GKV5TRA/o= -github.com/jackc/pgx/v4 v4.6.1-0.20200606145419-4e5062306904/go.mod h1:ZDaNWkt9sW1JMiNn0kdYBaLelIhw7Pg4qd+Vk6tw7Hg= -github.com/jackc/pgx/v4 v4.11.0/go.mod h1:i62xJgdrtVDsnL3U8ekyrQXEwGNTRoG7/8r+CIdYfcc= -github.com/jackc/pgx/v4 v4.12.0/go.mod h1:fE547h6VulLPA3kySjfnSG/e2D861g/50JlVUa/ub60= -github.com/jackc/puddle v0.0.0-20190413234325-e4ced69a3a2b/go.mod h1:m4B5Dj62Y0fbyuIc15OsIqK0+JU8nkqQjsgx7dvjSWk= -github.com/jackc/puddle v0.0.0-20190608224051-11cab39313c9/go.mod h1:m4B5Dj62Y0fbyuIc15OsIqK0+JU8nkqQjsgx7dvjSWk= -github.com/jackc/puddle v1.1.0/go.mod h1:m4B5Dj62Y0fbyuIc15OsIqK0+JU8nkqQjsgx7dvjSWk= -github.com/jackc/puddle v1.1.1/go.mod h1:m4B5Dj62Y0fbyuIc15OsIqK0+JU8nkqQjsgx7dvjSWk= -github.com/jackc/puddle v1.1.3/go.mod h1:m4B5Dj62Y0fbyuIc15OsIqK0+JU8nkqQjsgx7dvjSWk= -github.com/jmespath/go-jmespath v0.0.0-20180206201540-c2b33e8439af/go.mod h1:Nht3zPeWKUH0NzdCt2Blrr5ys8VGpn0CEB0cQHVjt7k= -github.com/jonboulle/clockwork v0.1.0 h1:VKV+ZcuP6l3yW9doeqz6ziZGgcynBVQO+obU0+0hcPo= -github.com/jonboulle/clockwork v0.1.0/go.mod h1:Ii8DK3G1RaLaWxj9trq07+26W01tbo22gdxWY5EU2bo= -github.com/jpillora/backoff v1.0.0/go.mod h1:J/6gKK9jxlEcS3zixgDgUAsiuZ7yrSoa/FX5e0EB2j4= -github.com/json-iterator/go v1.1.6/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU= -github.com/json-iterator/go v1.1.7/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= -github.com/json-iterator/go v1.1.8/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= -github.com/json-iterator/go v1.1.10/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= -github.com/json-iterator/go v1.1.11/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= -github.com/json-iterator/go v1.1.12 h1:PV8peI4a0ysnczrg+LtxykD8LfKY9ML6u2jnxaEnrnM= -github.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHmT4TnhNGBo= -github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1:6v2b51hI/fHJwM22ozAgKL4VKDeJcHhJFhtBdhmNjmU= -github.com/jstemmer/go-junit-report v0.9.1/go.mod h1:Brl9GWCQeLvo8nXZwPNNblvFj/XSXhF0NWZEnDohbsk= -github.com/jtolds/gls v4.20.0+incompatible/go.mod h1:QJZ7F/aHp+rZTRtaJ1ow/lLfFfVYBRgL+9YlvaHOwJU= -github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w= -github.com/julienschmidt/httprouter v1.3.0/go.mod h1:JR6WtHb+2LUe8TCKY3cZOxFyyO8IZAc4RVcycCCAKdM= -github.com/kballard/go-shellquote v0.0.0-20180428030007-95032a82bc51 h1:Z9n2FFNUXsshfwJMBgNA0RU6/i7WVaAegv3PtuIHPMs= -github.com/kballard/go-shellquote v0.0.0-20180428030007-95032a82bc51/go.mod h1:CzGEWj7cYgsdH8dAjBGEr58BoE7ScuLd+fwFZ44+/x8= -github.com/kisielk/errcheck v1.1.0/go.mod h1:EZBBE59ingxPouuu3KfxchcWSUPOHkagtvWXihfKN4Q= -github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8= -github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= -github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= -github.com/konsorten/go-windows-terminal-sequences v1.0.2/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= -github.com/konsorten/go-windows-terminal-sequences v1.0.3/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= -github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc= -github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= -github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= -github.com/kr/pty v1.1.8/go.mod h1:O1sed60cT9XZ5uDucP5qwvh+TE3NnUj51EiZO/lmSfw= -github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= -github.com/lestrrat-go/envload v0.0.0-20180220234015-a3eb8ddeffcc h1:RKf14vYWi2ttpEmkA4aQ3j4u9dStX2t4M8UM6qqNsG8= -github.com/lestrrat-go/envload v0.0.0-20180220234015-a3eb8ddeffcc/go.mod h1:kopuH9ugFRkIXf3YoqHKyrJ9YfUFsckUU9S7B+XP+is= -github.com/lestrrat-go/file-rotatelogs v2.4.0+incompatible h1:Y6sqxHMyB1D2YSzWkLibYKgg+SwmyFU9dF2hn6MdTj4= -github.com/lestrrat-go/file-rotatelogs v2.4.0+incompatible/go.mod h1:ZQnN8lSECaebrkQytbHj4xNgtg8CR7RYXnPok8e0EHA= -github.com/lestrrat-go/strftime v1.0.6 h1:CFGsDEt1pOpFNU+TJB0nhz9jl+K0hZSLE205AhTIGQQ= -github.com/lestrrat-go/strftime v1.0.6/go.mod h1:f7jQKgV5nnJpYgdEasS+/y7EsTb8ykN2z68n3TtcTaw= -github.com/lib/pq v1.0.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo= -github.com/lib/pq v1.1.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo= -github.com/lib/pq v1.2.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo= -github.com/lib/pq v1.3.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo= -github.com/lib/pq v1.10.2/go.mod h1:AlVN5x4E4T544tWzH6hKfbfQvm3HdbOxrmggDNAPY9o= -github.com/lightstep/lightstep-tracer-common/golang/gogo v0.0.0-20190605223551-bc2310a04743/go.mod h1:qklhhLq1aX+mtWk9cPHPzaBjWImj5ULL6C7HFJtXQMM= -github.com/lightstep/lightstep-tracer-go v0.18.1/go.mod h1:jlF1pusYV4pidLvZ+XD0UBX0ZE6WURAspgAczcDHrL4= -github.com/lyft/protoc-gen-validate v0.0.13/go.mod h1:XbGvPuh87YZc5TdIa2/I4pLk0QoUACkjt2znoq26NVQ= -github.com/magiconair/properties v1.8.0/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ= -github.com/mattn/go-colorable v0.0.9/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaOChaDxuIBZU= -github.com/mattn/go-colorable v0.1.1/go.mod h1:FuOcm+DKB9mbwrcAfNl7/TZVBZ6rcnceauSikq3lYCQ= -github.com/mattn/go-colorable v0.1.2/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVcfRqFIhoBtE= -github.com/mattn/go-colorable v0.1.6/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc= -github.com/mattn/go-isatty v0.0.3/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4= -github.com/mattn/go-isatty v0.0.4/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4= -github.com/mattn/go-isatty v0.0.5/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s= -github.com/mattn/go-isatty v0.0.7/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s= -github.com/mattn/go-isatty v0.0.8/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s= -github.com/mattn/go-isatty v0.0.9/go.mod h1:YNRxwqDuOph6SZLI9vUUz6OYw3QyUt7WiY2yME+cCiQ= -github.com/mattn/go-isatty v0.0.12 h1:wuysRhFDzyxgEmMf5xjvJ2M9dZoWAXNNr5LSBS7uHXY= -github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU= -github.com/mattn/go-runewidth v0.0.2/go.mod h1:LwmH8dsx7+W8Uxz3IHJYH5QSwggIsqBzpuz5H//U1FU= -github.com/mattn/go-sqlite3 v1.14.9 h1:10HX2Td0ocZpYEjhilsuo6WWtUqttj2Kb0KtD86/KYA= -github.com/mattn/go-sqlite3 v1.14.9/go.mod h1:NyWgC/yNuGj7Q9rpYnZvas74GogHl5/Z4A/KQRfk6bU= -github.com/matttproud/golang_protobuf_extensions v1.0.1 h1:4hp9jkHxhMHkqkrB3Ix0jegS5sx/RkqARlsWZ6pIwiU= -github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0= -github.com/miekg/dns v1.0.14/go.mod h1:W1PPwlIAgtquWBMBEV9nkV9Cazfe8ScdGz/Lj7v3Nrg= -github.com/mitchellh/cli v1.0.0/go.mod h1:hNIlj7HEI86fIcpObd7a0FcrxTWetlwJDGcceTlRvqc= -github.com/mitchellh/go-homedir v1.0.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= -github.com/mitchellh/go-homedir v1.1.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= -github.com/mitchellh/go-testing-interface v1.0.0/go.mod h1:kRemZodwjscx+RGhAo8eIhFbs2+BFgRtFPeD/KE+zxI= -github.com/mitchellh/gox v0.4.0/go.mod h1:Sd9lOJ0+aimLBi73mGofS1ycjY8lL3uZM3JPS42BGNg= -github.com/mitchellh/iochan v1.0.0/go.mod h1:JwYml1nuB7xOzsp52dPpHFffvOCDupsG0QubkSMEySY= -github.com/mitchellh/mapstructure v0.0.0-20160808181253-ca63d7c062ee/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= -github.com/mitchellh/mapstructure v1.1.2/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= -github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= -github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd h1:TRLaZ9cD/w8PVh93nsPXa1VrQ6jlwL5oN8l14QlcNfg= -github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= -github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= -github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= -github.com/modern-go/reflect2 v1.0.2 h1:xBagoLtFs94CBntxluKeaWgTMpvLxC4ur3nMaC9Gz0M= -github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk= -github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= -github.com/mwitkow/go-conntrack v0.0.0-20190716064945-2f068394615f/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= -github.com/nats-io/jwt v0.3.0/go.mod h1:fRYCDE99xlTsqUzISS1Bi75UBJ6ljOJQOAAu5VglpSg= -github.com/nats-io/jwt v0.3.2/go.mod h1:/euKqTS1ZD+zzjYrY7pseZrTtWQSjujC7xjPc8wL6eU= -github.com/nats-io/nats-server/v2 v2.1.2/go.mod h1:Afk+wRZqkMQs/p45uXdrVLuab3gwv3Z8C4HTBu8GD/k= -github.com/nats-io/nats.go v1.9.1/go.mod h1:ZjDU1L/7fJ09jvUSRVBR2e7+RnLiiIQyqyzEE/Zbp4w= -github.com/nats-io/nkeys v0.1.0/go.mod h1:xpnFELMwJABBLVhffcfd1MZx6VsNRFpEugbxziKVo7w= -github.com/nats-io/nkeys v0.1.3/go.mod h1:xpnFELMwJABBLVhffcfd1MZx6VsNRFpEugbxziKVo7w= -github.com/nats-io/nuid v1.0.1/go.mod h1:19wcPz3Ph3q0Jbyiqsd0kePYG7A95tJPxeL+1OSON2c= -github.com/oklog/oklog v0.3.2/go.mod h1:FCV+B7mhrz4o+ueLpx+KqkyXRGMWOYEvfiXtdGtbWGs= -github.com/oklog/run v1.0.0/go.mod h1:dlhp/R75TPv97u0XWUtDeV/lRKWPKSdTuV0TZvrmrQA= -github.com/oklog/ulid v1.3.1/go.mod h1:CirwcVhetQ6Lv90oh/F+FBtV6XMibvdAFo93nm5qn4U= -github.com/olekukonko/tablewriter v0.0.0-20170122224234-a0225b3f23b5/go.mod h1:vsDQFd/mU46D+Z4whnwzcISnGGzXWMclvtLoiIKAKIo= -github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= -github.com/onsi/ginkgo v1.7.0 h1:WSHQ+IS43OoUrWtD1/bbclrwK8TTH5hzp+umCiuxHgs= -github.com/onsi/ginkgo v1.7.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= -github.com/onsi/gomega v1.4.3 h1:RE1xgDvH7imwFD45h+u2SgIfERHlS2yNG4DObb5BSKU= -github.com/onsi/gomega v1.4.3/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY= -github.com/op/go-logging v0.0.0-20160315200505-970db520ece7/go.mod h1:HzydrMdWErDVzsI23lYNej1Htcns9BCg93Dk0bBINWk= -github.com/opentracing-contrib/go-observer v0.0.0-20170622124052-a52f23424492/go.mod h1:Ngi6UdF0k5OKD5t5wlmGhe/EDKPoUM3BXZSSfIuJbis= -github.com/opentracing/basictracer-go v1.0.0/go.mod h1:QfBfYuafItcjQuMwinw9GhYKwFXS9KnPs5lxoYwgW74= -github.com/opentracing/opentracing-go v1.0.2/go.mod h1:UkNAQd3GIcIGf0SeVgPpRdFStlNbqXla1AfSYxPUl2o= -github.com/opentracing/opentracing-go v1.1.0/go.mod h1:UkNAQd3GIcIGf0SeVgPpRdFStlNbqXla1AfSYxPUl2o= -github.com/openzipkin-contrib/zipkin-go-opentracing v0.4.5/go.mod h1:/wsWhb9smxSfWAKL3wpBW7V8scJMt8N8gnaMCS9E/cA= -github.com/openzipkin/zipkin-go v0.1.6/go.mod h1:QgAqvLzwWbR/WpD4A3cGpPtJrZXNIiJc5AZX7/PBEpw= -github.com/openzipkin/zipkin-go v0.2.1/go.mod h1:NaW6tEwdmWMaCDZzg8sh+IBNOxHMPnhQw8ySjnjRyN4= -github.com/openzipkin/zipkin-go v0.2.2/go.mod h1:NaW6tEwdmWMaCDZzg8sh+IBNOxHMPnhQw8ySjnjRyN4= -github.com/orcaman/concurrent-map v1.0.0 h1:I/2A2XPCb4IuQWcQhBhSwGfiuybl/J0ev9HDbW65HOY= -github.com/orcaman/concurrent-map v1.0.0/go.mod h1:Lu3tH6HLW3feq74c2GC+jIMS/K2CFcDWnWD9XkenwhI= -github.com/pact-foundation/pact-go v1.0.4/go.mod h1:uExwJY4kCzNPcHRj+hCR/HBbOOIwwtUjcrb0b5/5kLM= github.com/panjf2000/ants/v2 v2.5.0 h1:1rWGWSnxCsQBga+nQbA4/iY6VMeNoOIAM0ZWh9u3q2Q= github.com/panjf2000/ants/v2 v2.5.0/go.mod h1:cU93usDlihJZ5CfRGNDYsiBYvoilLvBF5Qp/BT2GNRE= -github.com/pascaldekloe/goe v0.0.0-20180627143212-57f6aae5913c/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc= -github.com/pborman/uuid v1.2.0/go.mod h1:X/NO0urCmaxf9VXbdlT7C2Yzkj2IKimNn4k+gtPdI/k= -github.com/pelletier/go-toml v1.2.0/go.mod h1:5z9KED0ma1S8pY6P1sdut58dfprrGBbd/94hg7ilaic= -github.com/performancecopilot/speed v3.0.0+incompatible/go.mod h1:/CLtqpZ5gBg1M9iaPbIdPPGyKcA8hKdoy6hAWba7Yac= -github.com/pierrec/lz4 v1.0.2-0.20190131084431-473cd7ce01a1/go.mod h1:3/3N9NVKO0jef7pBehbT1qWhCMrIgbYNnFAZCqQ5LRc= -github.com/pierrec/lz4 v2.0.5+incompatible/go.mod h1:pdkljMzZIN41W+lC3N2tnIh5sFi+IEE17M5jbnwPHcY= -github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= -github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= -github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= -github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= -github.com/pkg/profile v1.2.1/go.mod h1:hJw3o1OdXxsrSjjVksARp5W95eeEaEfptyVZyv6JUPA= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= -github.com/posener/complete v1.1.1/go.mod h1:em0nMJCgc9GFtwrmVmEMR/ZL6WyhyjMBndrE9hABlRI= -github.com/prometheus/client_golang v0.9.1/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw= -github.com/prometheus/client_golang v0.9.3-0.20190127221311-3c4408c8b829/go.mod h1:p2iRAGwDERtqlqzRXnrOVns+ignqQo//hLXqYxZYVNs= -github.com/prometheus/client_golang v0.9.3/go.mod h1:/TN21ttK/J9q6uSwhBd54HahCDft0ttaMvbicHlPoso= -github.com/prometheus/client_golang v1.0.0/go.mod h1:db9x61etRT2tGnBNRi70OPL5FsnadC4Ky3P0J6CfImo= -github.com/prometheus/client_golang v1.3.0/go.mod h1:hJaj2vgQTGQmVCsAACORcieXFeDPbaTKGT+JTgUa3og= -github.com/prometheus/client_golang v1.7.1/go.mod h1:PY5Wy2awLA44sXw4AOSfFBetzPP4j5+D6mVACh+pe2M= -github.com/prometheus/client_golang v1.11.0/go.mod h1:Z6t4BnS23TR94PD6BsDNk8yVqroYurpAkEiz0P2BEV0= -github.com/prometheus/client_golang v1.11.1/go.mod h1:Z6t4BnS23TR94PD6BsDNk8yVqroYurpAkEiz0P2BEV0= -github.com/prometheus/client_golang v1.12.2 h1:51L9cDoUHVrXx4zWYlcLQIZ+d+VXHgqnYKkIuq4g/34= -github.com/prometheus/client_golang v1.12.2/go.mod h1:3Z9XVyYiZYEO+YQWt3RD2R3jrbd179Rt297l4aS6nDY= -github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= -github.com/prometheus/client_model v0.0.0-20190115171406-56726106282f/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= -github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= -github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= -github.com/prometheus/client_model v0.1.0/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= -github.com/prometheus/client_model v0.2.0 h1:uq5h0d+GuxiXLJLNABMgp2qUWDPiLvgCzz2dUR+/W/M= -github.com/prometheus/client_model v0.2.0/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= -github.com/prometheus/common v0.0.0-20181113130724-41aa239b4cce/go.mod h1:daVV7qP5qjZbuso7PdcryaAu0sAZbrN9i7WWcTMWvro= -github.com/prometheus/common v0.2.0/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= -github.com/prometheus/common v0.4.0/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= -github.com/prometheus/common v0.4.1/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= -github.com/prometheus/common v0.7.0/go.mod h1:DjGbpBbp5NYNiECxcL/VnbXCCaQpKd3tt26CguLLsqA= -github.com/prometheus/common v0.10.0/go.mod h1:Tlit/dnDKsSWFlCLTWaA1cyBgKHSMdTB80sz/V91rCo= -github.com/prometheus/common v0.26.0/go.mod h1:M7rCNAaPfAosfx8veZJCuw84e35h3Cfd9VFqTh1DIvc= -github.com/prometheus/common v0.32.1 h1:hWIdL3N2HoUx3B8j3YN9mWor0qhY/NlEKZEaXxuIRh4= -github.com/prometheus/common v0.32.1/go.mod h1:vu+V0TpY+O6vW9J44gczi3Ap/oXXR10b+M/gUGO4Hls= -github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= -github.com/prometheus/procfs v0.0.0-20190117184657-bf6a532e95b1/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= -github.com/prometheus/procfs v0.0.0-20190507164030-5867b95ac084/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= -github.com/prometheus/procfs v0.0.2/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= -github.com/prometheus/procfs v0.0.8/go.mod h1:7Qr8sr6344vo1JqZ6HhLceV9o3AJ1Ff+GxbHq6oeK9A= -github.com/prometheus/procfs v0.1.3/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4OA4YeYWdaU= -github.com/prometheus/procfs v0.6.0/go.mod h1:cz+aTbrPOrUb4q7XlbU9ygM+/jj0fzG6c1xBZuNvfVA= -github.com/prometheus/procfs v0.7.3 h1:4jVXhlkAyzOScmCkXBTOLRLTz8EeU+eyjrwB/EPq0VU= -github.com/prometheus/procfs v0.7.3/go.mod h1:cz+aTbrPOrUb4q7XlbU9ygM+/jj0fzG6c1xBZuNvfVA= -github.com/prometheus/tsdb v0.7.1/go.mod h1:qhTCs0VvXwvX/y3TZrWD7rabWM+ijKTux40TwIPHuXU= -github.com/rcrowley/go-metrics v0.0.0-20181016184325-3113b8401b8a/go.mod h1:bCqnVzQkZxMG4s8nGwiZ5l3QUCyqpo9Y+/ZMZ9VjZe4= -github.com/remyoudompheng/bigfft v0.0.0-20200410134404-eec4a21b6bb0 h1:OdAsTTz6OkFY5QxjkYwrChwuRruF69c169dPK26NUlk= -github.com/remyoudompheng/bigfft v0.0.0-20200410134404-eec4a21b6bb0/go.mod h1:qqbHyh8v60DhA7CoWK5oRCqLrMHRGoxYCSS9EjAz6Eo= -github.com/rogpeppe/fastuuid v0.0.0-20150106093220-6724a57986af/go.mod h1:XWv6SoW27p1b0cqNHllgS5HIMJraePCO15w5zCzIWYg= -github.com/rogpeppe/fastuuid v1.2.0/go.mod h1:jVj6XXZzXRy/MSR5jhDC/2q6DgLz+nrA6LYCDYWNEvQ= -github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= -github.com/rs/xid v1.2.1/go.mod h1:+uKXf+4Djp6Md1KODXJxgGQPKngRmWyn10oCKFzNHOQ= -github.com/rs/zerolog v1.13.0/go.mod h1:YbFCdg8HfsridGWAh22vktObvhZbQsZXe4/zB0OKkWU= -github.com/rs/zerolog v1.15.0/go.mod h1:xYTKnLHcpfU2225ny5qZjxnj9NvkumZYjJHlAThCjNc= -github.com/russross/blackfriday/v2 v2.0.1/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= -github.com/ryanuber/columnize v0.0.0-20160712163229-9b3edd62028f/go.mod h1:sm1tb6uqfes/u+d4ooFouqFdy9/2g9QGwK3SQygK0Ts= -github.com/samuel/go-zookeeper v0.0.0-20190923202752-2cc03de413da/go.mod h1:gi+0XIa01GRL2eRQVjQkKGqKF3SF9vZR/HnPullcV2E= -github.com/satori/go.uuid v1.2.0/go.mod h1:dA0hQrYB0VpLJoorglMZABFdXlWrHn1NEOzdhQKdks0= -github.com/sean-/seed v0.0.0-20170313163322-e2103e2c3529/go.mod h1:DxrIzT+xaE7yg65j358z/aeFdxmN0P9QXhEzd20vsDc= -github.com/shopspring/decimal v0.0.0-20180709203117-cd690d0c9e24/go.mod h1:M+9NzErvs504Cn4c5DxATwIqPbtswREoFCre64PpcG4= -github.com/shopspring/decimal v0.0.0-20200227202807-02e2044944cc/go.mod h1:DKyhrW/HYNuLGql+MJL6WCR6knT2jwCFRcu2hWCYk4o= -github.com/shopspring/decimal v1.2.0/go.mod h1:DKyhrW/HYNuLGql+MJL6WCR6knT2jwCFRcu2hWCYk4o= -github.com/shurcooL/sanitized_anchor_name v1.0.0/go.mod h1:1NzhyTcUVG4SuEtjjoZeVRXNmyL/1OwPU0+IJeTBvfc= -github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= -github.com/sirupsen/logrus v1.4.1/go.mod h1:ni0Sbl8bgC9z8RoU9G6nDWqqs/fq4eDPysMBDgk/93Q= -github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE= -github.com/sirupsen/logrus v1.6.0/go.mod h1:7uNnSEd1DgxDLC74fIahvMZmmYsHGZGEOFrfsX/uA88= -github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d/go.mod h1:OnSkiWE9lh6wB0YB77sQom3nweQdgAjqCqsofrRNTgc= -github.com/smartystreets/goconvey v1.6.4/go.mod h1:syvi0/a8iFYH4r/RixwvyeAJjdLS9QV7WQ/tjFTllLA= -github.com/soheilhy/cmux v0.1.4/go.mod h1:IM3LyeVVIOuxMH7sFAkER9+bJ4dT7Ms6E4xg4kGIyLM= -github.com/sony/gobreaker v0.4.1/go.mod h1:ZKptC7FHNvhBz7dN2LGjPVBz2sZJmc0/PkyDJOjmxWY= -github.com/spaolacci/murmur3 v0.0.0-20180118202830-f09979ecbc72/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA= -github.com/spf13/afero v1.1.2/go.mod h1:j4pytiNVoe2o6bmDsKpLACNPDBIoEAkihy7loJ1B0CQ= -github.com/spf13/cast v1.3.0/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE= -github.com/spf13/cobra v0.0.3/go.mod h1:1l0Ry5zgKvJasoi3XT1TypsSe7PqH0Sj9dhYf7v3XqQ= -github.com/spf13/cobra v1.0.0/go.mod h1:/6GTrnGXV9HjY+aR4k0oJ5tcvakLuG6EuKReYlHNrgE= -github.com/spf13/jwalterweatherman v1.0.0/go.mod h1:cQK4TGJAtQXfYWX+Ddv3mKDzgVb68N+wFjFa4jdeBTo= -github.com/spf13/pflag v1.0.1/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= -github.com/spf13/pflag v1.0.3/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= -github.com/spf13/viper v1.4.0/go.mod h1:PTJ7Z/lr49W6bUbkmS1V3by4uWynFiR9p7+dSq/yZzE= -github.com/streadway/amqp v0.0.0-20190404075320-75d898a42a94/go.mod h1:AZpEONHx3DKn8O/DFsRAY58/XVQiIPMTMB1SddzLXVw= -github.com/streadway/amqp v0.0.0-20190827072141-edfb9018d271/go.mod h1:AZpEONHx3DKn8O/DFsRAY58/XVQiIPMTMB1SddzLXVw= -github.com/streadway/handy v0.0.0-20190108123426-d5acb3125c2a/go.mod h1:qNTQ5P5JnDBl6z3cMAg/SywNDC5ABu5ApDIw6lUbRmI= +github.com/sirupsen/logrus v1.9.3 h1:dueUQJ1C2q9oE3F7wvmSGAaVtTmUizReu6fjN8uqzbQ= +github.com/sirupsen/logrus v1.9.3/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= -github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= -github.com/stretchr/objx v0.2.0/go.mod h1:qt09Ya8vawLte6SNmTgCsAVtYtaKzEcn8ATUoHMkEqE= -github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= -github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= -github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA= github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.7.1 h1:5TQK59W5E3v0r2duFAb7P95B6hEeOyEnHRa8MjYSMTY= github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= -github.com/syndtr/goleveldb v1.0.0 h1:fBdIW9lB4Iz0n9khmH8w27SJ3QEJ7+IgjPEwGSZiFdE= -github.com/syndtr/goleveldb v1.0.0/go.mod h1:ZVVdQEZoIme9iO1Ch2Jdy24qqXrMMOU6lpPAyBWyWuQ= -github.com/tmc/grpc-websocket-proxy v0.0.0-20170815181823-89b8d40f7ca8/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U= -github.com/tmc/grpc-websocket-proxy v0.0.0-20190109142713-0ad062ec5ee5/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U= -github.com/ugorji/go v1.1.4/go.mod h1:uQMGLiO92mf5W77hV/PUCpI3pbzQx3CRekS0kk+RGrc= -github.com/urfave/cli v1.20.0/go.mod h1:70zkFmudgCuE/ngEzBv17Jvp/497gISqfk5gWijbERA= -github.com/urfave/cli v1.22.1/go.mod h1:Gos4lmkARVdJ6EkW0WaNv/tZAAMe9V7XWyB60NtXRu0= -github.com/xiang90/probing v0.0.0-20190116061207-43a291ad63a2/go.mod h1:UETIi67q53MR2AWcXfiuqkDkRtnGDLqkBTpCHuJHxtU= -github.com/xordataexchange/crypt v0.0.3-0.20170626215501-b2862e3d0a77/go.mod h1:aYKd//L2LvnjZzWKhF00oedf4jCCReLcmhLdhm1A27Q= -github.com/yuin/goldmark v1.1.25/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= -github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= -github.com/yuin/goldmark v1.1.32/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= -github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= -github.com/yuin/goldmark v1.3.5/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k= -github.com/yuin/gopher-lua v0.0.0-20220504180219-658193537a64 h1:5mLPGnFdSsevFRFc9q3yYbBkB6tsm4aCwwQV/j1JQAQ= -github.com/yuin/gopher-lua v0.0.0-20220504180219-658193537a64/go.mod h1:GBR0iDaNXjAgGg9zfCvksxSRnQx76gclCIb7kdAd1Pw= -github.com/zenazn/goji v0.9.0/go.mod h1:7S9M489iMyHBNxwZnk9/EHS098H4/F6TATF2mIxtB1Q= -github.com/ziutek/mymysql v1.5.4/go.mod h1:LMSpPZ6DbqWFxNCHW77HeMg9I646SAhApZ/wKdgO/C0= -go.etcd.io/bbolt v1.3.2/go.mod h1:IbVyRI1SCnLcuJnV2u8VeU0CEYM7e686BmAb1XKL+uU= -go.etcd.io/bbolt v1.3.3/go.mod h1:IbVyRI1SCnLcuJnV2u8VeU0CEYM7e686BmAb1XKL+uU= -go.etcd.io/etcd v0.0.0-20191023171146-3cf2f69b5738/go.mod h1:dnLIgRNXwCJa5e+c6mIZCrds/GIG4ncV9HhK5PX7jPg= -go.etcd.io/etcd/api/v3 v3.5.4 h1:OHVyt3TopwtUQ2GKdd5wu3PmmipR4FTwCqoEjSyRdIc= -go.etcd.io/etcd/api/v3 v3.5.4/go.mod h1:5GB2vv4A4AOn3yk7MftYGHkUfGtDHnEraIjym4dYz5A= -go.etcd.io/etcd/client/pkg/v3 v3.5.4 h1:lrneYvz923dvC14R54XcA7FXoZ3mlGZAgmwhfm7HqOg= -go.etcd.io/etcd/client/pkg/v3 v3.5.4/go.mod h1:IJHfcCEKxYu1Os13ZdwCwIUTUVGYTSAM3YSwc9/Ac1g= -go.etcd.io/etcd/client/v3 v3.5.4 h1:p83BUL3tAYS0OT/r0qglgc3M1JjhM0diV8DSWAhVXv4= -go.etcd.io/etcd/client/v3 v3.5.4/go.mod h1:ZaRkVgBZC+L+dLCjTcF1hRXpgZXQPOvnA/Ak/gq3kiY= -go.opencensus.io v0.20.1/go.mod h1:6WKK9ahsWS3RSO+PY9ZHZUfv2irvY6gN279GOPZjmmk= -go.opencensus.io v0.20.2/go.mod h1:6WKK9ahsWS3RSO+PY9ZHZUfv2irvY6gN279GOPZjmmk= -go.opencensus.io v0.21.0/go.mod h1:mSImk1erAIZhrmZN+AvHh14ztQfjbGwt4TtuofqLduU= -go.opencensus.io v0.22.0/go.mod h1:+kGneAE2xo2IficOXnaByMWTGM9T73dGwxeWcUqIpI8= -go.opencensus.io v0.22.2/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= -go.opencensus.io v0.22.3/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= -go.opencensus.io v0.22.4/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= -go.uber.org/atomic v1.3.2/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= -go.uber.org/atomic v1.4.0/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= -go.uber.org/atomic v1.5.0/go.mod h1:sABNBOSYdrvTF6hTgEIbc7YasKWGhgEQZyfxyTvoXHQ= -go.uber.org/atomic v1.6.0/go.mod h1:sABNBOSYdrvTF6hTgEIbc7YasKWGhgEQZyfxyTvoXHQ= -go.uber.org/atomic v1.7.0/go.mod h1:fEN4uk6kAWBTFdckzkM89CLk9XfWZrxpCo0nPH17wJc= go.uber.org/atomic v1.9.0 h1:ECmE8Bn/WFTYwEW/bpKD3M8VtR/zQVbavAoalC1PYyE= go.uber.org/atomic v1.9.0/go.mod h1:fEN4uk6kAWBTFdckzkM89CLk9XfWZrxpCo0nPH17wJc= -go.uber.org/goleak v1.1.11 h1:wy28qYRKZgnJTxGxvye5/wgWr1EKjmUDGYox5mGlRlI= -go.uber.org/goleak v1.1.11/go.mod h1:cwTWslyiVhfpKIDGSZEM2HlOvcqm+tG4zioyIeLoqMQ= -go.uber.org/multierr v1.1.0/go.mod h1:wR5kodmAFQ0UK8QlbwjlSNy0Z68gJhDJUG5sjR94q/0= -go.uber.org/multierr v1.3.0/go.mod h1:VgVr7evmIr6uPjLBxg28wmKNXyqE9akIJ5XnfpiKl+4= -go.uber.org/multierr v1.5.0/go.mod h1:FeouvMocqHpRaaGuG9EjoKcStLC43Zu/fmqdUMPcKYU= -go.uber.org/multierr v1.6.0 h1:y6IPFStTAIT5Ytl7/XYmHvzXQ7S3g/IeZW9hyZ5thw4= -go.uber.org/multierr v1.6.0/go.mod h1:cdWPpRnG4AhwMwsgIHip0KRBQjJy5kYEpYjJxpXp9iU= -go.uber.org/tools v0.0.0-20190618225709-2cfd321de3ee/go.mod h1:vJERXedbb3MVM5f9Ejo0C68/HhF8uaILCdgjnY+goOA= -go.uber.org/zap v1.9.1/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q= -go.uber.org/zap v1.10.0/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q= -go.uber.org/zap v1.13.0/go.mod h1:zwrFLgMcdUuIBviXEYEH1YKNaOBnKXsx2IPda5bBwHM= -go.uber.org/zap v1.17.0/go.mod h1:MXVU+bhUf/A7Xi2HNOnopQOrmycQ5Ih87HtOu4q5SSo= -go.uber.org/zap v1.21.0 h1:WefMeulhovoZ2sYXz7st6K0sLj7bBhpiFaud4r4zST8= -go.uber.org/zap v1.21.0/go.mod h1:wjWOCqI0f2ZZrJF/UufIOkiC8ii6tm1iqIsLo76RfJw= -golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= -golang.org/x/crypto v0.0.0-20181029021203-45a5f77698d3/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= -golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= -golang.org/x/crypto v0.0.0-20190325154230-a5d413f7728c/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= -golang.org/x/crypto v0.0.0-20190411191339-88737f569e3a/go.mod h1:WFFai1msRO1wXaEeE5yQxYXgSfI8pQAWXbQop6sCtWE= -golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= -golang.org/x/crypto v0.0.0-20190605123033-f99c8df09eb5/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= -golang.org/x/crypto v0.0.0-20190701094942-4def268fd1a4/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= -golang.org/x/crypto v0.0.0-20190820162420-60c769a6c586/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= -golang.org/x/crypto v0.0.0-20190911031432-227b76d455e7/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= -golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= -golang.org/x/crypto v0.0.0-20200323165209-0ec3e9974c59/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= -golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= -golang.org/x/crypto v0.0.0-20201203163018-be400aefbc4c/go.mod h1:jdWPYTVW3xRLrWPugEBEK3UY2ZEsg3UU495nc5E+M+I= -golang.org/x/crypto v0.0.0-20210322153248-0c34fe9e7dc2/go.mod h1:T9bdIzuCu7OtxOm1hfPfRQxPLYneinmdGuTeoZ9dtd4= -golang.org/x/crypto v0.0.0-20210616213533-5ff15b29337e/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= -golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= -golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= -golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8= -golang.org/x/exp v0.0.0-20190829153037-c13cbed26979/go.mod h1:86+5VVa7VpoJ4kLfm080zCjGlMRFzhUhsZKEZO7MGek= -golang.org/x/exp v0.0.0-20191030013958-a1ab85dbe136/go.mod h1:JXzH8nQsPlswgeRAPE3MuO9GYsAcnJvJ4vnMwN/5qkY= -golang.org/x/exp v0.0.0-20191129062945-2f5052295587/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= -golang.org/x/exp v0.0.0-20191227195350-da58074b4299/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= -golang.org/x/exp v0.0.0-20200119233911-0405dc783f0a/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= -golang.org/x/exp v0.0.0-20200207192155-f17229e696bd/go.mod h1:J/WKrq2StrnmMY6+EHIKF9dgMWnmCNThgcyBT1FY9mM= -golang.org/x/exp v0.0.0-20200224162631-6cc2880d07d6/go.mod h1:3jZMyOhIsHpP37uCMkUooju7aAi5cS1Q23tOzKc+0MU= -golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js= -golang.org/x/image v0.0.0-20190802002840-cff245a6509b/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= -golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= -golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU= -golang.org/x/lint v0.0.0-20190301231843-5614ed5bae6f/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= -golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= -golang.org/x/lint v0.0.0-20190409202823-959b441ac422/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= -golang.org/x/lint v0.0.0-20190909230951-414d861bb4ac/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= -golang.org/x/lint v0.0.0-20190930215403-16217165b5de/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= -golang.org/x/lint v0.0.0-20191125180803-fdd1cda4f05f/go.mod h1:5qLYkcX4OjUUV8bRuDixDT3tpyyb+LUpUlRWLxfhWrs= -golang.org/x/lint v0.0.0-20200130185559-910be7a94367/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= -golang.org/x/lint v0.0.0-20200302205851-738671d3881b/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= -golang.org/x/lint v0.0.0-20210508222113-6edffad5e616/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= -golang.org/x/mobile v0.0.0-20190312151609-d3739f865fa6/go.mod h1:z+o9i4GpDbdi3rU15maQ/Ox0txvL9dWGYEHz965HBQE= -golang.org/x/mobile v0.0.0-20190719004257-d2bd2a29d028/go.mod h1:E/iHnbuqvinMTCcRqshq8CkpyQDoeVncDDYHnLhea+o= -golang.org/x/mod v0.0.0-20190513183733-4bf6d317e70e/go.mod h1:mXi4GBBbnImb6dmsKGUJ2LatrhH/nqhxcFungHvyanc= -golang.org/x/mod v0.1.0/go.mod h1:0QHyrYULN0/3qlju5TqG8bIK38QM8yzMo5ekMj3DlcY= -golang.org/x/mod v0.1.1-0.20191105210325-c90efee705ee/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg= -golang.org/x/mod v0.1.1-0.20191107180719-034126e5016b/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg= -golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= -golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= -golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= -golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4 h1:6zppjxzCulZykYSLyVDYbneBfbaBIQPYMevg0bEwv2s= -golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= -golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20181023162649-9b4f9f5ad519/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20181114220301-adae6a3d119a/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20181201002055-351d144fa1fc/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20181220203305-927f97764cc3/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20190125091013-d26f9f9a57f3/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= -golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= -golang.org/x/net v0.0.0-20190501004415-9ce7a6920f09/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= -golang.org/x/net v0.0.0-20190503192946-f4e77d36d62c/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= -golang.org/x/net v0.0.0-20190522155817-f3200d17e092/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks= -golang.org/x/net v0.0.0-20190603091049-60506f45cf65/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks= -golang.org/x/net v0.0.0-20190613194153-d28f0bde5980/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20190628185345-da137c7871d7/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20190724013045-ca1201d0de80/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20190813141303-74dc4d7220e7/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20191209160850-c0dbc17a3553/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20200114155413-6afb5195e5aa/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20200202094626-16171245cfb2/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20200222125558-5a598a2470a0/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20200301022130-244492dfa37a/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20200324143707-d3edc9973b7e/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= -golang.org/x/net v0.0.0-20200501053045-e0ff5e5a1de5/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= -golang.org/x/net v0.0.0-20200506145744-7e3656a0809f/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= -golang.org/x/net v0.0.0-20200513185701-a91f0712d120/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= -golang.org/x/net v0.0.0-20200520182314-0ba52f642ac2/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= -golang.org/x/net v0.0.0-20200625001655-4c5254603344/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= -golang.org/x/net v0.0.0-20200707034311-ab3426394381/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= -golang.org/x/net v0.0.0-20200822124328-c89045814202/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= -golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= -golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= -golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96bSt6lcn1PtDYWL6XObtHCRCNQM= -golang.org/x/net v0.0.0-20210525063256-abc453219eb5/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= -golang.org/x/net v0.0.0-20220722155237-a158d28d115b h1:PxfKdU9lEEDYjdIzOtC4qFWgkU2rGHdKlKowJSMN9h0= -golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= -golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= -golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= -golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= -golang.org/x/oauth2 v0.0.0-20191202225959-858c2ad4c8b6/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= -golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= -golang.org/x/oauth2 v0.0.0-20210514164344-f6687ab2804c/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= -golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20190227155943-e225da77a7e6/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20200317015054-43a5402ce75a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20200625203802-6e8e738ad208/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20201207232520-09787c993a3a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sys v0.0.0-20180823144017-11551d06cbcc/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20181026203630-95b1ffbd15a5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20181107165924-66b7b1311ac8/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20181116152217-5ac8a444bdc5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20181122145206-62eef0e2fa9b/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20190222072716-a9d3bda3a223/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20190312061237-fead79001313/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190403152447-81d4e9dc473e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190422165155-953cdadca894/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190502145724-3ef323f4f1fd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190507160741-ecd444e8653b/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190606165138-5da285871e9c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190624142023-c5567b49c5d0/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190726091711-fc99dfbffb4e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190813064441-fde4db37ae7a/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190826190057-c7b8b68b1456/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20191001151750-bb3f8db39f24/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20191026070338-33540a1f6037/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20191204072324-ce4227a45e2e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20191220142924-d4481acd189f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20191228213918-04cbcbbfeed8/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200106162015-b016eb3dc98e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200113162924-86b910548bc1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200116001909-b77594299b42/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200122134326-e047566fdf82/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200202164722-d101bd2416d5/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200212091648-12a6c2dcc1e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200223170610-d5e6a3e2c0ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200302150141-5c8b2ff67527/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200331124033-c3d80250170d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200501052902-10377860bb8e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200511232937-7e40ca221e25/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200515095857-1151b9dac4a9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200523222454-059865788121/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200615200032-f1bc736245b1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200625212154-ddb9806d33ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200803210538-64077c9b5642/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20201126233918-771906719818/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210124154548-22da62e12c0c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210330210617-4fbd30eecc44/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210403161142-5e06dd20ab57/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210510120138-977fb7262007/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20210603081109-ebe580a85c40/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20210902050250-f475640dd07b/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20211007075335-d3039528d8ac/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220114195835-da31bd327af9/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f h1:v4INt8xihDGvnrfjMDVXGxw9wrfxYyCjk0KbXjhR55s= -golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/term v0.0.0-20201117132131-f5c789dd3221/go.mod h1:Nr5EML6q2oocZ2LXRh80K7BxOlk5/8JxuGnuhpl+muw= -golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= -golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= -golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= -golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= -golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= -golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= -golang.org/x/text v0.3.4/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= -golang.org/x/text v0.3.5/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= -golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= -golang.org/x/text v0.3.7 h1:olpwvP2KacW1ZWvsR7uQhoyTYvKAupfQrRGBFM352Gk= -golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= -golang.org/x/time v0.0.0-20180412165947-fbb02b2291d2/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= -golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= -golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= -golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= -golang.org/x/tools v0.0.0-20180221164845-07fd8470d635/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= -golang.org/x/tools v0.0.0-20180828015842-6cd1fcedba52/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= -golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= -golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= -golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY= -golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= -golang.org/x/tools v0.0.0-20190312151545-0bb0c0a6e846/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= -golang.org/x/tools v0.0.0-20190312170243-e65039ee4138/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= -golang.org/x/tools v0.0.0-20190328211700-ab21143f2384/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= -golang.org/x/tools v0.0.0-20190425150028-36563e24a262/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= -golang.org/x/tools v0.0.0-20190425163242-31fd60d6bfdc/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= -golang.org/x/tools v0.0.0-20190506145303-2d16b83fe98c/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= -golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= -golang.org/x/tools v0.0.0-20190606124116-d0a3d012864b/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= -golang.org/x/tools v0.0.0-20190621195816-6e04913cbbac/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= -golang.org/x/tools v0.0.0-20190628153133-6cdbf07be9d0/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= -golang.org/x/tools v0.0.0-20190816200558-6889da9d5479/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20190823170909-c4a336ef6a2f/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20190911174233-4f2ddba30aff/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20191012152004-8de300cfc20a/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20191029041327-9cc4af7d6b2c/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20191029190741-b9c20aec41a5/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20191113191852-77e3bb0ad9e7/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20191115202509-3a792d9c32b2/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20191125144606-a911d9008d1f/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20191130070609-6e064ea0cf2d/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20191216173652-a0e659d51361/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20191227053925-7b8e75db28f4/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20200103221440-774c71fcf114/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20200117161641-43d50277825c/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20200122220014-bf1340f18c4a/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20200130002326-2f3ba24bd6e7/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20200204074204-1cc6d1ef6c74/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20200207183749-b753a1ba74fa/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20200212150539-ea181f53ac56/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20200224181240-023911ca70b2/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20200227222343-706bc42d1f0d/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20200304193943-95d2e580d8eb/go.mod h1:o4KQGtdN14AW+yjsvvwRTJJuXz8XRtIHtEnmAXLyFUw= -golang.org/x/tools v0.0.0-20200312045724-11d5b4c81c7d/go.mod h1:o4KQGtdN14AW+yjsvvwRTJJuXz8XRtIHtEnmAXLyFUw= -golang.org/x/tools v0.0.0-20200331025713-a30bf2db82d4/go.mod h1:Sl4aGygMT6LrqrWclx+PTx3U+LnKx/seiNR+3G19Ar8= -golang.org/x/tools v0.0.0-20200501065659-ab2804fb9c9d/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= -golang.org/x/tools v0.0.0-20200512131952-2bc93b1c0c88/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= -golang.org/x/tools v0.0.0-20200515010526-7d3b6ebf133d/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= -golang.org/x/tools v0.0.0-20200618134242-20370b0cb4b2/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= -golang.org/x/tools v0.0.0-20200619180055-7c47624df98f/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= -golang.org/x/tools v0.0.0-20200729194436-6467de6f59a7/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= -golang.org/x/tools v0.0.0-20200804011535-6c149bb5ef0d/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= -golang.org/x/tools v0.0.0-20200825202427-b303f430e36d/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= -golang.org/x/tools v0.0.0-20201124115921-2c860bdd6e78/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= -golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= -golang.org/x/tools v0.1.2/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= -golang.org/x/tools v0.1.5/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= -golang.org/x/tools v0.1.12 h1:VveCTK38A2rkS8ZqFY25HIDFscX5X9OoEhJd3quQmXU= -golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= -golang.org/x/xerrors v0.0.0-20190410155217-1f06c39b4373/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -golang.org/x/xerrors v0.0.0-20190513163551-3ee3066db522/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8 h1:0A+M6Uqn+Eje4kHMK80dtF3JCXC4ykBgQG4Fe06QRhQ= +golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543 h1:E7g+9GITq07hpfrRu66IVDexMakfv52eLZ2CXBWiKr4= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -google.golang.org/api v0.3.1/go.mod h1:6wY9I6uQWHQ8EM57III9mq/AjF+i8G65rmVagqKMtkk= -google.golang.org/api v0.4.0/go.mod h1:8k5glujaEP+g9n7WNsDg8QP6cUVNI86fCNMcbazEtwE= -google.golang.org/api v0.7.0/go.mod h1:WtwebWUNSVBH/HAw79HIFXZNqEvBhG+Ra+ax0hx3E3M= -google.golang.org/api v0.8.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEnKg= -google.golang.org/api v0.9.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEnKg= -google.golang.org/api v0.13.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI= -google.golang.org/api v0.14.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI= -google.golang.org/api v0.15.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI= -google.golang.org/api v0.17.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= -google.golang.org/api v0.18.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= -google.golang.org/api v0.19.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= -google.golang.org/api v0.20.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= -google.golang.org/api v0.22.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= -google.golang.org/api v0.24.0/go.mod h1:lIXQywCXRcnZPGlsd8NbLnOjtAoL6em04bJ9+z0MncE= -google.golang.org/api v0.28.0/go.mod h1:lIXQywCXRcnZPGlsd8NbLnOjtAoL6em04bJ9+z0MncE= -google.golang.org/api v0.29.0/go.mod h1:Lcubydp8VUV7KeIHD9z2Bys/sm/vGKnG1UHuDBSrHWM= -google.golang.org/api v0.30.0/go.mod h1:QGmEvQ87FHZNiUVJkT14jQNYJ4ZJjdRF23ZXz5138Fc= -google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= -google.golang.org/appengine v1.2.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= -google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= -google.golang.org/appengine v1.5.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= -google.golang.org/appengine v1.6.1/go.mod h1:i06prIuMbXzDqacNJfV5OdTW448YApPu5ww/cMBSeb0= -google.golang.org/appengine v1.6.5/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= -google.golang.org/appengine v1.6.6/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= -google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= -google.golang.org/genproto v0.0.0-20190307195333-5fe7a883aa19/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= -google.golang.org/genproto v0.0.0-20190418145605-e7d98fc518a7/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= -google.golang.org/genproto v0.0.0-20190425155659-357c62f0e4bb/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= -google.golang.org/genproto v0.0.0-20190502173448-54afdca5d873/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= -google.golang.org/genproto v0.0.0-20190530194941-fb225487d101/go.mod h1:z3L6/3dTEVtUr6QSP8miRzeRqwQOioJ9I66odjN4I7s= -google.golang.org/genproto v0.0.0-20190801165951-fa694d86fc64/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= -google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= -google.golang.org/genproto v0.0.0-20190911173649-1774047e7e51/go.mod h1:IbNlFCBrqXvoKpeg0TB2l7cyZUmoaFKYIwrEpbDKLA8= -google.golang.org/genproto v0.0.0-20191108220845-16a3f7862a1a/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= -google.golang.org/genproto v0.0.0-20191115194625-c23dd37a84c9/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= -google.golang.org/genproto v0.0.0-20191216164720-4f79533eabd1/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= -google.golang.org/genproto v0.0.0-20191230161307-f3c370f40bfb/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= -google.golang.org/genproto v0.0.0-20200115191322-ca5a22157cba/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= -google.golang.org/genproto v0.0.0-20200122232147-0452cf42e150/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= -google.golang.org/genproto v0.0.0-20200204135345-fa8e72b47b90/go.mod h1:GmwEX6Z4W5gMy59cAlVYjN9JhxgbQH6Gn+gFDQe2lzA= -google.golang.org/genproto v0.0.0-20200212174721-66ed5ce911ce/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= -google.golang.org/genproto v0.0.0-20200224152610-e50cd9704f63/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= -google.golang.org/genproto v0.0.0-20200228133532-8c2c7df3a383/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= -google.golang.org/genproto v0.0.0-20200305110556-506484158171/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= -google.golang.org/genproto v0.0.0-20200312145019-da6875a35672/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= -google.golang.org/genproto v0.0.0-20200331122359-1ee6d9798940/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= -google.golang.org/genproto v0.0.0-20200430143042-b979b6f78d84/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= -google.golang.org/genproto v0.0.0-20200511104702-f5ebc3bea380/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= -google.golang.org/genproto v0.0.0-20200513103714-09dca8ec2884/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= -google.golang.org/genproto v0.0.0-20200515170657-fc4c6c6a6587/go.mod h1:YsZOwe1myG/8QRHRsmBRE1LrgQY60beZKjly0O1fX9U= -google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013/go.mod h1:NbSheEEYHJ7i3ixzK3sjbqSGDJWnxyFXZblF3eUsNvo= -google.golang.org/genproto v0.0.0-20200618031413-b414f8b61790/go.mod h1:jDfRM7FcilCzHH/e9qn6dsT145K34l5v+OpcnNgKAAA= -google.golang.org/genproto v0.0.0-20200729003335-053ba62fc06f/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20200804131852-c06518451d9c/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20200825200019-8632dd797987/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20210602131652-f16073e35f0c h1:wtujag7C+4D6KMoulW9YauvK2lgdvCMS260jsqqBXr0= -google.golang.org/genproto v0.0.0-20210602131652-f16073e35f0c/go.mod h1:UODoCrxHCcBojKKwX1terBiRUaqAsFqJiF615XL43r0= -google.golang.org/grpc v1.17.0/go.mod h1:6QZJwpn2B+Zp71q/5VxRsJ6NXXVCE5NRUHRo+f3cWCs= -google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= -google.golang.org/grpc v1.20.0/go.mod h1:chYK+tFQF0nDUGJgXMSgLCQk3phJEuONr2DCgLDdAQM= -google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38= -google.golang.org/grpc v1.21.0/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM= -google.golang.org/grpc v1.21.1/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM= -google.golang.org/grpc v1.22.1/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= -google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= -google.golang.org/grpc v1.23.1/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= -google.golang.org/grpc v1.25.1/go.mod h1:c3i+UQWmh7LiEpx4sFZnkU36qjEYZ0imhYfXVyQciAY= -google.golang.org/grpc v1.26.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= -google.golang.org/grpc v1.27.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= -google.golang.org/grpc v1.27.1/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= -google.golang.org/grpc v1.28.0/go.mod h1:rpkK4SK4GF4Ach/+MFLZUBavHOvF2JJB5uozKKal+60= -google.golang.org/grpc v1.29.1/go.mod h1:itym6AZVZYACWQqET3MqgPpjcuV5QH3BxFS3IjizoKk= -google.golang.org/grpc v1.30.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= -google.golang.org/grpc v1.31.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= -google.golang.org/grpc v1.33.1/go.mod h1:fr5YgcSWrqhRRxogOsw7RzIpsmvOZ6IcH4kBYTpR3n0= -google.golang.org/grpc v1.38.0 h1:/9BgsAsa5nWe26HqOlvlgJnqBuktYOLCgjCPqsa56W0= -google.golang.org/grpc v1.38.0/go.mod h1:NREThFqKR1f3iQ6oBuvc5LadQuXVGo9rkm5ZGrQdJfM= -google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= -google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= -google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM= -google.golang.org/protobuf v1.20.1-0.20200309200217-e05f789c0967/go.mod h1:A+miEFZTKqfCUM6K7xSMQL9OKL/b6hQv+e19PK+JZNE= -google.golang.org/protobuf v1.21.0/go.mod h1:47Nbq4nVaFHyn7ilMalzfO3qCViNmqZ2kzikPIcrTAo= -google.golang.org/protobuf v1.22.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= -google.golang.org/protobuf v1.23.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= -google.golang.org/protobuf v1.23.1-0.20200526195155-81db48ad09cc/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= -google.golang.org/protobuf v1.24.0/go.mod h1:r/3tXBNzIEhYS9I1OUVjXDlt8tc493IdKGjtUeSXeh4= -google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c= -google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= -google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= google.golang.org/protobuf v1.33.0 h1:uNO2rsAINq/JlFpSdYEKIZ0uKD/R9cpdv0T+yoGwGmI= google.golang.org/protobuf v1.33.0/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos= -gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/cheggaaa/pb.v1 v1.0.25/go.mod h1:V/YB90LKu/1FcN3WVnfiiE5oMCibMjukxqG/qStrOgw= -gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI= -gopkg.in/fsnotify.v1 v1.4.7 h1:xOHLXZwVvI9hhs+cLKq5+I5onOuwQLhQwiu63xxlHs4= -gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys= -gopkg.in/gcfg.v1 v1.2.3/go.mod h1:yesOnuUOFQAhST5vPY4nbZsb/huCgGGXlipJsBn0b3o= -gopkg.in/inconshreveable/log15.v2 v2.0.0-20180818164646-67afb5ed74ec/go.mod h1:aPpfJ7XW+gOuirDoZ8gHhLh3kZ1B08FtV2bbmy7Jv3s= -gopkg.in/resty.v1 v1.12.0/go.mod h1:mDo4pnntr5jdWRML875a/NmxYqAlA73dVijT2AXvQQo= -gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 h1:uRGJdciOHaEIrze2W8Q3AKkepLTh2hOroT7a+7czfdQ= -gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw= -gopkg.in/warnings.v0 v0.1.2/go.mod h1:jksf8JmL6Qr/oQM2OXTHunEvvTAsrWBLb6OOjuVWRNI= -gopkg.in/yaml.v2 v2.0.0-20170812160011-eb3733d160e7/go.mod h1:JAlM8MvJe8wmxCU4Bli9HhUf9+ttbYbLASfIpnQbh74= -gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -gopkg.in/yaml.v2 v2.2.3/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -gopkg.in/yaml.v2 v2.2.5/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -gopkg.in/yaml.v2 v2.3.0/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= -gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b h1:h8qDotaEPuJATrMmW04NCwg7v22aHH28wwpauUhK9Oo= gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= -honnef.co/go/tools v0.0.0-20180728063816-88497007e858/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= -honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= -honnef.co/go/tools v0.0.0-20190106161140-3f1c8253044a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= -honnef.co/go/tools v0.0.0-20190418001031-e561f6794a2a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= -honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= -honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt0JzvZhAg= -honnef.co/go/tools v0.0.1-2020.1.3/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= -honnef.co/go/tools v0.0.1-2020.1.4/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= -lukechampine.com/uint128 v1.1.1 h1:pnxCASz787iMf+02ssImqk6OLt+Z5QHMoZyUXR4z6JU= -lukechampine.com/uint128 v1.1.1/go.mod h1:c4eWIwlEGaxC/+H1VguhU4PHXNWDCDMUlWdIWl2j1gk= -modernc.org/cc/v3 v3.33.6/go.mod h1:iPJg1pkwXqAV16SNgFBVYmggfMg6xhs+2oiO0vclK3g= -modernc.org/cc/v3 v3.33.9/go.mod h1:iPJg1pkwXqAV16SNgFBVYmggfMg6xhs+2oiO0vclK3g= -modernc.org/cc/v3 v3.33.11/go.mod h1:iPJg1pkwXqAV16SNgFBVYmggfMg6xhs+2oiO0vclK3g= -modernc.org/cc/v3 v3.34.0/go.mod h1:iPJg1pkwXqAV16SNgFBVYmggfMg6xhs+2oiO0vclK3g= -modernc.org/cc/v3 v3.35.0/go.mod h1:iPJg1pkwXqAV16SNgFBVYmggfMg6xhs+2oiO0vclK3g= -modernc.org/cc/v3 v3.35.4/go.mod h1:iPJg1pkwXqAV16SNgFBVYmggfMg6xhs+2oiO0vclK3g= -modernc.org/cc/v3 v3.35.5/go.mod h1:iPJg1pkwXqAV16SNgFBVYmggfMg6xhs+2oiO0vclK3g= -modernc.org/cc/v3 v3.35.7/go.mod h1:iPJg1pkwXqAV16SNgFBVYmggfMg6xhs+2oiO0vclK3g= -modernc.org/cc/v3 v3.35.8/go.mod h1:iPJg1pkwXqAV16SNgFBVYmggfMg6xhs+2oiO0vclK3g= -modernc.org/cc/v3 v3.35.10/go.mod h1:iPJg1pkwXqAV16SNgFBVYmggfMg6xhs+2oiO0vclK3g= -modernc.org/cc/v3 v3.35.15/go.mod h1:iPJg1pkwXqAV16SNgFBVYmggfMg6xhs+2oiO0vclK3g= -modernc.org/cc/v3 v3.35.16/go.mod h1:iPJg1pkwXqAV16SNgFBVYmggfMg6xhs+2oiO0vclK3g= -modernc.org/cc/v3 v3.35.17/go.mod h1:iPJg1pkwXqAV16SNgFBVYmggfMg6xhs+2oiO0vclK3g= -modernc.org/cc/v3 v3.35.18 h1:rMZhRcWrba0y3nVmdiQ7kxAgOOSq2m2f2VzjHLgEs6U= -modernc.org/cc/v3 v3.35.18/go.mod h1:iPJg1pkwXqAV16SNgFBVYmggfMg6xhs+2oiO0vclK3g= -modernc.org/ccgo/v3 v3.9.5/go.mod h1:umuo2EP2oDSBnD3ckjaVUXMrmeAw8C8OSICVa0iFf60= -modernc.org/ccgo/v3 v3.10.0/go.mod h1:c0yBmkRFi7uW4J7fwx/JiijwOjeAeR2NoSaRVFPmjMw= -modernc.org/ccgo/v3 v3.11.0/go.mod h1:dGNposbDp9TOZ/1KBxghxtUp/bzErD0/0QW4hhSaBMI= -modernc.org/ccgo/v3 v3.11.1/go.mod h1:lWHxfsn13L3f7hgGsGlU28D9eUOf6y3ZYHKoPaKU0ag= -modernc.org/ccgo/v3 v3.11.3/go.mod h1:0oHunRBMBiXOKdaglfMlRPBALQqsfrCKXgw9okQ3GEw= -modernc.org/ccgo/v3 v3.12.4/go.mod h1:Bk+m6m2tsooJchP/Yk5ji56cClmN6R1cqc9o/YtbgBQ= -modernc.org/ccgo/v3 v3.12.6/go.mod h1:0Ji3ruvpFPpz+yu+1m0wk68pdr/LENABhTrDkMDWH6c= -modernc.org/ccgo/v3 v3.12.8/go.mod h1:Hq9keM4ZfjCDuDXxaHptpv9N24JhgBZmUG5q60iLgUo= -modernc.org/ccgo/v3 v3.12.11/go.mod h1:0jVcmyDwDKDGWbcrzQ+xwJjbhZruHtouiBEvDfoIsdg= -modernc.org/ccgo/v3 v3.12.14/go.mod h1:GhTu1k0YCpJSuWwtRAEHAol5W7g1/RRfS4/9hc9vF5I= -modernc.org/ccgo/v3 v3.12.18/go.mod h1:jvg/xVdWWmZACSgOiAhpWpwHWylbJaSzayCqNOJKIhs= -modernc.org/ccgo/v3 v3.12.20/go.mod h1:aKEdssiu7gVgSy/jjMastnv/q6wWGRbszbheXgWRHc8= -modernc.org/ccgo/v3 v3.12.21/go.mod h1:ydgg2tEprnyMn159ZO/N4pLBqpL7NOkJ88GT5zNU2dE= -modernc.org/ccgo/v3 v3.12.22/go.mod h1:nyDVFMmMWhMsgQw+5JH6B6o4MnZ+UQNw1pp52XYFPRk= -modernc.org/ccgo/v3 v3.12.25/go.mod h1:UaLyWI26TwyIT4+ZFNjkyTbsPsY3plAEB6E7L/vZV3w= -modernc.org/ccgo/v3 v3.12.29/go.mod h1:FXVjG7YLf9FetsS2OOYcwNhcdOLGt8S9bQ48+OP75cE= -modernc.org/ccgo/v3 v3.12.36/go.mod h1:uP3/Fiezp/Ga8onfvMLpREq+KUjUmYMxXPO8tETHtA8= -modernc.org/ccgo/v3 v3.12.38/go.mod h1:93O0G7baRST1vNj4wnZ49b1kLxt0xCW5Hsa2qRaZPqc= -modernc.org/ccgo/v3 v3.12.43/go.mod h1:k+DqGXd3o7W+inNujK15S5ZYuPoWYLpF5PYougCmthU= -modernc.org/ccgo/v3 v3.12.46/go.mod h1:UZe6EvMSqOxaJ4sznY7b23/k13R8XNlyWsO5bAmSgOE= -modernc.org/ccgo/v3 v3.12.47/go.mod h1:m8d6p0zNps187fhBwzY/ii6gxfjob1VxWb919Nk1HUk= -modernc.org/ccgo/v3 v3.12.50/go.mod h1:bu9YIwtg+HXQxBhsRDE+cJjQRuINuT9PUK4orOco/JI= -modernc.org/ccgo/v3 v3.12.51/go.mod h1:gaIIlx4YpmGO2bLye04/yeblmvWEmE4BBBls4aJXFiE= -modernc.org/ccgo/v3 v3.12.53/go.mod h1:8xWGGTFkdFEWBEsUmi+DBjwu/WLy3SSOrqEmKUjMeEg= -modernc.org/ccgo/v3 v3.12.54/go.mod h1:yANKFTm9llTFVX1FqNKHE0aMcQb1fuPJx6p8AcUx+74= -modernc.org/ccgo/v3 v3.12.55/go.mod h1:rsXiIyJi9psOwiBkplOaHye5L4MOOaCjHg1Fxkj7IeU= -modernc.org/ccgo/v3 v3.12.56/go.mod h1:ljeFks3faDseCkr60JMpeDb2GSO3TKAmrzm7q9YOcMU= -modernc.org/ccgo/v3 v3.12.57/go.mod h1:hNSF4DNVgBl8wYHpMvPqQWDQx8luqxDnNGCMM4NFNMc= -modernc.org/ccgo/v3 v3.12.60/go.mod h1:k/Nn0zdO1xHVWjPYVshDeWKqbRWIfif5dtsIOCUVMqM= -modernc.org/ccgo/v3 v3.12.65/go.mod h1:D6hQtKxPNZiY6wDBtehSGKFKmyXn53F8nGTpH+POmS4= -modernc.org/ccgo/v3 v3.12.66/go.mod h1:jUuxlCFZTUZLMV08s7B1ekHX5+LIAurKTTaugUr/EhQ= -modernc.org/ccgo/v3 v3.12.67/go.mod h1:Bll3KwKvGROizP2Xj17GEGOTrlvB1XcVaBrC90ORO84= -modernc.org/ccgo/v3 v3.12.73/go.mod h1:hngkB+nUUqzOf3iqsM48Gf1FZhY599qzVg1iX+BT3cQ= -modernc.org/ccgo/v3 v3.12.81/go.mod h1:p2A1duHoBBg1mFtYvnhAnQyI6vL0uw5PGYLSIgF6rYY= -modernc.org/ccgo/v3 v3.12.82 h1:wudcnJyjLj1aQQCXF3IM9Gz2X6UNjw+afIghzdtn0v8= -modernc.org/ccgo/v3 v3.12.82/go.mod h1:ApbflUfa5BKadjHynCficldU1ghjen84tuM5jRynB7w= -modernc.org/ccorpus v1.11.1/go.mod h1:2gEUTrWqdpH2pXsmTM1ZkjeSrUWDpjMu2T6m29L/ErQ= -modernc.org/httpfs v1.0.6/go.mod h1:7dosgurJGp0sPaRanU53W4xZYKh14wfzX420oZADeHM= -modernc.org/libc v1.9.8/go.mod h1:U1eq8YWr/Kc1RWCMFUWEdkTg8OTcfLw2kY8EDwl039w= -modernc.org/libc v1.9.11/go.mod h1:NyF3tsA5ArIjJ83XB0JlqhjTabTCHm9aX4XMPHyQn0Q= -modernc.org/libc v1.11.0/go.mod h1:2lOfPmj7cz+g1MrPNmX65QCzVxgNq2C5o0jdLY2gAYg= -modernc.org/libc v1.11.2/go.mod h1:ioIyrl3ETkugDO3SGZ+6EOKvlP3zSOycUETe4XM4n8M= -modernc.org/libc v1.11.5/go.mod h1:k3HDCP95A6U111Q5TmG3nAyUcp3kR5YFZTeDS9v8vSU= -modernc.org/libc v1.11.6/go.mod h1:ddqmzR6p5i4jIGK1d/EiSw97LBcE3dK24QEwCFvgNgE= -modernc.org/libc v1.11.11/go.mod h1:lXEp9QOOk4qAYOtL3BmMve99S5Owz7Qyowzvg6LiZso= -modernc.org/libc v1.11.13/go.mod h1:ZYawJWlXIzXy2Pzghaf7YfM8OKacP3eZQI81PDLFdY8= -modernc.org/libc v1.11.16/go.mod h1:+DJquzYi+DMRUtWI1YNxrlQO6TcA5+dRRiq8HWBWRC8= -modernc.org/libc v1.11.19/go.mod h1:e0dgEame6mkydy19KKaVPBeEnyJB4LGNb0bBH1EtQ3I= -modernc.org/libc v1.11.24/go.mod h1:FOSzE0UwookyT1TtCJrRkvsOrX2k38HoInhw+cSCUGk= -modernc.org/libc v1.11.26/go.mod h1:SFjnYi9OSd2W7f4ct622o/PAYqk7KHv6GS8NZULIjKY= -modernc.org/libc v1.11.27/go.mod h1:zmWm6kcFXt/jpzeCgfvUNswM0qke8qVwxqZrnddlDiE= -modernc.org/libc v1.11.28/go.mod h1:Ii4V0fTFcbq3qrv3CNn+OGHAvzqMBvC7dBNyC4vHZlg= -modernc.org/libc v1.11.31/go.mod h1:FpBncUkEAtopRNJj8aRo29qUiyx5AvAlAxzlx9GNaVM= -modernc.org/libc v1.11.34/go.mod h1:+Tzc4hnb1iaX/SKAutJmfzES6awxfU1BPvrrJO0pYLg= -modernc.org/libc v1.11.37/go.mod h1:dCQebOwoO1046yTrfUE5nX1f3YpGZQKNcITUYWlrAWo= -modernc.org/libc v1.11.39/go.mod h1:mV8lJMo2S5A31uD0k1cMu7vrJbSA3J3waQJxpV4iqx8= -modernc.org/libc v1.11.42/go.mod h1:yzrLDU+sSjLE+D4bIhS7q1L5UwXDOw99PLSX0BlZvSQ= -modernc.org/libc v1.11.44/go.mod h1:KFq33jsma7F5WXiYelU8quMJasCCTnHK0mkri4yPHgA= -modernc.org/libc v1.11.45/go.mod h1:Y192orvfVQQYFzCNsn+Xt0Hxt4DiO4USpLNXBlXg/tM= -modernc.org/libc v1.11.47/go.mod h1:tPkE4PzCTW27E6AIKIR5IwHAQKCAtudEIeAV1/SiyBg= -modernc.org/libc v1.11.49/go.mod h1:9JrJuK5WTtoTWIFQ7QjX2Mb/bagYdZdscI3xrvHbXjE= -modernc.org/libc v1.11.51/go.mod h1:R9I8u9TS+meaWLdbfQhq2kFknTW0O3aw3kEMqDDxMaM= -modernc.org/libc v1.11.53/go.mod h1:5ip5vWYPAoMulkQ5XlSJTy12Sz5U6blOQiYasilVPsU= -modernc.org/libc v1.11.54/go.mod h1:S/FVnskbzVUrjfBqlGFIPA5m7UwB3n9fojHhCNfSsnw= -modernc.org/libc v1.11.55/go.mod h1:j2A5YBRm6HjNkoSs/fzZrSxCuwWqcMYTDPLNx0URn3M= -modernc.org/libc v1.11.56/go.mod h1:pakHkg5JdMLt2OgRadpPOTnyRXm/uzu+Yyg/LSLdi18= -modernc.org/libc v1.11.58/go.mod h1:ns94Rxv0OWyoQrDqMFfWwka2BcaF6/61CqJRK9LP7S8= -modernc.org/libc v1.11.70/go.mod h1:DUOmMYe+IvKi9n6Mycyx3DbjfzSKrdr/0Vgt3j7P5gw= -modernc.org/libc v1.11.71/go.mod h1:DUOmMYe+IvKi9n6Mycyx3DbjfzSKrdr/0Vgt3j7P5gw= -modernc.org/libc v1.11.75/go.mod h1:dGRVugT6edz361wmD9gk6ax1AbDSe0x5vji0dGJiPT0= -modernc.org/libc v1.11.82/go.mod h1:NF+Ek1BOl2jeC7lw3a7Jj5PWyHPwWD4aq3wVKxqV1fI= -modernc.org/libc v1.11.86/go.mod h1:ePuYgoQLmvxdNT06RpGnaDKJmDNEkV7ZPKI2jnsvZoE= -modernc.org/libc v1.11.87 h1:PzIzOqtlzMDDcCzJ5cUP6h/Ku6Fa9iyflP2ccTY64aE= -modernc.org/libc v1.11.87/go.mod h1:Qvd5iXTeLhI5PS0XSyqMY99282y+3euapQFxM7jYnpY= -modernc.org/mathutil v1.1.1/go.mod h1:mZW8CKdRPY1v87qxC/wUdX5O1qDzXMP5TH3wjfpga6E= -modernc.org/mathutil v1.2.2/go.mod h1:mZW8CKdRPY1v87qxC/wUdX5O1qDzXMP5TH3wjfpga6E= -modernc.org/mathutil v1.4.0/go.mod h1:mZW8CKdRPY1v87qxC/wUdX5O1qDzXMP5TH3wjfpga6E= -modernc.org/mathutil v1.4.1 h1:ij3fYGe8zBF4Vu+g0oT7mB06r8sqGWKuJu1yXeR4by8= -modernc.org/mathutil v1.4.1/go.mod h1:mZW8CKdRPY1v87qxC/wUdX5O1qDzXMP5TH3wjfpga6E= -modernc.org/memory v1.0.4/go.mod h1:nV2OApxradM3/OVbs2/0OsP6nPfakXpi50C7dcoHXlc= -modernc.org/memory v1.0.5 h1:XRch8trV7GgvTec2i7jc33YlUI0RKVDBvZ5eZ5m8y14= -modernc.org/memory v1.0.5/go.mod h1:B7OYswTRnfGg+4tDH1t1OeUNnsy2viGTdME4tzd+IjM= -modernc.org/opt v0.1.1 h1:/0RX92k9vwVeDXj+Xn23DKp2VJubL7k8qNffND6qn3A= -modernc.org/opt v0.1.1/go.mod h1:WdSiB5evDcignE70guQKxYUl14mgWtbClRi5wmkkTX0= -modernc.org/sqlite v1.14.2 h1:ohsW2+e+Qe2To1W6GNezzKGwjXwSax6R+CrhRxVaFbE= -modernc.org/sqlite v1.14.2/go.mod h1:yqfn85u8wVOE6ub5UT8VI9JjhrwBUUCNyTACN0h6Sx8= -modernc.org/strutil v1.1.1 h1:xv+J1BXY3Opl2ALrBwyfEikFAj8pmqcpnfmuwUwcozs= -modernc.org/strutil v1.1.1/go.mod h1:DE+MQQ/hjKBZS2zNInV5hhcipt5rLPWkmpbGeW5mmdw= -modernc.org/tcl v1.8.13/go.mod h1:V+q/Ef0IJaNUSECieLU4o+8IScapxnMyFV6i/7uQlAY= -modernc.org/token v1.0.0 h1:a0jaWiNMDhDUtqOj09wvjWWAqd3q7WpBulmL9H2egsk= -modernc.org/token v1.0.0/go.mod h1:UGzOrNV1mAFSEB63lOFHIpNRUVMvYTc6yu1SMY/XTDM= -modernc.org/z v1.2.19/go.mod h1:+ZpP0pc4zz97eukOzW3xagV/lS82IpPN9NGG5pNF9vY= -rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8= -rsc.io/quote/v3 v3.1.0/go.mod h1:yEA65RcK8LyAZtP9Kv3t0HmxON59tX3rD+tICJqUlj0= -rsc.io/sampler v1.3.0/go.mod h1:T1hPZKmBbMNahiBKFy5HrXp6adAjACjK9JXDnKaTXpA= -sigs.k8s.io/yaml v1.1.0/go.mod h1:UJmg0vDUVViEyp3mgSv9WPwZCDxu4rQW1olrI1uml+o= -sigs.k8s.io/yaml v1.2.0/go.mod h1:yfXDCHCao9+ENCvLSE62v9VSji2MKu5jeNfTrofGhJc= -sourcegraph.com/sourcegraph/appdash v0.0.0-20190731080439-ebfcffb1b5c0/go.mod h1:hI742Nqp5OhwiqlzhgfbWU4mW4yO10fP+LoT9WOswdU= -xorm.io/builder v0.3.11-0.20220531020008-1bd24a7dc978 h1:bvLlAPW1ZMTWA32LuZMBEGHAUOcATZjzHcotf3SWweM= -xorm.io/builder v0.3.11-0.20220531020008-1bd24a7dc978/go.mod h1:aUW0S9eb9VCaPohFCH3j7czOx1PMW3i1HrSzbLYGBSE= -xorm.io/xorm v1.3.1 h1:z5egKrDoOLqZFhMjcGF4FBHiTmE5/feQoHclfhNidfM= -xorm.io/xorm v1.3.1/go.mod h1:9NbjqdnjX6eyjRRhh01GHm64r6N9shTb/8Ak3YRt8Nw= diff --git a/src/core/goroutine/go.go b/src/core/goroutine/go.go index b2197c7..fe28530 100644 --- a/src/core/goroutine/go.go +++ b/src/core/goroutine/go.go @@ -9,12 +9,10 @@ import ( "reflect" "runtime" "runtime/debug" - "strings" "sync" "syscall" "time" - "core/log" "github.com/panjf2000/ants/v2" ) @@ -38,10 +36,7 @@ func Try(fn func(), catch func(ex interface{})) { os.Stderr.WriteString(info) if r == ExitErr { - log.KV("err", r).KV("file", file).KV("line", line).InfoStack(3, "panic recover") } else { - log.KV("err", r).KV("file", file).KV("line", line).KV("stack", stack).ErrorStack(3, "panic recover") - goprome().record_panic(fmt.Sprintf("%s:%d", file, line), r) } if catch != nil { @@ -54,14 +49,8 @@ func Try(fn func(), catch func(ex interface{})) { func GoLogic(fn func(), catch func(ex interface{})) { //go Try(func() { fn() }, catch) - file, line := TraceFunc(fn) - addr := fmt.Sprintf("%s:%d", file, line) - goprome().record_start(addr) if err := _pool.Submit(func() { Try(func() { fn() }, catch) }); err != nil { - log.KV("err", err).ErrorStack(1, "run goroutine failed") - goprome().record_failed(addr, err) } else { - goprome().record_over(addr) } } @@ -93,5 +82,4 @@ func WaitExit() (waitFn func(), exitFn func()) { type antsLogger struct{} func (l *antsLogger) Printf(format string, args ...interface{}) { - log.Error(fmt.Sprintf(strings.TrimRight(format, "\n"), args)) } diff --git a/src/core/goroutine/go_worker.go b/src/core/goroutine/go_worker.go index 7711a5d..95ff620 100644 --- a/src/core/goroutine/go_worker.go +++ b/src/core/goroutine/go_worker.go @@ -5,7 +5,6 @@ import ( "sync" "core/container/safe/mpsc" - "core/log" "go.uber.org/atomic" ) @@ -41,7 +40,6 @@ func (w *GoWorker) Push(fn Task) { w.queue.Push(fn) if w.schedulerStatus.CAS(idle, running) { if err := _pool.Submit(w.schedule); err != nil { - log.KV("err", err).ErrorStack(1, "run goroutine failed") } } } diff --git a/src/core/goroutine/prometheus.go b/src/core/goroutine/prometheus.go deleted file mode 100644 index 4ca8e6b..0000000 --- a/src/core/goroutine/prometheus.go +++ /dev/null @@ -1,34 +0,0 @@ -package goroutine - -import ( - "fmt" - - "core/prometheus" -) - -const Subsystem = "goroutine" - -var _goprome = &GoProme{ - registry: prometheus.Default(), - panic: prometheus.Default().RegCounter(Subsystem, "panic", []string{"file", "error"}), - goStart: prometheus.Default().RegCounter(Subsystem, "gostart", []string{"file"}), - goFailed: prometheus.Default().RegCounter(Subsystem, "gofailed", []string{"file", "error"}), - goOver: prometheus.Default().RegCounter(Subsystem, "goover", []string{"file"}), -} - -func goprome() *GoProme { return _goprome } - -type GoProme struct { - registry *prometheus.Prometheus - panic *prometheus.CounterVec //panic - goStart *prometheus.CounterVec - goFailed *prometheus.CounterVec - goOver *prometheus.CounterVec -} - -func (this *GoProme) record_panic(file string, r interface{}) { - this.panic.Inc(file, fmt.Sprintf("%v", r)) -} -func (this *GoProme) record_start(file string) { this.goStart.Inc(file) } -func (this *GoProme) record_failed(file string, err error) { this.goFailed.Inc(file, err.Error()) } -func (this *GoProme) record_over(file string) { this.goOver.Inc(file) } diff --git a/src/core/log/builder.go b/src/core/log/builder.go deleted file mode 100644 index 187264c..0000000 --- a/src/core/log/builder.go +++ /dev/null @@ -1,193 +0,0 @@ -package log - -import ( - "bytes" - "encoding/json" - "fmt" - "time" - - "go.uber.org/zap" - "go.uber.org/zap/zapcore" -) - -const ( - FIELD_TIME = iota //时间 - FIELD_LEVEL //日志等级 - FIELD_FILE //文件 - FIELD_LINE //行号 - FIELD_MSG //msg - FIELD_MAX -) - -type Builder struct { - fields []zap.Field -} - -func (b *Builder) Reset() { - b.fields = b.fields[:FIELD_MAX] -} - -func (b *Builder) KV(key string, value interface{}) *Builder { - b.fields = append(b.fields, b.zapAny(key, value)) - return b -} - -func (b *Builder) Debug(msg string) { write(b, 0, TAG_DEBUG, msg) } -func (b *Builder) Info(msg string) { write(b, 0, TAG_INFO, msg) } -func (b *Builder) Warn(msg string) { write(b, 0, TAG_WARN, msg) } -func (b *Builder) Error(msg string) { write(b, 0, TAG_ERROR, msg) } -func (b *Builder) Fatal(msg string) { write(b, 0, TAG_FATAL, msg) } -func (b *Builder) DebugStack(st int, msg string) { write(b, st, TAG_DEBUG, msg) } -func (b *Builder) InfoStack(st int, msg string) { write(b, st, TAG_INFO, msg) } -func (b *Builder) WarnStack(st int, msg string) { write(b, st, TAG_WARN, msg) } -func (b *Builder) ErrorStack(st int, msg string) { write(b, st, TAG_ERROR, msg) } -func (b *Builder) FatalStack(st int, msg string) { write(b, st, TAG_FATAL, msg) } - -func newFields() []zap.Field { - return make([]zap.Field, FIELD_MAX, 8) -} - -func (b *Builder) zapAny(key string, value interface{}) zapcore.Field { - switch val := value.(type) { - //case zapcore.ObjectMarshaler: - // return zap.Object(key, val) - //case zapcore.ArrayMarshaler: - // return zap.Array(key, val) - case bool: - return zap.Bool(key, val) - case *bool: - return zap.Boolp(key, val) - //case []bool: - // return zap.Bools(key, val) - case complex128: - return zap.Complex128(key, val) - case *complex128: - return zap.Complex128p(key, val) - //case []complex128: - // return zap.Complex128s(key, val) - case complex64: - return zap.Complex64(key, val) - case *complex64: - return zap.Complex64p(key, val) - //case []complex64: - // return zap.Complex64s(key, val) - case float64: - return zap.Float64(key, val) - case *float64: - return zap.Float64p(key, val) - //case []float64: - // return zap.Float64s(key, val) - case float32: - return zap.Float32(key, val) - case *float32: - return zap.Float32p(key, val) - //case []float32: - // return zap.Float32s(key, val) - case int: - return zap.Int(key, val) - case *int: - return zap.Intp(key, val) - //case []int: - // return zap.Ints(key, val) - case int64: - return zap.Int64(key, val) - case *int64: - return zap.Int64p(key, val) - //case []int64: - // return zap.Int64s(key, val) - case int32: - return zap.Int32(key, val) - case *int32: - return zap.Int32p(key, val) - //case []int32: - // return zap.Int32s(key, val) - case int16: - return zap.Int16(key, val) - case *int16: - return zap.Int16p(key, val) - //case []int16: - // return zap.Int16s(key, val) - case int8: - return zap.Int8(key, val) - case *int8: - return zap.Int8p(key, val) - //case []int8: - // return zap.Int8s(key, val) - case string: - return zap.String(key, val) - case *string: - return zap.Stringp(key, val) - //case []string: - // return zap.Strings(key, val) - case uint: - return zap.Uint(key, val) - case *uint: - return zap.Uintp(key, val) - //case []uint: - // return zap.Uints(key, val) - case uint64: - return zap.Uint64(key, val) - case *uint64: - return zap.Uint64p(key, val) - //case []uint64: - // return zap.Uint64s(key, val) - case uint32: - return zap.Uint32(key, val) - case *uint32: - return zap.Uint32p(key, val) - //case []uint32: - // return zap.Uint32s(key, val) - case uint16: - return zap.Uint16(key, val) - case *uint16: - return zap.Uint16p(key, val) - //case []uint16: - // return zap.Uint16s(key, val) - case uint8: - return zap.Uint8(key, val) - case *uint8: - return zap.Uint8p(key, val) - //case []byte: - // return zap.Binary(key, val) - case uintptr: - return zap.Uintptr(key, val) - case *uintptr: - return zap.Uintptrp(key, val) - //case []uintptr: - // return zap.Uintptrs(key, val) - case time.Time: - return zap.Time(key, val) - case *time.Time: - return zap.Timep(key, val) - //case []time.Time: - // return zap.Times(key, val) - case time.Duration: - return zap.Duration(key, val) - case *time.Duration: - return zap.Durationp(key, val) - //case []time.Duration: - // return zap.Durations(key, val) - case error: - //return zap.NamedError(key, val) - return zap.String(key, val.Error()) - case []error: - return zap.Errors(key, val) - case fmt.Stringer: - //return zap.Stringer(key, val) - return zap.String(key, val.String()) - default: - //return zap.Reflect(key, val) - var data bytes.Buffer - js := json.NewEncoder(&data) - js.SetEscapeHTML(false) - js.Encode(val) - - ret := data.Bytes() - if i := len(ret) - 1; i >= 0 { - if ret[i] == '\n' { - ret = ret[:i] - } - } - return zap.String(key, string(ret)) - } -} diff --git a/src/core/log/init.go b/src/core/log/init.go deleted file mode 100644 index e276765..0000000 --- a/src/core/log/init.go +++ /dev/null @@ -1,107 +0,0 @@ -package log - -import ( - "os" - "path" - "runtime" - "strings" - "sync" - "time" - - rotatelogs "github.com/lestrrat-go/file-rotatelogs" - - "core/log/internal/colorized" - "core/log/internal/tools" -) - -var ( - stopWait sync.WaitGroup - stopCh = make(chan struct{}) - - //编译信息 - compile_time = "" //时间 - compile_user = "" //git用户 - compile_path = "" //绝对路径 - git_version = "" //git版本 - git_branch = "" //git分支 -) - -func Stop() { - close(stopCh) - stopWait.Wait() -} - -func init() { - KV("compile_time", compile_time).KV("compile_user", compile_user).KV("compile_path", compile_path). - KV("git_version", git_version).KV("git_branch", git_branch).KV("go_root", runtime.GOROOT()). - KV("go_arch", runtime.GOARCH).KV("go_os", runtime.GOOS).KV("go_version", runtime.Version()).Debug("compile info") -} - -func Init(file, level string) { - initOutput(parseLevel(level), file) - - stopWait.Add(1) - go func() { - defer stopWait.Done() - - ticker := time.NewTicker(200 * time.Millisecond) - defer ticker.Stop() - - writer := getOutput() - defer flush(writer) - - for { - select { - case <-stopCh: - return - case <-ticker.C: - flush(writer) - } - } - }() -} - -func initOutput(level int, filePath string) { - logLevel = level - - if filePath != "" { - dir, fileName := path.Split(filePath) - err := os.MkdirAll(dir, os.ModePerm) - tools.AssertNil(err) - - fileName = strings.TrimSuffix(fileName, path.Ext(fileName)) - outfile, err := rotatelogs.New( - path.Join(dir, fileName+".%Y%m%d%H%M.log"), - rotatelogs.WithLinkName(path.Join(dir, fileName+".log")), // 生成软链,指向最新日志文件 - rotatelogs.WithRotationTime(24*time.Hour), // 日志切割时间间隔 - rotatelogs.WithRotationSize(1024*1024*50), // 日志切割大小 50M一个文件 - rotatelogs.WithMaxAge(time.Hour*24*365), // 默认只有7天,必须设置 - ) - tools.AssertNil(err) - - fileWriter := NewFileWriter(outfile) - if colorized.FileAndStd() { - writer := MultiWriter(NewConsoleWriter(), fileWriter) - setOutput(writer) - } else { - setOutput(fileWriter) - } - } -} - -func parseLevel(s string) int { - switch strings.ToLower(s) { - case "debug", "d": - return TAG_DEBUG - case "info", "i": - return TAG_INFO - case "warn", "warning", "w": - return TAG_WARN - case "error", "e": - return TAG_ERROR - case "fatal", "f": - return TAG_FATAL - default: - return TAG_DEBUG - } -} diff --git a/src/core/log/internal/colorized/color.go b/src/core/log/internal/colorized/color.go deleted file mode 100644 index 8cf356c..0000000 --- a/src/core/log/internal/colorized/color.go +++ /dev/null @@ -1,15 +0,0 @@ -//go:build !debug -// +build !debug - -package colorized - -func Blue() []byte { return nil } -func Yellow() []byte { return nil } -func Green() []byte { return nil } -func Magenta() []byte { return nil } -func Cyan() []byte { return nil } -func Gray() []byte { return nil } -func White() []byte { return nil } -func Red() []byte { return nil } -func End() []byte { return nil } -func FileAndStd() bool { return false } diff --git a/src/core/log/internal/colorized/color_debug.go b/src/core/log/internal/colorized/color_debug.go deleted file mode 100644 index 9a318b2..0000000 --- a/src/core/log/internal/colorized/color_debug.go +++ /dev/null @@ -1,14 +0,0 @@ -// +build debug - -package colorized - -func Blue() []byte { return []byte("\x1b[0;34m") } -func Yellow() []byte { return []byte("\x1b[0;33m") } -func Green() []byte { return []byte("\x1b[0;32m") } -func Magenta() []byte { return []byte("\x1b[0;35m") } -func Cyan() []byte { return []byte("\x1b[0;36m") } -func Gray() []byte { return []byte("\x1b[0;37m") } -func White() []byte { return []byte("\x1b[1;37m") } -func Red() []byte { return []byte("\x1b[0;31m") } -func End() []byte { return []byte("\x1b[0m") } -func FileAndStd() bool { return true } diff --git a/src/core/log/internal/goid/goid.go b/src/core/log/internal/goid/goid.go deleted file mode 100644 index 2c53051..0000000 --- a/src/core/log/internal/goid/goid.go +++ /dev/null @@ -1,6 +0,0 @@ -//go:build !goid -// +build !goid - -package goid - -func GoId() int64 { return 0 } diff --git a/src/core/log/internal/goid/goid_debug.go b/src/core/log/internal/goid/goid_debug.go deleted file mode 100644 index 3aeb124..0000000 --- a/src/core/log/internal/goid/goid_debug.go +++ /dev/null @@ -1,19 +0,0 @@ -// +build goid - -package goid - -import ( - "runtime" -) - -func GoId() int64 { - return runtime.GoId() -} - -/* -//runtime1.go -func GoId() int64 { - g := getg() - return g.goid -} -*/ diff --git a/src/core/log/internal/tools/tools.go b/src/core/log/internal/tools/tools.go deleted file mode 100644 index a0d1ee4..0000000 --- a/src/core/log/internal/tools/tools.go +++ /dev/null @@ -1,61 +0,0 @@ -package tools - -import ( - "runtime" - "strings" - "unsafe" -) - -func ShortPath(path string, need int) string { - if need <= 0 { - return path - } - - count := 0 - for i := len(path) - 1; i > 0; i-- { - if path[i] == '/' { - count++ - } - if count == need { - return path[i+1:] - } - } - return path -} - -// 输出堆栈信息, skip表示需要跳过的帧数 -func Stack(skip, needline int) string { - buf := make([]byte, 4096) - n := runtime.Stack(buf, false) - buf = buf[:n] - s := string(buf) - lines := skip - count := 0 - begin := strings.IndexFunc(s, func(c rune) bool { - if c != '\n' { - return false - } - count++ - return count == lines - }) - - count = 0 - end := strings.IndexFunc(s, func(c rune) bool { - if c != '\n' { - return false - } - count++ - return count == lines+needline+2 - }) - return s[begin+1 : end+1] -} - -func AssertNil(v interface{}) { - if !IsNil(v) { - panic(v) - } -} - -func IsNil(i interface{}) bool { - return (*[2]uintptr)(unsafe.Pointer(&i))[1] == 0 -} diff --git a/src/core/log/log.go b/src/core/log/log.go deleted file mode 100644 index 3bfd38e..0000000 --- a/src/core/log/log.go +++ /dev/null @@ -1,111 +0,0 @@ -package log - -import ( - "runtime" - "sync" - "time" - - "go.uber.org/zap" - "go.uber.org/zap/buffer" - "go.uber.org/zap/zapcore" - - "core/container/safe/mpsc" - "core/log/internal/colorized" - "core/log/internal/tools" -) - -const ( - TAG_DEBUG_S = "D" - TAG_INFO_S = "I" - TAG_WARN_S = "W" - TAG_ERROR_S = "E" - TAG_FATAL_S = "F" -) - -const ( - TAG_DEBUG = 7 //log/syslog.LOG_DEBUG - TAG_INFO = 6 //log/syslog.LOG_INFO - TAG_WARN = 4 //log/syslog.LOG_WARNING - TAG_ERROR = 3 //log/syslog.LOG_ERR - TAG_FATAL = 0 //log/syslog.LOG_EMERG -) - -var Levels = []string{ - TAG_DEBUG: TAG_DEBUG_S, - TAG_INFO: TAG_INFO_S, - TAG_WARN: TAG_WARN_S, - TAG_ERROR: TAG_ERROR_S, - TAG_FATAL: TAG_FATAL_S, -} - -var Colors = []func() []byte{ - TAG_DEBUG: colorized.Blue, - TAG_INFO: colorized.Cyan, - TAG_WARN: colorized.Yellow, - TAG_ERROR: colorized.Red, - TAG_FATAL: colorized.Red, -} - -const BaseStack = 4 - -type LogHook func(t time.Time, level int, file string, line int, msg string, param []byte) - -var ( - logLevel = TAG_DEBUG - msgs = mpsc.New[*Builder]() - msgPool = &sync.Pool{New: func() interface{} { return &Builder{fields: newFields()} }} - buffPool = buffer.NewPool() - zapEncoder = zapcore.NewJSONEncoder(zapcore.EncoderConfig{LineEnding: " ", EncodeTime: zapcore.ISO8601TimeEncoder}) - zapEnt = zapcore.Entry{} -) - -func getBuilder() *Builder { return msgPool.Get().(*Builder) } -func releaseBuilder(b *Builder) { - b.Reset() - msgPool.Put(b) -} - -func flush(writer IWriter) { - for msg := msgs.Pop(); msg != nil; msg = msgs.Pop() { - writer.Write(msg) - releaseBuilder(msg) - } - writer.Flush() -} - -func write(sb *Builder, stack int, level int, msg string) { - if level > logLevel { - return - } - sb.fields[FIELD_LEVEL], sb.fields[FIELD_TIME] = zap.Int("llevel", level), zap.Time("ltime", time.Now()) - file, line := WhereCall(BaseStack+stack, 3) - sb.fields[FIELD_FILE], sb.fields[FIELD_LINE] = zap.String("lfile", file), zap.Int("lline", line) - sb.fields[FIELD_MSG] = zap.String("message", msg) - - msgs.Push(sb) -} - -func WhereCall(depth int, need int) (string, int) { - pc := make([]uintptr, 1) - numFrames := runtime.Callers(depth, pc) - if numFrames < 1 { - return "???", 0 - } - frame, _ := runtime.CallersFrames(pc).Next() - if need > 0 { - return tools.ShortPath(frame.File, need), frame.Line - } - return frame.File, frame.Line -} - -func KV(key string, value interface{}) *Builder { return getBuilder().KV(key, value) } -func Debug(msg string) { write(getBuilder(), 0, TAG_DEBUG, msg) } -func Info(msg string) { write(getBuilder(), 0, TAG_INFO, msg) } -func Warn(msg string) { write(getBuilder(), 0, TAG_WARN, msg) } -func Error(msg string) { write(getBuilder(), 0, TAG_ERROR, msg) } -func Fatal(msg string) { write(getBuilder(), 0, TAG_FATAL, msg) } -func DebugStack(st int, msg string) { write(getBuilder(), st, TAG_DEBUG, msg) } -func InfoStack(st int, msg string) { write(getBuilder(), st, TAG_INFO, msg) } -func WarnStack(st int, msg string) { write(getBuilder(), st, TAG_WARN, msg) } -func ErrorStack(st int, msg string) { write(getBuilder(), st, TAG_ERROR, msg) } -func FatalStack(st int, msg string) { write(getBuilder(), st, TAG_FATAL, msg) } diff --git a/src/core/log/writer.go b/src/core/log/writer.go deleted file mode 100644 index 040785c..0000000 --- a/src/core/log/writer.go +++ /dev/null @@ -1,117 +0,0 @@ -package log - -import ( - "bufio" - "os" - "sync" - - rotatelogs "github.com/lestrrat-go/file-rotatelogs" - - "core/log/internal/colorized" -) - -var ( - writerMut sync.Mutex - output IWriter = NewConsoleWriter() -) - -func getOutput() IWriter { - writerMut.Lock() - defer writerMut.Unlock() - - return output -} - -func setOutput(writer IWriter) { - writerMut.Lock() - defer writerMut.Unlock() - - output = writer -} - -type IWriter interface { - Write(builder *Builder) - Flush() -} - -type multiWriter struct { - writers []IWriter -} - -func (t *multiWriter) Write(builder *Builder) { - for _, w := range t.writers { - w.Write(builder) - } -} - -func (t *multiWriter) Flush() { - for _, w := range t.writers { - w.Flush() - } -} - -func MultiWriter(writers ...IWriter) IWriter { - allWriters := make([]IWriter, 0, len(writers)) - for _, w := range writers { - if mw, ok := w.(*multiWriter); ok { - allWriters = append(allWriters, mw.writers...) - } else { - allWriters = append(allWriters, w) - } - } - return &multiWriter{allWriters} -} - -type ConsoleWriter struct { - raw *bufio.Writer -} - -func (w *ConsoleWriter) Write(builder *Builder) { - buffer, _ := zapEncoder.EncodeEntry(zapEnt, builder.fields) - w.raw.Write(Colors[builder.fields[FIELD_LEVEL].Integer]()) - w.raw.Write(buffer.Bytes()) - w.raw.Write(colorized.End()) - w.raw.Write([]byte{'\n'}) - - if len(buffer.Bytes()) < 1<<12 { - buffer.Free() - } -} - -func (w *ConsoleWriter) Flush() { - w.raw.Flush() -} - -func NewConsoleWriter() *ConsoleWriter { - return &ConsoleWriter{ - raw: bufio.NewWriter(os.Stdout), - } -} - -type FileWriter struct { - raw *bufio.Writer -} - -func (w *FileWriter) Write(builder *Builder) { - buffer, _ := zapEncoder.EncodeEntry(zapEnt, builder.fields) - w.raw.Write(buffer.Bytes()) - w.raw.Write([]byte{'\n'}) - - if len(buffer.Bytes()) < 1<<12 { - buffer.Free() - } -} - -func (w *FileWriter) Size() int { - return w.raw.Size() -} - -func (w *FileWriter) Flush() { - w.raw.Flush() -} - -func NewFileWriter(file *rotatelogs.RotateLogs) *FileWriter { - return &FileWriter{ - raw: bufio.NewWriter(file), - } -} diff --git a/src/core/network/codec.go b/src/core/network/codec.go index 49cb4e2..6d63904 100644 --- a/src/core/network/codec.go +++ b/src/core/network/codec.go @@ -7,8 +7,8 @@ import ( ) type ICodec interface { - Decode([]byte, ...CodecChain) ([]int32, []interface{}, error) - Encode(interface{}, ...CodecChain) []byte + Decode([]byte) ([]int32, []interface{}, error) + Encode(interface{}) []byte } type CodecChain func(l int, paloay interface{}) @@ -23,7 +23,7 @@ type StreamCodec struct { const STREAM_HEADLEN = 4 -func (s *StreamCodec) Decode(data []byte, chains ...CodecChain) ([]int32, []interface{}, error) { +func (s *StreamCodec) Decode(data []byte) ([]int32, []interface{}, error) { s.context.Write(data) var ret []interface{} = nil @@ -49,18 +49,12 @@ func (s *StreamCodec) Decode(data []byte, chains ...CodecChain) ([]int32, []inte s.msglen = 0 each := d[STREAM_HEADLEN:] - for _, chain := range chains { - chain(len(each), each) - } ret = append(ret, each) } return nil, ret, nil } -func (s *StreamCodec) Encode(data interface{}, chains ...CodecChain) []byte { - for _, chain := range chains { - chain(len(data.([]byte)), data) - } +func (s *StreamCodec) Encode(data interface{}) []byte { d := make([]byte, STREAM_HEADLEN) binary.BigEndian.PutUint32(d, uint32(len(data.([]byte)))) return append(d, data.([]byte)...) diff --git a/src/core/actor/actor_msg/msg_name.go b/src/core/network/msg_handler.go similarity index 53% rename from src/core/actor/actor_msg/msg_name.go rename to src/core/network/msg_handler.go index 07879f9..bd1eec5 100644 --- a/src/core/actor/actor_msg/msg_name.go +++ b/src/core/network/msg_handler.go @@ -1,14 +1,45 @@ -package actor_msg +package network import ( - "reflect" - "sync" - + "core/tools" "google.golang.org/protobuf/proto" "google.golang.org/protobuf/reflect/protoreflect" "google.golang.org/protobuf/reflect/protoregistry" + "reflect" + "sync" ) +/* +按消息/请求的数据类型注册回调 +注意:不是区分具体类型的值 +*/ + +func NewMsgTypeHandler() *MsgTypeHandler { + return &MsgTypeHandler{msgMap: make(map[string]MsgFun)} +} + +type MsgFun func(sourceId, msg interface{}) + +type MsgTypeHandler struct { + msgMap map[string]MsgFun +} + +// 注册消息回调 +func (h *MsgTypeHandler) RegistMsg(msg interface{}, f MsgFun) { + msgName := MsgName(msg) + _, ok := h.msgMap[msgName] + tools.AssertTrue(!ok, "regist repeated msg=%v", msgName) + h.msgMap[msgName] = f +} + +func (h *MsgTypeHandler) HandleMsg(sourceId, msg interface{}) bool { + msgName := MsgName(msg) + handler := h.msgMap[msgName] + tools.AssertTrue(handler != nil, "msg=%v not regist handler", msgName) + handler(sourceId, msg) + return true +} + var _msgName sync.Map // func MsgName(msg interface{}) string { if msg == nil { @@ -36,7 +67,6 @@ func MsgName(msg interface{}) string { _msgName.Store(tp, msgName) return msgName } - func FindMsgByName(msgName string) (protoreflect.MessageType, error) { return protoregistry.GlobalTypes.FindMessageByName(protoreflect.FullName(msgName)) } diff --git a/src/core/network/network_test.go b/src/core/network/network_test.go deleted file mode 100644 index 468edd0..0000000 --- a/src/core/network/network_test.go +++ /dev/null @@ -1,43 +0,0 @@ -package network - -import ( - "math/rand" - "testing" - "time" - - "core/log" - "core/tools" -) - -func TestTcpListen(t *testing.T) { - tools.AssertNil(NewTcpListener("0.0.0.0:8080", - func() ICodec { return &StreamCodec{} }, - func() INetHandler { return &remoteHandler{} }, - ).Listen()) - - for i := 0; i < 50; i++ { - tools.AssertNil(NewTcpClient("192.168.0.128:8080", - func() ICodec { return &StreamCodec{} }, - func() INetHandler { return &remoteHandler{} }, - ).Connect(false)) - } - - time.Sleep(time.Hour) - log.Stop() -} - -type remoteHandler struct { - BaseNetHandler -} - -func (s *remoteHandler) OnSessionCreated() { - s.SendMsg([]byte("hello world")) -} -func (s *remoteHandler) OnSessionClosed() {} - -func (s *remoteHandler) OnRecv(data interface{}) { - s.SendMsg([]byte("hello class")) - if rand.Intn(100000) == 1 { - s.Stop() - } -} diff --git a/src/core/network/prometheus.go b/src/core/network/prometheus.go deleted file mode 100644 index 6ea9be6..0000000 --- a/src/core/network/prometheus.go +++ /dev/null @@ -1,62 +0,0 @@ -package network - -import ( - "core/prometheus" - "google.golang.org/protobuf/proto" -) - -type Prometheus struct { - registry *prometheus.Prometheus - host string - - connect *prometheus.CounterVec // 连接数 - disconnect *prometheus.CounterVec // 断开数 - big_msg *prometheus.HistogramVec // 大消息 - send_histogram *prometheus.HistogramVec // 发包长度 - recv_histogram *prometheus.HistogramVec // 收包长度 -} - -func (this *Prometheus) init(host string) { - this.host = host - subsystem := "session" - this.connect = this.registry.RegCounter(subsystem, "connect", []string{"host"}) - this.disconnect = this.registry.RegCounter(subsystem, "disconnect", []string{"host"}) - this.big_msg = this.registry.RegHistogram(subsystem, "big_msg", []string{"host", "msg"}, []float64{1024, 1024 * 2, 1024 * 4, 1024 * 16, 1024 * 64, 1024 * 256, 1024 * 512, 1024 * 1024, 2 * 1024 * 1024}) - values := [...]float64{16, 32, 64, 128, 512, 1024, 1024 * 4, 1024 * 16, 1024 * 64, 1024 * 512, 2 * 1024 * 1024} - this.send_histogram = this.registry.RegHistogram(subsystem, "send_his", []string{"host"}, values[:]) - this.recv_histogram = this.registry.RegHistogram(subsystem, "recv_his", []string{"host"}, values[:]) -} - -func (this *Prometheus) AddConnect() { - if this != nil { - this.connect.Add(1, this.host) - } -} - -func (this *Prometheus) AddDisconnect() { - if this != nil { - this.disconnect.Add(1, this.host) - } -} - -func (this *Prometheus) AddSendLen(l int, paloay interface{}) { - if this != nil { - this.send_histogram.Observe(float64(l), this.host) - if l > 1024 { - if act, ok := paloay.(proto.Message); ok { - this.big_msg.Observe(float64(l), this.host, string(act.ProtoReflect().Type().Descriptor().FullName())) - } - } - } -} - -func (this *Prometheus) AddRecvLen(l int, paloay interface{}) { - if this != nil { - this.recv_histogram.Observe(float64(l), this.host) - if l > 1024 { - if act, ok := paloay.(proto.Message); ok { - this.big_msg.Observe(float64(l), this.host, string(act.ProtoReflect().Type().Descriptor().FullName())) - } - } - } -} diff --git a/src/core/network/tcpclient.go b/src/core/network/tcpclient.go index a4c9511..3b12b59 100644 --- a/src/core/network/tcpclient.go +++ b/src/core/network/tcpclient.go @@ -9,7 +9,6 @@ import ( "unsafe" "core/goroutine" - "core/log" ) func NewTcpClient(addr string, newCodec func() ICodec, newHanlder func() INetHandler, op ...func(*TcpClient) error) INetClient { @@ -66,7 +65,7 @@ func (s *TcpClient) connect() error { return err } - session := newTcpSession(conn, s.newCodec(), s.newHanlder(), nil) + session := newTcpSession(conn, s.newCodec(), s.newHanlder()) atomic.StorePointer((*unsafe.Pointer)(unsafe.Pointer(&s.session)), unsafe.Pointer(session)) session.start() return nil @@ -105,7 +104,6 @@ func (s *TcpClient) Stop() { s.connMux.Lock() defer s.connMux.Unlock() - log.KV("addr", s.addr).InfoStack(1, "stop client") s.session.Stop() } } diff --git a/src/core/network/tcplisten.go b/src/core/network/tcplisten.go index 2b0f4da..489c890 100644 --- a/src/core/network/tcplisten.go +++ b/src/core/network/tcplisten.go @@ -4,11 +4,6 @@ import ( "net" "strings" "sync/atomic" - - "core/prometheus" - - "core/goroutine" - "core/log" ) func NewTcpListener(addr string, newCodec func() ICodec, newHanlder func() INetHandler, options ...func(*TcpListener) error) INetListener { @@ -32,16 +27,13 @@ type TcpListener struct { running int32 newCodec func() ICodec newHanlder func() INetHandler - prome *Prometheus } func (s *TcpListener) Listen() error { err := s.listen() if err == nil { - log.KV("addr", s.addr).Info("tcp listen success") return nil } - log.KV("addr", s.addr).KV("err", err).Error("tcp listen failed") return err } @@ -52,35 +44,23 @@ func (s *TcpListener) listen() error { } s.listener = listener - goroutine.GoLogic(func() { - for { - if conn, err := listener.Accept(); err != nil { - if strings.Contains(err.Error(), "use of closed network connection") { - break - } - log.KV("addr", s.addr).KV("err", err).Warn("tcp accept error") - } else { - newTcpSession(conn, s.newCodec(), s.newHanlder(), s.prome).start() + for { + if conn, err := listener.Accept(); err != nil { + if strings.Contains(err.Error(), "use of closed network connection") { + break } + } else { + newTcpSession(conn, s.newCodec(), s.newHanlder()).start() } - s.Stop() - }, nil) + } + s.Stop() return nil } func (s *TcpListener) Stop() { if atomic.CompareAndSwapInt32(&s.running, 1, 0) { - log.KV("addr", s.addr).Info("tcp stop listen") if l := s.listener; l != nil { _ = s.listener.Close() } } } - -func WithPrometheus(prome *prometheus.Prometheus) func(l *TcpListener) error { - return func(l *TcpListener) error { - l.prome = &Prometheus{registry: prome} - l.prome.init(l.addr) - return nil - } -} diff --git a/src/core/network/tcpsession.go b/src/core/network/tcpsession.go index bba3b2f..a605698 100644 --- a/src/core/network/tcpsession.go +++ b/src/core/network/tcpsession.go @@ -7,11 +7,10 @@ import ( "core/container/safe/mpsc" "core/goroutine" - "core/log" "go.uber.org/atomic" ) -func newTcpSession(conn net.Conn, coder ICodec, handler INetHandler, prome *Prometheus) *TcpSession { +func newTcpSession(conn net.Conn, coder ICodec, handler INetHandler) *TcpSession { session := &TcpSession{ id: genNetSessionId(), conn: conn, @@ -20,9 +19,7 @@ func newTcpSession(conn net.Conn, coder ICodec, handler INetHandler, prome *Prom handler: handler, sendQue: mpsc.New[interface{}](), notifySend: make(chan struct{}, 1), - prome: prome, } - log.KV("sessionId", session.Id()).KV("local", session.LocalAddr()).KV("remote", session.RemoteAddr()).Debug("new tcp session") handler.setSession(session) return session } @@ -40,8 +37,6 @@ type TcpSession struct { sendQue *mpsc.Queue[interface{}] notifySend chan struct{} sending atomic.Int32 - - prome *Prometheus } func (s *TcpSession) Type() SessionType { return TYPE_TCP } @@ -74,7 +69,6 @@ func (s *TcpSession) Load(key interface{}) (value interface{}, ok bool) { } func (s *TcpSession) start() { - s.prome.AddConnect() goroutine.Try(s.handler.OnSessionCreated, nil) goroutine.GoLogic(s.read, func(ex interface{}) { s.Stop() }) goroutine.GoLogic(s.write, func(ex interface{}) { s.Stop() }) @@ -85,8 +79,6 @@ func (s *TcpSession) Stop() { s.conn.Close() close(s.stopped) goroutine.Try(s.handler.OnSessionClosed, nil) - s.prome.AddDisconnect() - log.KV("sessionId", s.id).Debug("tcp session close") }) } @@ -101,14 +93,12 @@ func (s *TcpSession) read() { buffer := make([]byte, 1024) for { if err := s.conn.SetReadDeadline(time.Now().Add(time.Second * 15)); err != nil { - log.KV("sessionId", s.Id()).KV("err", err).Info("tcp read SetReadDeadline") break } n, err := s.conn.Read(buffer) if err != nil { if e, ok := err.(net.Error); !ok || !e.Timeout() { - log.KV("sessionId", s.Id()).KV("err", err).Info("tcp read buff failed") break } } @@ -117,9 +107,8 @@ func (s *TcpSession) read() { continue } - msgIds, datas, err := s.coder.Decode(buffer[:n], func(l int, paloay interface{}) { s.prome.AddRecvLen(l, paloay) }) + msgIds, datas, err := s.coder.Decode(buffer[:n]) if err != nil { - log.KV("sessionId", s.Id()).KV("err", err).Info("tcp decode failed") break } @@ -138,12 +127,11 @@ loop: case <-s.notifySend: s.sending.Store(0) for data := s.sendQue.Pop(); data != nil; data = s.sendQue.Pop() { - if edata := s.coder.Encode(data, func(l int, paloay interface{}) { s.prome.AddSendLen(l, data) }); edata != nil { + if edata := s.coder.Encode(data); edata != nil { if err = s.conn.SetWriteDeadline(time.Now().Add(time.Second * 5)); err == nil { _, err = s.conn.Write(edata) } if err != nil { - log.KV("sessionId", s.Id()).KV("err", err).Info("tcp session write error") break loop } } diff --git a/src/core/ormdb/db_obj.go b/src/core/ormdb/db_obj.go deleted file mode 100644 index dfe1a7c..0000000 --- a/src/core/ormdb/db_obj.go +++ /dev/null @@ -1,132 +0,0 @@ -package ormdb - -import ( - "encoding/json" - "time" - - "core/log" - "core/tools" -) - -type DBOp int - -const ( - DB_UPDATE DBOp = 0 - DB_INSERT DBOp = 1 - DB_DELETE DBOp = 2 -) - -type IQueSaver interface { - TableName(bean interface{}) string - AddToQue(IDBObj) -} - -type IDBObj interface { - Update() //更新到数据库 - Delete() //从数据库删除 - ObjName() string - OnNewObj(saver IQueSaver, data IDBObj) - OnLoadObj(saver IQueSaver, data IDBObj) - QueId() int64 - - setOp(op DBOp) - getOp() DBOp - getObjId() int64 //数据库唯一标识 - getQueId(queNum int) int - private() *DBObjBase - copyPrivate(cp *DBObjBase) -} - -type DBObjBase struct { - ObjId int64 `xorm:"not null pk unique index"` - CreatedAt int64 `xorm:"BIGINT(20)"` - - saver IQueSaver - data IDBObj - op DBOp - queId int -} - -func (this *DBObjBase) ObjName() string { - return this.saver.TableName(this.data) -} - -func (this *DBObjBase) QueId() int64 { - return this.ObjId -} - -func (this *DBObjBase) ObjIdStr() string { - return tools.Itoa64(this.ObjId) -} - -func (this *DBObjBase) Update() { - if this.op == DB_DELETE { - data, _ := json.Marshal(this.data) - log.KV("table", this.ObjName()).KV("data", string(data)).ErrorStack(1, "update failed, has call delete") - return - } - this.saver.AddToQue(this.data) -} - -func (this *DBObjBase) Delete() { - if this.op == DB_DELETE { - data, _ := json.Marshal(this.data) - log.KV("table", this.ObjName()).KV("data", string(data)).ErrorStack(1, "delete failed, has call delete") - return - } - this.op = DB_DELETE - this.saver.AddToQue(this.data) -} - -func (this *DBObjBase) OnNewObj(saver IQueSaver, data IDBObj) { - this.saver = saver - this.data = data - this.op = DB_INSERT - this.queId = -1 - this.ObjId = tools.SnowflakeID() - this.CreatedAt = time.Now().Unix() -} - -func (this *DBObjBase) OnLoadObj(saver IQueSaver, data IDBObj) { - this.saver = saver - this.data = data - this.op = DB_UPDATE - this.queId = -1 -} - -func (this *DBObjBase) getOp() DBOp { return this.op } -func (this *DBObjBase) setOp(op DBOp) { this.op = op } -func (this *DBObjBase) getObjId() int64 { return this.ObjId } -func (this *DBObjBase) getQueId(queNum int) int { - if this.queId >= 0 { - return this.queId - } - this.queId = int(uint64Hash(uint64(this.data.QueId())) % uint64(queNum)) - return this.queId -} -func (this *DBObjBase) private() *DBObjBase { return this } -func (this *DBObjBase) copyPrivate(cp *DBObjBase) { - this.saver = cp.saver - this.data = cp.data - this.op = cp.op - this.queId = cp.queId -} - -// https://github.com/orcaman/concurrent-map.fnv32(key string) uint32 -// nolint -func fnv32(key string) uint32 { - id := uint32(2166136261) - const prime32 = uint32(16777619) - for i := 0; i < len(key); i++ { - id *= prime32 - id ^= uint32(key[i]) - } - return id -} - -func uint64Hash(x uint64) uint64 { - x = (x ^ (x >> 30)) * uint64(0xbf58476d1ce4e5b9) - x = (x ^ (x >> 27)) * uint64(0x94d049bb133111eb) - x = x ^ (x >> 31) - return x -} diff --git a/src/core/ormdb/db_queue.go b/src/core/ormdb/db_queue.go deleted file mode 100644 index d25af04..0000000 --- a/src/core/ormdb/db_queue.go +++ /dev/null @@ -1,285 +0,0 @@ -package ormdb - -import ( - "encoding/json" - "reflect" - "strconv" - "sync" - "time" - - "xorm.io/xorm" - - "core/abtime" - "core/goroutine" - "core/log" - "core/tools" -) - -func newDBQueueManager(ormMgr *MysqlEngine, queNum int) *DBQueueManager { - mgr := &DBQueueManager{ - ormMgr: ormMgr, - dbQues: make(map[int]*DBQueue), - dbQueNum: queNum, - stopCh: make(chan struct{}), - } - - mgr.init() - return mgr -} - -type DBQueueManager struct { - ormMgr *MysqlEngine - dbQues map[int]*DBQueue - dbQueNum int - stopWait sync.WaitGroup - stopCh chan struct{} -} - -func (qm *DBQueueManager) init() { - for idx := 0; idx < qm.dbQueNum; idx++ { - que := newDBQueue(idx, qm.ormMgr) - qm.dbQues[idx] = que - qm.stopWait.Add(1) - goroutine.GoLogic(func() { que.loop(qm.stopCh); qm.stopWait.Done() }, nil) - } -} - -func (qm *DBQueueManager) add(dbObj IDBObj) { - qm.dbQues[dbObj.getQueId(qm.dbQueNum)].add(dbObj) -} - -func (qm *DBQueueManager) flush(force bool) { - for _, dbQue := range qm.dbQues { - dbQue.flush(force) - } -} - -func (qm *DBQueueManager) stop() { - log.Info("dbqueue close start") - qm.flush(true) - close(qm.stopCh) - qm.stopWait.Wait() - log.Info("dbqueue close over") -} - -func newDBQueue(qid int, ormMgr *MysqlEngine) *DBQueue { - que := &DBQueue{ - id: qid, - idStr: strconv.Itoa(qid), - cache: newQueueX(), - merge: newQueueX(), - ormMgr: ormMgr, - } - que.speed.init(ormMgr.flushInterval) - return que -} - -type DBQueue struct { - id int - idStr string - cache *QueueX - merge *QueueX - dbSession *xorm.Session - ormMgr *MysqlEngine - speed SaveSpeed -} - -func (dq *DBQueue) add(dbObj IDBObj) { - if dbObj.getObjId() == 0 { - log.ErrorStack(3, "dbqueue model has no objId") - return - } - dq.merge.ReplaceOrPushBack(dbObj) -} - -func (dq *DBQueue) flush(force bool) { - flushCount := dq.speed.flushCount(dq.merge.Length(), dq.cache.Length()) - for force || flushCount > 0 { - dbObj := dq.merge.PopFront() - if dbObj == nil { - break - } - dq.copy(dbObj) - flushCount-- - } - - dq.ormMgr.prome.record_quelen(dq.idStr, dq.cache.Length()) - dq.ormMgr.prome.record_mergelen(dq.idStr, dq.merge.Length()) -} - -func (dq *DBQueue) copy(dbObj IDBObj) { - clone := tools.DeepCopy(dbObj).(IDBObj) - clone.copyPrivate(dbObj.private()) - dq.cache.ReplaceOrPushBack(clone) - if dbObj.getOp() == DB_INSERT { - dbObj.setOp(DB_UPDATE) - } -} - -func (dq *DBQueue) checkSession() { - const ( - MAX_CHECK_TIMES = 3 - - STATE_INIT = 0 - STATE_FAILED = 1 - STATE_OK = 2 - ) - - checkTimes := 0 - dq.ormMgr.prome.record_sessionstate(dq.idStr, STATE_INIT) - var err error - for { - if dq.dbSession == nil { - dq.dbSession, err = dq.ormMgr.NewSession() - } else { - err = dq.dbSession.Ping() - } - - if err == nil { - break - } - dq.ormMgr.prome.record_sessionstate(dq.idStr, STATE_FAILED) - log.KV("id", dq.id).KV("err", err).Error("db session is closed") - - dq.dbSession.Close() - dq.dbSession = nil - - if checkTimes >= MAX_CHECK_TIMES { - log.KV("id", dq.id).KV("err", err).Error("db connect failed") - time.Sleep(time.Minute) - } - time.Sleep(time.Second * time.Duration(checkTimes) * 5) - checkTimes++ - } - dq.ormMgr.prome.record_sessionstate(dq.idStr, STATE_OK) -} - -func (dq *DBQueue) loop(stopCh <-chan struct{}) { - ticker := time.NewTicker(dq.speed.saveTicker()) - defer ticker.Stop() -loop: - for { - select { - case <-ticker.C: - goroutine.Try(func() { dq.saveQue(dq.speed.persistentCount(dq.cache.Length())) }, nil) - case <-stopCh: - log.KV("que_id", dq.id).KV("count", dq.cache.Length()).Info("dbqueue close start") - goroutine.Try(func() { dq.saveQue(-1) }, nil) - break loop - } - } - log.KV("que_id", dq.id).KV("count", dq.cache.Length()).Info("dbqueue close over") -} - -func (dq *DBQueue) saveQue(saveCount int) { - dq.checkSession() - - start := abtime.Now().UnixNano() - count := 0 - defer func() { dq.speed.add(start, count) }() - - will := []IDBObj{} //暂存,避免失败又放回去,PopFront死循环 - for { - obj := dq.cache.PopFront() - if obj == nil { - break - } - will = append(will, obj) - if saveCount > 0 && len(will) >= saveCount { - break - } - } - count = len(will) - - for _, obj := range will { - goroutine.Try(func() { - if err := dq.save(obj); err != nil { - dq.cache.PushBackIfNotExist(obj) - } - }, func(ex interface{}) { - data, _ := json.Marshal(obj) - log.KV("ex", ex).KV("table", obj.ObjName()).KV("op", obj.getOp()).KV("data", string(data)).Error("dbobj save crash") - dq.cache.PushBackIfNotExist(obj) - dq.ormMgr.prome.record_error(obj.ObjName()) - }) - } - dq.ormMgr.prome.record_quelen(dq.idStr, dq.cache.Length()) -} - -func (dq *DBQueue) save(obj IDBObj) (err error) { - table := obj.ObjName() - - if obj.getOp() == DB_INSERT { - _, err = dq.dbSession.Insert(obj) - } else if obj.getOp() == DB_UPDATE { - _, err = dq.dbSession.AllCols().Where("obj_id=?", obj.getObjId()).Update(obj) - } else if obj.getOp() == DB_DELETE { - clean := reflect.New(reflect.TypeOf(obj).Elem()) //解决obj带入额外条件参数 - _, err = dq.dbSession.Where("obj_id=?", obj.getObjId()).Delete(clean) - } - - if err != nil { - dq.ormMgr.prome.record_error(table) - data, _ := json.Marshal(obj) - log.KV("err", err).KV("table", table).KV("op", obj.getOp()).KV("data", string(data)).Error("dbobj save failed") - } else { - dq.ormMgr.prome.record_success(table) - } - return err -} - -const SpeedSampleNum = 6 //计算回存速率样本数 -type SaveSpeed struct { - sample [SpeedSampleNum]int - index int - total int - flushScale float64 -} - -func (this *SaveSpeed) init(flushInverval time.Duration) { - const InitSpeed = 10 - for i := 0; i < SpeedSampleNum; i++ { - this.sample[i] = InitSpeed - this.total += this.sample[i] - } - this.flushScale = float64(flushInverval) / float64(this.saveTicker()) -} - -func (this *SaveSpeed) avg() int { return this.total / SpeedSampleNum } -func (this *SaveSpeed) saveTicker() time.Duration { return time.Second } -func (this *SaveSpeed) add(start int64, count int) { - dis := abtime.Now().UnixNano() - start - if count <= 0 || dis <= 0 { - return - } - - num := int(float64(time.Second) / float64(dis) * float64(count)) - this.index++ - if this.index >= SpeedSampleNum { - this.index = 0 - } - this.total += num - this.total -= this.sample[this.index] - this.sample[this.index] = num -} - -// deepcoy数量 -func (this *SaveSpeed) flushCount(mergeCount, cacheCount int) int { - count := int(float64(mergeCount) / 10 * this.flushScale) //至多1/x - avg := int(float64(this.avg()) * this.flushScale) - avg = tools.MaxInt(5, avg) - if ratio := cacheCount / avg; ratio > 3 { - count = tools.MinInt(avg/ratio, count) //至多avg的1/ratio - } else { - count = tools.MinInt(avg, count) //至多avg - } - count = tools.MaxInt(int(5*this.flushScale), count) //至少5 - return count -} - -// 入库数量 -func (this *SaveSpeed) persistentCount(cacheCount int) int { - count := tools.MinInt(this.avg(), cacheCount) //至多avg - count = tools.MaxInt(20, count) //至少20 - return count -} diff --git a/src/core/ormdb/logger.go b/src/core/ormdb/logger.go deleted file mode 100644 index 625161c..0000000 --- a/src/core/ormdb/logger.go +++ /dev/null @@ -1,84 +0,0 @@ -package ormdb - -import ( - "fmt" - - "core/log" - xlog "xorm.io/xorm/log" -) - -func NewXormLogger(database string) *xormLogger { return &xormLogger{database: database} } - -type xormLogger struct { - level xlog.LogLevel - showSQL bool - database string -} - -func (s *xormLogger) Debug(v ...interface{}) { - if s.level <= xlog.LOG_DEBUG { - log.KV("db", s.database).DebugStack(2, fmt.Sprint(v...)) - } -} - -func (s *xormLogger) Debugf(format string, v ...interface{}) { - if s.level <= xlog.LOG_DEBUG { - log.KV("db", s.database).DebugStack(2, fmt.Sprintf(format, v...)) - } -} - -func (s *xormLogger) Error(v ...interface{}) { - if s.level <= xlog.LOG_ERR { - log.KV("db", s.database).ErrorStack(2, fmt.Sprint(v...)) - } -} - -func (s *xormLogger) Errorf(format string, v ...interface{}) { - if s.level <= xlog.LOG_ERR { - log.KV("db", s.database).ErrorStack(2, fmt.Sprintf(format, v...)) - } -} - -func (s *xormLogger) Info(v ...interface{}) { - if s.level <= xlog.LOG_INFO { - log.KV("db", s.database).InfoStack(2, fmt.Sprint(v...)) - } -} - -func (s *xormLogger) Infof(format string, v ...interface{}) { - if s.level <= xlog.LOG_INFO { - log.KV("db", s.database).InfoStack(2, fmt.Sprintf(format, v...)) - } -} - -func (s *xormLogger) Warn(v ...interface{}) { - if s.level <= xlog.LOG_WARNING { - log.KV("db", s.database).WarnStack(2, fmt.Sprint(v...)) - } -} - -func (s *xormLogger) Warnf(format string, v ...interface{}) { - if s.level <= xlog.LOG_WARNING { - log.KV("db", s.database).WarnStack(2, fmt.Sprintf(format, v...)) - } -} - -func (s *xormLogger) Level() xlog.LogLevel { - return s.level -} - -func (s *xormLogger) SetLevel(lv xlog.LogLevel) { - s.level = lv -} - -func (s *xormLogger) ShowSQL(show ...bool) { - if len(show) == 0 { - s.showSQL = true - return - } - s.showSQL = show[0] -} - -func (s *xormLogger) IsShowSQL() bool { - return s.showSQL -} diff --git a/src/core/ormdb/mgr_orm.go b/src/core/ormdb/mgr_orm.go deleted file mode 100644 index dcef557..0000000 --- a/src/core/ormdb/mgr_orm.go +++ /dev/null @@ -1,292 +0,0 @@ -package ormdb - -import ( - "database/sql" - "errors" - "fmt" - "reflect" - "runtime" - "sync" - "sync/atomic" - "time" - - "core/abtime" - "core/goroutine" - "core/log" - "core/prometheus" - "core/tools" - "github.com/go-sql-driver/mysql" - "xorm.io/xorm" - xlog "xorm.io/xorm/log" - "xorm.io/xorm/names" -) - -func New(mysqlDSN string, options ...func(*MysqlEngine) error) (*MysqlEngine, error) { - engine := &MysqlEngine{objs: make(map[string]IDBObj), pageSize: 200000, queNum: 4} - for _, option := range options { - if err := option(engine); err != nil { - return nil, err - } - } - if err := engine.init(mysqlDSN); err != nil { - return nil, err - } - return engine, nil -} - -func WithPrometheus(prome *prometheus.Prometheus) func(engine *MysqlEngine) error { - return func(engine *MysqlEngine) error { - engine.prome = &Prometheus{registry: prome} - return nil - } -} - -func WithFlushInterval(interval time.Duration) func(engine *MysqlEngine) error { - return func(engine *MysqlEngine) error { - engine.flushInterval = interval - return nil - } -} - -func WithPageSize(pageSize int64) func(engine *MysqlEngine) error { - return func(engine *MysqlEngine) error { - engine.pageSize = pageSize - return nil - } -} - -func WithQueNum(queNum int64) func(engine *MysqlEngine) error { - return func(engine *MysqlEngine) error { - engine.queNum = queNum - return nil - } -} - -type MysqlEngine struct { - engine *xorm.Engine - database string - objs map[string]IDBObj - queMgr *DBQueueManager - prome *Prometheus - flushInterval time.Duration - pageSize int64 - queNum int64 -} - -func (this *MysqlEngine) init(mysqlDSN string) error { - if err := this.createDatabase(mysqlDSN); err != nil { - return err - } - - if err := this.connectDatabase(mysqlDSN); err != nil { - return err - } - this.prome.init(this.database) - this.queMgr = newDBQueueManager(this, int(this.queNum)) - return nil -} - -func (this *MysqlEngine) Stop() { - this.queMgr.stop() -} - -func (this *MysqlEngine) Engine() *xorm.Engine { return this.engine } -func (this *MysqlEngine) NewSession() (*xorm.Session, error) { - if this.engine == nil { - log.Error("xorm has not init") - return nil, errors.New("xorm has not init") - } - - session := this.engine.NewSession() - if err := session.Ping(); err != nil { - log.KV("err", err).ErrorStack(2, "new db session not connect") - return nil, fmt.Errorf("new session failed:%v", err) - } - return session, nil -} - -func (this *MysqlEngine) RegistTable(dbObj IDBObj) { this.objs[this.engine.TableName(dbObj)] = dbObj } -func (this *MysqlEngine) TableName(bean interface{}) string { return this.engine.TableName(bean) } -func (this *MysqlEngine) RangeTables(f func(IDBObj) (stop bool)) { - for _, dbObj := range this.objs { - if f(dbObj) { - return - } - } -} - -func (this *MysqlEngine) Flush(force bool) { this.queMgr.flush(force) } -func (this *MysqlEngine) AddToQue(dbObj IDBObj) { this.queMgr.add(dbObj) } - -func (s *MysqlEngine) createDatabase(mysqlDSN string) error { - dsn, err := mysql.ParseDSN(mysqlDSN) - if err != nil { - log.KV("err", err).Error("mysql ParseDSN failed") - return err - } - s.database = dsn.DBName - dsn.DBName = "" - - mysql, err := sql.Open("mysql", dsn.FormatDSN()) - if err != nil { - log.KV("database", dsn.DBName).KV("host", dsn.Addr).KV("err", err).Error("mysql connect failed") - return err - } - defer mysql.Close() - - sql := fmt.Sprintf("CREATE DATABASE IF NOT EXISTS `%s` DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci", s.database) - _, err = mysql.Exec(sql) - if err == nil { - log.KV("database", s.database).KV("host", dsn.Addr).Debug("mysql create database success") - } else { - log.KV("database", s.database).KV("host", dsn.Addr).KV("err", err).KV("sql", sql).Error("mysql create database failed") - } - return err -} - -func (s *MysqlEngine) connectDatabase(mysqlDSN string) error { - engine, err := xorm.NewEngine("mysql", mysqlDSN) - if err != nil { - log.KV("err", err).Error("connect mysql failed") - return err - } - - engine.SetLogger(NewXormLogger(s.database)) - engine.SetLogLevel(xlog.LOG_WARNING) - engine.SetTableMapper(names.GonicMapper{}) - engine.SetColumnMapper(names.GonicMapper{}) - engine.SetMaxIdleConns(runtime.NumCPU()) - engine.DB().SetConnMaxIdleTime(time.Minute) - engine.SetMaxOpenConns(runtime.NumCPU() * 4) - - err = engine.Ping() - - if err != nil { - log.KV("database", s.database).KV("err", err).Error("connect mysql failed") - return err - } - log.KV("database", s.database).Info("connect mysql success") - s.engine = engine - return nil -} - -func (s *MysqlEngine) Count(beanPtr IDBObj, wraper func(*xorm.Session) *xorm.Session) (int64, error) { - session, err := s.NewSessionWithWraper(wraper) - if err != nil { - return 0, err - } - defer session.Close() - - count, err := session.Count(beanPtr) - return count, err -} - -func (s *MysqlEngine) LoadAll(beanPtr IDBObj, wraper func(*xorm.Session) *xorm.Session) (interface{}, error) { - session, err := s.NewSessionWithWraper(wraper) - if err != nil { - return nil, err - } - defer session.Close() - - tableName := s.TableName(beanPtr) - log.KV("database", s.database).KV("model", tableName).InfoStack(2, "start load all") - defer tools.TimeCostLog(abtime.Now(), 0, tableName) - - data := reflect.New(reflect.SliceOf(reflect.TypeOf(beanPtr))) - if err := session.Find(data.Interface(), beanPtr); err != nil { - return nil, err - } - return data.Elem().Interface(), nil -} - -func (s *MysqlEngine) PageLoad(beanPtr IDBObj, wraper func(*xorm.Session) *xorm.Session) (interface{}, error) { - tableName := s.TableName(beanPtr) - log.KV("database", s.database).KV("model", tableName).InfoStack(2, "start page load") - defer tools.TimeCostLog(abtime.Now(), 0, tableName) - - countSession, err := s.NewSessionWithWraper(wraper) - if err != nil { - return 0, err - } - pageCount, pageSize, err := s.getPageInfo(s.pageSize, reflect.New(reflect.TypeOf(beanPtr).Elem()).Interface(), countSession) - countSession.Close() - if err != nil { - return nil, err - } - - var wg sync.WaitGroup - var lock sync.Mutex - - result := reflect.MakeSlice(reflect.SliceOf(reflect.TypeOf(beanPtr)), 0, 0) - - errorOnce := int32(0) - for i := 0; i < pageCount; i++ { - wg.Add(1) - index := i - - goroutine.GoLogic(func() { - loadSession, nerr := s.NewSessionWithWraper(wraper) - if nerr != nil { - if atomic.CompareAndSwapInt32(&errorOnce, 0, 1) { - err = nerr - } - } - defer loadSession.Close() - - data := reflect.New(reflect.SliceOf(reflect.TypeOf(beanPtr))) - if lerr := loadSession.Asc(s.engine.GetColumnMapper().Obj2Table("ObjId")).Limit(pageSize, index*pageSize).Find(data.Interface(), beanPtr); lerr != nil { - if atomic.CompareAndSwapInt32(&errorOnce, 0, 1) { - err = lerr - } - wg.Done() - return - } - - lock.Lock() - defer lock.Unlock() - - result = reflect.AppendSlice(result, data.Elem()) - wg.Done() - }, func(ex interface{}) { - err = fmt.Errorf("panic on database=%v table=%v", s.database, s.TableName(beanPtr)) - wg.Done() - }) - } - wg.Wait() - return result.Interface(), err -} - -func (s *MysqlEngine) getPageInfo(maxSize int64, beanPtr interface{}, session *xorm.Session) (pageCount int, pageSize int, err error) { - total, err := session.Count(beanPtr) - if err != nil { - return - } - - if total > maxSize { - pageSize = int(maxSize) - pageCount = int(total / maxSize) - if total%maxSize != 0 { - pageCount += 1 - } - } else { - pageCount = 1 - pageSize = int(total) - } - return -} - -func (s *MysqlEngine) NewSessionWithWraper(sessionWraper func(*xorm.Session) *xorm.Session) (*xorm.Session, error) { - session, err := s.NewSession() - if err != nil { - return nil, err - } - - if sessionWraper != nil { - session = sessionWraper(session) - } - return session, nil -} - -func (s *MysqlEngine) CreateTable(beans ...interface{}) error { - return s.engine.Charset("utf8mb4").Sync2(beans...) -} diff --git a/src/core/ormdb/prometheus.go b/src/core/ormdb/prometheus.go deleted file mode 100644 index 78ecc0c..0000000 --- a/src/core/ormdb/prometheus.go +++ /dev/null @@ -1,38 +0,0 @@ -package ormdb - -import ( - "core/prometheus" -) - -type Prometheus struct { - registry *prometheus.Prometheus - database string - - error *prometheus.CounterVec //回存报错 - success *prometheus.CounterVec //回存成功 - queLen *prometheus.GaugeVec //回存队列长度 - mergeLen *prometheus.GaugeVec //等待合并长度 - sessionState *prometheus.GaugeVec //连接状态 -} - -func (this *Prometheus) init(database string) { - this.database = database - subsystem := "mysql" - this.error = this.registry.RegCounter(subsystem, "error", []string{"database", "table"}) - this.success = this.registry.RegCounter(subsystem, "success", []string{"database", "table"}) - this.queLen = this.registry.RegGauge(subsystem, "que_len", []string{"database", "que"}) - this.mergeLen = this.registry.RegGauge(subsystem, "merge_len", []string{"database", "que"}) - this.sessionState = this.registry.RegGauge(subsystem, "session", []string{"database", "que"}) -} - -func (this *Prometheus) record_error(table string) { this.error.Inc(this.database, table) } -func (this *Prometheus) record_success(table string) { this.success.Inc(this.database, table) } -func (this *Prometheus) record_quelen(queId string, l int) { - this.queLen.Set(float64(l), this.database, queId) -} -func (this *Prometheus) record_mergelen(queId string, l int) { - this.mergeLen.Set(float64(l), this.database, queId) -} -func (this *Prometheus) record_sessionstate(queId string, state int64) { - this.sessionState.Set(float64(state), this.database, queId) -} diff --git a/src/core/ormdb/queue_x.go b/src/core/ormdb/queue_x.go deleted file mode 100644 index 4e7c266..0000000 --- a/src/core/ormdb/queue_x.go +++ /dev/null @@ -1,152 +0,0 @@ -package ormdb - -import ( - "sync" -) - -const minQueueXLen = 4096 - -type QueueX struct { - buf []IDBObj - dict map[int64]int - bufLen int - head, tail, count int - mux sync.RWMutex -} - -func newQueueX() *QueueX { - return &QueueX{buf: make([]IDBObj, minQueueXLen), bufLen: minQueueXLen, dict: map[int64]int{}} -} - -func (q *QueueX) Length() int { - q.mux.RLock() - defer q.mux.RUnlock() - - if q.count < 0 { - return 0 - } - return q.count -} - -// 2倍缩放 -func (q *QueueX) resize() { - if q.count < minQueueXLen { - return - } - - if q.count == q.bufLen || (q.count<<2) == q.bufLen { - newBuf := make([]IDBObj, q.count<<1) - if q.tail > q.head { - copy(newBuf, q.buf[q.head:q.tail]) - } else { - n := copy(newBuf, q.buf[q.head:]) - copy(newBuf[n:], q.buf[:q.tail]) - } - q.head = 0 - q.tail = q.count - q.buf = newBuf - q.bufLen = len(newBuf) - - q.dict = map[int64]int{} - for i := 0; i < q.tail; i++ { - q.dict[q.buf[i].getObjId()] = i - } - } -} - -// 追加到队尾 -func (q *QueueX) PushBack(elem IDBObj) { - q.mux.Lock() - defer q.mux.Unlock() - - q.pushBack(elem) -} - -func (q *QueueX) pushBack(elem IDBObj) { - q.resize() - - q.buf[q.tail] = elem - q.dict[elem.getObjId()] = q.tail - q.tail = (q.tail + 1) & (q.bufLen - 1) - q.count++ -} - -func (q *QueueX) ReplaceOrPushBack(elem IDBObj) { - q.mux.Lock() - defer q.mux.Unlock() - - if i, ok := q.dict[elem.getObjId()]; ok { - if q.buf[i].getOp() == DB_INSERT && elem.getOp() != DB_DELETE { - elem.setOp(DB_INSERT) - } - q.buf[i] = elem - } else { - q.pushBack(elem) - } -} - -func (q *QueueX) PushBackIfNotExist(elem IDBObj) { - q.mux.Lock() - defer q.mux.Unlock() - - if _, ok := q.dict[elem.getObjId()]; !ok { - q.pushBack(elem) - } -} - -// 弹出队头 -func (q *QueueX) PopFront() IDBObj { - q.mux.Lock() - defer q.mux.Unlock() - - if q.count <= 0 { - return nil - } - ret := q.buf[q.head] - delete(q.dict, ret.getObjId()) - q.buf[q.head] = nil - q.head = (q.head + 1) & (q.bufLen - 1) - q.count-- - return ret -} - -//返回队头 -func (q *QueueX) Front() IDBObj { - q.mux.RLock() - defer q.mux.RUnlock() - - if q.count <= 0 { - return nil - } - return q.buf[q.head] -} - -//返回队头 -func (q *QueueX) Back() IDBObj { - return q.Get(q.count - 1) -} - -// 正数队头遍历,负数队尾遍历 -func (q *QueueX) Get(i int) IDBObj { - q.mux.RLock() - defer q.mux.RUnlock() - - if i < 0 { - i += q.count - } - - if i < 0 || i >= q.count { - return nil - } - return q.buf[(q.head+i)&(q.bufLen-1)] -} - -func (q *QueueX) Find(key int64) IDBObj { - q.mux.RLock() - defer q.mux.RUnlock() - - if i, ok := q.dict[key]; ok { - return q.buf[i] - } - return nil -} diff --git a/src/core/ormdb/queue_x_test.go b/src/core/ormdb/queue_x_test.go deleted file mode 100644 index 3efd8a9..0000000 --- a/src/core/ormdb/queue_x_test.go +++ /dev/null @@ -1,35 +0,0 @@ -package ormdb - -import ( - "fmt" - "testing" -) - -type Data struct { - DBObjBase `json:"-" xorm:"-"` - ObjId string - Num int -} - -func (d *Data) GetObjId() string { - return d.ObjId -} - -func (this *Data) Update() {} -func (this *Data) Delete() {} - -func TestNewQueueX(t *testing.T) { - que := newQueueX() - - que.ReplaceOrPushBack(&Data{ObjId: "1", Num: 1}) - que.ReplaceOrPushBack(&Data{ObjId: "2", Num: 2}) - fmt.Println(que.PopFront()) - fmt.Println(que.PopFront()) - que.ReplaceOrPushBack(&Data{ObjId: "1", Num: 1}) - que.ReplaceOrPushBack(&Data{ObjId: "2", Num: 2}) - que.ReplaceOrPushBack(&Data{ObjId: "3", Num: 3}) - fmt.Println(que.PopFront()) - fmt.Println(que.PopFront()) - fmt.Println(que.PopFront()) - fmt.Println(que.PopFront()) -} diff --git a/src/core/prometheus/prometheus.go b/src/core/prometheus/prometheus.go deleted file mode 100644 index e8d3728..0000000 --- a/src/core/prometheus/prometheus.go +++ /dev/null @@ -1,138 +0,0 @@ -package prometheus - -import ( - "fmt" - "net/http" - "sync" - "time" - - "core/log" - "github.com/prometheus/client_golang/prometheus" - "github.com/prometheus/client_golang/prometheus/promhttp" -) - -var _default = NewPrometheus("prs") - -func Default() *Prometheus { return _default } - -func NewPrometheus(namespace string) *Prometheus { - return &Prometheus{ - namespace: namespace, - registry: prometheus.NewRegistry(), - } -} - -type Prometheus struct { - namespace string - regist sync.Map - registry *prometheus.Registry -} - -// 在服务中内嵌一个Prometheus的http服务 -func (p *Prometheus) Start(host string) *Prometheus { - go func() { - server := http.NewServeMux() - server.Handle("/metrics", promhttp.InstrumentMetricHandler(p.registry, promhttp.HandlerFor(p.registry, promhttp.HandlerOpts{ErrorLog: &promeLogger{}}))) - log.KV("addr", host).Info("prometheus http start") - err := http.ListenAndServe(host, server) // start an http server using the mux server - if err != nil { - log.KV("err", err).Warn("prometheus http stop") - } - }() - return p -} - -// 计数器(累加指标) -func (s *Prometheus) RegCounter(subsystem, name string, labels []string) *CounterVec { - vec := prometheus.NewCounterVec(prometheus.CounterOpts{ - Namespace: s.namespace, Subsystem: subsystem, Name: name}, - labels, - ) - return s.register(subsystem, name, &CounterVec{vec}).(*CounterVec) -} - -// 计量器(当前值指标) -func (s *Prometheus) RegGauge(subsystem, name string, labels []string) *GaugeVec { - vec := prometheus.NewGaugeVec(prometheus.GaugeOpts{ - Namespace: s.namespace, Subsystem: subsystem, Name: name}, - labels, - ) - return s.register(subsystem, name, &GaugeVec{vec}).(*GaugeVec) -} - -// 分布图(直方图) -func (s *Prometheus) RegHistogram(subsystem, name string, labels []string, buckets []float64) *HistogramVec { - vec := prometheus.NewHistogramVec(prometheus.HistogramOpts{ - Namespace: s.namespace, Subsystem: subsystem, Name: name, Buckets: buckets}, - labels, - ) - return s.register(subsystem, name, &HistogramVec{vec}).(*HistogramVec) -} - -// 摘要(概略图) -func (s *Prometheus) RegSummary(subsystem, name string, labels []string, objectives map[float64]float64, maxAge time.Duration, ageBuckets, bufCap uint32) *SummaryVec { - vec := prometheus.NewSummaryVec(prometheus.SummaryOpts{ - Namespace: s.namespace, Subsystem: subsystem, Name: name, Objectives: objectives, MaxAge: maxAge, AgeBuckets: ageBuckets, BufCap: bufCap}, - labels, - ) - return s.register(subsystem, name, &SummaryVec{vec}).(*SummaryVec) -} - -func (p *Prometheus) register(subsystem, name string, c prometheus.Collector) prometheus.Collector { - key := fmt.Sprintf("%s/%s/%s", p.namespace, subsystem, name) - if old, load := p.regist.LoadOrStore(key, c); load { - //log.KV("key", key).InfoStack(2, "prometheus regist same key") - return old.(prometheus.Collector) - } - p.registry.MustRegister(c) - return c -} - -type promeLogger struct{} - -func (pl *promeLogger) Println(v ...interface{}) { - log.KV("msg", fmt.Sprintln(v...)).Warn("prometheus error happen") -} - -type ( - CounterVec struct{ *prometheus.CounterVec } - GaugeVec struct{ *prometheus.GaugeVec } - HistogramVec struct{ *prometheus.HistogramVec } - SummaryVec struct{ *prometheus.SummaryVec } -) - -func (s *CounterVec) Inc(lvs ...string) { - m, err := s.GetMetricWithLabelValues(lvs...) - if err != nil { - log.KV("err", err).WarnStack(1, "counter inc failed") - return - } - m.Inc() -} - -func (s *CounterVec) Add(val float64, lvs ...string) { - m, err := s.GetMetricWithLabelValues(lvs...) - if err != nil { - log.KV("err", err).WarnStack(1, "counter add failed") - return - } - m.Add(val) -} - -func (s *GaugeVec) Set(val float64, lvs ...string) { - m, err := s.GetMetricWithLabelValues(lvs...) - if err != nil { - log.KV("err", err).WarnStack(1, "gauge set failed") - return - } - m.Set(val) -} - -func (s *HistogramVec) Observe(val float64, lvs ...string) { - m, err := s.GetMetricWithLabelValues(lvs...) - if err != nil { - log.KV("err", err).WarnStack(1, "histogram observe failed") - return - } - m.Observe(val) -} diff --git a/src/core/tools/compress.go b/src/core/tools/compress.go deleted file mode 100644 index f5ecac7..0000000 --- a/src/core/tools/compress.go +++ /dev/null @@ -1,48 +0,0 @@ -package tools - -import ( - "bytes" - "compress/gzip" - "io" - - "core/log" -) - -func StringGZIPEncode(data string) (result []byte) { - buffer := bytes.Buffer{} - gzipwr := gzip.NewWriter(&buffer) - if gzipwr == nil { - log.Error("StringGZIPEncode failed gzipwr is nil") - return - } - - _, err := gzipwr.Write([]byte(data)) - if err != nil { - log.KV("err", err).Error("StringGZIPEncode failed") - return - } - - err = gzipwr.Close() - if err != nil { - log.KV("err", err).Error("StringGZIPEncode failed") - return - } - return buffer.Bytes() -} - -func StringGZIPDecode(data []byte) (result string) { - buffer := bytes.Buffer{} - gziprr, err := gzip.NewReader(bytes.NewBuffer(data)) - if err != nil || gziprr == nil { - log.KV("err", err).Error("StringGZIPDecode failed") - return - } - defer gziprr.Close() - - _, err = io.Copy(&buffer, gziprr) - if err != nil { - log.KV("err", err).Error("StringGZIPDecode failed err %v") - return - } - return buffer.String() -} diff --git a/src/core/tools/deepcopy.go b/src/core/tools/deepcopy.go index 1c9d44c..c7f11c1 100644 --- a/src/core/tools/deepcopy.go +++ b/src/core/tools/deepcopy.go @@ -6,7 +6,7 @@ import ( "time" ) -//both function should call with input type of struct or pointer of struct +// both function should call with input type of struct or pointer of struct func DeepCopy(origin interface{}) interface{} { if origin == nil { return nil @@ -36,7 +36,7 @@ func copyRecursive(original, cpy reflect.Value) { cpy.Set(reflect.New(originalValue.Type())) copyRecursive(originalValue, cpy.Elem()) case reflect.Interface: - // get the value for the interface, not the pointer. + // get the value for the in_obj, not the pointer. originalValue := original.Elem() if !originalValue.IsValid() { return diff --git a/src/core/tools/email.go b/src/core/tools/email.go deleted file mode 100644 index 8560bd7..0000000 --- a/src/core/tools/email.go +++ /dev/null @@ -1,267 +0,0 @@ -package tools - -import ( - "bytes" - "crypto/rand" - "crypto/tls" - "fmt" - "io" - "math" - "math/big" - "mime" - "mime/multipart" - "mime/quotedprintable" - "net" - "net/smtp" - "net/textproto" - "os" - "strings" - "time" - - "core/goroutine" - "core/log" -) - -type Email struct { - From string - To []string - Subject string - Text []byte // Plaintext message (optional) - HTML []byte // Html message (optional) - Sender string // override From as SMTP envelope sender (optional) - Headers textproto.MIMEHeader -} - -func generateMessageID() (string, error) { - t := time.Now().UnixNano() - pid := os.Getpid() - rint, err := rand.Int(rand.Reader, big.NewInt(math.MaxInt64)) - if err != nil { - return "", err - } - h, err := os.Hostname() - // If we can't get the hostname, we'll use localhost - if err != nil { - h = "localhost.localdomain" - } - msgid := fmt.Sprintf("<%d.%d.%d@%s>", t, pid, rint, h) - return msgid, nil -} - -func headerToBytes(buff io.Writer, header textproto.MIMEHeader) { - for field, vals := range header { - for _, subval := range vals { - // bytes.Buffer.Write() never returns an error. - io.WriteString(buff, field) - io.WriteString(buff, ": ") - // Write the encoded header if needed - switch { - case field == "Content-Type" || field == "Content-Disposition": - buff.Write([]byte(subval)) - default: - buff.Write([]byte(mime.QEncoding.Encode("UTF-8", subval))) - } - io.WriteString(buff, "\r\n") - } - } -} - -func writeMessage(buff io.Writer, msg []byte, multipart bool, mediaType string, w *multipart.Writer) error { - if multipart { - header := textproto.MIMEHeader{ - "Content-Type": {mediaType + "; charset=UTF-8"}, - "Content-Transfer-Encoding": {"quoted-printable"}, - } - if _, err := w.CreatePart(header); err != nil { - return err - } - } - - qp := quotedprintable.NewWriter(buff) - // Write the text - if _, err := qp.Write(msg); err != nil { - return err - } - return qp.Close() -} - -func (e *Email) msgHeaders() (textproto.MIMEHeader, error) { - res := make(textproto.MIMEHeader, len(e.Headers)+4) - if e.Headers != nil { - for _, h := range []string{"Reply-To", "To", "Cc", "From", "Subject", "Date", "Message-Id", "MIME-Version"} { - if v, ok := e.Headers[h]; ok { - res[h] = v - } - } - } - // Add headers if there are values. - if _, ok := res["To"]; !ok && len(e.To) > 0 { - res.Set("To", strings.Join(e.To, ", ")) - } - if _, ok := res["Subject"]; !ok && e.Subject != "" { - res.Set("Subject", e.Subject) - } - if _, ok := res["Message-Id"]; !ok { - id, err := generateMessageID() - if err != nil { - return nil, err - } - res.Set("Message-Id", id) - } - // Date and From are required headers. - if _, ok := res["From"]; !ok { - res.Set("From", e.From) - } - if _, ok := res["Date"]; !ok { - res.Set("Date", time.Now().Format(time.RFC1123Z)) - } - if _, ok := res["MIME-Version"]; !ok { - res.Set("MIME-Version", "1.0") - } - for field, vals := range e.Headers { - if _, ok := res[field]; !ok { - res[field] = vals - } - } - return res, nil -} - -func (e *Email) Bytes() ([]byte, error) { - buff := bytes.NewBuffer(make([]byte, 0, 4096)) - - headers, err := e.msgHeaders() - if err != nil { - return nil, err - } - - var ( - isAlternative = len(e.Text) > 0 && len(e.HTML) > 0 - ) - - var w *multipart.Writer - if isAlternative { - w = multipart.NewWriter(buff) - } - switch { - case isAlternative: - headers.Set("Content-Type", "multipart/alternative;\r\n boundary="+w.Boundary()) - case len(e.HTML) > 0: - headers.Set("Content-Type", "text/html; charset=UTF-8") - headers.Set("Content-Transfer-Encoding", "quoted-printable") - default: - headers.Set("Content-Type", "text/plain; charset=UTF-8") - headers.Set("Content-Transfer-Encoding", "quoted-printable") - } - headerToBytes(buff, headers) - _, err = io.WriteString(buff, "\r\n") - if err != nil { - return nil, err - } - - // Check to see if there is a Text or HTML field - if len(e.Text) > 0 || len(e.HTML) > 0 { - subWriter := w - // Create the body sections - if len(e.Text) > 0 { - // Write the text - if err := writeMessage(buff, e.Text, isAlternative, "text/plain", subWriter); err != nil { - return nil, err - } - } - if len(e.HTML) > 0 { - // Write the HTML - if err := writeMessage(buff, e.HTML, isAlternative, "text/html", subWriter); err != nil { - return nil, err - } - } - } - - if isAlternative { - if err := w.Close(); err != nil { - return nil, err - } - } - return buff.Bytes(), nil -} - -func buildMsg(from string, to []string, subject, content string) []byte { - mail := Email{ - From: from, - To: to, - Sender: from, - Subject: subject, - HTML: []byte(content), - } - - bytesData, err := mail.Bytes() - if err != nil { - log.KV("mail", mail).KV("err", err).Error("marshal mail failed") - } - return bytesData -} - -const ( - mail_host = "smtp.exmail.qq.com" - mail_port = "465" - mail_usr = "noreply@txnebula.com" - mail_pwd = "QAZwsxedc123" -) - -func mailDial(addr string) (*smtp.Client, error) { - conn, err := tls.Dial("tcp", addr, nil) - if err != nil { - return nil, err - } - host, _, _ := net.SplitHostPort(addr) - return smtp.NewClient(conn, host) -} - -func sendMailSSL(subject, content string, to string) (err error) { - mailClient, err := mailDial(net.JoinHostPort(mail_host, mail_port)) - if err != nil || mailClient == nil { - return fmt.Errorf("create mail client failed %v:%v err %v", mail_host, mail_port, err) - } - defer mailClient.Quit() - - ok, _ := mailClient.Extension("AUTH") - if !ok { - return fmt.Errorf("remote AUTH failed") - } - - err = mailClient.Auth(smtp.PlainAuth("", mail_usr, mail_pwd, mail_host)) - if err != nil { - return - } - - err = mailClient.Mail(mail_usr) - if err != nil { - return - } - - err = mailClient.Rcpt(to) - if err != nil { - return - } - - w, err := mailClient.Data() - if w == nil || err != nil { - return fmt.Errorf("get mail client write data failed") - } - defer w.Close() - - w.Write(buildMsg(mail_usr, []string{to}, subject, content)) - return nil -} - -func SendMail(subject, content string, recvList ...string) { - for _, to := range recvList { - goroutine.Try(func() { - err := sendMailSSL(subject, content, to) - if err != nil { - log.KV("to", to).KV("subject", subject).KV("err", err).Error("SendMail failed") - } else { - log.KV("to", to).KV("subject", subject).Info("SendMail") - } - }, nil) - } -} diff --git a/src/core/tools/http.go b/src/core/tools/http.go deleted file mode 100644 index 195653f..0000000 --- a/src/core/tools/http.go +++ /dev/null @@ -1,186 +0,0 @@ -package tools - -import ( - "bytes" - "encoding/json" - "fmt" - "io" - "net" - "net/http" - "net/url" - "strings" - "time" - - "core/goroutine" - "core/log" -) - -type HttpHandler struct { - HanderMap map[string]http.Handler -} - -func (h *HttpHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) { - c := time.Now() - - xffh := r.Header.Get("X-Forwarded-For") - remote := r.RemoteAddr - if ip := ParseXForwardedFor(xffh); ip != "" { - r.RemoteAddr = net.JoinHostPort(ip, "0") - } - - defer func() { - log.KV("url", r.URL).KV("from", remote).KV("xffh", xffh).KV("cost", time.Since(c)).Debug("http request") - }() - r.ParseForm() - log.KV("url", r.URL).KV("from", remote).KV("xffh", xffh).KV("Content-Type", r.Header.Get("Content-Type")).KV("form", r.Form).Debug("http request") - - goroutine.Try(func() { - if method := h.HanderMap[r.URL.Path]; method != nil { - method.ServeHTTP(w, r) - } else { - http.NotFound(w, r) - } - }, func(ex interface{}) { - http.Error(w, "server error", http.StatusInternalServerError) - }) -} - -func HttpGet(url string) ([]byte, error) { - client := &http.Client{ - Timeout: time.Second * 3, - } - - resp, err := client.Get(url) - if err != nil { - return nil, err - } - if resp == nil { - err = fmt.Errorf("resp is nil") - return nil, err - } - - defer resp.Body.Close() - result, err := io.ReadAll(resp.Body) - return result, err -} - -func HttpReq(r *http.Request) *http.Response { - if r == nil { - return nil - } - - client := &http.Client{ - Timeout: time.Second * 3, - } - - response, err := client.Do(r) - if err != nil { - log.KV("error", err).ErrorStack(2, "httpreq error") - return nil - } - return response -} - -func HttpPost(addr string, body []byte, timeout ...time.Duration) (result []byte, err error) { - bodyReader := bytes.NewReader(body) - client := &http.Client{ - Timeout: time.Second * 3, - } - if len(timeout) > 0 { - client.Timeout = timeout[0] - } - - resp, err := client.Post(addr, "application/json", bodyReader) - if err != nil { - return - } - if resp == nil { - err = fmt.Errorf("resp is nil") - return - } - defer resp.Body.Close() - - result, err = io.ReadAll(resp.Body) - return -} - -func HttpPostForm(url string, data url.Values) (result []byte, err error) { - client := &http.Client{Timeout: time.Second * 6} - - resp, err := client.PostForm(url, data) - if err != nil { - return - } - if resp == nil { - err = fmt.Errorf("resp is nil") - return - } - defer resp.Body.Close() - - result, err = io.ReadAll(resp.Body) - return -} - -func HttpTransmit(w http.ResponseWriter, r *http.Request, remote string) { - if r == nil { - return - } - - remoter, err := http.NewRequest(r.Method, fmt.Sprintf("http://%v%v", remote, r.URL.Path), r.Body) - if err != nil { - log.KV("error", err).Error("HttpTransmit err") - return - } - - remoter.Header = r.Header - - response := HttpReq(remoter) - if response == nil { - return - } - - defer response.Body.Close() - for k, v := range response.Header { - w.Header().Set(k, v[0]) - } - io.Copy(w, response.Body) -} - -func HttpUnmarshalBody(r *http.Request, data interface{}) (body []byte, ok bool) { - defer r.Body.Close() - content, err := io.ReadAll(r.Body) - if err != nil { - log.KV("err", err).WarnStack(2, "http body read err") - return - } - - err = json.Unmarshal(content, data) - if err != nil { - log.KV("err", err).KV("content", string(content)).WarnStack(2, "http body json unmarshal err") - return content, false - } - log.KV("from", r.RemoteAddr).KV("url", r.URL).KV("content", string(content)).DebugStack(1, "HttpUnmarshalBody") - return content, true -} - -func HttpResponse(w http.ResponseWriter, data interface{}) (ok bool) { - content, err := json.Marshal(data) - if err != nil { - log.KV("error", err).KV("data", data).ErrorStack(2, "json marsh failed") - return - } - if _, err = w.Write(content); err != nil { - log.KV("content", string(content)).KV("error", err).ErrorStack(2, "write http error") - return - } - log.KV("content", string(content)).DebugStack(1, "HttpResponse") - return true -} - -func ParseXForwardedFor(xffh string) string { - xffh = strings.TrimSpace(xffh) - if xffh == "" { - return "" - } - return strings.TrimSpace(strings.Split(xffh, ",")[0]) -} diff --git a/src/core/tools/pprof.go b/src/core/tools/pprof.go deleted file mode 100644 index f4fe293..0000000 --- a/src/core/tools/pprof.go +++ /dev/null @@ -1,69 +0,0 @@ -package tools - -import ( - "net" - "net/http" - "net/http/pprof" - "runtime" - "sync" - "time" - - "core/goroutine" - "core/log" -) - -var _initOnce = sync.Once{} - -func PProfInit() { - _initOnce.Do(func() { - goroutine.GoLogic(func() { - s := &http.Server{ - Handler: &HttpHandler{HanderMap: pprofHandlers()}, - ReadTimeout: 3 * time.Minute, - WriteTimeout: 3 * time.Minute, - } - - ln, err := net.Listen("tcp", "127.0.0.1:0") - AssertNil(err) - - s.Addr = ln.Addr().String() - log.KV("addr", ln.Addr().String()).Info("pprof http start") - if err := s.Serve(ln); err != nil { - log.KV("err", err).Warn("pprof http stop") - } - }, nil) - }) -} - -const HTTPPrefixPProf = "/debug/pprof" - -// PProfHandlers returns a map of pprof handlers keyed by the HTTP path. -func pprofHandlers() map[string]http.Handler { - // set only when there's no existing setting - if runtime.SetMutexProfileFraction(-1) == 0 { - // 1 out of 5 mutex ev are reported, on average - runtime.SetMutexProfileFraction(5) - } - - m := make(map[string]http.Handler) - - m[HTTPPrefixPProf+"/"] = http.HandlerFunc(pprof.Index) - m[HTTPPrefixPProf+"/allocs"] = pprof.Handler("allocs") - m[HTTPPrefixPProf+"/block"] = pprof.Handler("block") - m[HTTPPrefixPProf+"/cmdline"] = http.HandlerFunc(pprof.Cmdline) - m[HTTPPrefixPProf+"/goroutine"] = pprof.Handler("goroutine") - m[HTTPPrefixPProf+"/heap"] = pprof.Handler("heap") - m[HTTPPrefixPProf+"/mutex"] = pprof.Handler("mutex") - m[HTTPPrefixPProf+"/profile"] = http.HandlerFunc(pprof.Profile) - m[HTTPPrefixPProf+"/threadcreate"] = pprof.Handler("threadcreate") - m[HTTPPrefixPProf+"/trace "] = http.HandlerFunc(pprof.Trace) - m[HTTPPrefixPProf+"/symbol"] = http.HandlerFunc(pprof.Symbol) - return m -} - -func TimeCostLog(start time.Time, limit time.Duration, msg string) { - cost := time.Since(start) - if cost >= limit { - log.KV("cost", cost/time.Millisecond).KV("info", msg).InfoStack(1, "time cost") - } -} diff --git a/src/core/tools/stringify.go b/src/core/tools/stringify.go deleted file mode 100644 index b4027d1..0000000 --- a/src/core/tools/stringify.go +++ /dev/null @@ -1,13 +0,0 @@ -package tools - -import ( - "strconv" -) - -func Itoa64(i int64) string { - return strconv.FormatInt(i, 10) -} - -func Itoa32(i int32) string { - return strconv.FormatInt(int64(i), 10) -} diff --git a/src/core/tools/tools_test.go b/src/core/tools/tools_test.go deleted file mode 100644 index 7a38914..0000000 --- a/src/core/tools/tools_test.go +++ /dev/null @@ -1,11 +0,0 @@ -package tools - -import ( - "fmt" - "testing" -) - -func TestTool(t *testing.T) { - ip := GetOutboundIP() - fmt.Println(ip.String()) -} diff --git a/src/core/tools/uuid.go b/src/core/tools/uuid.go deleted file mode 100644 index 034e746..0000000 --- a/src/core/tools/uuid.go +++ /dev/null @@ -1,55 +0,0 @@ -package tools - -import ( - "encoding/hex" - "sync" - - "github.com/bwmarrin/snowflake" - "github.com/google/uuid" -) - -var ( - global_snode *SnowflakeNode - snode_init_once sync.Once -) - -func init() { - snowflake.Epoch = 1645539742222 //2022-02-22 22:22:22.222 63-NodeBits-StepBits=39 2^39/86400000/365大约可用17年 - snowflake.NodeBits = 14 //16384个节点 - snowflake.StepBits = 10 //每毫秒输出1024个 -} - -func UUID() string { - u := uuid.New() - dst := make([]byte, 32) - hex.Encode(dst, u[:4]) - hex.Encode(dst[8:12], u[4:6]) - hex.Encode(dst[12:16], u[6:8]) - hex.Encode(dst[16:20], u[8:10]) - hex.Encode(dst[20:], u[10:]) - return string(dst) -} - -func SnowflakeIDStr() string { return Itoa64(global_snode.ID()) } - -func SnowflakeID() int64 { return global_snode.ID() } - -func InitSnowflake(node int64) { - snode_init_once.Do(func() { - snode, err := NewSnowflakeNode(node) - AssertNil(err) - global_snode = snode - }) -} - -func NewSnowflakeNode(node int64) (*SnowflakeNode, error) { - snode, err := snowflake.NewNode(node) - if err != nil { - return nil, err - } - return &SnowflakeNode{snode}, nil -} - -type SnowflakeNode struct{ *snowflake.Node } - -func (this *SnowflakeNode) ID() int64 { return int64(this.Generate()) }