dubbo.apache.org/dubbo-go/v3@v3.1.1/common/constant/default.go (about)

     1  /*
     2   * Licensed to the Apache Software Foundation (ASF) under one or more
     3   * contributor license agreements.  See the NOTICE file distributed with
     4   * this work for additional information regarding copyright ownership.
     5   * The ASF licenses this file to You under the Apache License, Version 2.0
     6   * (the "License"); you may not use this file except in compliance with
     7   * the License.  You may obtain a copy of the License at
     8   *
     9   *     http://www.apache.org/licenses/LICENSE-2.0
    10   *
    11   * Unless required by applicable law or agreed to in writing, software
    12   * distributed under the License is distributed on an "AS IS" BASIS,
    13   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    14   * See the License for the specific language governing permissions and
    15   * limitations under the License.
    16   */
    17  
    18  package constant
    19  
    20  import (
    21  	"math"
    22  )
    23  
    24  const (
    25  	Dubbo            = "dubbo"
    26  	ProviderProtocol = "provider"
    27  	OverrideProtocol = "override" //compatible with 2.6.x
    28  	EmptyProtocol    = "empty"
    29  	RouterProtocol   = "router"
    30  )
    31  
    32  const (
    33  	DefaultWeight           = 100
    34  	DefaultWarmup           = 10 * 60 // in java here is 10*60*1000 because of System.currentTimeMillis() is measured in milliseconds & in go time.Unix() is second
    35  	DefaultLoadBalance      = "random"
    36  	DefaultRetries          = "2"
    37  	DefaultRetriesInt       = 2
    38  	DefaultProtocol         = "dubbo"
    39  	DefaultRegTimeout       = "5s"
    40  	DefaultRegTTL           = "15m"
    41  	DefaultCluster          = "failover"
    42  	DefaultFailbackTimes    = "3"
    43  	DefaultFailbackTimesInt = 3
    44  	DefaultFailbackTasks    = 100
    45  	DefaultRestClient       = "resty"
    46  	DefaultRestServer       = "go-restful"
    47  	DefaultPort             = 20000
    48  )
    49  
    50  const (
    51  	DefaultKey   = "default"
    52  	Generic      = "$invoke"
    53  	GenericAsync = "$invokeAsync"
    54  	Echo         = "$echo"
    55  )
    56  
    57  // default filters
    58  const (
    59  	// DefaultServiceFilters defines default service filters, it is highly recommended
    60  	// that put the AdaptiveServiceProviderFilterKey at the end.
    61  	DefaultServiceFilters = EchoFilterKey + "," +
    62  		TokenFilterKey + "," + AccessLogFilterKey + "," + TpsLimitFilterKey + "," +
    63  		GenericServiceFilterKey + "," + ExecuteLimitFilterKey + "," + GracefulShutdownProviderFilterKey
    64  
    65  	DefaultReferenceFilters = GracefulShutdownConsumerFilterKey
    66  )
    67  
    68  const (
    69  	AnyValue          = "*"
    70  	AnyHostValue      = "0.0.0.0"
    71  	LocalHostValue    = "192.168.1.1"
    72  	RemoveValuePrefix = "-"
    73  )
    74  
    75  const (
    76  	ConfiguratorsCategory           = "configurators"
    77  	RouterCategory                  = "category"
    78  	DefaultCategory                 = ProviderCategory
    79  	DynamicConfiguratorsCategory    = "dynamicconfigurators"
    80  	AppDynamicConfiguratorsCategory = "appdynamicconfigurators"
    81  	ProviderCategory                = "providers"
    82  	ConsumerCategory                = "consumers"
    83  )
    84  
    85  const (
    86  	CommaSplitPattern = "\\s*[,]+\\s*"
    87  )
    88  
    89  const (
    90  	SimpleMetadataServiceName = "MetadataService"
    91  	DefaultRevision           = "N/A"
    92  )
    93  
    94  const (
    95  	ServiceDiscoveryDefaultGroup = "DEFAULT_GROUP"
    96  	NotAvailable                 = "N/A"
    97  )
    98  
    99  const (
   100  	DefaultMaxServerRecvMsgSize = 1024 * 1024 * 4
   101  	DefaultMaxServerSendMsgSize = math.MaxInt32
   102  
   103  	DefaultMaxCallRecvMsgSize = 1024 * 1024 * 4
   104  	DefaultMaxCallSendMsgSize = math.MaxInt32
   105  )
   106  
   107  const (
   108  	LoggerLevel    = "info"
   109  	LoggerAppender = "console"
   110  	LoggerFormat   = "text"
   111  )