WorkflowDefinitionValidator 是整个验证入口,上一个非常复杂的对象结构。 参考:https://github.com/serverlessworkflow/specification/blob/main/specification.md 通过依赖注入,继续检查下一层的字段。 /// <summary> /// Represents the service used to validate <see cref="WorkflowDefinition"/>s /// &…
WorkflowDefinitionValidator 是整个验证入口,上一个非常复杂的对象结构。 参考:https://github.com/serverlessworkflow/specification/blob/main/specification.md 通过依赖注入,继续检查下一层的字段。 /// <summary> /// Represents the service used to validate <see cref="WorkflowDefinition"/>s /// &…
The code example is as follows: System.Net.ServicePointManager.ServerCertificateValidationCallback += (sender, certificate, chain, sslPolicyErrors) => true; services.ConfigureAll<HttpClientFactoryOptions>(options => { options.HttpMessag[......]继续阅读
代码示例如下: System.Net.ServicePointManager.ServerCertificateValidationCallback += (sender, certificate, chain, sslPolicyErrors) => true; services.ConfigureAll<HttpClientFactoryOptions>(options => { options.HttpMessageHandlerBuilderActions.A[......]继续阅读
Establishing Link SDK Official Repository Address: https://github.com/open-telemetry/opentelemetry-go Design an execution flow like this: Run executes Run1 and Run2 in sequence: a.Run1(newCtx) a.Run2(newCtx) Inside Run1, another function Run1-1 is also execute…
建立链路 SDK 官方仓库地址: https://github.com/open-telemetry/opentelemetry-go 设计一个这样的执行流程: Run 先后执行 Run1、Run2: a.Run1(newCtx) a.Run2(newCtx) Run1 中,还执行了另一个函数 Run1-1。 使用 opentelemetry SDK 的代码示例如下: package main import ( "context" "go.opentelemetry.io/otel" "io" "log" ) //…
package main import ( "fmt" "os" "os/signal" ) func main() { // Set up channel on which to send signal notifications. // We must use a buffered channel or risk missing the signal // if we're not ready to receive when the signal is…
使用示例: package main import ( "fmt" "os" "os/signal" ) func main() { // Set up channel on which to send signal notifications. // We must use a buffered channel or risk missing the signal // if we're not ready to receive when the signal is sent. c := make(chan os…
Usage Common log methods in Go: Print/Printf/Println : Print log information Panic/Panicf/Panicln : Print log information and call Panic with the formatted string as an argument Fatal/Fatalf/Fatalln : Print log information and exit the program with os.Exit(1) …
使用 Go 中常用的 log 方法: Print/Printf/Println : 打印日志信息 Panic/Panicf/Panicln : 打印日志信息后,以拼装好的字符串为参数调用 Panic Fatal/Fatalf/Fatalln : 打印日志信息后,os.Exit(1) 退出程序 New 一个 Logger 的定义如下: func New(out io.Writer, prefix string, flag int) *Logger { return &Logger{out: out, pref…
首先在要被执行的类型加上参数: [Option(Description = "CloudEvents 'source' (default: urn:example-com:mysource:abc)", LongName = "source", ShortName = "s")] private string Source { get; } = "urn:example-com:mysource:abc"; [Option(Descri…
首先在要被执行的 类型 加上参数: [Option(Description = "CloudEvents 'source' (default: urn:example-com:mysource:abc)", LongName = "source", ShortName = "s")] private string Source { get; } = "urn:example-com:mysource:abc"; [Option(Description = "CloudEvents 'type' (default: …
Introduce this library: YamlDotNet Configuration example: services.AddYamlDotNetSerializer( serializer => serializer .IncludeNonPublicProperties() .WithTypeConverter(new OneOfConverter()) .WithEmissionPhaseOb[......]继续阅读
引入这个库: YamlDotNet 配置示例: services.AddYamlDotNetSerializer( serializer => serializer .IncludeNonPublicProperties() .WithTypeConverter(new OneOfConverter()) .WithEmissionPhaseObjectGraphVisitor(args => new Cha[......]继续阅读
From ServerlessWorkflow, I learned an interesting configuration for NewtonsoftJson. var newtonsoftJsonDefaultConfig = (JsonSerializerSettings settings) => { settings.ContractResolver = new NonPublicSetterContractResolver(); settings.NullValu[......]继续阅读
从 ServerlessWorkflow 中学习到一个有趣的 NewtonsoftJson 配置。 var newtonsoftJsonDefaultConfig = (JsonSerializerSettings settings) => { settings.ContractResolver = new NonPublicSetterContractResolver(); settings.NullValueHandling = NullValueHandling.Igno[......]继续阅读
ISO 8601 specifies the time format. In Go language, Duration implements this time format. package main import ( "fmt" "time" ) func main() { t := time.Now() fmt.Println(t) } Output: 2022-11-19 02:59:28.201938781 +0000 UTC m=+0.000051897 In …
ISO8601 规定了时间格式。 在 Go 语言中,Duration 就实现了这种时间格式。 package main import ( "fmt" "time" ) func main() { t := time.Now() fmt.Println(t) } 输出: 2022-11-19 02:59:28.201938781 +0000 UTC m=+0.000051897 在 C# 中,可以通过引用 Iso8601DurationHelper 来实现 Duration。 var duration = Durat…
Background I suddenly learned about a project called ServerlessWorkflow. https://github.com/serverlessworkflow The specific utility of this project is not important; what matters is that it provides insight into the current state of cloud-native middleware dev…
背景 突然了解到有个项目叫 ServerlessWorkflow 。 https://github.com/serverlessworkflow 这个项目有什么用,并不重要,重要的是可以从这里了解到云原生中间件开发的一些现状和需要学习的知识。 因为这个项目是 CNCF 项目,里面使用到的规范、思想、协议,也可以很好地体现当前 CNCF 的趋势。 ServerlessWorkflow 是一个 CNCF 发起的工作流协议,然后现在使用了 C# 实现了这个协议。 https://github.com/serverless…
首先打开 /etc/kubernetes/pki 目录,里面会有很多证书。 执行命令查看当前证书允许通过哪些地址访问 APIServer: openssl x509 -in apiserver.crt -noout -text | grep -A 2 'Alternative' 可以看到证书允许的都是些内网 IP、本地 DNS 等。 备份好当前的密钥和客户端证书: mv apiserver.crt apiserver.crt.bak mv apiserver.key apiserver.key.bak 修改 kub…