Documentation
¶
Index ¶
- Constants
- Variables
- func GetValues(ctx context.Context, headerNames ...string) []string
- func NewDefaultVersionChecker() *versionChecker
- func NewVersionChecker(supportedClients map[string]string, serverVersion string) *versionChecker
- func PropagateVersions(ctx context.Context) context.Context
- func SetCLIVersions(ctx context.Context) context.Context
- func SetVersions(ctx context.Context) context.Context
- func SetVersionsForTests(ctx context.Context, clientVersion, clientName, supportedServerVersions string) context.Context
- type VersionChecker
Constants ¶
const (
ClientNameHeaderName = "client-name"
ClientVersionHeaderName = "client-version"
SupportedServerVersionsHeaderName = "supported-server-versions"
)
const (
ClientNameServer = "temporal-server"
ClientNameGoSDK = "temporal-go"
ClientNameJavaSDK = "temporal-java"
ClientNameCLI = "temporal-cli"
ServerVersion = "1.7.1"
CLIVersion = "1.7.1"
// SupportedServerVersions is used by CLI and inter role communication.
SupportedServerVersions = ">=1.0.0 <2.0.0"
)
Variables ¶
var (
SupportedClients = map[string]string{
ClientNameGoSDK: "<2.0.0",
ClientNameJavaSDK: "<2.0.0",
ClientNameCLI: "<2.0.0",
ClientNameServer: "<2.0.0",
}
)
Functions ¶
func GetValues ¶
func GetValues(ctx context.Context, headerNames ...string) []string
GetValues returns header values for passed header names. It always returns slice of the same size as number of passed header names.
func NewDefaultVersionChecker ¶ added in v1.0.0
func NewDefaultVersionChecker() *versionChecker
NewDefaultVersionChecker constructs a new VersionChecker using default versions from const.
func NewVersionChecker ¶
func NewVersionChecker(supportedClients map[string]string, serverVersion string) *versionChecker
NewVersionChecker constructs a new VersionChecker
func PropagateVersions ¶
func PropagateVersions(ctx context.Context) context.Context
PropagateVersions propagates version headers from incoming context to outgoing context. It copies all version headers to outgoing context only if they are exist in incoming context and doesn't exist in outgoing context already.
func SetCLIVersions ¶
func SetCLIVersions(ctx context.Context) context.Context
SetCLIVersions sets headers for CLI requests.
func SetVersions ¶
func SetVersions(ctx context.Context) context.Context
SetVersions sets headers for internal communications.
func SetVersionsForTests ¶
func SetVersionsForTests(ctx context.Context, clientVersion, clientName, supportedServerVersions string) context.Context
SetVersionsForTests sets headers as they would be received from the client. Must be used in tests only.
Types ¶
type VersionChecker ¶
type VersionChecker interface {
ClientSupported(ctx context.Context, enableClientVersionCheck bool) error
}
VersionChecker is used to check client/server compatibility and client's capabilities