Documentation
¶
Index ¶
Constants ¶
const ( Provider = "Provider" Consumer = "Consumer" )
constant for provider and consumer
const ( // ScopeFull means service is able to access to another app's service ScopeFull = "full" // ScopeApp means service is not able to access to another app's service ScopeApp = "app" )
const ( Env = "ServiceComb_ENV" EnvNodeIP = "HOSTING_SERVER_IP" EnvSchemaRoot = "SCHEMA_ROOT" EnvProjectID = "CSE_PROJECT_ID" )
constant for microservice environment parameters
const ( CseRegistryAddress = "CSE_REGISTRY_ADDR" CseConfigCenterAddress = "CSE_CONFIG_CENTER_ADDR" CseMonitorServer = "CSE_MONITOR_SERVER_ADDR" )
constant environment keys service center, config center, monitor server addresses
const ( ServiceName = "SERVICE_NAME" Version = "VERSION" )
env connect with "." like service_description.name and service_description.version which can not be used in k8s. So we can not use archaius to set env. To support this decalring constant for service name and version constant for service name and version.
const ( EnvValueDev = "development" EnvValueProd = "production" )
constant for microservice environment
const ( SslCipherPluginKey = "cipherPlugin" SslVerifyPeerKey = "verifyPeer" SslCipherSuitsKey = "cipherSuits" SslProtocolKey = "protocol" SslCaFileKey = "caFile" SslCertFileKey = "certFile" SslKeyFileKey = "keyFile" SslCertPwdFileKey = "certPwdFile" AKSKCustomCipher = "cse.credentials.akskCustomCipher" )
constant for secure socket layer parameters
const ( ProtocolRest = "rest" ProtocolHighway = "highway" LBSessionID = "ServiceCombLB" )
constant for protocol types
const ( DefaultApp = "default" DefaultVersion = "0.0.1" LatestVersion = "latest" AllVersion = "0+" DefaultStatus = "UP" DefaultLevel = "BACK" DefaultHBInterval = 30 )
constant for default application name and version
const ( HTTP = "http" HTTPS = "https" JSON = "application/json" Create = "CREATE" Update = "UPDATE" Delete = "DELETE" Size = "size" Client = "client" File = "File" SessionID = "sessionid" DefaultTenant = "default" DefaultChainName = "default" RollingPolicySize = "size" FileRegistry = "File" DefaultUserName = "default" DefaultDomainName = "default" DefaultProvider = "default" )
constant used
const BuildinTagApp = "app"
BuildinTagApp build tag for the application
const BuildinTagVersion = "version"
BuildinTagVersion build tag version
const CallerKey = "caller"
CallerKey caller key
const DefaultKey = "default"
DefaultKey default key
const (
DefaultRefreshMode = 1
)
const default config for config-center
const DefaultValue = "default"
DefaultValue default value
const (
// HeaderSourceName is constant for header source name
HeaderSourceName = "x-cse-src-microservice"
)
const (
// RestMethod is the http method for restful protocol
RestMethod = "method"
)
const (
TransportTCP = "tcp"
)
constant for transport tcp
Variables ¶
This section is empty.
Functions ¶
func FromContext ¶
FromContext transforms a context object to metadata
func NewContext ¶
NewContext transforms a metadata to context object