github.com/cloudwego/kitex@v0.9.0/pkg/remote/transmeta/metakey.go (about)

     1  /*
     2   * Copyright 2021 CloudWeGo Authors
     3   *
     4   * Licensed under the Apache License, Version 2.0 (the "License");
     5   * you may not use this file except in compliance with the License.
     6   * You may obtain a copy of the License at
     7   *
     8   *     http://www.apache.org/licenses/LICENSE-2.0
     9   *
    10   * Unless required by applicable law or agreed to in writing, software
    11   * distributed under the License is distributed on an "AS IS" BASIS,
    12   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    13   * See the License for the specific language governing permissions and
    14   * limitations under the License.
    15   */
    16  
    17  // Package transmeta .
    18  package transmeta
    19  
    20  import "github.com/bytedance/gopkg/cloud/metainfo"
    21  
    22  // Keys in mesh header.
    23  const (
    24  	MeshVersion uint16 = iota
    25  	TransportType
    26  	LogID
    27  	FromService
    28  	FromCluster
    29  	FromIDC
    30  	ToService
    31  	ToCluster
    32  	ToIDC
    33  	ToMethod
    34  	Env
    35  	DestAddress
    36  	RPCTimeout
    37  	ReadTimeout
    38  	RingHashKey
    39  	DDPTag
    40  	WithMeshHeader
    41  	ConnectTimeout
    42  	SpanContext
    43  	ShortConnection
    44  	FromMethod
    45  	StressTag
    46  	MsgType
    47  	HTTPContentType
    48  	RawRingHashKey
    49  	LBType
    50  )
    51  
    52  // key of header transport
    53  const (
    54  	HeaderIDLServiceName      = "isn"
    55  	HeaderTransRemoteAddr     = "rip"
    56  	HeaderTransToCluster      = "tc"
    57  	HeaderTransToIDC          = "ti"
    58  	HeaderTransPerfTConnStart = "pcs"
    59  	HeaderTransPerfTConnEnd   = "pce"
    60  	HeaderTransPerfTSendStart = "pss"
    61  	HeaderTransPerfTRecvStart = "prs"
    62  	HeaderTransPerfTRecvEnd   = "pre"
    63  	// the connection peer will shutdown later,so it send back the header to tell client to close the connection.
    64  	HeaderConnectionReadyToReset = "crrst"
    65  	HeaderProcessAtTime          = "K_ProcessAtTime"
    66  )
    67  
    68  // key of acl token
    69  // You can set up acl token through metainfo.
    70  // eg:
    71  //
    72  //	ctx = metainfo.WithValue(ctx, "gdpr-token", "your token")
    73  const (
    74  	// GDPRToken is used to set up gdpr token into InfoIDACLToken
    75  	GDPRToken = metainfo.PrefixTransient + "gdpr-token"
    76  )