From 37a18705e93868a8d3c8f177f52fa1e14b9b71ba Mon Sep 17 00:00:00 2001 From: chris ludden Date: Mon, 1 Apr 2024 19:40:17 -0600 Subject: [PATCH] Deploy website - based on 45bdb2444c6bb86733372529305c8e0df3534017 --- 404.html | 10 +++---- ...5b50a.ecd185e2.js => 0145b50a.6dedce92.js} | 2 +- assets/js/031793e1.5ce2668b.js | 1 - assets/js/046e2194.882fe9bc.js | 1 - assets/js/046e2194.cc4bb0eb.js | 1 + assets/js/096bfee4.cf1a9176.js | 1 - ...ea4cb.d9dcdf11.js => 0c3ea4cb.ce5ad2c6.js} | 2 +- assets/js/0ec9a4c5.0366a533.js | 1 + assets/js/0ec9a4c5.ada7faa3.js | 1 - ...4f122.f97b5ddc.js => 0fe4f122.a8408588.js} | 2 +- assets/js/13f3ef77.440168ab.js | 1 + assets/js/13f3ef77.4ae82bf0.js | 1 - assets/js/183ed9a2.85c1b55a.js | 1 - assets/js/183ed9a2.b26feba4.js | 1 + assets/js/24b40d04.62c90611.js | 1 - assets/js/24b40d04.bc0e2c59.js | 1 + assets/js/2c4b19b8.1a4f3401.js | 1 + assets/js/2c4b19b8.5bec1ad8.js | 1 - assets/js/3021cf83.a3597eae.js | 1 - assets/js/3021cf83.cad4733b.js | 1 + assets/js/30a24c52.4c1347b4.js | 1 - assets/js/328da6b0.1f94afe3.js | 1 - assets/js/328da6b0.466b6b12.js | 1 + assets/js/35b74448.354bc6fd.js | 1 + assets/js/35b74448.b3ffa949.js | 1 - assets/js/36041992.5adb5a46.js | 1 + assets/js/36041992.892c8dd8.js | 1 - assets/js/393be207.2db108f6.js | 1 - assets/js/393be207.67121378.js | 1 + assets/js/3b117d94.365fd472.js | 1 + assets/js/3fa420c0.51cf74bd.js | 1 + assets/js/3fa420c0.5b86c265.js | 1 - assets/js/437149ac.0f69cc60.js | 1 + assets/js/437149ac.5fb56165.js | 1 - assets/js/474a3cec.1ebbdffb.js | 1 + assets/js/4c9e35b1.9e712b60.js | 1 - assets/js/53df995c.26a01b8c.js | 1 - assets/js/53df995c.e7704f75.js | 1 + assets/js/59362658.052dc88d.js | 1 + assets/js/59362658.cd26dc5c.js | 1 - assets/js/608ae6a4.2a0abb3c.js | 1 - assets/js/66406991.9e0e48cf.js | 1 - assets/js/6c2deb41.78d87bbb.js | 1 + assets/js/6c883624.21d51499.js | 1 + assets/js/7081f529.944ed5f5.js | 1 - assets/js/7081f529.ff6ee44c.js | 1 + assets/js/73664a40.5c163397.js | 1 + assets/js/73664a40.de7e10a7.js | 1 - assets/js/7661071f.8bd2a584.js | 1 + assets/js/7661071f.b38144f9.js | 1 - assets/js/77587487.6fcb8571.js | 1 + assets/js/77587487.8b4b83d6.js | 1 - assets/js/7f7ed216.9f6466d0.js | 1 - assets/js/7f7ed216.d2bedb9b.js | 1 + assets/js/814f3328.5dfaceaf.js | 1 - assets/js/814f3328.e35e6f1b.js | 1 + assets/js/8717b14a.03076b3f.js | 1 + assets/js/8717b14a.3c7a3dd9.js | 1 - assets/js/89450fc0.b7fd6d88.js | 1 + assets/js/925b3f96.15b77012.js | 1 - assets/js/925b3f96.90b7bac1.js | 1 + assets/js/935f2afb.3097c3c5.js | 1 + assets/js/935f2afb.9c1d7074.js | 1 - assets/js/93fb8980.4cf42dce.js | 1 + assets/js/93fb8980.bb4ee59f.js | 1 - assets/js/94350439.0fd8f775.js | 1 - assets/js/94350439.292adea4.js | 1 + assets/js/956a4e1f.924daeed.js | 1 + assets/js/956a4e1f.f7a55fd6.js | 1 - assets/js/98260113.8e322bca.js | 1 - assets/js/98260113.dfa2acb6.js | 1 + assets/js/a7023ddc.c0adbbf8.js | 1 - assets/js/a80da1cf.e39cd5b6.js | 1 - assets/js/aba4fb3d.7b37fae6.js | 1 + assets/js/b2b675dd.e198e674.js | 1 - assets/js/b2f554cd.c3fd38f0.js | 1 - assets/js/b419606a.f3f375f3.js | 1 + assets/js/b9958750.1a70b6ce.js | 1 - assets/js/b9958750.b47dc2fd.js | 1 + assets/js/c726c94b.e696db08.js | 1 + assets/js/cb7b72ef.b01787c3.js | 1 - assets/js/cb7b72ef.e063f60b.js | 1 + assets/js/d6629652.1ad2a2cb.js | 1 - assets/js/d6629652.d138c022.js | 1 + assets/js/d9f32620.01da87c2.js | 1 + assets/js/d9f32620.d52c6267.js | 1 - assets/js/dcf58752.b56b3c9d.js | 1 + assets/js/dd7fddbf.0dd3d26c.js | 1 + assets/js/dd7fddbf.d1e9a7dc.js | 1 - assets/js/e16015ca.50f76e86.js | 1 - assets/js/e17b2e0e.2fadf9a2.js | 1 - assets/js/e17b2e0e.9e2f228c.js | 1 + assets/js/e273c56f.a2f3ff95.js | 1 - assets/js/e273c56f.d7239e79.js | 1 + assets/js/eb3fa7af.157c54ef.js | 1 + assets/js/ee3a5f89.04ffe02a.js | 1 + assets/js/f4f34a3a.0f36b332.js | 1 + assets/js/f4f34a3a.84d9f4d2.js | 1 - assets/js/main.8b0a5f68.js | 2 -- assets/js/main.dfa4d446.js | 2 ++ ...CENSE.txt => main.dfa4d446.js.LICENSE.txt} | 0 assets/js/runtime~main.2a53d3a1.js | 1 + assets/js/runtime~main.483581bb.js | 1 - blog.html | 18 +++++------ blog/archive.html | 10 +++---- blog/atom.xml | 24 +++++++-------- blog/first-blog-post.html | 10 +++---- blog/long-blog-post.html | 12 ++++---- blog/mdx-blog-post.html | 12 ++++---- blog/rss.xml | 20 ++++++------- blog/tags.html | 10 +++---- blog/tags/docusaurus.html | 18 +++++------ blog/tags/facebook.html | 14 ++++----- blog/tags/hello.html | 16 +++++----- blog/tags/hola.html | 10 +++---- blog/welcome.html | 14 ++++----- docs/about.html | 18 +++++------ docs/configuration/activity.html | 14 ++++----- docs/configuration/plugin.html | 24 +++++++-------- docs/configuration/query.html | 18 +++++------ docs/configuration/service.html | 12 ++++---- docs/configuration/signal.html | 18 +++++------ docs/configuration/update.html | 22 +++++++------- docs/configuration/workflow.html | 30 +++++++++---------- docs/examples/codecserver.html | 12 ++++---- docs/examples/helloworld.html | 12 ++++---- docs/examples/searchattributes.html | 12 ++++---- docs/examples/updatabletimer.html | 12 ++++---- docs/getting-started.html | 14 ++++----- docs/guides/activities.html | 12 ++++---- docs/guides/bloblang.html | 12 ++++---- docs/guides/child-workflows.html | 12 ++++---- docs/guides/cli.html | 12 ++++---- docs/guides/clients.html | 12 ++++---- docs/guides/codec-server.html | 14 ++++----- docs/guides/documentation.html | 12 ++++---- docs/guides/queries.html | 18 +++++------ docs/guides/signals.html | 12 ++++---- docs/guides/testing.html | 12 ++++---- docs/guides/updates.html | 12 ++++---- docs/guides/workflows.html | 20 ++++++------- docs/guides/xns.html | 12 ++++---- docs/install.html | 12 ++++---- docs/reference.html | 10 +++---- index.html | 10 +++---- markdown-page.html | 10 +++---- sitemap.xml | 2 +- 147 files changed, 369 insertions(+), 369 deletions(-) rename assets/js/{0145b50a.ecd185e2.js => 0145b50a.6dedce92.js} (62%) delete mode 100644 assets/js/031793e1.5ce2668b.js delete mode 100644 assets/js/046e2194.882fe9bc.js create mode 100644 assets/js/046e2194.cc4bb0eb.js delete mode 100644 assets/js/096bfee4.cf1a9176.js rename assets/js/{0c3ea4cb.d9dcdf11.js => 0c3ea4cb.ce5ad2c6.js} (57%) create mode 100644 assets/js/0ec9a4c5.0366a533.js delete mode 100644 assets/js/0ec9a4c5.ada7faa3.js rename assets/js/{0fe4f122.f97b5ddc.js => 0fe4f122.a8408588.js} (59%) create mode 100644 assets/js/13f3ef77.440168ab.js delete mode 100644 assets/js/13f3ef77.4ae82bf0.js delete mode 100644 assets/js/183ed9a2.85c1b55a.js create mode 100644 assets/js/183ed9a2.b26feba4.js delete mode 100644 assets/js/24b40d04.62c90611.js create mode 100644 assets/js/24b40d04.bc0e2c59.js create mode 100644 assets/js/2c4b19b8.1a4f3401.js delete mode 100644 assets/js/2c4b19b8.5bec1ad8.js delete mode 100644 assets/js/3021cf83.a3597eae.js create mode 100644 assets/js/3021cf83.cad4733b.js delete mode 100644 assets/js/30a24c52.4c1347b4.js delete mode 100644 assets/js/328da6b0.1f94afe3.js create mode 100644 assets/js/328da6b0.466b6b12.js create mode 100644 assets/js/35b74448.354bc6fd.js delete mode 100644 assets/js/35b74448.b3ffa949.js create mode 100644 assets/js/36041992.5adb5a46.js delete mode 100644 assets/js/36041992.892c8dd8.js delete mode 100644 assets/js/393be207.2db108f6.js create mode 100644 assets/js/393be207.67121378.js create mode 100644 assets/js/3b117d94.365fd472.js create mode 100644 assets/js/3fa420c0.51cf74bd.js delete mode 100644 assets/js/3fa420c0.5b86c265.js create mode 100644 assets/js/437149ac.0f69cc60.js delete mode 100644 assets/js/437149ac.5fb56165.js create mode 100644 assets/js/474a3cec.1ebbdffb.js delete mode 100644 assets/js/4c9e35b1.9e712b60.js delete mode 100644 assets/js/53df995c.26a01b8c.js create mode 100644 assets/js/53df995c.e7704f75.js create mode 100644 assets/js/59362658.052dc88d.js delete mode 100644 assets/js/59362658.cd26dc5c.js delete mode 100644 assets/js/608ae6a4.2a0abb3c.js delete mode 100644 assets/js/66406991.9e0e48cf.js create mode 100644 assets/js/6c2deb41.78d87bbb.js create mode 100644 assets/js/6c883624.21d51499.js delete mode 100644 assets/js/7081f529.944ed5f5.js create mode 100644 assets/js/7081f529.ff6ee44c.js create mode 100644 assets/js/73664a40.5c163397.js delete mode 100644 assets/js/73664a40.de7e10a7.js create mode 100644 assets/js/7661071f.8bd2a584.js delete mode 100644 assets/js/7661071f.b38144f9.js create mode 100644 assets/js/77587487.6fcb8571.js delete mode 100644 assets/js/77587487.8b4b83d6.js delete mode 100644 assets/js/7f7ed216.9f6466d0.js create mode 100644 assets/js/7f7ed216.d2bedb9b.js delete mode 100644 assets/js/814f3328.5dfaceaf.js create mode 100644 assets/js/814f3328.e35e6f1b.js create mode 100644 assets/js/8717b14a.03076b3f.js delete mode 100644 assets/js/8717b14a.3c7a3dd9.js create mode 100644 assets/js/89450fc0.b7fd6d88.js delete mode 100644 assets/js/925b3f96.15b77012.js create mode 100644 assets/js/925b3f96.90b7bac1.js create mode 100644 assets/js/935f2afb.3097c3c5.js delete mode 100644 assets/js/935f2afb.9c1d7074.js create mode 100644 assets/js/93fb8980.4cf42dce.js delete mode 100644 assets/js/93fb8980.bb4ee59f.js delete mode 100644 assets/js/94350439.0fd8f775.js create mode 100644 assets/js/94350439.292adea4.js create mode 100644 assets/js/956a4e1f.924daeed.js delete mode 100644 assets/js/956a4e1f.f7a55fd6.js delete mode 100644 assets/js/98260113.8e322bca.js create mode 100644 assets/js/98260113.dfa2acb6.js delete mode 100644 assets/js/a7023ddc.c0adbbf8.js delete mode 100644 assets/js/a80da1cf.e39cd5b6.js create mode 100644 assets/js/aba4fb3d.7b37fae6.js delete mode 100644 assets/js/b2b675dd.e198e674.js delete mode 100644 assets/js/b2f554cd.c3fd38f0.js create mode 100644 assets/js/b419606a.f3f375f3.js delete mode 100644 assets/js/b9958750.1a70b6ce.js create mode 100644 assets/js/b9958750.b47dc2fd.js create mode 100644 assets/js/c726c94b.e696db08.js delete mode 100644 assets/js/cb7b72ef.b01787c3.js create mode 100644 assets/js/cb7b72ef.e063f60b.js delete mode 100644 assets/js/d6629652.1ad2a2cb.js create mode 100644 assets/js/d6629652.d138c022.js create mode 100644 assets/js/d9f32620.01da87c2.js delete mode 100644 assets/js/d9f32620.d52c6267.js create mode 100644 assets/js/dcf58752.b56b3c9d.js create mode 100644 assets/js/dd7fddbf.0dd3d26c.js delete mode 100644 assets/js/dd7fddbf.d1e9a7dc.js delete mode 100644 assets/js/e16015ca.50f76e86.js delete mode 100644 assets/js/e17b2e0e.2fadf9a2.js create mode 100644 assets/js/e17b2e0e.9e2f228c.js delete mode 100644 assets/js/e273c56f.a2f3ff95.js create mode 100644 assets/js/e273c56f.d7239e79.js create mode 100644 assets/js/eb3fa7af.157c54ef.js create mode 100644 assets/js/ee3a5f89.04ffe02a.js create mode 100644 assets/js/f4f34a3a.0f36b332.js delete mode 100644 assets/js/f4f34a3a.84d9f4d2.js delete mode 100644 assets/js/main.8b0a5f68.js create mode 100644 assets/js/main.dfa4d446.js rename assets/js/{main.8b0a5f68.js.LICENSE.txt => main.dfa4d446.js.LICENSE.txt} (100%) create mode 100644 assets/js/runtime~main.2a53d3a1.js delete mode 100644 assets/js/runtime~main.483581bb.js diff --git a/404.html b/404.html index 77ad05c0..87e9a65d 100644 --- a/404.html +++ b/404.html @@ -3,12 +3,12 @@ -Page Not Found | protoc-gen-go-temporal - - - +Page Not Found | protoc-gen-go-temporal + + + -
Skip to main content

Page Not Found

We could not find what you were looking for.

Please contact the owner of the site that linked you to the original URL and let them know their link is broken.

+
Skip to main content

Page Not Found

We could not find what you were looking for.

Please contact the owner of the site that linked you to the original URL and let them know their link is broken.

\ No newline at end of file diff --git a/assets/js/0145b50a.ecd185e2.js b/assets/js/0145b50a.6dedce92.js similarity index 62% rename from assets/js/0145b50a.ecd185e2.js rename to assets/js/0145b50a.6dedce92.js index 079c1779..5d7403eb 100644 --- a/assets/js/0145b50a.ecd185e2.js +++ b/assets/js/0145b50a.6dedce92.js @@ -1 +1 @@ -"use strict";(self.webpackChunkdocs=self.webpackChunkdocs||[]).push([[4737],{3829:(l,e,o)=>{o.r(e),o.d(e,{assets:()=>p,contentTitle:()=>a,default:()=>h,frontMatter:()=>d,metadata:()=>c,toc:()=>u});var t=o(4848),r=o(8453),n=o(1432);const i='syntax="proto3";\n\npackage example.helloworld.v1;\n\nimport "temporal/v1/temporal.proto";\n\nservice HelloWorld {\n option (temporal.v1.service) = {\n task_queue: "hello-world"\n };\n\n // HelloWorld describes a Temporal workflow and activity with the same name\n // and signature\n rpc HelloWorld(HelloWorldInput) returns (HelloWorldOutput) {\n option (temporal.v1.workflow) = {\n name: "HelloWorld"\n id: \'hello_world/${! uuid_v4() }\'\n };\n option (temporal.v1.activity) = {\n name: "HelloWorld"\n start_to_close_timeout: { seconds: 10 }\n };\n }\n}\n\n// HelloWorldInput describes the input to a HelloWorld task\nmessage HelloWorldInput {\n string name = 1;\n}\n\n// HelloWorldOutput describes the output from a HelloWorld task\nmessage HelloWorldOutput {\n string result = 1;\n}\n',s='package main\n\nimport (\n\t"context"\n\t"log"\n\t"os"\n\n\thelloworldv1 "github.com/cludden/protoc-gen-go-temporal/gen/example/helloworld/v1"\n\t"github.com/urfave/cli/v2"\n\t"go.temporal.io/sdk/activity"\n\t"go.temporal.io/sdk/client"\n\tsdklog "go.temporal.io/sdk/log"\n\t"go.temporal.io/sdk/worker"\n\t"go.temporal.io/sdk/workflow"\n)\n\ntype (\n\t// HelloWorldWorkflow provides a helloworldv1.HelloWorldWorkflow implementation\n\tHelloWorldWorkflow struct {\n\t\t*helloworldv1.HelloWorldWorkflowInput\n\t\tlog sdklog.Logger\n\t}\n\n\t// Activities provides a helloworldv1.HelloWorldActivities implementation\n\tActivities struct{}\n)\n\n// NewHelloWorldWorkflow initializes a new helloworldv1.HelloWorldWorkflow value\nfunc NewHelloWorldWorkflow(ctx workflow.Context, input *helloworldv1.HelloWorldWorkflowInput) (helloworldv1.HelloWorldWorkflow, error) {\n\treturn &HelloWorldWorkflow{input, workflow.GetLogger(ctx)}, nil\n}\n\n// Execute defines the entrypoint to a HelloWorld workflow\nfunc (w *HelloWorldWorkflow) Execute(ctx workflow.Context) (*helloworldv1.HelloWorldOutput, error) {\n\tresult, err := helloworldv1.HelloWorld(ctx, w.Req)\n\tif err != nil {\n\t\tw.log.Error("Activity failed.", "error", err)\n\t\treturn nil, err\n\t}\n\n\tw.log.Info("HelloWorld workflow completed.", "result", result.GetResult())\n\treturn result, nil\n}\n\n// HelloWorld defines the entrypoint to a HelloWorld activity\nfunc (a *Activities) HelloWorld(ctx context.Context, input *helloworldv1.HelloWorldInput) (*helloworldv1.HelloWorldOutput, error) {\n\tactivity.GetLogger(ctx).Info("Activity", "name", input.GetName())\n\treturn &helloworldv1.HelloWorldOutput{\n\t\tResult: "Hello " + input.GetName() + "!",\n\t}, nil\n}\n\nfunc main() {\n\tapp, err := helloworldv1.NewHelloWorldCli(\n\t\thelloworldv1.NewHelloWorldCliOptions().\n\t\t\tWithWorker(func(cmd *cli.Context, c client.Client) (worker.Worker, error) {\n\t\t\t\tw := worker.New(c, helloworldv1.HelloWorldTaskQueue, worker.Options{})\n\t\t\t\thelloworldv1.RegisterHelloWorldWorkflow(w, NewHelloWorldWorkflow)\n\t\t\t\thelloworldv1.RegisterHelloWorldActivities(w, &Activities{})\n\t\t\t\treturn w, nil\n\t\t\t}),\n\t)\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\n\tif err := app.Run(os.Args); err != nil {\n\t\tlog.Fatal(err)\n\t}\n}\n',d={},a="Hello World",c={id:"examples/helloworld",title:"Hello World",description:"A simple example inspired by temporalio/samples-go/helloworld",source:"@site/docs/examples/helloworld.mdx",sourceDirName:"examples",slug:"/examples/helloworld",permalink:"/docs/examples/helloworld",draft:!1,unlisted:!1,editUrl:"https://github.com/facebook/docusaurus/tree/main/packages/create-docusaurus/templates/shared/docs/examples/helloworld.mdx",tags:[],version:"current",frontMatter:{},sidebar:"examples",next:{title:"Codec Server",permalink:"/docs/examples/codecserver"}},p={},u=[{value:"Run this example",id:"run-this-example",level:2}];function m(l){const e={a:"a",code:"code",h1:"h1",h2:"h2",li:"li",ol:"ol",p:"p",pre:"pre",...(0,r.R)(),...l.components};return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(e.h1,{id:"hello-world",children:"Hello World"}),"\n",(0,t.jsxs)(e.p,{children:["A simple example inspired by ",(0,t.jsx)(e.a,{href:"https://github.com/temporalio/samples-go/tree/main/helloworld",children:"temporalio/samples-go/helloworld"})]}),"\n",(0,t.jsx)(n.A,{language:"protobuf",title:"example.proto",children:i}),"\n",(0,t.jsx)(n.A,{language:"go",title:"main.go",children:s}),"\n",(0,t.jsx)(e.h2,{id:"run-this-example",children:"Run this example"}),"\n",(0,t.jsxs)(e.ol,{children:["\n",(0,t.jsxs)(e.li,{children:["Clone the examples","\n",(0,t.jsx)(e.pre,{children:(0,t.jsx)(e.code,{className:"language-sh",children:"git clone https://github.com/cludden/protoc-gen-go-temporal && cd protoc-gen-go-temporal\n"})}),"\n"]}),"\n",(0,t.jsxs)(e.li,{children:["Run a local Temporal server","\n",(0,t.jsx)(e.pre,{children:(0,t.jsx)(e.code,{className:"language-sh",children:"temporal server start-dev\n"})}),"\n"]}),"\n",(0,t.jsxs)(e.li,{children:["Run the example worker","\n",(0,t.jsx)(e.pre,{children:(0,t.jsx)(e.code,{className:"language-sh",children:"go run examples/helloworld/main.go worker\n"})}),"\n"]}),"\n",(0,t.jsxs)(e.li,{children:["Execute a ",(0,t.jsx)(e.code,{children:"HelloWorld"})," workflow","\n",(0,t.jsx)(e.pre,{children:(0,t.jsx)(e.code,{className:"language-sh",children:"go run examples/helloworld/main.go hello-world --name Temporal\n"})}),"\n"]}),"\n"]})]})}function h(l={}){const{wrapper:e}={...(0,r.R)(),...l.components};return e?(0,t.jsx)(e,{...l,children:(0,t.jsx)(m,{...l})}):m(l)}}}]); \ No newline at end of file +"use strict";(self.webpackChunkdocs=self.webpackChunkdocs||[]).push([[4737],{3829:(l,e,o)=>{o.r(e),o.d(e,{assets:()=>p,contentTitle:()=>a,default:()=>h,frontMatter:()=>d,metadata:()=>c,toc:()=>u});var t=o(4848),r=o(8453),n=o(1432);const i='syntax="proto3";\n\npackage example.helloworld.v1;\n\nimport "temporal/v1/temporal.proto";\n\nservice HelloWorld {\n option (temporal.v1.service) = {\n task_queue: "hello-world"\n };\n\n // HelloWorld describes a Temporal workflow and activity with the same name\n // and signature\n rpc HelloWorld(HelloWorldInput) returns (HelloWorldOutput) {\n option (temporal.v1.workflow) = {\n name: "HelloWorld"\n id: \'hello_world/${! uuid_v4() }\'\n };\n option (temporal.v1.activity) = {\n name: "HelloWorld"\n start_to_close_timeout: { seconds: 10 }\n };\n }\n}\n\n// HelloWorldInput describes the input to a HelloWorld task\nmessage HelloWorldInput {\n string name = 1;\n}\n\n// HelloWorldOutput describes the output from a HelloWorld task\nmessage HelloWorldOutput {\n string result = 1;\n}\n',s='package main\n\nimport (\n\t"context"\n\t"log"\n\t"os"\n\n\thelloworldv1 "github.com/cludden/protoc-gen-go-temporal/gen/example/helloworld/v1"\n\t"github.com/urfave/cli/v2"\n\t"go.temporal.io/sdk/activity"\n\t"go.temporal.io/sdk/client"\n\tsdklog "go.temporal.io/sdk/log"\n\t"go.temporal.io/sdk/worker"\n\t"go.temporal.io/sdk/workflow"\n)\n\ntype (\n\t// HelloWorldWorkflow provides a helloworldv1.HelloWorldWorkflow implementation\n\tHelloWorldWorkflow struct {\n\t\t*helloworldv1.HelloWorldWorkflowInput\n\t\tlog sdklog.Logger\n\t}\n\n\t// Activities provides a helloworldv1.HelloWorldActivities implementation\n\tActivities struct{}\n)\n\n// NewHelloWorldWorkflow initializes a new helloworldv1.HelloWorldWorkflow value\nfunc NewHelloWorldWorkflow(ctx workflow.Context, input *helloworldv1.HelloWorldWorkflowInput) (helloworldv1.HelloWorldWorkflow, error) {\n\treturn &HelloWorldWorkflow{input, workflow.GetLogger(ctx)}, nil\n}\n\n// Execute defines the entrypoint to a HelloWorld workflow\nfunc (w *HelloWorldWorkflow) Execute(ctx workflow.Context) (*helloworldv1.HelloWorldOutput, error) {\n\tresult, err := helloworldv1.HelloWorld(ctx, w.Req)\n\tif err != nil {\n\t\tw.log.Error("Activity failed.", "error", err)\n\t\treturn nil, err\n\t}\n\n\tw.log.Info("HelloWorld workflow completed.", "result", result.GetResult())\n\treturn result, nil\n}\n\n// HelloWorld defines the entrypoint to a HelloWorld activity\nfunc (a *Activities) HelloWorld(ctx context.Context, input *helloworldv1.HelloWorldInput) (*helloworldv1.HelloWorldOutput, error) {\n\tactivity.GetLogger(ctx).Info("Activity", "name", input.GetName())\n\treturn &helloworldv1.HelloWorldOutput{\n\t\tResult: "Hello " + input.GetName() + "!",\n\t}, nil\n}\n\nfunc main() {\n\tapp, err := helloworldv1.NewHelloWorldCli(\n\t\thelloworldv1.NewHelloWorldCliOptions().\n\t\t\tWithWorker(func(cmd *cli.Context, c client.Client) (worker.Worker, error) {\n\t\t\t\tw := worker.New(c, helloworldv1.HelloWorldTaskQueue, worker.Options{})\n\t\t\t\thelloworldv1.RegisterHelloWorldWorkflow(w, NewHelloWorldWorkflow)\n\t\t\t\thelloworldv1.RegisterHelloWorldActivities(w, &Activities{})\n\t\t\t\treturn w, nil\n\t\t\t}),\n\t)\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\n\tif err := app.Run(os.Args); err != nil {\n\t\tlog.Fatal(err)\n\t}\n}\n',d={},a="Hello World",c={id:"examples/helloworld",title:"Hello World",description:"A simple example inspired by temporalio/samples-go/helloworld",source:"@site/docs/examples/helloworld.mdx",sourceDirName:"examples",slug:"/examples/helloworld",permalink:"/protoc-gen-go-temporal/docs/examples/helloworld",draft:!1,unlisted:!1,editUrl:"https://github.com/facebook/docusaurus/tree/main/packages/create-docusaurus/templates/shared/docs/examples/helloworld.mdx",tags:[],version:"current",frontMatter:{},sidebar:"examples",next:{title:"Codec Server",permalink:"/protoc-gen-go-temporal/docs/examples/codecserver"}},p={},u=[{value:"Run this example",id:"run-this-example",level:2}];function m(l){const e={a:"a",code:"code",h1:"h1",h2:"h2",li:"li",ol:"ol",p:"p",pre:"pre",...(0,r.R)(),...l.components};return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(e.h1,{id:"hello-world",children:"Hello World"}),"\n",(0,t.jsxs)(e.p,{children:["A simple example inspired by ",(0,t.jsx)(e.a,{href:"https://github.com/temporalio/samples-go/tree/main/helloworld",children:"temporalio/samples-go/helloworld"})]}),"\n",(0,t.jsx)(n.A,{language:"protobuf",title:"example.proto",children:i}),"\n",(0,t.jsx)(n.A,{language:"go",title:"main.go",children:s}),"\n",(0,t.jsx)(e.h2,{id:"run-this-example",children:"Run this example"}),"\n",(0,t.jsxs)(e.ol,{children:["\n",(0,t.jsxs)(e.li,{children:["Clone the examples","\n",(0,t.jsx)(e.pre,{children:(0,t.jsx)(e.code,{className:"language-sh",children:"git clone https://github.com/cludden/protoc-gen-go-temporal && cd protoc-gen-go-temporal\n"})}),"\n"]}),"\n",(0,t.jsxs)(e.li,{children:["Run a local Temporal server","\n",(0,t.jsx)(e.pre,{children:(0,t.jsx)(e.code,{className:"language-sh",children:"temporal server start-dev\n"})}),"\n"]}),"\n",(0,t.jsxs)(e.li,{children:["Run the example worker","\n",(0,t.jsx)(e.pre,{children:(0,t.jsx)(e.code,{className:"language-sh",children:"go run examples/helloworld/main.go worker\n"})}),"\n"]}),"\n",(0,t.jsxs)(e.li,{children:["Execute a ",(0,t.jsx)(e.code,{children:"HelloWorld"})," workflow","\n",(0,t.jsx)(e.pre,{children:(0,t.jsx)(e.code,{className:"language-sh",children:"go run examples/helloworld/main.go hello-world --name Temporal\n"})}),"\n"]}),"\n"]})]})}function h(l={}){const{wrapper:e}={...(0,r.R)(),...l.components};return e?(0,t.jsx)(e,{...l,children:(0,t.jsx)(m,{...l})}):m(l)}}}]); \ No newline at end of file diff --git a/assets/js/031793e1.5ce2668b.js b/assets/js/031793e1.5ce2668b.js deleted file mode 100644 index f81c87c8..00000000 --- a/assets/js/031793e1.5ce2668b.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunkdocs=self.webpackChunkdocs||[]).push([[6334],{1794:s=>{s.exports=JSON.parse('{"label":"facebook","permalink":"/blog/tags/facebook","allTagsPath":"/blog/tags","count":1,"unlisted":false}')}}]); \ No newline at end of file diff --git a/assets/js/046e2194.882fe9bc.js b/assets/js/046e2194.882fe9bc.js deleted file mode 100644 index bb0ae42b..00000000 --- a/assets/js/046e2194.882fe9bc.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunkdocs=self.webpackChunkdocs||[]).push([[3568],{7607:(e,t,n)=>{n.r(t),n.d(t,{assets:()=>c,contentTitle:()=>i,default:()=>p,frontMatter:()=>o,metadata:()=>u,toc:()=>d});var r=n(4848),a=n(8453),l=n(1470),s=n(9365);const o={},i="Install",u={id:"install",title:"Install",description:"This installation method omits detailed version metadata in generated file headers.",source:"@site/docs/install.mdx",sourceDirName:".",slug:"/install",permalink:"/docs/install",draft:!1,unlisted:!1,editUrl:"https://github.com/facebook/docusaurus/tree/main/packages/create-docusaurus/templates/shared/docs/install.mdx",tags:[],version:"current",frontMatter:{},sidebar:"docs",previous:{title:"About",permalink:"/docs/about"},next:{title:"Getting Started",permalink:"/docs/getting-started"}},c={},d=[{value:"Dependencies",id:"dependencies",level:2}];function h(e){const t={a:"a",admonition:"admonition",code:"code",h1:"h1",h2:"h2",p:"p",pre:"pre",strong:"strong",...(0,a.R)(),...e.components},{Details:n}=t;return n||function(e,t){throw new Error("Expected "+(t?"component":"object")+" `"+e+"` to be defined: you likely forgot to import, pass, or provide it.")}("Details",!0),(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(t.h1,{id:"install",children:"Install"}),"\n",(0,r.jsxs)(l.A,{children:[(0,r.jsx)(s.A,{value:"brew",label:"brew",children:(0,r.jsx)(t.pre,{children:(0,r.jsx)(t.code,{className:"language-sh",children:"brew install cludden/formula/protoc-gen-go_temporal\n"})})}),(0,r.jsx)(s.A,{value:"curl",label:"curl",children:(0,r.jsx)(t.pre,{children:(0,r.jsx)(t.code,{className:"language-sh",children:"curl -L https://raw.githubusercontent.com/cludden/protoc-gen-go-temporal/main/scripts/install.sh | bash\n"})})}),(0,r.jsxs)(s.A,{value:"go",label:"go",children:[(0,r.jsx)(t.admonition,{type:"warning",children:(0,r.jsx)(t.p,{children:"This installation method omits detailed version metadata in generated file headers."})}),(0,r.jsx)(t.pre,{children:(0,r.jsx)(t.code,{className:"language-sh",children:"go install github.com/cludden/protoc-gen-go-temporal/cmd/protoc-gen-go_temporal@\n"})})]})]}),"\n",(0,r.jsx)(t.h2,{id:"dependencies",children:"Dependencies"}),"\n",(0,r.jsxs)(n,{children:[(0,r.jsxs)("summary",{children:["1. Install ",(0,r.jsx)(t.strong,{children:(0,r.jsx)(t.a,{href:"https://docs.buf.build/installation",children:"buf"})})]}),(0,r.jsxs)(l.A,{children:[(0,r.jsx)(s.A,{value:"brew",label:"brew",children:(0,r.jsx)(t.pre,{children:(0,r.jsx)(t.code,{className:"language-sh",children:"brew install bufbuild/buf/buf\n"})})}),(0,r.jsx)(s.A,{value:"curl",label:"curl",children:(0,r.jsx)(t.pre,{children:(0,r.jsx)(t.code,{className:"language-sh",children:'# Substitute BIN for your bin directory.\n# Substitute VERSION for the current released version.\nBIN="/usr/local/bin" && \\\nVERSION="1.30.0" && \\\ncurl -sSL \\\n"https://github.com/bufbuild/buf/releases/download/v${VERSION}/buf-$(uname -s)-$(uname -m)" \\\n-o "${BIN}/buf" && \\\nchmod +x "${BIN}/buf"\n'})})})]})]}),"\n",(0,r.jsxs)(n,{children:[(0,r.jsxs)("summary",{children:["2. Install ",(0,r.jsx)(t.strong,{children:(0,r.jsx)(t.a,{href:"https://github.com/golang/protobuf",children:"protoc-gen-go"})})]}),(0,r.jsxs)(l.A,{children:[(0,r.jsx)(s.A,{value:"brew",label:"brew",children:(0,r.jsx)(t.pre,{children:(0,r.jsx)(t.code,{className:"language-sh",children:"brew install protoc-gen-go\n"})})}),(0,r.jsx)(s.A,{value:"go",label:"go",children:(0,r.jsx)(t.pre,{children:(0,r.jsx)(t.code,{className:"language-sh",children:"go install google.golang.org/protobuf/cmd/protoc-gen-go@latest\n"})})})]})]}),"\n",(0,r.jsxs)(n,{children:[(0,r.jsxs)("summary",{children:["3. Install ",(0,r.jsx)(t.strong,{children:(0,r.jsx)(t.a,{href:"https://docs.temporal.io/cli#install",children:"temporal"})})]}),(0,r.jsxs)(l.A,{children:[(0,r.jsx)(s.A,{value:"brew",label:"brew",children:(0,r.jsx)(t.pre,{children:(0,r.jsx)(t.code,{className:"language-sh",children:"brew install temporal\n"})})}),(0,r.jsx)(s.A,{value:"curl",label:"curl",children:(0,r.jsx)(t.pre,{children:(0,r.jsx)(t.code,{className:"language-sh",children:"curl -sSf https://temporal.download/cli.sh | sh\n"})})})]})]})]})}function p(e={}){const{wrapper:t}={...(0,a.R)(),...e.components};return t?(0,r.jsx)(t,{...e,children:(0,r.jsx)(h,{...e})}):h(e)}},9365:(e,t,n)=>{n.d(t,{A:()=>s});n(6540);var r=n(4164);const a={tabItem:"tabItem_Ymn6"};var l=n(4848);function s(e){let{children:t,hidden:n,className:s}=e;return(0,l.jsx)("div",{role:"tabpanel",className:(0,r.A)(a.tabItem,s),hidden:n,children:t})}},1470:(e,t,n)=>{n.d(t,{A:()=>y});var r=n(6540),a=n(4164),l=n(3104),s=n(6347),o=n(205),i=n(7485),u=n(1682),c=n(9466);function d(e){return r.Children.toArray(e).filter((e=>"\n"!==e)).map((e=>{if(!e||(0,r.isValidElement)(e)&&function(e){const{props:t}=e;return!!t&&"object"==typeof t&&"value"in t}(e))return e;throw new Error(`Docusaurus error: Bad child <${"string"==typeof e.type?e.type:e.type.name}>: all children of the component should be , and every should have a unique "value" prop.`)}))?.filter(Boolean)??[]}function h(e){const{values:t,children:n}=e;return(0,r.useMemo)((()=>{const e=t??function(e){return d(e).map((e=>{let{props:{value:t,label:n,attributes:r,default:a}}=e;return{value:t,label:n,attributes:r,default:a}}))}(n);return function(e){const t=(0,u.X)(e,((e,t)=>e.value===t.value));if(t.length>0)throw new Error(`Docusaurus error: Duplicate values "${t.map((e=>e.value)).join(", ")}" found in . Every value needs to be unique.`)}(e),e}),[t,n])}function p(e){let{value:t,tabValues:n}=e;return n.some((e=>e.value===t))}function b(e){let{queryString:t=!1,groupId:n}=e;const a=(0,s.W6)(),l=function(e){let{queryString:t=!1,groupId:n}=e;if("string"==typeof t)return t;if(!1===t)return null;if(!0===t&&!n)throw new Error('Docusaurus error: The component groupId prop is required if queryString=true, because this value is used as the search param name. You can also provide an explicit value such as queryString="my-search-param".');return n??null}({queryString:t,groupId:n});return[(0,i.aZ)(l),(0,r.useCallback)((e=>{if(!l)return;const t=new URLSearchParams(a.location.search);t.set(l,e),a.replace({...a.location,search:t.toString()})}),[l,a])]}function m(e){const{defaultValue:t,queryString:n=!1,groupId:a}=e,l=h(e),[s,i]=(0,r.useState)((()=>function(e){let{defaultValue:t,tabValues:n}=e;if(0===n.length)throw new Error("Docusaurus error: the component requires at least one children component");if(t){if(!p({value:t,tabValues:n}))throw new Error(`Docusaurus error: The has a defaultValue "${t}" but none of its children has the corresponding value. Available values are: ${n.map((e=>e.value)).join(", ")}. If you intend to show no default tab, use defaultValue={null} instead.`);return t}const r=n.find((e=>e.default))??n[0];if(!r)throw new Error("Unexpected error: 0 tabValues");return r.value}({defaultValue:t,tabValues:l}))),[u,d]=b({queryString:n,groupId:a}),[m,f]=function(e){let{groupId:t}=e;const n=function(e){return e?`docusaurus.tab.${e}`:null}(t),[a,l]=(0,c.Dv)(n);return[a,(0,r.useCallback)((e=>{n&&l.set(e)}),[n,l])]}({groupId:a}),g=(()=>{const e=u??m;return p({value:e,tabValues:l})?e:null})();(0,o.A)((()=>{g&&i(g)}),[g]);return{selectedValue:s,selectValue:(0,r.useCallback)((e=>{if(!p({value:e,tabValues:l}))throw new Error(`Can't select invalid tab value=${e}`);i(e),d(e),f(e)}),[d,f,l]),tabValues:l}}var f=n(2303);const g={tabList:"tabList__CuJ",tabItem:"tabItem_LNqP"};var x=n(4848);function v(e){let{className:t,block:n,selectedValue:r,selectValue:s,tabValues:o}=e;const i=[],{blockElementScrollPositionUntilNextRender:u}=(0,l.a_)(),c=e=>{const t=e.currentTarget,n=i.indexOf(t),a=o[n].value;a!==r&&(u(t),s(a))},d=e=>{let t=null;switch(e.key){case"Enter":c(e);break;case"ArrowRight":{const n=i.indexOf(e.currentTarget)+1;t=i[n]??i[0];break}case"ArrowLeft":{const n=i.indexOf(e.currentTarget)-1;t=i[n]??i[i.length-1];break}}t?.focus()};return(0,x.jsx)("ul",{role:"tablist","aria-orientation":"horizontal",className:(0,a.A)("tabs",{"tabs--block":n},t),children:o.map((e=>{let{value:t,label:n,attributes:l}=e;return(0,x.jsx)("li",{role:"tab",tabIndex:r===t?0:-1,"aria-selected":r===t,ref:e=>i.push(e),onKeyDown:d,onClick:c,...l,className:(0,a.A)("tabs__item",g.tabItem,l?.className,{"tabs__item--active":r===t}),children:n??t},t)}))})}function j(e){let{lazy:t,children:n,selectedValue:a}=e;const l=(Array.isArray(n)?n:[n]).filter(Boolean);if(t){const e=l.find((e=>e.props.value===a));return e?(0,r.cloneElement)(e,{className:"margin-top--md"}):null}return(0,x.jsx)("div",{className:"margin-top--md",children:l.map(((e,t)=>(0,r.cloneElement)(e,{key:t,hidden:e.props.value!==a})))})}function w(e){const t=m(e);return(0,x.jsxs)("div",{className:(0,a.A)("tabs-container",g.tabList),children:[(0,x.jsx)(v,{...e,...t}),(0,x.jsx)(j,{...e,...t})]})}function y(e){const t=(0,f.A)();return(0,x.jsx)(w,{...e,children:d(e.children)},String(t))}},8453:(e,t,n)=>{n.d(t,{R:()=>s,x:()=>o});var r=n(6540);const a={},l=r.createContext(a);function s(e){const t=r.useContext(l);return r.useMemo((function(){return"function"==typeof e?e(t):{...t,...e}}),[t,e])}function o(e){let t;return t=e.disableParentContext?"function"==typeof e.components?e.components(a):e.components||a:s(e.components),r.createElement(l.Provider,{value:t},e.children)}}}]); \ No newline at end of file diff --git a/assets/js/046e2194.cc4bb0eb.js b/assets/js/046e2194.cc4bb0eb.js new file mode 100644 index 00000000..160a3637 --- /dev/null +++ b/assets/js/046e2194.cc4bb0eb.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunkdocs=self.webpackChunkdocs||[]).push([[3568],{7607:(e,t,n)=>{n.r(t),n.d(t,{assets:()=>u,contentTitle:()=>i,default:()=>p,frontMatter:()=>o,metadata:()=>c,toc:()=>d});var r=n(4848),a=n(8453),l=n(1470),s=n(9365);const o={},i="Install",c={id:"install",title:"Install",description:"This installation method omits detailed version metadata in generated file headers.",source:"@site/docs/install.mdx",sourceDirName:".",slug:"/install",permalink:"/protoc-gen-go-temporal/docs/install",draft:!1,unlisted:!1,editUrl:"https://github.com/facebook/docusaurus/tree/main/packages/create-docusaurus/templates/shared/docs/install.mdx",tags:[],version:"current",frontMatter:{},sidebar:"docs",previous:{title:"About",permalink:"/protoc-gen-go-temporal/docs/about"},next:{title:"Getting Started",permalink:"/protoc-gen-go-temporal/docs/getting-started"}},u={},d=[{value:"Dependencies",id:"dependencies",level:2}];function h(e){const t={a:"a",admonition:"admonition",code:"code",h1:"h1",h2:"h2",p:"p",pre:"pre",strong:"strong",...(0,a.R)(),...e.components},{Details:n}=t;return n||function(e,t){throw new Error("Expected "+(t?"component":"object")+" `"+e+"` to be defined: you likely forgot to import, pass, or provide it.")}("Details",!0),(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(t.h1,{id:"install",children:"Install"}),"\n",(0,r.jsxs)(l.A,{children:[(0,r.jsx)(s.A,{value:"brew",label:"brew",children:(0,r.jsx)(t.pre,{children:(0,r.jsx)(t.code,{className:"language-sh",children:"brew install cludden/formula/protoc-gen-go_temporal\n"})})}),(0,r.jsx)(s.A,{value:"curl",label:"curl",children:(0,r.jsx)(t.pre,{children:(0,r.jsx)(t.code,{className:"language-sh",children:"curl -L https://raw.githubusercontent.com/cludden/protoc-gen-go-temporal/main/scripts/install.sh | bash\n"})})}),(0,r.jsxs)(s.A,{value:"go",label:"go",children:[(0,r.jsx)(t.admonition,{type:"warning",children:(0,r.jsx)(t.p,{children:"This installation method omits detailed version metadata in generated file headers."})}),(0,r.jsx)(t.pre,{children:(0,r.jsx)(t.code,{className:"language-sh",children:"go install github.com/cludden/protoc-gen-go-temporal/cmd/protoc-gen-go_temporal@\n"})})]})]}),"\n",(0,r.jsx)(t.h2,{id:"dependencies",children:"Dependencies"}),"\n",(0,r.jsxs)(n,{children:[(0,r.jsxs)("summary",{children:["1. Install ",(0,r.jsx)(t.strong,{children:(0,r.jsx)(t.a,{href:"https://docs.buf.build/installation",children:"buf"})})]}),(0,r.jsxs)(l.A,{children:[(0,r.jsx)(s.A,{value:"brew",label:"brew",children:(0,r.jsx)(t.pre,{children:(0,r.jsx)(t.code,{className:"language-sh",children:"brew install bufbuild/buf/buf\n"})})}),(0,r.jsx)(s.A,{value:"curl",label:"curl",children:(0,r.jsx)(t.pre,{children:(0,r.jsx)(t.code,{className:"language-sh",children:'# Substitute BIN for your bin directory.\n# Substitute VERSION for the current released version.\nBIN="/usr/local/bin" && \\\nVERSION="1.30.0" && \\\ncurl -sSL \\\n"https://github.com/bufbuild/buf/releases/download/v${VERSION}/buf-$(uname -s)-$(uname -m)" \\\n-o "${BIN}/buf" && \\\nchmod +x "${BIN}/buf"\n'})})})]})]}),"\n",(0,r.jsxs)(n,{children:[(0,r.jsxs)("summary",{children:["2. Install ",(0,r.jsx)(t.strong,{children:(0,r.jsx)(t.a,{href:"https://github.com/golang/protobuf",children:"protoc-gen-go"})})]}),(0,r.jsxs)(l.A,{children:[(0,r.jsx)(s.A,{value:"brew",label:"brew",children:(0,r.jsx)(t.pre,{children:(0,r.jsx)(t.code,{className:"language-sh",children:"brew install protoc-gen-go\n"})})}),(0,r.jsx)(s.A,{value:"go",label:"go",children:(0,r.jsx)(t.pre,{children:(0,r.jsx)(t.code,{className:"language-sh",children:"go install google.golang.org/protobuf/cmd/protoc-gen-go@latest\n"})})})]})]}),"\n",(0,r.jsxs)(n,{children:[(0,r.jsxs)("summary",{children:["3. Install ",(0,r.jsx)(t.strong,{children:(0,r.jsx)(t.a,{href:"https://docs.temporal.io/cli#install",children:"temporal"})})]}),(0,r.jsxs)(l.A,{children:[(0,r.jsx)(s.A,{value:"brew",label:"brew",children:(0,r.jsx)(t.pre,{children:(0,r.jsx)(t.code,{className:"language-sh",children:"brew install temporal\n"})})}),(0,r.jsx)(s.A,{value:"curl",label:"curl",children:(0,r.jsx)(t.pre,{children:(0,r.jsx)(t.code,{className:"language-sh",children:"curl -sSf https://temporal.download/cli.sh | sh\n"})})})]})]})]})}function p(e={}){const{wrapper:t}={...(0,a.R)(),...e.components};return t?(0,r.jsx)(t,{...e,children:(0,r.jsx)(h,{...e})}):h(e)}},9365:(e,t,n)=>{n.d(t,{A:()=>s});n(6540);var r=n(4164);const a={tabItem:"tabItem_Ymn6"};var l=n(4848);function s(e){let{children:t,hidden:n,className:s}=e;return(0,l.jsx)("div",{role:"tabpanel",className:(0,r.A)(a.tabItem,s),hidden:n,children:t})}},1470:(e,t,n)=>{n.d(t,{A:()=>y});var r=n(6540),a=n(4164),l=n(3104),s=n(6347),o=n(205),i=n(7485),c=n(1682),u=n(9466);function d(e){return r.Children.toArray(e).filter((e=>"\n"!==e)).map((e=>{if(!e||(0,r.isValidElement)(e)&&function(e){const{props:t}=e;return!!t&&"object"==typeof t&&"value"in t}(e))return e;throw new Error(`Docusaurus error: Bad child <${"string"==typeof e.type?e.type:e.type.name}>: all children of the component should be , and every should have a unique "value" prop.`)}))?.filter(Boolean)??[]}function h(e){const{values:t,children:n}=e;return(0,r.useMemo)((()=>{const e=t??function(e){return d(e).map((e=>{let{props:{value:t,label:n,attributes:r,default:a}}=e;return{value:t,label:n,attributes:r,default:a}}))}(n);return function(e){const t=(0,c.X)(e,((e,t)=>e.value===t.value));if(t.length>0)throw new Error(`Docusaurus error: Duplicate values "${t.map((e=>e.value)).join(", ")}" found in . Every value needs to be unique.`)}(e),e}),[t,n])}function p(e){let{value:t,tabValues:n}=e;return n.some((e=>e.value===t))}function b(e){let{queryString:t=!1,groupId:n}=e;const a=(0,s.W6)(),l=function(e){let{queryString:t=!1,groupId:n}=e;if("string"==typeof t)return t;if(!1===t)return null;if(!0===t&&!n)throw new Error('Docusaurus error: The component groupId prop is required if queryString=true, because this value is used as the search param name. You can also provide an explicit value such as queryString="my-search-param".');return n??null}({queryString:t,groupId:n});return[(0,i.aZ)(l),(0,r.useCallback)((e=>{if(!l)return;const t=new URLSearchParams(a.location.search);t.set(l,e),a.replace({...a.location,search:t.toString()})}),[l,a])]}function m(e){const{defaultValue:t,queryString:n=!1,groupId:a}=e,l=h(e),[s,i]=(0,r.useState)((()=>function(e){let{defaultValue:t,tabValues:n}=e;if(0===n.length)throw new Error("Docusaurus error: the component requires at least one children component");if(t){if(!p({value:t,tabValues:n}))throw new Error(`Docusaurus error: The has a defaultValue "${t}" but none of its children has the corresponding value. Available values are: ${n.map((e=>e.value)).join(", ")}. If you intend to show no default tab, use defaultValue={null} instead.`);return t}const r=n.find((e=>e.default))??n[0];if(!r)throw new Error("Unexpected error: 0 tabValues");return r.value}({defaultValue:t,tabValues:l}))),[c,d]=b({queryString:n,groupId:a}),[m,g]=function(e){let{groupId:t}=e;const n=function(e){return e?`docusaurus.tab.${e}`:null}(t),[a,l]=(0,u.Dv)(n);return[a,(0,r.useCallback)((e=>{n&&l.set(e)}),[n,l])]}({groupId:a}),f=(()=>{const e=c??m;return p({value:e,tabValues:l})?e:null})();(0,o.A)((()=>{f&&i(f)}),[f]);return{selectedValue:s,selectValue:(0,r.useCallback)((e=>{if(!p({value:e,tabValues:l}))throw new Error(`Can't select invalid tab value=${e}`);i(e),d(e),g(e)}),[d,g,l]),tabValues:l}}var g=n(2303);const f={tabList:"tabList__CuJ",tabItem:"tabItem_LNqP"};var x=n(4848);function v(e){let{className:t,block:n,selectedValue:r,selectValue:s,tabValues:o}=e;const i=[],{blockElementScrollPositionUntilNextRender:c}=(0,l.a_)(),u=e=>{const t=e.currentTarget,n=i.indexOf(t),a=o[n].value;a!==r&&(c(t),s(a))},d=e=>{let t=null;switch(e.key){case"Enter":u(e);break;case"ArrowRight":{const n=i.indexOf(e.currentTarget)+1;t=i[n]??i[0];break}case"ArrowLeft":{const n=i.indexOf(e.currentTarget)-1;t=i[n]??i[i.length-1];break}}t?.focus()};return(0,x.jsx)("ul",{role:"tablist","aria-orientation":"horizontal",className:(0,a.A)("tabs",{"tabs--block":n},t),children:o.map((e=>{let{value:t,label:n,attributes:l}=e;return(0,x.jsx)("li",{role:"tab",tabIndex:r===t?0:-1,"aria-selected":r===t,ref:e=>i.push(e),onKeyDown:d,onClick:u,...l,className:(0,a.A)("tabs__item",f.tabItem,l?.className,{"tabs__item--active":r===t}),children:n??t},t)}))})}function j(e){let{lazy:t,children:n,selectedValue:a}=e;const l=(Array.isArray(n)?n:[n]).filter(Boolean);if(t){const e=l.find((e=>e.props.value===a));return e?(0,r.cloneElement)(e,{className:"margin-top--md"}):null}return(0,x.jsx)("div",{className:"margin-top--md",children:l.map(((e,t)=>(0,r.cloneElement)(e,{key:t,hidden:e.props.value!==a})))})}function w(e){const t=m(e);return(0,x.jsxs)("div",{className:(0,a.A)("tabs-container",f.tabList),children:[(0,x.jsx)(v,{...e,...t}),(0,x.jsx)(j,{...e,...t})]})}function y(e){const t=(0,g.A)();return(0,x.jsx)(w,{...e,children:d(e.children)},String(t))}},8453:(e,t,n)=>{n.d(t,{R:()=>s,x:()=>o});var r=n(6540);const a={},l=r.createContext(a);function s(e){const t=r.useContext(l);return r.useMemo((function(){return"function"==typeof e?e(t):{...t,...e}}),[t,e])}function o(e){let t;return t=e.disableParentContext?"function"==typeof e.components?e.components(a):e.components||a:s(e.components),r.createElement(l.Provider,{value:t},e.children)}}}]); \ No newline at end of file diff --git a/assets/js/096bfee4.cf1a9176.js b/assets/js/096bfee4.cf1a9176.js deleted file mode 100644 index f1e75a1d..00000000 --- a/assets/js/096bfee4.cf1a9176.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunkdocs=self.webpackChunkdocs||[]).push([[1398],{5305:e=>{e.exports=JSON.parse('{"permalink":"/blog/tags/facebook","page":1,"postsPerPage":10,"totalPages":1,"totalCount":1,"blogDescription":"Blog","blogTitle":"Blog"}')}}]); \ No newline at end of file diff --git a/assets/js/0c3ea4cb.d9dcdf11.js b/assets/js/0c3ea4cb.ce5ad2c6.js similarity index 57% rename from assets/js/0c3ea4cb.d9dcdf11.js rename to assets/js/0c3ea4cb.ce5ad2c6.js index df51756e..94522913 100644 --- a/assets/js/0c3ea4cb.d9dcdf11.js +++ b/assets/js/0c3ea4cb.ce5ad2c6.js @@ -1 +1 @@ -"use strict";(self.webpackChunkdocs=self.webpackChunkdocs||[]).push([[7312],{1528:(e,t,n)=>{n.r(t),n.d(t,{assets:()=>d,contentTitle:()=>m,default:()=>g,frontMatter:()=>o,metadata:()=>s,toc:()=>u});var a=n(4848),r=n(8453),i=n(1432);const l='syntax="proto3";\n\npackage example.updatabletimer.v1;\n\nimport "google/protobuf/empty.proto";\nimport "google/protobuf/timestamp.proto";\nimport "temporal/v1/temporal.proto";\n\nservice Example {\n option (temporal.v1.service) = {\n task_queue: "updatable-timer"\n };\n\n // GetWakeUpTime retrieves the current timer expiration timestamp\n rpc GetWakeUpTime(google.protobuf.Empty) returns (GetWakeUpTimeOutput) {\n option (temporal.v1.query) = {};\n }\n\n // UpdatableTimer describes an updatable timer workflow\n rpc UpdatableTimer(UpdatableTimerInput) returns (google.protobuf.Empty) {\n option (temporal.v1.workflow) = {\n name: "UpdatableTimer"\n id: \'updatable-timer/${! name.or(uuid_v4()) }\'\n query: { ref: "GetWakeUpTime" }\n signal: { ref: "UpdateWakeUpTime" }\n };\n }\n\n // UpdateWakeUpTime updates the timer expiration timestamp\n rpc UpdateWakeUpTime(UpdateWakeUpTimeInput) returns (google.protobuf.Empty) {\n option (temporal.v1.signal) = {};\n }\n}\n\n// GetWakeUpTimeOutput describes the input to a GetWakeUpTime query\nmessage GetWakeUpTimeOutput {\n google.protobuf.Timestamp wake_up_time = 1;\n}\n\n// UpdatableTimerInput describes the input to a UpdatableTimer workflow\nmessage UpdatableTimerInput {\n google.protobuf.Timestamp initial_wake_up_time = 1;\n string name = 2;\n}\n\n// UpdateWakeUpTimeInput describes the input to a UpdateWakeUpTime signal\nmessage UpdateWakeUpTimeInput {\n google.protobuf.Timestamp wake_up_time = 1;\n}\n',p='package main\n\nimport (\n\t"log"\n\t"os"\n\n\tupdatabletimerv1 "github.com/cludden/protoc-gen-go-temporal/gen/example/updatabletimer/v1"\n\t"github.com/urfave/cli/v2"\n\t"go.temporal.io/sdk/client"\n\ttlog "go.temporal.io/sdk/log"\n\t"go.temporal.io/sdk/worker"\n\t"go.temporal.io/sdk/workflow"\n\t"google.golang.org/protobuf/types/known/timestamppb"\n)\n\n// UpdatableTimerWorkflow provides a updatabletimerv1.UpdatableTimerWorkflow implementation\ntype UpdatableTimerWorkflow struct {\n\t*updatabletimerv1.UpdatableTimerWorkflowInput\n\tlog tlog.Logger\n\twakeUpTime *timestamppb.Timestamp\n}\n\n// NewUpdatableTimerWorkflow initializes a new updatabletimerv1.UpdatableTimerWorkflow value\nfunc NewUpdatableTimerWorkflow(ctx workflow.Context, input *updatabletimerv1.UpdatableTimerWorkflowInput) (updatabletimerv1.UpdatableTimerWorkflow, error) {\n\treturn &UpdatableTimerWorkflow{input, workflow.GetLogger(ctx), input.Req.GetInitialWakeUpTime()}, nil\n}\n\n// Execute defines the entrypoint to a UpdatableTimer workflow\nfunc (w *UpdatableTimerWorkflow) Execute(ctx workflow.Context) error {\n\tfor timerFired := false; !timerFired && ctx.Err() == nil; {\n\t\ttimerCtx, cancelTimer := workflow.WithCancel(ctx)\n\t\ttimer := workflow.NewTimer(timerCtx, w.wakeUpTime.AsTime().Sub(workflow.Now(ctx)))\n\t\tw.log.Info("SleepUntil", "WakeUpTime", w.wakeUpTime)\n\n\t\tworkflow.NewSelector(ctx).\n\t\t\tAddFuture(timer, func(f workflow.Future) {\n\t\t\t\tif err := f.Get(timerCtx, nil); err != nil {\n\t\t\t\t\tw.log.Info("Timer canceled")\n\t\t\t\t} else {\n\t\t\t\t\tw.log.Info("Timer fired")\n\t\t\t\t\ttimerFired = true\n\t\t\t\t}\n\t\t\t}).\n\t\t\tAddReceive(w.UpdateWakeUpTime.Channel, func(workflow.ReceiveChannel, bool) {\n\t\t\t\tdefer cancelTimer()\n\t\t\t\tw.wakeUpTime = w.UpdateWakeUpTime.ReceiveAsync().GetWakeUpTime()\n\t\t\t\tw.log.Info("WakeUpTime updated", "WakeUpTime", w.wakeUpTime)\n\t\t\t}).\n\t\t\tSelect(ctx)\n\t}\n\treturn ctx.Err()\n}\n\n// GetWakeUpTime defines the entrypoint to a GetWakeUpTime query\nfunc (w *UpdatableTimerWorkflow) GetWakeUpTime() (*updatabletimerv1.GetWakeUpTimeOutput, error) {\n\treturn &updatabletimerv1.GetWakeUpTimeOutput{WakeUpTime: w.wakeUpTime}, nil\n}\n\nfunc main() {\n\tapp, err := updatabletimerv1.NewExampleCli(\n\t\tupdatabletimerv1.NewExampleCliOptions().WithWorker(func(cmd *cli.Context, c client.Client) (worker.Worker, error) {\n\t\t\tw := worker.New(c, updatabletimerv1.ExampleTaskQueue, worker.Options{})\n\t\t\tupdatabletimerv1.RegisterUpdatableTimerWorkflow(w, NewUpdatableTimerWorkflow)\n\t\t\treturn w, nil\n\t\t}),\n\t)\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\n\tif err := app.Run(os.Args); err != nil {\n\t\tlog.Fatal(err)\n\t}\n}\n',o={},m="Updatable Timer",s={id:"examples/updatabletimer",title:"Updatable Timer",description:"A simple example inspired by temporalio/samples-go/updatabletimer",source:"@site/docs/examples/updatabletimer.mdx",sourceDirName:"examples",slug:"/examples/updatabletimer",permalink:"/docs/examples/updatabletimer",draft:!1,unlisted:!1,editUrl:"https://github.com/facebook/docusaurus/tree/main/packages/create-docusaurus/templates/shared/docs/examples/updatabletimer.mdx",tags:[],version:"current",frontMatter:{},sidebar:"examples",previous:{title:"Search Attributes",permalink:"/docs/examples/searchattributes"}},d={},u=[{value:"Run this example",id:"run-this-example",level:2}];function c(e){const t={a:"a",code:"code",h1:"h1",h2:"h2",li:"li",ol:"ol",p:"p",pre:"pre",...(0,r.R)(),...e.components};return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(t.h1,{id:"updatable-timer",children:"Updatable Timer"}),"\n",(0,a.jsxs)(t.p,{children:["A simple example inspired by ",(0,a.jsx)(t.a,{href:"https://github.com/temporalio/samples-go/tree/main/updatabletimer",children:"temporalio/samples-go/updatabletimer"})]}),"\n",(0,a.jsx)(i.A,{language:"protobuf",title:"example.proto",children:l}),"\n",(0,a.jsx)(i.A,{language:"go",title:"main.go",children:p}),"\n",(0,a.jsx)(t.h2,{id:"run-this-example",children:"Run this example"}),"\n",(0,a.jsxs)(t.ol,{children:["\n",(0,a.jsxs)(t.li,{children:["\n",(0,a.jsx)(t.p,{children:"Clone the examples"}),"\n",(0,a.jsx)(t.pre,{children:(0,a.jsx)(t.code,{className:"language-sh",children:"git clone https://github.com/cludden/protoc-gen-go-temporal && cd protoc-gen-go-temporal\n"})}),"\n"]}),"\n",(0,a.jsxs)(t.li,{children:["\n",(0,a.jsx)(t.p,{children:"Run a local Temporal server"}),"\n",(0,a.jsx)(t.pre,{children:(0,a.jsx)(t.code,{className:"language-sh",children:"temporal server start-dev\n"})}),"\n"]}),"\n",(0,a.jsxs)(t.li,{children:["\n",(0,a.jsx)(t.p,{children:"Run the example worker"}),"\n",(0,a.jsx)(t.pre,{children:(0,a.jsx)(t.code,{className:"language-sh",children:"go run examples/updatabletimer/main.go worker\n"})}),"\n"]}),"\n",(0,a.jsxs)(t.li,{children:["\n",(0,a.jsxs)(t.p,{children:["Initialize an ",(0,a.jsx)(t.code,{children:"UpdatableTimer"})," workflow with an expiration ",(0,a.jsx)(t.code,{children:"1h"})," in the future"]}),"\n",(0,a.jsx)(t.pre,{children:(0,a.jsx)(t.code,{className:"language-sh",children:'go run examples/updatabletimer/main.go updatable-timer \\\n --name example \\\n --initial-wake-up-time $(TZ=UTC date -v+1H "+%Y-%m-%dT%H:%M:%SZ") \\\n -d\n'})}),"\n"]}),"\n",(0,a.jsxs)(t.li,{children:["\n",(0,a.jsxs)(t.p,{children:["Query the ",(0,a.jsx)(t.code,{children:"UpdatableTimer"})," workflow"]}),"\n",(0,a.jsx)(t.pre,{children:(0,a.jsx)(t.code,{className:"language-sh",children:"go run examples/updatabletimer/main.go get-wake-up-time -w updatable-timer/example\n"})}),"\n"]}),"\n",(0,a.jsxs)(t.li,{children:["\n",(0,a.jsxs)(t.p,{children:["Update the timer expiration to ",(0,a.jsx)(t.code,{children:"30s"})," in the future"]}),"\n",(0,a.jsx)(t.pre,{children:(0,a.jsx)(t.code,{className:"language-sh",children:'go run examples/updatabletimer/main.go update-wake-up-time \\\n -w updatable-timer/example \\\n --wake-up-time $(TZ=UTC date -v+30S "+%Y-%m-%dT%H:%M:%SZ")\n'})}),"\n"]}),"\n"]})]})}function g(e={}){const{wrapper:t}={...(0,r.R)(),...e.components};return t?(0,a.jsx)(t,{...e,children:(0,a.jsx)(c,{...e})}):c(e)}}}]); \ No newline at end of file +"use strict";(self.webpackChunkdocs=self.webpackChunkdocs||[]).push([[7312],{1528:(e,t,n)=>{n.r(t),n.d(t,{assets:()=>d,contentTitle:()=>m,default:()=>g,frontMatter:()=>p,metadata:()=>s,toc:()=>u});var a=n(4848),r=n(8453),i=n(1432);const l='syntax="proto3";\n\npackage example.updatabletimer.v1;\n\nimport "google/protobuf/empty.proto";\nimport "google/protobuf/timestamp.proto";\nimport "temporal/v1/temporal.proto";\n\nservice Example {\n option (temporal.v1.service) = {\n task_queue: "updatable-timer"\n };\n\n // GetWakeUpTime retrieves the current timer expiration timestamp\n rpc GetWakeUpTime(google.protobuf.Empty) returns (GetWakeUpTimeOutput) {\n option (temporal.v1.query) = {};\n }\n\n // UpdatableTimer describes an updatable timer workflow\n rpc UpdatableTimer(UpdatableTimerInput) returns (google.protobuf.Empty) {\n option (temporal.v1.workflow) = {\n name: "UpdatableTimer"\n id: \'updatable-timer/${! name.or(uuid_v4()) }\'\n query: { ref: "GetWakeUpTime" }\n signal: { ref: "UpdateWakeUpTime" }\n };\n }\n\n // UpdateWakeUpTime updates the timer expiration timestamp\n rpc UpdateWakeUpTime(UpdateWakeUpTimeInput) returns (google.protobuf.Empty) {\n option (temporal.v1.signal) = {};\n }\n}\n\n// GetWakeUpTimeOutput describes the input to a GetWakeUpTime query\nmessage GetWakeUpTimeOutput {\n google.protobuf.Timestamp wake_up_time = 1;\n}\n\n// UpdatableTimerInput describes the input to a UpdatableTimer workflow\nmessage UpdatableTimerInput {\n google.protobuf.Timestamp initial_wake_up_time = 1;\n string name = 2;\n}\n\n// UpdateWakeUpTimeInput describes the input to a UpdateWakeUpTime signal\nmessage UpdateWakeUpTimeInput {\n google.protobuf.Timestamp wake_up_time = 1;\n}\n',o='package main\n\nimport (\n\t"log"\n\t"os"\n\n\tupdatabletimerv1 "github.com/cludden/protoc-gen-go-temporal/gen/example/updatabletimer/v1"\n\t"github.com/urfave/cli/v2"\n\t"go.temporal.io/sdk/client"\n\ttlog "go.temporal.io/sdk/log"\n\t"go.temporal.io/sdk/worker"\n\t"go.temporal.io/sdk/workflow"\n\t"google.golang.org/protobuf/types/known/timestamppb"\n)\n\n// UpdatableTimerWorkflow provides a updatabletimerv1.UpdatableTimerWorkflow implementation\ntype UpdatableTimerWorkflow struct {\n\t*updatabletimerv1.UpdatableTimerWorkflowInput\n\tlog tlog.Logger\n\twakeUpTime *timestamppb.Timestamp\n}\n\n// NewUpdatableTimerWorkflow initializes a new updatabletimerv1.UpdatableTimerWorkflow value\nfunc NewUpdatableTimerWorkflow(ctx workflow.Context, input *updatabletimerv1.UpdatableTimerWorkflowInput) (updatabletimerv1.UpdatableTimerWorkflow, error) {\n\treturn &UpdatableTimerWorkflow{input, workflow.GetLogger(ctx), input.Req.GetInitialWakeUpTime()}, nil\n}\n\n// Execute defines the entrypoint to a UpdatableTimer workflow\nfunc (w *UpdatableTimerWorkflow) Execute(ctx workflow.Context) error {\n\tfor timerFired := false; !timerFired && ctx.Err() == nil; {\n\t\ttimerCtx, cancelTimer := workflow.WithCancel(ctx)\n\t\ttimer := workflow.NewTimer(timerCtx, w.wakeUpTime.AsTime().Sub(workflow.Now(ctx)))\n\t\tw.log.Info("SleepUntil", "WakeUpTime", w.wakeUpTime)\n\n\t\tworkflow.NewSelector(ctx).\n\t\t\tAddFuture(timer, func(f workflow.Future) {\n\t\t\t\tif err := f.Get(timerCtx, nil); err != nil {\n\t\t\t\t\tw.log.Info("Timer canceled")\n\t\t\t\t} else {\n\t\t\t\t\tw.log.Info("Timer fired")\n\t\t\t\t\ttimerFired = true\n\t\t\t\t}\n\t\t\t}).\n\t\t\tAddReceive(w.UpdateWakeUpTime.Channel, func(workflow.ReceiveChannel, bool) {\n\t\t\t\tdefer cancelTimer()\n\t\t\t\tw.wakeUpTime = w.UpdateWakeUpTime.ReceiveAsync().GetWakeUpTime()\n\t\t\t\tw.log.Info("WakeUpTime updated", "WakeUpTime", w.wakeUpTime)\n\t\t\t}).\n\t\t\tSelect(ctx)\n\t}\n\treturn ctx.Err()\n}\n\n// GetWakeUpTime defines the entrypoint to a GetWakeUpTime query\nfunc (w *UpdatableTimerWorkflow) GetWakeUpTime() (*updatabletimerv1.GetWakeUpTimeOutput, error) {\n\treturn &updatabletimerv1.GetWakeUpTimeOutput{WakeUpTime: w.wakeUpTime}, nil\n}\n\nfunc main() {\n\tapp, err := updatabletimerv1.NewExampleCli(\n\t\tupdatabletimerv1.NewExampleCliOptions().WithWorker(func(cmd *cli.Context, c client.Client) (worker.Worker, error) {\n\t\t\tw := worker.New(c, updatabletimerv1.ExampleTaskQueue, worker.Options{})\n\t\t\tupdatabletimerv1.RegisterUpdatableTimerWorkflow(w, NewUpdatableTimerWorkflow)\n\t\t\treturn w, nil\n\t\t}),\n\t)\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\n\tif err := app.Run(os.Args); err != nil {\n\t\tlog.Fatal(err)\n\t}\n}\n',p={},m="Updatable Timer",s={id:"examples/updatabletimer",title:"Updatable Timer",description:"A simple example inspired by temporalio/samples-go/updatabletimer",source:"@site/docs/examples/updatabletimer.mdx",sourceDirName:"examples",slug:"/examples/updatabletimer",permalink:"/protoc-gen-go-temporal/docs/examples/updatabletimer",draft:!1,unlisted:!1,editUrl:"https://github.com/facebook/docusaurus/tree/main/packages/create-docusaurus/templates/shared/docs/examples/updatabletimer.mdx",tags:[],version:"current",frontMatter:{},sidebar:"examples",previous:{title:"Search Attributes",permalink:"/protoc-gen-go-temporal/docs/examples/searchattributes"}},d={},u=[{value:"Run this example",id:"run-this-example",level:2}];function c(e){const t={a:"a",code:"code",h1:"h1",h2:"h2",li:"li",ol:"ol",p:"p",pre:"pre",...(0,r.R)(),...e.components};return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(t.h1,{id:"updatable-timer",children:"Updatable Timer"}),"\n",(0,a.jsxs)(t.p,{children:["A simple example inspired by ",(0,a.jsx)(t.a,{href:"https://github.com/temporalio/samples-go/tree/main/updatabletimer",children:"temporalio/samples-go/updatabletimer"})]}),"\n",(0,a.jsx)(i.A,{language:"protobuf",title:"example.proto",children:l}),"\n",(0,a.jsx)(i.A,{language:"go",title:"main.go",children:o}),"\n",(0,a.jsx)(t.h2,{id:"run-this-example",children:"Run this example"}),"\n",(0,a.jsxs)(t.ol,{children:["\n",(0,a.jsxs)(t.li,{children:["\n",(0,a.jsx)(t.p,{children:"Clone the examples"}),"\n",(0,a.jsx)(t.pre,{children:(0,a.jsx)(t.code,{className:"language-sh",children:"git clone https://github.com/cludden/protoc-gen-go-temporal && cd protoc-gen-go-temporal\n"})}),"\n"]}),"\n",(0,a.jsxs)(t.li,{children:["\n",(0,a.jsx)(t.p,{children:"Run a local Temporal server"}),"\n",(0,a.jsx)(t.pre,{children:(0,a.jsx)(t.code,{className:"language-sh",children:"temporal server start-dev\n"})}),"\n"]}),"\n",(0,a.jsxs)(t.li,{children:["\n",(0,a.jsx)(t.p,{children:"Run the example worker"}),"\n",(0,a.jsx)(t.pre,{children:(0,a.jsx)(t.code,{className:"language-sh",children:"go run examples/updatabletimer/main.go worker\n"})}),"\n"]}),"\n",(0,a.jsxs)(t.li,{children:["\n",(0,a.jsxs)(t.p,{children:["Initialize an ",(0,a.jsx)(t.code,{children:"UpdatableTimer"})," workflow with an expiration ",(0,a.jsx)(t.code,{children:"1h"})," in the future"]}),"\n",(0,a.jsx)(t.pre,{children:(0,a.jsx)(t.code,{className:"language-sh",children:'go run examples/updatabletimer/main.go updatable-timer \\\n --name example \\\n --initial-wake-up-time $(TZ=UTC date -v+1H "+%Y-%m-%dT%H:%M:%SZ") \\\n -d\n'})}),"\n"]}),"\n",(0,a.jsxs)(t.li,{children:["\n",(0,a.jsxs)(t.p,{children:["Query the ",(0,a.jsx)(t.code,{children:"UpdatableTimer"})," workflow"]}),"\n",(0,a.jsx)(t.pre,{children:(0,a.jsx)(t.code,{className:"language-sh",children:"go run examples/updatabletimer/main.go get-wake-up-time -w updatable-timer/example\n"})}),"\n"]}),"\n",(0,a.jsxs)(t.li,{children:["\n",(0,a.jsxs)(t.p,{children:["Update the timer expiration to ",(0,a.jsx)(t.code,{children:"30s"})," in the future"]}),"\n",(0,a.jsx)(t.pre,{children:(0,a.jsx)(t.code,{className:"language-sh",children:'go run examples/updatabletimer/main.go update-wake-up-time \\\n -w updatable-timer/example \\\n --wake-up-time $(TZ=UTC date -v+30S "+%Y-%m-%dT%H:%M:%SZ")\n'})}),"\n"]}),"\n"]})]})}function g(e={}){const{wrapper:t}={...(0,r.R)(),...e.components};return t?(0,a.jsx)(t,{...e,children:(0,a.jsx)(c,{...e})}):c(e)}}}]); \ No newline at end of file diff --git a/assets/js/0ec9a4c5.0366a533.js b/assets/js/0ec9a4c5.0366a533.js new file mode 100644 index 00000000..e15299f7 --- /dev/null +++ b/assets/js/0ec9a4c5.0366a533.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunkdocs=self.webpackChunkdocs||[]).push([[8249],{6140:(e,t,n)=>{n.r(t),n.d(t,{assets:()=>d,contentTitle:()=>c,default:()=>g,frontMatter:()=>s,metadata:()=>i,toc:()=>p});var r=n(4848),o=n(8453),l=n(1432);const a='package main\n\nimport (\n\t"context"\n\t"errors"\n\t"log"\n\t"log/slog"\n\t"net/http"\n\t"os"\n\t"os/signal"\n\t"syscall"\n\n\t"github.com/cludden/protoc-gen-go-temporal/examples/example"\n\texamplev1 "github.com/cludden/protoc-gen-go-temporal/gen/example/v1"\n\t"github.com/cludden/protoc-gen-go-temporal/pkg/codec"\n\t"github.com/cludden/protoc-gen-go-temporal/pkg/scheme"\n\t"github.com/urfave/cli/v2"\n\t"go.temporal.io/sdk/client"\n\t"go.temporal.io/sdk/converter"\n\ttlog "go.temporal.io/sdk/log"\n\t"go.temporal.io/sdk/worker"\n)\n\nfunc main() {\n\tapp, err := examplev1.NewExampleCli(\n\t\texamplev1.NewExampleCliOptions().\n\t\t\tWithClient(func(cmd *cli.Context) (client.Client, error) {\n\t\t\t\treturn client.Dial(client.Options{\n\t\t\t\t\tDataConverter: converter.NewCompositeDataConverter(\n\t\t\t\t\t\tconverter.NewNilPayloadConverter(),\n\t\t\t\t\t\tconverter.NewByteSlicePayloadConverter(),\n\t\t\t\t\t\tconverter.NewProtoPayloadConverter(),\n\t\t\t\t\t),\n\t\t\t\t\tLogger: tlog.NewStructuredLogger(slog.Default()),\n\t\t\t\t})\n\t\t\t}).\n\t\t\tWithWorker(func(cmd *cli.Context, c client.Client) (worker.Worker, error) {\n\t\t\t\tw := worker.New(c, examplev1.ExampleTaskQueue, worker.Options{})\n\t\t\t\texamplev1.RegisterExampleActivities(w, &example.Activities{})\n\t\t\t\texamplev1.RegisterExampleWorkflows(w, &example.Workflows{})\n\t\t\t\treturn w, nil\n\t\t\t}),\n\t)\n\tif err != nil {\n\t\tlog.Fatalf("error initializing example cli: %v", err)\n\t}\n\n\tapp.Commands = append(app.Commands, &cli.Command{\n\t\tName: "codec",\n\t\tUsage: "run remote codec server",\n\t\tAction: func(cmd *cli.Context) error {\n\t\t\thandler := converter.NewPayloadCodecHTTPHandler(\n\t\t\t\tcodec.NewProtoJSONCodec(\n\t\t\t\t\tscheme.New(\n\t\t\t\t\t\texamplev1.WithExampleSchemeTypes(),\n\t\t\t\t\t),\n\t\t\t\t),\n\t\t\t)\n\n\t\t\tsrv := &http.Server{\n\t\t\t\tAddr: "0.0.0.0:8080",\n\t\t\t\tHandler: handler,\n\t\t\t}\n\n\t\t\tgo func() {\n\t\t\t\tsigChan := make(chan os.Signal, 1)\n\t\t\t\tsignal.Notify(sigChan, syscall.SIGINT, syscall.SIGTERM)\n\t\t\t\t<-sigChan\n\n\t\t\t\tif err := srv.Shutdown(context.Background()); err != nil {\n\t\t\t\t\tlog.Fatalf("error shutting down server: %v", err)\n\t\t\t\t}\n\t\t\t}()\n\n\t\t\tif err := srv.ListenAndServe(); err != nil && !errors.Is(err, http.ErrServerClosed) {\n\t\t\t\tlog.Fatalf("server error: %v", err)\n\t\t\t}\n\t\t\treturn nil\n\t\t},\n\t})\n\n\t// run cli\n\tif err := app.Run(os.Args); err != nil {\n\t\tlog.Fatal(err)\n\t}\n}\n',s={},c="Codec Server",i={id:"examples/codecserver",title:"Codec Server",description:"A simple example inspired by temporalio/samples-go/codecserver",source:"@site/docs/examples/codecserver.mdx",sourceDirName:"examples",slug:"/examples/codecserver",permalink:"/protoc-gen-go-temporal/docs/examples/codecserver",draft:!1,unlisted:!1,editUrl:"https://github.com/facebook/docusaurus/tree/main/packages/create-docusaurus/templates/shared/docs/examples/codecserver.mdx",tags:[],version:"current",frontMatter:{},sidebar:"examples",previous:{title:"Hello World",permalink:"/protoc-gen-go-temporal/docs/examples/helloworld"},next:{title:"Search Attributes",permalink:"/protoc-gen-go-temporal/docs/examples/searchattributes"}},d={},p=[{value:"Run this example",id:"run-this-example",level:2}];function m(e){const t={a:"a",code:"code",h1:"h1",h2:"h2",li:"li",ol:"ol",p:"p",pre:"pre",...(0,o.R)(),...e.components};return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(t.h1,{id:"codec-server",children:"Codec Server"}),"\n",(0,r.jsxs)(t.p,{children:["A simple example inspired by ",(0,r.jsx)(t.a,{href:"https://github.com/temporalio/samples-go/tree/main/codecserver",children:"temporalio/samples-go/codecserver"})]}),"\n",(0,r.jsx)(l.A,{language:"go",title:"main.go",children:a}),"\n",(0,r.jsx)(t.h2,{id:"run-this-example",children:"Run this example"}),"\n",(0,r.jsxs)(t.ol,{children:["\n",(0,r.jsxs)(t.li,{children:["Clone the examples","\n",(0,r.jsx)(t.pre,{children:(0,r.jsx)(t.code,{className:"language-sh",children:"git clone https://github.com/cludden/protoc-gen-go-temporal && cd protoc-gen-go-temporal\n"})}),"\n"]}),"\n",(0,r.jsxs)(t.li,{children:["Start the codec server","\n",(0,r.jsx)(t.pre,{children:(0,r.jsx)(t.code,{className:"language-shell",children:"go run examples/codecserver/main.go codec\n"})}),"\n"]}),"\n",(0,r.jsxs)(t.li,{children:["In a different terminal, start temporal using the codec server","\n",(0,r.jsx)(t.pre,{children:(0,r.jsx)(t.code,{className:"language-shell",children:'temporal server start-dev \\\n --dynamic-config-value "frontend.enableUpdateWorkflowExecution=true" \\\n --dynamic-config-value "frontend.enableUpdateWorkflowExecutionAsyncAccepted=true" \\\n --ui-codec-endpoint http://localhost:8080\n'})}),"\n"]}),"\n",(0,r.jsxs)(t.li,{children:["In a different terminal, run the worker","\n",(0,r.jsx)(t.pre,{children:(0,r.jsx)(t.code,{className:"language-shell",children:"go run examples/codecserver/main.go worker\n"})}),"\n"]}),"\n",(0,r.jsxs)(t.li,{children:["In a different terminal, execute a workflow, signal, query, and update","\n",(0,r.jsx)(t.pre,{children:(0,r.jsx)(t.code,{className:"language-shell",children:"# execute a workflow in the background\ngo run examples/codecserver/main.go create-foo --name test -d\n\n# signal the workflow\ngo run examples/codecserver/main.go set-foo-progress -w create-foo/test --progress 5.7\n\n# query the workflow\ngo run examples/codecserver/main.go get-foo-progress -w create-foo/test\n\n# update the workflow\ngo run examples/codecserver/main.go update-foo-progress -w create-foo/test --progress 100\n"})}),"\n"]}),"\n",(0,r.jsxs)(t.li,{children:["In the UI, switch to the JSON tab and disable the ",(0,r.jsx)(t.code,{children:"Decode Event History"})," toggle and verify that all payloads have metadata with ",(0,r.jsx)(t.code,{children:'"encoding": "YmluYXJ5L3Byb3RvYnVm"'}),", which is ",(0,r.jsx)(t.code,{children:"binary/protobuf"})," base64-encoded"]}),"\n"]})]})}function g(e={}){const{wrapper:t}={...(0,o.R)(),...e.components};return t?(0,r.jsx)(t,{...e,children:(0,r.jsx)(m,{...e})}):m(e)}}}]); \ No newline at end of file diff --git a/assets/js/0ec9a4c5.ada7faa3.js b/assets/js/0ec9a4c5.ada7faa3.js deleted file mode 100644 index 69a2592a..00000000 --- a/assets/js/0ec9a4c5.ada7faa3.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunkdocs=self.webpackChunkdocs||[]).push([[8249],{6140:(e,t,n)=>{n.r(t),n.d(t,{assets:()=>d,contentTitle:()=>c,default:()=>g,frontMatter:()=>s,metadata:()=>i,toc:()=>p});var r=n(4848),o=n(8453),l=n(1432);const a='package main\n\nimport (\n\t"context"\n\t"errors"\n\t"log"\n\t"log/slog"\n\t"net/http"\n\t"os"\n\t"os/signal"\n\t"syscall"\n\n\t"github.com/cludden/protoc-gen-go-temporal/examples/example"\n\texamplev1 "github.com/cludden/protoc-gen-go-temporal/gen/example/v1"\n\t"github.com/cludden/protoc-gen-go-temporal/pkg/codec"\n\t"github.com/cludden/protoc-gen-go-temporal/pkg/scheme"\n\t"github.com/urfave/cli/v2"\n\t"go.temporal.io/sdk/client"\n\t"go.temporal.io/sdk/converter"\n\ttlog "go.temporal.io/sdk/log"\n\t"go.temporal.io/sdk/worker"\n)\n\nfunc main() {\n\tapp, err := examplev1.NewExampleCli(\n\t\texamplev1.NewExampleCliOptions().\n\t\t\tWithClient(func(cmd *cli.Context) (client.Client, error) {\n\t\t\t\treturn client.Dial(client.Options{\n\t\t\t\t\tDataConverter: converter.NewCompositeDataConverter(\n\t\t\t\t\t\tconverter.NewNilPayloadConverter(),\n\t\t\t\t\t\tconverter.NewByteSlicePayloadConverter(),\n\t\t\t\t\t\tconverter.NewProtoPayloadConverter(),\n\t\t\t\t\t),\n\t\t\t\t\tLogger: tlog.NewStructuredLogger(slog.Default()),\n\t\t\t\t})\n\t\t\t}).\n\t\t\tWithWorker(func(cmd *cli.Context, c client.Client) (worker.Worker, error) {\n\t\t\t\tw := worker.New(c, examplev1.ExampleTaskQueue, worker.Options{})\n\t\t\t\texamplev1.RegisterExampleActivities(w, &example.Activities{})\n\t\t\t\texamplev1.RegisterExampleWorkflows(w, &example.Workflows{})\n\t\t\t\treturn w, nil\n\t\t\t}),\n\t)\n\tif err != nil {\n\t\tlog.Fatalf("error initializing example cli: %v", err)\n\t}\n\n\tapp.Commands = append(app.Commands, &cli.Command{\n\t\tName: "codec",\n\t\tUsage: "run remote codec server",\n\t\tAction: func(cmd *cli.Context) error {\n\t\t\thandler := converter.NewPayloadCodecHTTPHandler(\n\t\t\t\tcodec.NewProtoJSONCodec(\n\t\t\t\t\tscheme.New(\n\t\t\t\t\t\texamplev1.WithExampleSchemeTypes(),\n\t\t\t\t\t),\n\t\t\t\t),\n\t\t\t)\n\n\t\t\tsrv := &http.Server{\n\t\t\t\tAddr: "0.0.0.0:8080",\n\t\t\t\tHandler: handler,\n\t\t\t}\n\n\t\t\tgo func() {\n\t\t\t\tsigChan := make(chan os.Signal, 1)\n\t\t\t\tsignal.Notify(sigChan, syscall.SIGINT, syscall.SIGTERM)\n\t\t\t\t<-sigChan\n\n\t\t\t\tif err := srv.Shutdown(context.Background()); err != nil {\n\t\t\t\t\tlog.Fatalf("error shutting down server: %v", err)\n\t\t\t\t}\n\t\t\t}()\n\n\t\t\tif err := srv.ListenAndServe(); err != nil && !errors.Is(err, http.ErrServerClosed) {\n\t\t\t\tlog.Fatalf("server error: %v", err)\n\t\t\t}\n\t\t\treturn nil\n\t\t},\n\t})\n\n\t// run cli\n\tif err := app.Run(os.Args); err != nil {\n\t\tlog.Fatal(err)\n\t}\n}\n',s={},c="Codec Server",i={id:"examples/codecserver",title:"Codec Server",description:"A simple example inspired by temporalio/samples-go/codecserver",source:"@site/docs/examples/codecserver.mdx",sourceDirName:"examples",slug:"/examples/codecserver",permalink:"/docs/examples/codecserver",draft:!1,unlisted:!1,editUrl:"https://github.com/facebook/docusaurus/tree/main/packages/create-docusaurus/templates/shared/docs/examples/codecserver.mdx",tags:[],version:"current",frontMatter:{},sidebar:"examples",previous:{title:"Hello World",permalink:"/docs/examples/helloworld"},next:{title:"Search Attributes",permalink:"/docs/examples/searchattributes"}},d={},p=[{value:"Run this example",id:"run-this-example",level:2}];function m(e){const t={a:"a",code:"code",h1:"h1",h2:"h2",li:"li",ol:"ol",p:"p",pre:"pre",...(0,o.R)(),...e.components};return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(t.h1,{id:"codec-server",children:"Codec Server"}),"\n",(0,r.jsxs)(t.p,{children:["A simple example inspired by ",(0,r.jsx)(t.a,{href:"https://github.com/temporalio/samples-go/tree/main/codecserver",children:"temporalio/samples-go/codecserver"})]}),"\n",(0,r.jsx)(l.A,{language:"go",title:"main.go",children:a}),"\n",(0,r.jsx)(t.h2,{id:"run-this-example",children:"Run this example"}),"\n",(0,r.jsxs)(t.ol,{children:["\n",(0,r.jsxs)(t.li,{children:["Clone the examples","\n",(0,r.jsx)(t.pre,{children:(0,r.jsx)(t.code,{className:"language-sh",children:"git clone https://github.com/cludden/protoc-gen-go-temporal && cd protoc-gen-go-temporal\n"})}),"\n"]}),"\n",(0,r.jsxs)(t.li,{children:["Start the codec server","\n",(0,r.jsx)(t.pre,{children:(0,r.jsx)(t.code,{className:"language-shell",children:"go run examples/codecserver/main.go codec\n"})}),"\n"]}),"\n",(0,r.jsxs)(t.li,{children:["In a different terminal, start temporal using the codec server","\n",(0,r.jsx)(t.pre,{children:(0,r.jsx)(t.code,{className:"language-shell",children:'temporal server start-dev \\\n --dynamic-config-value "frontend.enableUpdateWorkflowExecution=true" \\\n --dynamic-config-value "frontend.enableUpdateWorkflowExecutionAsyncAccepted=true" \\\n --ui-codec-endpoint http://localhost:8080\n'})}),"\n"]}),"\n",(0,r.jsxs)(t.li,{children:["In a different terminal, run the worker","\n",(0,r.jsx)(t.pre,{children:(0,r.jsx)(t.code,{className:"language-shell",children:"go run examples/codecserver/main.go worker\n"})}),"\n"]}),"\n",(0,r.jsxs)(t.li,{children:["In a different terminal, execute a workflow, signal, query, and update","\n",(0,r.jsx)(t.pre,{children:(0,r.jsx)(t.code,{className:"language-shell",children:"# execute a workflow in the background\ngo run examples/codecserver/main.go create-foo --name test -d\n\n# signal the workflow\ngo run examples/codecserver/main.go set-foo-progress -w create-foo/test --progress 5.7\n\n# query the workflow\ngo run examples/codecserver/main.go get-foo-progress -w create-foo/test\n\n# update the workflow\ngo run examples/codecserver/main.go update-foo-progress -w create-foo/test --progress 100\n"})}),"\n"]}),"\n",(0,r.jsxs)(t.li,{children:["In the UI, switch to the JSON tab and disable the ",(0,r.jsx)(t.code,{children:"Decode Event History"})," toggle and verify that all payloads have metadata with ",(0,r.jsx)(t.code,{children:'"encoding": "YmluYXJ5L3Byb3RvYnVm"'}),", which is ",(0,r.jsx)(t.code,{children:"binary/protobuf"})," base64-encoded"]}),"\n"]})]})}function g(e={}){const{wrapper:t}={...(0,o.R)(),...e.components};return t?(0,r.jsx)(t,{...e,children:(0,r.jsx)(m,{...e})}):m(e)}}}]); \ No newline at end of file diff --git a/assets/js/0fe4f122.f97b5ddc.js b/assets/js/0fe4f122.a8408588.js similarity index 59% rename from assets/js/0fe4f122.f97b5ddc.js rename to assets/js/0fe4f122.a8408588.js index ab3bb9e2..62606eac 100644 --- a/assets/js/0fe4f122.f97b5ddc.js +++ b/assets/js/0fe4f122.a8408588.js @@ -1 +1 @@ -"use strict";(self.webpackChunkdocs=self.webpackChunkdocs||[]).push([[9517],{8562:(t,e,r)=>{r.r(e),r.d(e,{assets:()=>m,contentTitle:()=>u,default:()=>h,frontMatter:()=>i,metadata:()=>c,toc:()=>p});var o=r(4848),a=r(8453),n=r(1432);const s="syntax=\"proto3\";\n\npackage example.searchattributes.v1;\n\nimport \"google/protobuf/empty.proto\";\nimport \"google/protobuf/timestamp.proto\";\nimport \"temporal/v1/temporal.proto\";\n\nservice Example {\n option (temporal.v1.service) = {\n task_queue: \"searchattributes\"\n };\n\n rpc SearchAttributes(SearchAttributesInput) returns (google.protobuf.Empty) {\n option (temporal.v1.workflow) = {\n id: 'search_attributes_${! uuid_v4() }'\n search_attributes:\n 'CustomKeywordField = customKeywordField \\n'\n 'CustomTextField = customTextField \\n'\n 'CustomIntField = customIntField.int64() \\n'\n 'CustomDoubleField = customDoubleField \\n'\n 'CustomBoolField = customBoolField \\n'\n 'CustomDatetimeField = customDatetimeField.ts_parse(\"2006-01-02T15:04:05Z\") \\n'\n };\n }\n}\n\nmessage SearchAttributesInput {\n string custom_keyword_field = 1;\n string custom_text_field = 2;\n int64 custom_int_field = 3;\n double custom_double_field = 4;\n bool custom_bool_field = 5;\n google.protobuf.Timestamp custom_datetime_field = 6;\n}\n",l='package main\n\nimport (\n\t"log"\n\t"os"\n\t"strings"\n\t"time"\n\n\tsearchattributesv1 "github.com/cludden/protoc-gen-go-temporal/gen/example/searchattributes/v1"\n\t"github.com/urfave/cli/v2"\n\t"go.temporal.io/sdk/client"\n\t"go.temporal.io/sdk/converter"\n\ttlog "go.temporal.io/sdk/log"\n\t"go.temporal.io/sdk/worker"\n\t"go.temporal.io/sdk/workflow"\n)\n\ntype SearchAttributesWorkflow struct {\n\t*searchattributesv1.SearchAttributesWorkflowInput\n\tlog tlog.Logger\n}\n\nfunc NewSearchAttributesWorkflow(ctx workflow.Context, input *searchattributesv1.SearchAttributesWorkflowInput) (searchattributesv1.SearchAttributesWorkflow, error) {\n\treturn &SearchAttributesWorkflow{input, workflow.GetLogger(ctx)}, nil\n}\n\nfunc (w *SearchAttributesWorkflow) Execute(ctx workflow.Context) (err error) {\n\tsa := workflow.GetInfo(ctx).SearchAttributes\n\tfor _, attr := range strings.Split("CustomBoolField,CustomDatetimeField,CustomDoubleField,CustomIntField,CustomKeywordField,CustomTextField", ",") {\n\t\tif p, ok := sa.IndexedFields[attr]; ok {\n\t\t\tswitch attr {\n\t\t\tcase "CustomBoolField":\n\t\t\t\tvar result bool\n\t\t\t\terr = converter.GetDefaultDataConverter().FromPayload(p, &result)\n\t\t\t\tw.log.Info("search attribute", "name", attr, "value", result, "error", err)\n\t\t\tcase "CustomDatetimeField":\n\t\t\t\tvar result time.Time\n\t\t\t\terr = converter.GetDefaultDataConverter().FromPayload(p, &result)\n\t\t\t\tw.log.Info("search attribute", "name", attr, "value", result, "error", err)\n\t\t\tcase "CustomDoubleField":\n\t\t\t\tvar result float64\n\t\t\t\terr = converter.GetDefaultDataConverter().FromPayload(p, &result)\n\t\t\t\tw.log.Info("search attribute", "name", attr, "value", result, "error", err)\n\t\t\tcase "CustomIntField":\n\t\t\t\tvar result int\n\t\t\t\terr = converter.GetDefaultDataConverter().FromPayload(p, &result)\n\t\t\t\tw.log.Info("search attribute", "name", attr, "value", result, "error", err)\n\t\t\tcase "CustomKeywordField":\n\t\t\t\tvar result string\n\t\t\t\terr = converter.GetDefaultDataConverter().FromPayload(p, &result)\n\t\t\t\tw.log.Info("search attribute", "name", attr, "value", result, "error", err)\n\t\t\tcase "CustomTextField":\n\t\t\t\tvar result string\n\t\t\t\terr = converter.GetDefaultDataConverter().FromPayload(p, &result)\n\t\t\t\tw.log.Info("search attribute", "name", attr, "value", result, "error", err)\n\t\t\t}\n\t\t}\n\t}\n\n\treturn nil\n}\n\nfunc main() {\n\tapp, err := searchattributesv1.NewExampleCli(\n\t\tsearchattributesv1.NewExampleCliOptions().WithWorker(func(cmd *cli.Context, c client.Client) (worker.Worker, error) {\n\t\t\tw := worker.New(c, searchattributesv1.ExampleTaskQueue, worker.Options{})\n\t\t\tsearchattributesv1.RegisterSearchAttributesWorkflow(w, NewSearchAttributesWorkflow)\n\t\t\treturn w, nil\n\t\t}),\n\t)\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\tif err := app.Run(os.Args); err != nil {\n\t\tlog.Fatal(err)\n\t}\n}\n',i={},u="Search Attributes",c={id:"examples/searchattributes",title:"Search Attributes",description:"A simple example inspired by temporalio/samples-go/searchattributes",source:"@site/docs/examples/searchattributes.mdx",sourceDirName:"examples",slug:"/examples/searchattributes",permalink:"/docs/examples/searchattributes",draft:!1,unlisted:!1,editUrl:"https://github.com/facebook/docusaurus/tree/main/packages/create-docusaurus/templates/shared/docs/examples/searchattributes.mdx",tags:[],version:"current",frontMatter:{},sidebar:"examples",previous:{title:"Codec Server",permalink:"/docs/examples/codecserver"},next:{title:"Updatable Timer",permalink:"/docs/examples/updatabletimer"}},m={},p=[{value:"Run this example",id:"run-this-example",level:2}];function d(t){const e={a:"a",code:"code",h1:"h1",h2:"h2",li:"li",ol:"ol",p:"p",pre:"pre",...(0,a.R)(),...t.components};return(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(e.h1,{id:"search-attributes",children:"Search Attributes"}),"\n",(0,o.jsxs)(e.p,{children:["A simple example inspired by ",(0,o.jsx)(e.a,{href:"https://github.com/temporalio/samples-go/tree/main/searchattributes",children:"temporalio/samples-go/searchattributes"})]}),"\n",(0,o.jsx)(n.A,{language:"protobuf",title:"example.proto",children:s}),"\n",(0,o.jsx)(n.A,{language:"go",title:"main.go",children:l}),"\n",(0,o.jsx)(e.h2,{id:"run-this-example",children:"Run this example"}),"\n",(0,o.jsxs)(e.ol,{children:["\n",(0,o.jsxs)(e.li,{children:["Clone the examples","\n",(0,o.jsx)(e.pre,{children:(0,o.jsx)(e.code,{className:"language-sh",children:"git clone https://github.com/cludden/protoc-gen-go-temporal && cd protoc-gen-go-temporal\n"})}),"\n"]}),"\n",(0,o.jsxs)(e.li,{children:["Run a local Temporal server","\n",(0,o.jsx)(e.pre,{children:(0,o.jsx)(e.code,{className:"language-sh",children:"temporal server start-dev\n"})}),"\n"]}),"\n",(0,o.jsxs)(e.li,{children:["In a different shell, register custom search attributes and run the example worker","\n",(0,o.jsx)(e.pre,{children:(0,o.jsx)(e.code,{className:"language-shell",children:"temporal operator search-attribute create --name CustomDatetimeField --type Datetime\ntemporal operator search-attribute create --name CustomKeywordField --type Keyword\ntemporal operator search-attribute create --name CustomTextField --type Text\ntemporal operator search-attribute create --name CustomIntField --type Int\ntemporal operator search-attribute create --name CustomDoubleField --type Double\ntemporal operator search-attribute create --name CustomBoolField --type Bool\ngo run examples/searchattributes/main.go worker\n"})}),"\n"]}),"\n",(0,o.jsxs)(e.li,{children:["In a different shell, execute the workflow","\n",(0,o.jsx)(e.pre,{children:(0,o.jsx)(e.code,{className:"language-shell",children:"go run examples/searchattributes/main.go search-attributes \\\n --custom-datetime-field=2024-01-01T00:00:00Z \\\n --custom-keyword-field=foo-bar \\\n --custom-text-field=foo-bar \\\n --custom-int-field=42 \\\n --custom-double-field=42 \\\n --custom-bool-field=true\n"})}),"\n"]}),"\n"]})]})}function h(t={}){const{wrapper:e}={...(0,a.R)(),...t.components};return e?(0,o.jsx)(e,{...t,children:(0,o.jsx)(d,{...t})}):d(t)}}}]); \ No newline at end of file +"use strict";(self.webpackChunkdocs=self.webpackChunkdocs||[]).push([[9517],{8562:(t,e,r)=>{r.r(e),r.d(e,{assets:()=>m,contentTitle:()=>u,default:()=>h,frontMatter:()=>i,metadata:()=>c,toc:()=>p});var o=r(4848),a=r(8453),n=r(1432);const s="syntax=\"proto3\";\n\npackage example.searchattributes.v1;\n\nimport \"google/protobuf/empty.proto\";\nimport \"google/protobuf/timestamp.proto\";\nimport \"temporal/v1/temporal.proto\";\n\nservice Example {\n option (temporal.v1.service) = {\n task_queue: \"searchattributes\"\n };\n\n rpc SearchAttributes(SearchAttributesInput) returns (google.protobuf.Empty) {\n option (temporal.v1.workflow) = {\n id: 'search_attributes_${! uuid_v4() }'\n search_attributes:\n 'CustomKeywordField = customKeywordField \\n'\n 'CustomTextField = customTextField \\n'\n 'CustomIntField = customIntField.int64() \\n'\n 'CustomDoubleField = customDoubleField \\n'\n 'CustomBoolField = customBoolField \\n'\n 'CustomDatetimeField = customDatetimeField.ts_parse(\"2006-01-02T15:04:05Z\") \\n'\n };\n }\n}\n\nmessage SearchAttributesInput {\n string custom_keyword_field = 1;\n string custom_text_field = 2;\n int64 custom_int_field = 3;\n double custom_double_field = 4;\n bool custom_bool_field = 5;\n google.protobuf.Timestamp custom_datetime_field = 6;\n}\n",l='package main\n\nimport (\n\t"log"\n\t"os"\n\t"strings"\n\t"time"\n\n\tsearchattributesv1 "github.com/cludden/protoc-gen-go-temporal/gen/example/searchattributes/v1"\n\t"github.com/urfave/cli/v2"\n\t"go.temporal.io/sdk/client"\n\t"go.temporal.io/sdk/converter"\n\ttlog "go.temporal.io/sdk/log"\n\t"go.temporal.io/sdk/worker"\n\t"go.temporal.io/sdk/workflow"\n)\n\ntype SearchAttributesWorkflow struct {\n\t*searchattributesv1.SearchAttributesWorkflowInput\n\tlog tlog.Logger\n}\n\nfunc NewSearchAttributesWorkflow(ctx workflow.Context, input *searchattributesv1.SearchAttributesWorkflowInput) (searchattributesv1.SearchAttributesWorkflow, error) {\n\treturn &SearchAttributesWorkflow{input, workflow.GetLogger(ctx)}, nil\n}\n\nfunc (w *SearchAttributesWorkflow) Execute(ctx workflow.Context) (err error) {\n\tsa := workflow.GetInfo(ctx).SearchAttributes\n\tfor _, attr := range strings.Split("CustomBoolField,CustomDatetimeField,CustomDoubleField,CustomIntField,CustomKeywordField,CustomTextField", ",") {\n\t\tif p, ok := sa.IndexedFields[attr]; ok {\n\t\t\tswitch attr {\n\t\t\tcase "CustomBoolField":\n\t\t\t\tvar result bool\n\t\t\t\terr = converter.GetDefaultDataConverter().FromPayload(p, &result)\n\t\t\t\tw.log.Info("search attribute", "name", attr, "value", result, "error", err)\n\t\t\tcase "CustomDatetimeField":\n\t\t\t\tvar result time.Time\n\t\t\t\terr = converter.GetDefaultDataConverter().FromPayload(p, &result)\n\t\t\t\tw.log.Info("search attribute", "name", attr, "value", result, "error", err)\n\t\t\tcase "CustomDoubleField":\n\t\t\t\tvar result float64\n\t\t\t\terr = converter.GetDefaultDataConverter().FromPayload(p, &result)\n\t\t\t\tw.log.Info("search attribute", "name", attr, "value", result, "error", err)\n\t\t\tcase "CustomIntField":\n\t\t\t\tvar result int\n\t\t\t\terr = converter.GetDefaultDataConverter().FromPayload(p, &result)\n\t\t\t\tw.log.Info("search attribute", "name", attr, "value", result, "error", err)\n\t\t\tcase "CustomKeywordField":\n\t\t\t\tvar result string\n\t\t\t\terr = converter.GetDefaultDataConverter().FromPayload(p, &result)\n\t\t\t\tw.log.Info("search attribute", "name", attr, "value", result, "error", err)\n\t\t\tcase "CustomTextField":\n\t\t\t\tvar result string\n\t\t\t\terr = converter.GetDefaultDataConverter().FromPayload(p, &result)\n\t\t\t\tw.log.Info("search attribute", "name", attr, "value", result, "error", err)\n\t\t\t}\n\t\t}\n\t}\n\n\treturn nil\n}\n\nfunc main() {\n\tapp, err := searchattributesv1.NewExampleCli(\n\t\tsearchattributesv1.NewExampleCliOptions().WithWorker(func(cmd *cli.Context, c client.Client) (worker.Worker, error) {\n\t\t\tw := worker.New(c, searchattributesv1.ExampleTaskQueue, worker.Options{})\n\t\t\tsearchattributesv1.RegisterSearchAttributesWorkflow(w, NewSearchAttributesWorkflow)\n\t\t\treturn w, nil\n\t\t}),\n\t)\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\tif err := app.Run(os.Args); err != nil {\n\t\tlog.Fatal(err)\n\t}\n}\n',i={},u="Search Attributes",c={id:"examples/searchattributes",title:"Search Attributes",description:"A simple example inspired by temporalio/samples-go/searchattributes",source:"@site/docs/examples/searchattributes.mdx",sourceDirName:"examples",slug:"/examples/searchattributes",permalink:"/protoc-gen-go-temporal/docs/examples/searchattributes",draft:!1,unlisted:!1,editUrl:"https://github.com/facebook/docusaurus/tree/main/packages/create-docusaurus/templates/shared/docs/examples/searchattributes.mdx",tags:[],version:"current",frontMatter:{},sidebar:"examples",previous:{title:"Codec Server",permalink:"/protoc-gen-go-temporal/docs/examples/codecserver"},next:{title:"Updatable Timer",permalink:"/protoc-gen-go-temporal/docs/examples/updatabletimer"}},m={},p=[{value:"Run this example",id:"run-this-example",level:2}];function d(t){const e={a:"a",code:"code",h1:"h1",h2:"h2",li:"li",ol:"ol",p:"p",pre:"pre",...(0,a.R)(),...t.components};return(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(e.h1,{id:"search-attributes",children:"Search Attributes"}),"\n",(0,o.jsxs)(e.p,{children:["A simple example inspired by ",(0,o.jsx)(e.a,{href:"https://github.com/temporalio/samples-go/tree/main/searchattributes",children:"temporalio/samples-go/searchattributes"})]}),"\n",(0,o.jsx)(n.A,{language:"protobuf",title:"example.proto",children:s}),"\n",(0,o.jsx)(n.A,{language:"go",title:"main.go",children:l}),"\n",(0,o.jsx)(e.h2,{id:"run-this-example",children:"Run this example"}),"\n",(0,o.jsxs)(e.ol,{children:["\n",(0,o.jsxs)(e.li,{children:["Clone the examples","\n",(0,o.jsx)(e.pre,{children:(0,o.jsx)(e.code,{className:"language-sh",children:"git clone https://github.com/cludden/protoc-gen-go-temporal && cd protoc-gen-go-temporal\n"})}),"\n"]}),"\n",(0,o.jsxs)(e.li,{children:["Run a local Temporal server","\n",(0,o.jsx)(e.pre,{children:(0,o.jsx)(e.code,{className:"language-sh",children:"temporal server start-dev\n"})}),"\n"]}),"\n",(0,o.jsxs)(e.li,{children:["In a different shell, register custom search attributes and run the example worker","\n",(0,o.jsx)(e.pre,{children:(0,o.jsx)(e.code,{className:"language-shell",children:"temporal operator search-attribute create --name CustomDatetimeField --type Datetime\ntemporal operator search-attribute create --name CustomKeywordField --type Keyword\ntemporal operator search-attribute create --name CustomTextField --type Text\ntemporal operator search-attribute create --name CustomIntField --type Int\ntemporal operator search-attribute create --name CustomDoubleField --type Double\ntemporal operator search-attribute create --name CustomBoolField --type Bool\ngo run examples/searchattributes/main.go worker\n"})}),"\n"]}),"\n",(0,o.jsxs)(e.li,{children:["In a different shell, execute the workflow","\n",(0,o.jsx)(e.pre,{children:(0,o.jsx)(e.code,{className:"language-shell",children:"go run examples/searchattributes/main.go search-attributes \\\n --custom-datetime-field=2024-01-01T00:00:00Z \\\n --custom-keyword-field=foo-bar \\\n --custom-text-field=foo-bar \\\n --custom-int-field=42 \\\n --custom-double-field=42 \\\n --custom-bool-field=true\n"})}),"\n"]}),"\n"]})]})}function h(t={}){const{wrapper:e}={...(0,a.R)(),...t.components};return e?(0,o.jsx)(e,{...t,children:(0,o.jsx)(d,{...t})}):d(t)}}}]); \ No newline at end of file diff --git a/assets/js/13f3ef77.440168ab.js b/assets/js/13f3ef77.440168ab.js new file mode 100644 index 00000000..848923c9 --- /dev/null +++ b/assets/js/13f3ef77.440168ab.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunkdocs=self.webpackChunkdocs||[]).push([[2241],{8952:(e,t,r)=>{r.r(t),r.d(t,{assets:()=>l,contentTitle:()=>s,default:()=>d,frontMatter:()=>o,metadata:()=>u,toc:()=>i});var n=r(4848),a=r(8453);r(1470),r(9365);const o={},s="CLI",u={id:"guides/cli",title:"CLI",description:"Coming Soon...",source:"@site/docs/guides/cli.mdx",sourceDirName:"guides",slug:"/guides/cli",permalink:"/protoc-gen-go-temporal/docs/guides/cli",draft:!1,unlisted:!1,editUrl:"https://github.com/facebook/docusaurus/tree/main/packages/create-docusaurus/templates/shared/docs/guides/cli.mdx",tags:[],version:"current",frontMatter:{},sidebar:"docs",previous:{title:"Clients",permalink:"/protoc-gen-go-temporal/docs/guides/clients"},next:{title:"Child Workflows",permalink:"/protoc-gen-go-temporal/docs/guides/child-workflows"}},l={},i=[];function c(e){const t={h1:"h1",p:"p",strong:"strong",...(0,a.R)(),...e.components};return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(t.h1,{id:"cli",children:"CLI"}),"\n",(0,n.jsx)(t.p,{children:(0,n.jsx)(t.strong,{children:"Coming Soon..."})})]})}function d(e={}){const{wrapper:t}={...(0,a.R)(),...e.components};return t?(0,n.jsx)(t,{...e,children:(0,n.jsx)(c,{...e})}):c(e)}},9365:(e,t,r)=>{r.d(t,{A:()=>s});r(6540);var n=r(4164);const a={tabItem:"tabItem_Ymn6"};var o=r(4848);function s(e){let{children:t,hidden:r,className:s}=e;return(0,o.jsx)("div",{role:"tabpanel",className:(0,n.A)(a.tabItem,s),hidden:r,children:t})}},1470:(e,t,r)=>{r.d(t,{A:()=>k});var n=r(6540),a=r(4164),o=r(3104),s=r(6347),u=r(205),l=r(7485),i=r(1682),c=r(9466);function d(e){return n.Children.toArray(e).filter((e=>"\n"!==e)).map((e=>{if(!e||(0,n.isValidElement)(e)&&function(e){const{props:t}=e;return!!t&&"object"==typeof t&&"value"in t}(e))return e;throw new Error(`Docusaurus error: Bad child <${"string"==typeof e.type?e.type:e.type.name}>: all children of the component should be , and every should have a unique "value" prop.`)}))?.filter(Boolean)??[]}function p(e){const{values:t,children:r}=e;return(0,n.useMemo)((()=>{const e=t??function(e){return d(e).map((e=>{let{props:{value:t,label:r,attributes:n,default:a}}=e;return{value:t,label:r,attributes:n,default:a}}))}(r);return function(e){const t=(0,i.X)(e,((e,t)=>e.value===t.value));if(t.length>0)throw new Error(`Docusaurus error: Duplicate values "${t.map((e=>e.value)).join(", ")}" found in . Every value needs to be unique.`)}(e),e}),[t,r])}function f(e){let{value:t,tabValues:r}=e;return r.some((e=>e.value===t))}function m(e){let{queryString:t=!1,groupId:r}=e;const a=(0,s.W6)(),o=function(e){let{queryString:t=!1,groupId:r}=e;if("string"==typeof t)return t;if(!1===t)return null;if(!0===t&&!r)throw new Error('Docusaurus error: The component groupId prop is required if queryString=true, because this value is used as the search param name. You can also provide an explicit value such as queryString="my-search-param".');return r??null}({queryString:t,groupId:r});return[(0,l.aZ)(o),(0,n.useCallback)((e=>{if(!o)return;const t=new URLSearchParams(a.location.search);t.set(o,e),a.replace({...a.location,search:t.toString()})}),[o,a])]}function h(e){const{defaultValue:t,queryString:r=!1,groupId:a}=e,o=p(e),[s,l]=(0,n.useState)((()=>function(e){let{defaultValue:t,tabValues:r}=e;if(0===r.length)throw new Error("Docusaurus error: the component requires at least one children component");if(t){if(!f({value:t,tabValues:r}))throw new Error(`Docusaurus error: The has a defaultValue "${t}" but none of its children has the corresponding value. Available values are: ${r.map((e=>e.value)).join(", ")}. If you intend to show no default tab, use defaultValue={null} instead.`);return t}const n=r.find((e=>e.default))??r[0];if(!n)throw new Error("Unexpected error: 0 tabValues");return n.value}({defaultValue:t,tabValues:o}))),[i,d]=m({queryString:r,groupId:a}),[h,b]=function(e){let{groupId:t}=e;const r=function(e){return e?`docusaurus.tab.${e}`:null}(t),[a,o]=(0,c.Dv)(r);return[a,(0,n.useCallback)((e=>{r&&o.set(e)}),[r,o])]}({groupId:a}),g=(()=>{const e=i??h;return f({value:e,tabValues:o})?e:null})();(0,u.A)((()=>{g&&l(g)}),[g]);return{selectedValue:s,selectValue:(0,n.useCallback)((e=>{if(!f({value:e,tabValues:o}))throw new Error(`Can't select invalid tab value=${e}`);l(e),d(e),b(e)}),[d,b,o]),tabValues:o}}var b=r(2303);const g={tabList:"tabList__CuJ",tabItem:"tabItem_LNqP"};var v=r(4848);function x(e){let{className:t,block:r,selectedValue:n,selectValue:s,tabValues:u}=e;const l=[],{blockElementScrollPositionUntilNextRender:i}=(0,o.a_)(),c=e=>{const t=e.currentTarget,r=l.indexOf(t),a=u[r].value;a!==n&&(i(t),s(a))},d=e=>{let t=null;switch(e.key){case"Enter":c(e);break;case"ArrowRight":{const r=l.indexOf(e.currentTarget)+1;t=l[r]??l[0];break}case"ArrowLeft":{const r=l.indexOf(e.currentTarget)-1;t=l[r]??l[l.length-1];break}}t?.focus()};return(0,v.jsx)("ul",{role:"tablist","aria-orientation":"horizontal",className:(0,a.A)("tabs",{"tabs--block":r},t),children:u.map((e=>{let{value:t,label:r,attributes:o}=e;return(0,v.jsx)("li",{role:"tab",tabIndex:n===t?0:-1,"aria-selected":n===t,ref:e=>l.push(e),onKeyDown:d,onClick:c,...o,className:(0,a.A)("tabs__item",g.tabItem,o?.className,{"tabs__item--active":n===t}),children:r??t},t)}))})}function w(e){let{lazy:t,children:r,selectedValue:a}=e;const o=(Array.isArray(r)?r:[r]).filter(Boolean);if(t){const e=o.find((e=>e.props.value===a));return e?(0,n.cloneElement)(e,{className:"margin-top--md"}):null}return(0,v.jsx)("div",{className:"margin-top--md",children:o.map(((e,t)=>(0,n.cloneElement)(e,{key:t,hidden:e.props.value!==a})))})}function y(e){const t=h(e);return(0,v.jsxs)("div",{className:(0,a.A)("tabs-container",g.tabList),children:[(0,v.jsx)(x,{...e,...t}),(0,v.jsx)(w,{...e,...t})]})}function k(e){const t=(0,b.A)();return(0,v.jsx)(y,{...e,children:d(e.children)},String(t))}},8453:(e,t,r)=>{r.d(t,{R:()=>s,x:()=>u});var n=r(6540);const a={},o=n.createContext(a);function s(e){const t=n.useContext(o);return n.useMemo((function(){return"function"==typeof e?e(t):{...t,...e}}),[t,e])}function u(e){let t;return t=e.disableParentContext?"function"==typeof e.components?e.components(a):e.components||a:s(e.components),n.createElement(o.Provider,{value:t},e.children)}}}]); \ No newline at end of file diff --git a/assets/js/13f3ef77.4ae82bf0.js b/assets/js/13f3ef77.4ae82bf0.js deleted file mode 100644 index 415019e4..00000000 --- a/assets/js/13f3ef77.4ae82bf0.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunkdocs=self.webpackChunkdocs||[]).push([[2241],{8952:(e,t,r)=>{r.r(t),r.d(t,{assets:()=>l,contentTitle:()=>u,default:()=>d,frontMatter:()=>s,metadata:()=>o,toc:()=>i});var n=r(4848),a=r(8453);r(1470),r(9365);const s={},u="CLI",o={id:"guides/cli",title:"CLI",description:"Coming Soon...",source:"@site/docs/guides/cli.mdx",sourceDirName:"guides",slug:"/guides/cli",permalink:"/docs/guides/cli",draft:!1,unlisted:!1,editUrl:"https://github.com/facebook/docusaurus/tree/main/packages/create-docusaurus/templates/shared/docs/guides/cli.mdx",tags:[],version:"current",frontMatter:{},sidebar:"docs",previous:{title:"Clients",permalink:"/docs/guides/clients"},next:{title:"Child Workflows",permalink:"/docs/guides/child-workflows"}},l={},i=[];function c(e){const t={h1:"h1",p:"p",strong:"strong",...(0,a.R)(),...e.components};return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(t.h1,{id:"cli",children:"CLI"}),"\n",(0,n.jsx)(t.p,{children:(0,n.jsx)(t.strong,{children:"Coming Soon..."})})]})}function d(e={}){const{wrapper:t}={...(0,a.R)(),...e.components};return t?(0,n.jsx)(t,{...e,children:(0,n.jsx)(c,{...e})}):c(e)}},9365:(e,t,r)=>{r.d(t,{A:()=>u});r(6540);var n=r(4164);const a={tabItem:"tabItem_Ymn6"};var s=r(4848);function u(e){let{children:t,hidden:r,className:u}=e;return(0,s.jsx)("div",{role:"tabpanel",className:(0,n.A)(a.tabItem,u),hidden:r,children:t})}},1470:(e,t,r)=>{r.d(t,{A:()=>k});var n=r(6540),a=r(4164),s=r(3104),u=r(6347),o=r(205),l=r(7485),i=r(1682),c=r(9466);function d(e){return n.Children.toArray(e).filter((e=>"\n"!==e)).map((e=>{if(!e||(0,n.isValidElement)(e)&&function(e){const{props:t}=e;return!!t&&"object"==typeof t&&"value"in t}(e))return e;throw new Error(`Docusaurus error: Bad child <${"string"==typeof e.type?e.type:e.type.name}>: all children of the component should be , and every should have a unique "value" prop.`)}))?.filter(Boolean)??[]}function f(e){const{values:t,children:r}=e;return(0,n.useMemo)((()=>{const e=t??function(e){return d(e).map((e=>{let{props:{value:t,label:r,attributes:n,default:a}}=e;return{value:t,label:r,attributes:n,default:a}}))}(r);return function(e){const t=(0,i.X)(e,((e,t)=>e.value===t.value));if(t.length>0)throw new Error(`Docusaurus error: Duplicate values "${t.map((e=>e.value)).join(", ")}" found in . Every value needs to be unique.`)}(e),e}),[t,r])}function p(e){let{value:t,tabValues:r}=e;return r.some((e=>e.value===t))}function h(e){let{queryString:t=!1,groupId:r}=e;const a=(0,u.W6)(),s=function(e){let{queryString:t=!1,groupId:r}=e;if("string"==typeof t)return t;if(!1===t)return null;if(!0===t&&!r)throw new Error('Docusaurus error: The component groupId prop is required if queryString=true, because this value is used as the search param name. You can also provide an explicit value such as queryString="my-search-param".');return r??null}({queryString:t,groupId:r});return[(0,l.aZ)(s),(0,n.useCallback)((e=>{if(!s)return;const t=new URLSearchParams(a.location.search);t.set(s,e),a.replace({...a.location,search:t.toString()})}),[s,a])]}function m(e){const{defaultValue:t,queryString:r=!1,groupId:a}=e,s=f(e),[u,l]=(0,n.useState)((()=>function(e){let{defaultValue:t,tabValues:r}=e;if(0===r.length)throw new Error("Docusaurus error: the component requires at least one children component");if(t){if(!p({value:t,tabValues:r}))throw new Error(`Docusaurus error: The has a defaultValue "${t}" but none of its children has the corresponding value. Available values are: ${r.map((e=>e.value)).join(", ")}. If you intend to show no default tab, use defaultValue={null} instead.`);return t}const n=r.find((e=>e.default))??r[0];if(!n)throw new Error("Unexpected error: 0 tabValues");return n.value}({defaultValue:t,tabValues:s}))),[i,d]=h({queryString:r,groupId:a}),[m,b]=function(e){let{groupId:t}=e;const r=function(e){return e?`docusaurus.tab.${e}`:null}(t),[a,s]=(0,c.Dv)(r);return[a,(0,n.useCallback)((e=>{r&&s.set(e)}),[r,s])]}({groupId:a}),v=(()=>{const e=i??m;return p({value:e,tabValues:s})?e:null})();(0,o.A)((()=>{v&&l(v)}),[v]);return{selectedValue:u,selectValue:(0,n.useCallback)((e=>{if(!p({value:e,tabValues:s}))throw new Error(`Can't select invalid tab value=${e}`);l(e),d(e),b(e)}),[d,b,s]),tabValues:s}}var b=r(2303);const v={tabList:"tabList__CuJ",tabItem:"tabItem_LNqP"};var g=r(4848);function x(e){let{className:t,block:r,selectedValue:n,selectValue:u,tabValues:o}=e;const l=[],{blockElementScrollPositionUntilNextRender:i}=(0,s.a_)(),c=e=>{const t=e.currentTarget,r=l.indexOf(t),a=o[r].value;a!==n&&(i(t),u(a))},d=e=>{let t=null;switch(e.key){case"Enter":c(e);break;case"ArrowRight":{const r=l.indexOf(e.currentTarget)+1;t=l[r]??l[0];break}case"ArrowLeft":{const r=l.indexOf(e.currentTarget)-1;t=l[r]??l[l.length-1];break}}t?.focus()};return(0,g.jsx)("ul",{role:"tablist","aria-orientation":"horizontal",className:(0,a.A)("tabs",{"tabs--block":r},t),children:o.map((e=>{let{value:t,label:r,attributes:s}=e;return(0,g.jsx)("li",{role:"tab",tabIndex:n===t?0:-1,"aria-selected":n===t,ref:e=>l.push(e),onKeyDown:d,onClick:c,...s,className:(0,a.A)("tabs__item",v.tabItem,s?.className,{"tabs__item--active":n===t}),children:r??t},t)}))})}function w(e){let{lazy:t,children:r,selectedValue:a}=e;const s=(Array.isArray(r)?r:[r]).filter(Boolean);if(t){const e=s.find((e=>e.props.value===a));return e?(0,n.cloneElement)(e,{className:"margin-top--md"}):null}return(0,g.jsx)("div",{className:"margin-top--md",children:s.map(((e,t)=>(0,n.cloneElement)(e,{key:t,hidden:e.props.value!==a})))})}function y(e){const t=m(e);return(0,g.jsxs)("div",{className:(0,a.A)("tabs-container",v.tabList),children:[(0,g.jsx)(x,{...e,...t}),(0,g.jsx)(w,{...e,...t})]})}function k(e){const t=(0,b.A)();return(0,g.jsx)(y,{...e,children:d(e.children)},String(t))}},8453:(e,t,r)=>{r.d(t,{R:()=>u,x:()=>o});var n=r(6540);const a={},s=n.createContext(a);function u(e){const t=n.useContext(s);return n.useMemo((function(){return"function"==typeof e?e(t):{...t,...e}}),[t,e])}function o(e){let t;return t=e.disableParentContext?"function"==typeof e.components?e.components(a):e.components||a:u(e.components),n.createElement(s.Provider,{value:t},e.children)}}}]); \ No newline at end of file diff --git a/assets/js/183ed9a2.85c1b55a.js b/assets/js/183ed9a2.85c1b55a.js deleted file mode 100644 index 4a04e79d..00000000 --- a/assets/js/183ed9a2.85c1b55a.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunkdocs=self.webpackChunkdocs||[]).push([[7104],{58:(e,t,n)=>{n.r(t),n.d(t,{assets:()=>l,contentTitle:()=>u,default:()=>d,frontMatter:()=>s,metadata:()=>o,toc:()=>i});var r=n(4848),a=n(8453);n(1470),n(9365);const s={},u="Testing",o={id:"guides/testing",title:"Testing",description:"Coming Soon...",source:"@site/docs/guides/testing.mdx",sourceDirName:"guides",slug:"/guides/testing",permalink:"/docs/guides/testing",draft:!1,unlisted:!1,editUrl:"https://github.com/facebook/docusaurus/tree/main/packages/create-docusaurus/templates/shared/docs/guides/testing.mdx",tags:[],version:"current",frontMatter:{},sidebar:"docs",previous:{title:"Signals",permalink:"/docs/guides/signals"},next:{title:"Updates",permalink:"/docs/guides/updates"}},l={},i=[];function c(e){const t={h1:"h1",p:"p",strong:"strong",...(0,a.R)(),...e.components};return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(t.h1,{id:"testing",children:"Testing"}),"\n",(0,r.jsx)(t.p,{children:(0,r.jsx)(t.strong,{children:"Coming Soon..."})})]})}function d(e={}){const{wrapper:t}={...(0,a.R)(),...e.components};return t?(0,r.jsx)(t,{...e,children:(0,r.jsx)(c,{...e})}):c(e)}},9365:(e,t,n)=>{n.d(t,{A:()=>u});n(6540);var r=n(4164);const a={tabItem:"tabItem_Ymn6"};var s=n(4848);function u(e){let{children:t,hidden:n,className:u}=e;return(0,s.jsx)("div",{role:"tabpanel",className:(0,r.A)(a.tabItem,u),hidden:n,children:t})}},1470:(e,t,n)=>{n.d(t,{A:()=>k});var r=n(6540),a=n(4164),s=n(3104),u=n(6347),o=n(205),l=n(7485),i=n(1682),c=n(9466);function d(e){return r.Children.toArray(e).filter((e=>"\n"!==e)).map((e=>{if(!e||(0,r.isValidElement)(e)&&function(e){const{props:t}=e;return!!t&&"object"==typeof t&&"value"in t}(e))return e;throw new Error(`Docusaurus error: Bad child <${"string"==typeof e.type?e.type:e.type.name}>: all children of the component should be , and every should have a unique "value" prop.`)}))?.filter(Boolean)??[]}function p(e){const{values:t,children:n}=e;return(0,r.useMemo)((()=>{const e=t??function(e){return d(e).map((e=>{let{props:{value:t,label:n,attributes:r,default:a}}=e;return{value:t,label:n,attributes:r,default:a}}))}(n);return function(e){const t=(0,i.X)(e,((e,t)=>e.value===t.value));if(t.length>0)throw new Error(`Docusaurus error: Duplicate values "${t.map((e=>e.value)).join(", ")}" found in . Every value needs to be unique.`)}(e),e}),[t,n])}function f(e){let{value:t,tabValues:n}=e;return n.some((e=>e.value===t))}function m(e){let{queryString:t=!1,groupId:n}=e;const a=(0,u.W6)(),s=function(e){let{queryString:t=!1,groupId:n}=e;if("string"==typeof t)return t;if(!1===t)return null;if(!0===t&&!n)throw new Error('Docusaurus error: The component groupId prop is required if queryString=true, because this value is used as the search param name. You can also provide an explicit value such as queryString="my-search-param".');return n??null}({queryString:t,groupId:n});return[(0,l.aZ)(s),(0,r.useCallback)((e=>{if(!s)return;const t=new URLSearchParams(a.location.search);t.set(s,e),a.replace({...a.location,search:t.toString()})}),[s,a])]}function b(e){const{defaultValue:t,queryString:n=!1,groupId:a}=e,s=p(e),[u,l]=(0,r.useState)((()=>function(e){let{defaultValue:t,tabValues:n}=e;if(0===n.length)throw new Error("Docusaurus error: the component requires at least one children component");if(t){if(!f({value:t,tabValues:n}))throw new Error(`Docusaurus error: The has a defaultValue "${t}" but none of its children has the corresponding value. Available values are: ${n.map((e=>e.value)).join(", ")}. If you intend to show no default tab, use defaultValue={null} instead.`);return t}const r=n.find((e=>e.default))??n[0];if(!r)throw new Error("Unexpected error: 0 tabValues");return r.value}({defaultValue:t,tabValues:s}))),[i,d]=m({queryString:n,groupId:a}),[b,h]=function(e){let{groupId:t}=e;const n=function(e){return e?`docusaurus.tab.${e}`:null}(t),[a,s]=(0,c.Dv)(n);return[a,(0,r.useCallback)((e=>{n&&s.set(e)}),[n,s])]}({groupId:a}),g=(()=>{const e=i??b;return f({value:e,tabValues:s})?e:null})();(0,o.A)((()=>{g&&l(g)}),[g]);return{selectedValue:u,selectValue:(0,r.useCallback)((e=>{if(!f({value:e,tabValues:s}))throw new Error(`Can't select invalid tab value=${e}`);l(e),d(e),h(e)}),[d,h,s]),tabValues:s}}var h=n(2303);const g={tabList:"tabList__CuJ",tabItem:"tabItem_LNqP"};var v=n(4848);function x(e){let{className:t,block:n,selectedValue:r,selectValue:u,tabValues:o}=e;const l=[],{blockElementScrollPositionUntilNextRender:i}=(0,s.a_)(),c=e=>{const t=e.currentTarget,n=l.indexOf(t),a=o[n].value;a!==r&&(i(t),u(a))},d=e=>{let t=null;switch(e.key){case"Enter":c(e);break;case"ArrowRight":{const n=l.indexOf(e.currentTarget)+1;t=l[n]??l[0];break}case"ArrowLeft":{const n=l.indexOf(e.currentTarget)-1;t=l[n]??l[l.length-1];break}}t?.focus()};return(0,v.jsx)("ul",{role:"tablist","aria-orientation":"horizontal",className:(0,a.A)("tabs",{"tabs--block":n},t),children:o.map((e=>{let{value:t,label:n,attributes:s}=e;return(0,v.jsx)("li",{role:"tab",tabIndex:r===t?0:-1,"aria-selected":r===t,ref:e=>l.push(e),onKeyDown:d,onClick:c,...s,className:(0,a.A)("tabs__item",g.tabItem,s?.className,{"tabs__item--active":r===t}),children:n??t},t)}))})}function y(e){let{lazy:t,children:n,selectedValue:a}=e;const s=(Array.isArray(n)?n:[n]).filter(Boolean);if(t){const e=s.find((e=>e.props.value===a));return e?(0,r.cloneElement)(e,{className:"margin-top--md"}):null}return(0,v.jsx)("div",{className:"margin-top--md",children:s.map(((e,t)=>(0,r.cloneElement)(e,{key:t,hidden:e.props.value!==a})))})}function w(e){const t=b(e);return(0,v.jsxs)("div",{className:(0,a.A)("tabs-container",g.tabList),children:[(0,v.jsx)(x,{...e,...t}),(0,v.jsx)(y,{...e,...t})]})}function k(e){const t=(0,h.A)();return(0,v.jsx)(w,{...e,children:d(e.children)},String(t))}},8453:(e,t,n)=>{n.d(t,{R:()=>u,x:()=>o});var r=n(6540);const a={},s=r.createContext(a);function u(e){const t=r.useContext(s);return r.useMemo((function(){return"function"==typeof e?e(t):{...t,...e}}),[t,e])}function o(e){let t;return t=e.disableParentContext?"function"==typeof e.components?e.components(a):e.components||a:u(e.components),r.createElement(s.Provider,{value:t},e.children)}}}]); \ No newline at end of file diff --git a/assets/js/183ed9a2.b26feba4.js b/assets/js/183ed9a2.b26feba4.js new file mode 100644 index 00000000..ebc19bc5 --- /dev/null +++ b/assets/js/183ed9a2.b26feba4.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunkdocs=self.webpackChunkdocs||[]).push([[7104],{58:(e,t,n)=>{n.r(t),n.d(t,{assets:()=>l,contentTitle:()=>o,default:()=>d,frontMatter:()=>s,metadata:()=>u,toc:()=>i});var r=n(4848),a=n(8453);n(1470),n(9365);const s={},o="Testing",u={id:"guides/testing",title:"Testing",description:"Coming Soon...",source:"@site/docs/guides/testing.mdx",sourceDirName:"guides",slug:"/guides/testing",permalink:"/protoc-gen-go-temporal/docs/guides/testing",draft:!1,unlisted:!1,editUrl:"https://github.com/facebook/docusaurus/tree/main/packages/create-docusaurus/templates/shared/docs/guides/testing.mdx",tags:[],version:"current",frontMatter:{},sidebar:"docs",previous:{title:"Signals",permalink:"/protoc-gen-go-temporal/docs/guides/signals"},next:{title:"Updates",permalink:"/protoc-gen-go-temporal/docs/guides/updates"}},l={},i=[];function c(e){const t={h1:"h1",p:"p",strong:"strong",...(0,a.R)(),...e.components};return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(t.h1,{id:"testing",children:"Testing"}),"\n",(0,r.jsx)(t.p,{children:(0,r.jsx)(t.strong,{children:"Coming Soon..."})})]})}function d(e={}){const{wrapper:t}={...(0,a.R)(),...e.components};return t?(0,r.jsx)(t,{...e,children:(0,r.jsx)(c,{...e})}):c(e)}},9365:(e,t,n)=>{n.d(t,{A:()=>o});n(6540);var r=n(4164);const a={tabItem:"tabItem_Ymn6"};var s=n(4848);function o(e){let{children:t,hidden:n,className:o}=e;return(0,s.jsx)("div",{role:"tabpanel",className:(0,r.A)(a.tabItem,o),hidden:n,children:t})}},1470:(e,t,n)=>{n.d(t,{A:()=>k});var r=n(6540),a=n(4164),s=n(3104),o=n(6347),u=n(205),l=n(7485),i=n(1682),c=n(9466);function d(e){return r.Children.toArray(e).filter((e=>"\n"!==e)).map((e=>{if(!e||(0,r.isValidElement)(e)&&function(e){const{props:t}=e;return!!t&&"object"==typeof t&&"value"in t}(e))return e;throw new Error(`Docusaurus error: Bad child <${"string"==typeof e.type?e.type:e.type.name}>: all children of the component should be , and every should have a unique "value" prop.`)}))?.filter(Boolean)??[]}function p(e){const{values:t,children:n}=e;return(0,r.useMemo)((()=>{const e=t??function(e){return d(e).map((e=>{let{props:{value:t,label:n,attributes:r,default:a}}=e;return{value:t,label:n,attributes:r,default:a}}))}(n);return function(e){const t=(0,i.X)(e,((e,t)=>e.value===t.value));if(t.length>0)throw new Error(`Docusaurus error: Duplicate values "${t.map((e=>e.value)).join(", ")}" found in . Every value needs to be unique.`)}(e),e}),[t,n])}function f(e){let{value:t,tabValues:n}=e;return n.some((e=>e.value===t))}function m(e){let{queryString:t=!1,groupId:n}=e;const a=(0,o.W6)(),s=function(e){let{queryString:t=!1,groupId:n}=e;if("string"==typeof t)return t;if(!1===t)return null;if(!0===t&&!n)throw new Error('Docusaurus error: The component groupId prop is required if queryString=true, because this value is used as the search param name. You can also provide an explicit value such as queryString="my-search-param".');return n??null}({queryString:t,groupId:n});return[(0,l.aZ)(s),(0,r.useCallback)((e=>{if(!s)return;const t=new URLSearchParams(a.location.search);t.set(s,e),a.replace({...a.location,search:t.toString()})}),[s,a])]}function b(e){const{defaultValue:t,queryString:n=!1,groupId:a}=e,s=p(e),[o,l]=(0,r.useState)((()=>function(e){let{defaultValue:t,tabValues:n}=e;if(0===n.length)throw new Error("Docusaurus error: the component requires at least one children component");if(t){if(!f({value:t,tabValues:n}))throw new Error(`Docusaurus error: The has a defaultValue "${t}" but none of its children has the corresponding value. Available values are: ${n.map((e=>e.value)).join(", ")}. If you intend to show no default tab, use defaultValue={null} instead.`);return t}const r=n.find((e=>e.default))??n[0];if(!r)throw new Error("Unexpected error: 0 tabValues");return r.value}({defaultValue:t,tabValues:s}))),[i,d]=m({queryString:n,groupId:a}),[b,h]=function(e){let{groupId:t}=e;const n=function(e){return e?`docusaurus.tab.${e}`:null}(t),[a,s]=(0,c.Dv)(n);return[a,(0,r.useCallback)((e=>{n&&s.set(e)}),[n,s])]}({groupId:a}),g=(()=>{const e=i??b;return f({value:e,tabValues:s})?e:null})();(0,u.A)((()=>{g&&l(g)}),[g]);return{selectedValue:o,selectValue:(0,r.useCallback)((e=>{if(!f({value:e,tabValues:s}))throw new Error(`Can't select invalid tab value=${e}`);l(e),d(e),h(e)}),[d,h,s]),tabValues:s}}var h=n(2303);const g={tabList:"tabList__CuJ",tabItem:"tabItem_LNqP"};var v=n(4848);function x(e){let{className:t,block:n,selectedValue:r,selectValue:o,tabValues:u}=e;const l=[],{blockElementScrollPositionUntilNextRender:i}=(0,s.a_)(),c=e=>{const t=e.currentTarget,n=l.indexOf(t),a=u[n].value;a!==r&&(i(t),o(a))},d=e=>{let t=null;switch(e.key){case"Enter":c(e);break;case"ArrowRight":{const n=l.indexOf(e.currentTarget)+1;t=l[n]??l[0];break}case"ArrowLeft":{const n=l.indexOf(e.currentTarget)-1;t=l[n]??l[l.length-1];break}}t?.focus()};return(0,v.jsx)("ul",{role:"tablist","aria-orientation":"horizontal",className:(0,a.A)("tabs",{"tabs--block":n},t),children:u.map((e=>{let{value:t,label:n,attributes:s}=e;return(0,v.jsx)("li",{role:"tab",tabIndex:r===t?0:-1,"aria-selected":r===t,ref:e=>l.push(e),onKeyDown:d,onClick:c,...s,className:(0,a.A)("tabs__item",g.tabItem,s?.className,{"tabs__item--active":r===t}),children:n??t},t)}))})}function y(e){let{lazy:t,children:n,selectedValue:a}=e;const s=(Array.isArray(n)?n:[n]).filter(Boolean);if(t){const e=s.find((e=>e.props.value===a));return e?(0,r.cloneElement)(e,{className:"margin-top--md"}):null}return(0,v.jsx)("div",{className:"margin-top--md",children:s.map(((e,t)=>(0,r.cloneElement)(e,{key:t,hidden:e.props.value!==a})))})}function w(e){const t=b(e);return(0,v.jsxs)("div",{className:(0,a.A)("tabs-container",g.tabList),children:[(0,v.jsx)(x,{...e,...t}),(0,v.jsx)(y,{...e,...t})]})}function k(e){const t=(0,h.A)();return(0,v.jsx)(w,{...e,children:d(e.children)},String(t))}},8453:(e,t,n)=>{n.d(t,{R:()=>o,x:()=>u});var r=n(6540);const a={},s=r.createContext(a);function o(e){const t=r.useContext(s);return r.useMemo((function(){return"function"==typeof e?e(t):{...t,...e}}),[t,e])}function u(e){let t;return t=e.disableParentContext?"function"==typeof e.components?e.components(a):e.components||a:o(e.components),r.createElement(s.Provider,{value:t},e.children)}}}]); \ No newline at end of file diff --git a/assets/js/24b40d04.62c90611.js b/assets/js/24b40d04.62c90611.js deleted file mode 100644 index df90fb8d..00000000 --- a/assets/js/24b40d04.62c90611.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunkdocs=self.webpackChunkdocs||[]).push([[8975],{1534:(e,t,n)=>{n.r(t),n.d(t,{assets:()=>l,contentTitle:()=>u,default:()=>d,frontMatter:()=>s,metadata:()=>o,toc:()=>i});var r=n(4848),a=n(8453);n(1470),n(9365);const s={},u="Clients",o={id:"guides/clients",title:"Clients",description:"Coming Soon...",source:"@site/docs/guides/clients.mdx",sourceDirName:"guides",slug:"/guides/clients",permalink:"/docs/guides/clients",draft:!1,unlisted:!1,editUrl:"https://github.com/facebook/docusaurus/tree/main/packages/create-docusaurus/templates/shared/docs/guides/clients.mdx",tags:[],version:"current",frontMatter:{},sidebar:"docs",previous:{title:"Updates",permalink:"/docs/guides/updates"},next:{title:"CLI",permalink:"/docs/guides/cli"}},l={},i=[];function c(e){const t={h1:"h1",p:"p",strong:"strong",...(0,a.R)(),...e.components};return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(t.h1,{id:"clients",children:"Clients"}),"\n",(0,r.jsx)(t.p,{children:(0,r.jsx)(t.strong,{children:"Coming Soon..."})})]})}function d(e={}){const{wrapper:t}={...(0,a.R)(),...e.components};return t?(0,r.jsx)(t,{...e,children:(0,r.jsx)(c,{...e})}):c(e)}},9365:(e,t,n)=>{n.d(t,{A:()=>u});n(6540);var r=n(4164);const a={tabItem:"tabItem_Ymn6"};var s=n(4848);function u(e){let{children:t,hidden:n,className:u}=e;return(0,s.jsx)("div",{role:"tabpanel",className:(0,r.A)(a.tabItem,u),hidden:n,children:t})}},1470:(e,t,n)=>{n.d(t,{A:()=>k});var r=n(6540),a=n(4164),s=n(3104),u=n(6347),o=n(205),l=n(7485),i=n(1682),c=n(9466);function d(e){return r.Children.toArray(e).filter((e=>"\n"!==e)).map((e=>{if(!e||(0,r.isValidElement)(e)&&function(e){const{props:t}=e;return!!t&&"object"==typeof t&&"value"in t}(e))return e;throw new Error(`Docusaurus error: Bad child <${"string"==typeof e.type?e.type:e.type.name}>: all children of the component should be , and every should have a unique "value" prop.`)}))?.filter(Boolean)??[]}function p(e){const{values:t,children:n}=e;return(0,r.useMemo)((()=>{const e=t??function(e){return d(e).map((e=>{let{props:{value:t,label:n,attributes:r,default:a}}=e;return{value:t,label:n,attributes:r,default:a}}))}(n);return function(e){const t=(0,i.X)(e,((e,t)=>e.value===t.value));if(t.length>0)throw new Error(`Docusaurus error: Duplicate values "${t.map((e=>e.value)).join(", ")}" found in . Every value needs to be unique.`)}(e),e}),[t,n])}function f(e){let{value:t,tabValues:n}=e;return n.some((e=>e.value===t))}function m(e){let{queryString:t=!1,groupId:n}=e;const a=(0,u.W6)(),s=function(e){let{queryString:t=!1,groupId:n}=e;if("string"==typeof t)return t;if(!1===t)return null;if(!0===t&&!n)throw new Error('Docusaurus error: The component groupId prop is required if queryString=true, because this value is used as the search param name. You can also provide an explicit value such as queryString="my-search-param".');return n??null}({queryString:t,groupId:n});return[(0,l.aZ)(s),(0,r.useCallback)((e=>{if(!s)return;const t=new URLSearchParams(a.location.search);t.set(s,e),a.replace({...a.location,search:t.toString()})}),[s,a])]}function b(e){const{defaultValue:t,queryString:n=!1,groupId:a}=e,s=p(e),[u,l]=(0,r.useState)((()=>function(e){let{defaultValue:t,tabValues:n}=e;if(0===n.length)throw new Error("Docusaurus error: the component requires at least one children component");if(t){if(!f({value:t,tabValues:n}))throw new Error(`Docusaurus error: The has a defaultValue "${t}" but none of its children has the corresponding value. Available values are: ${n.map((e=>e.value)).join(", ")}. If you intend to show no default tab, use defaultValue={null} instead.`);return t}const r=n.find((e=>e.default))??n[0];if(!r)throw new Error("Unexpected error: 0 tabValues");return r.value}({defaultValue:t,tabValues:s}))),[i,d]=m({queryString:n,groupId:a}),[b,h]=function(e){let{groupId:t}=e;const n=function(e){return e?`docusaurus.tab.${e}`:null}(t),[a,s]=(0,c.Dv)(n);return[a,(0,r.useCallback)((e=>{n&&s.set(e)}),[n,s])]}({groupId:a}),v=(()=>{const e=i??b;return f({value:e,tabValues:s})?e:null})();(0,o.A)((()=>{v&&l(v)}),[v]);return{selectedValue:u,selectValue:(0,r.useCallback)((e=>{if(!f({value:e,tabValues:s}))throw new Error(`Can't select invalid tab value=${e}`);l(e),d(e),h(e)}),[d,h,s]),tabValues:s}}var h=n(2303);const v={tabList:"tabList__CuJ",tabItem:"tabItem_LNqP"};var g=n(4848);function x(e){let{className:t,block:n,selectedValue:r,selectValue:u,tabValues:o}=e;const l=[],{blockElementScrollPositionUntilNextRender:i}=(0,s.a_)(),c=e=>{const t=e.currentTarget,n=l.indexOf(t),a=o[n].value;a!==r&&(i(t),u(a))},d=e=>{let t=null;switch(e.key){case"Enter":c(e);break;case"ArrowRight":{const n=l.indexOf(e.currentTarget)+1;t=l[n]??l[0];break}case"ArrowLeft":{const n=l.indexOf(e.currentTarget)-1;t=l[n]??l[l.length-1];break}}t?.focus()};return(0,g.jsx)("ul",{role:"tablist","aria-orientation":"horizontal",className:(0,a.A)("tabs",{"tabs--block":n},t),children:o.map((e=>{let{value:t,label:n,attributes:s}=e;return(0,g.jsx)("li",{role:"tab",tabIndex:r===t?0:-1,"aria-selected":r===t,ref:e=>l.push(e),onKeyDown:d,onClick:c,...s,className:(0,a.A)("tabs__item",v.tabItem,s?.className,{"tabs__item--active":r===t}),children:n??t},t)}))})}function y(e){let{lazy:t,children:n,selectedValue:a}=e;const s=(Array.isArray(n)?n:[n]).filter(Boolean);if(t){const e=s.find((e=>e.props.value===a));return e?(0,r.cloneElement)(e,{className:"margin-top--md"}):null}return(0,g.jsx)("div",{className:"margin-top--md",children:s.map(((e,t)=>(0,r.cloneElement)(e,{key:t,hidden:e.props.value!==a})))})}function w(e){const t=b(e);return(0,g.jsxs)("div",{className:(0,a.A)("tabs-container",v.tabList),children:[(0,g.jsx)(x,{...e,...t}),(0,g.jsx)(y,{...e,...t})]})}function k(e){const t=(0,h.A)();return(0,g.jsx)(w,{...e,children:d(e.children)},String(t))}},8453:(e,t,n)=>{n.d(t,{R:()=>u,x:()=>o});var r=n(6540);const a={},s=r.createContext(a);function u(e){const t=r.useContext(s);return r.useMemo((function(){return"function"==typeof e?e(t):{...t,...e}}),[t,e])}function o(e){let t;return t=e.disableParentContext?"function"==typeof e.components?e.components(a):e.components||a:u(e.components),r.createElement(s.Provider,{value:t},e.children)}}}]); \ No newline at end of file diff --git a/assets/js/24b40d04.bc0e2c59.js b/assets/js/24b40d04.bc0e2c59.js new file mode 100644 index 00000000..a50a7231 --- /dev/null +++ b/assets/js/24b40d04.bc0e2c59.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunkdocs=self.webpackChunkdocs||[]).push([[8975],{1534:(e,t,n)=>{n.r(t),n.d(t,{assets:()=>l,contentTitle:()=>o,default:()=>d,frontMatter:()=>s,metadata:()=>u,toc:()=>i});var r=n(4848),a=n(8453);n(1470),n(9365);const s={},o="Clients",u={id:"guides/clients",title:"Clients",description:"Coming Soon...",source:"@site/docs/guides/clients.mdx",sourceDirName:"guides",slug:"/guides/clients",permalink:"/protoc-gen-go-temporal/docs/guides/clients",draft:!1,unlisted:!1,editUrl:"https://github.com/facebook/docusaurus/tree/main/packages/create-docusaurus/templates/shared/docs/guides/clients.mdx",tags:[],version:"current",frontMatter:{},sidebar:"docs",previous:{title:"Updates",permalink:"/protoc-gen-go-temporal/docs/guides/updates"},next:{title:"CLI",permalink:"/protoc-gen-go-temporal/docs/guides/cli"}},l={},i=[];function c(e){const t={h1:"h1",p:"p",strong:"strong",...(0,a.R)(),...e.components};return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(t.h1,{id:"clients",children:"Clients"}),"\n",(0,r.jsx)(t.p,{children:(0,r.jsx)(t.strong,{children:"Coming Soon..."})})]})}function d(e={}){const{wrapper:t}={...(0,a.R)(),...e.components};return t?(0,r.jsx)(t,{...e,children:(0,r.jsx)(c,{...e})}):c(e)}},9365:(e,t,n)=>{n.d(t,{A:()=>o});n(6540);var r=n(4164);const a={tabItem:"tabItem_Ymn6"};var s=n(4848);function o(e){let{children:t,hidden:n,className:o}=e;return(0,s.jsx)("div",{role:"tabpanel",className:(0,r.A)(a.tabItem,o),hidden:n,children:t})}},1470:(e,t,n)=>{n.d(t,{A:()=>k});var r=n(6540),a=n(4164),s=n(3104),o=n(6347),u=n(205),l=n(7485),i=n(1682),c=n(9466);function d(e){return r.Children.toArray(e).filter((e=>"\n"!==e)).map((e=>{if(!e||(0,r.isValidElement)(e)&&function(e){const{props:t}=e;return!!t&&"object"==typeof t&&"value"in t}(e))return e;throw new Error(`Docusaurus error: Bad child <${"string"==typeof e.type?e.type:e.type.name}>: all children of the component should be , and every should have a unique "value" prop.`)}))?.filter(Boolean)??[]}function p(e){const{values:t,children:n}=e;return(0,r.useMemo)((()=>{const e=t??function(e){return d(e).map((e=>{let{props:{value:t,label:n,attributes:r,default:a}}=e;return{value:t,label:n,attributes:r,default:a}}))}(n);return function(e){const t=(0,i.X)(e,((e,t)=>e.value===t.value));if(t.length>0)throw new Error(`Docusaurus error: Duplicate values "${t.map((e=>e.value)).join(", ")}" found in . Every value needs to be unique.`)}(e),e}),[t,n])}function f(e){let{value:t,tabValues:n}=e;return n.some((e=>e.value===t))}function m(e){let{queryString:t=!1,groupId:n}=e;const a=(0,o.W6)(),s=function(e){let{queryString:t=!1,groupId:n}=e;if("string"==typeof t)return t;if(!1===t)return null;if(!0===t&&!n)throw new Error('Docusaurus error: The component groupId prop is required if queryString=true, because this value is used as the search param name. You can also provide an explicit value such as queryString="my-search-param".');return n??null}({queryString:t,groupId:n});return[(0,l.aZ)(s),(0,r.useCallback)((e=>{if(!s)return;const t=new URLSearchParams(a.location.search);t.set(s,e),a.replace({...a.location,search:t.toString()})}),[s,a])]}function b(e){const{defaultValue:t,queryString:n=!1,groupId:a}=e,s=p(e),[o,l]=(0,r.useState)((()=>function(e){let{defaultValue:t,tabValues:n}=e;if(0===n.length)throw new Error("Docusaurus error: the component requires at least one children component");if(t){if(!f({value:t,tabValues:n}))throw new Error(`Docusaurus error: The has a defaultValue "${t}" but none of its children has the corresponding value. Available values are: ${n.map((e=>e.value)).join(", ")}. If you intend to show no default tab, use defaultValue={null} instead.`);return t}const r=n.find((e=>e.default))??n[0];if(!r)throw new Error("Unexpected error: 0 tabValues");return r.value}({defaultValue:t,tabValues:s}))),[i,d]=m({queryString:n,groupId:a}),[b,h]=function(e){let{groupId:t}=e;const n=function(e){return e?`docusaurus.tab.${e}`:null}(t),[a,s]=(0,c.Dv)(n);return[a,(0,r.useCallback)((e=>{n&&s.set(e)}),[n,s])]}({groupId:a}),g=(()=>{const e=i??b;return f({value:e,tabValues:s})?e:null})();(0,u.A)((()=>{g&&l(g)}),[g]);return{selectedValue:o,selectValue:(0,r.useCallback)((e=>{if(!f({value:e,tabValues:s}))throw new Error(`Can't select invalid tab value=${e}`);l(e),d(e),h(e)}),[d,h,s]),tabValues:s}}var h=n(2303);const g={tabList:"tabList__CuJ",tabItem:"tabItem_LNqP"};var v=n(4848);function x(e){let{className:t,block:n,selectedValue:r,selectValue:o,tabValues:u}=e;const l=[],{blockElementScrollPositionUntilNextRender:i}=(0,s.a_)(),c=e=>{const t=e.currentTarget,n=l.indexOf(t),a=u[n].value;a!==r&&(i(t),o(a))},d=e=>{let t=null;switch(e.key){case"Enter":c(e);break;case"ArrowRight":{const n=l.indexOf(e.currentTarget)+1;t=l[n]??l[0];break}case"ArrowLeft":{const n=l.indexOf(e.currentTarget)-1;t=l[n]??l[l.length-1];break}}t?.focus()};return(0,v.jsx)("ul",{role:"tablist","aria-orientation":"horizontal",className:(0,a.A)("tabs",{"tabs--block":n},t),children:u.map((e=>{let{value:t,label:n,attributes:s}=e;return(0,v.jsx)("li",{role:"tab",tabIndex:r===t?0:-1,"aria-selected":r===t,ref:e=>l.push(e),onKeyDown:d,onClick:c,...s,className:(0,a.A)("tabs__item",g.tabItem,s?.className,{"tabs__item--active":r===t}),children:n??t},t)}))})}function y(e){let{lazy:t,children:n,selectedValue:a}=e;const s=(Array.isArray(n)?n:[n]).filter(Boolean);if(t){const e=s.find((e=>e.props.value===a));return e?(0,r.cloneElement)(e,{className:"margin-top--md"}):null}return(0,v.jsx)("div",{className:"margin-top--md",children:s.map(((e,t)=>(0,r.cloneElement)(e,{key:t,hidden:e.props.value!==a})))})}function w(e){const t=b(e);return(0,v.jsxs)("div",{className:(0,a.A)("tabs-container",g.tabList),children:[(0,v.jsx)(x,{...e,...t}),(0,v.jsx)(y,{...e,...t})]})}function k(e){const t=(0,h.A)();return(0,v.jsx)(w,{...e,children:d(e.children)},String(t))}},8453:(e,t,n)=>{n.d(t,{R:()=>o,x:()=>u});var r=n(6540);const a={},s=r.createContext(a);function o(e){const t=r.useContext(s);return r.useMemo((function(){return"function"==typeof e?e(t):{...t,...e}}),[t,e])}function u(e){let t;return t=e.disableParentContext?"function"==typeof e.components?e.components(a):e.components||a:o(e.components),r.createElement(s.Provider,{value:t},e.children)}}}]); \ No newline at end of file diff --git a/assets/js/2c4b19b8.1a4f3401.js b/assets/js/2c4b19b8.1a4f3401.js new file mode 100644 index 00000000..3210d47e --- /dev/null +++ b/assets/js/2c4b19b8.1a4f3401.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunkdocs=self.webpackChunkdocs||[]).push([[6940],{2922:(e,t,r)=>{r.r(t),r.d(t,{assets:()=>i,contentTitle:()=>l,default:()=>d,frontMatter:()=>a,metadata:()=>s,toc:()=>c});var n=r(4848),o=r(8453);r(1470),r(9365);const a={},l="Codec Server",s={id:"guides/codec-server",title:"Codec Server",description:"Data Converter",source:"@site/docs/guides/codec-server.mdx",sourceDirName:"guides",slug:"/guides/codec-server",permalink:"/protoc-gen-go-temporal/docs/guides/codec-server",draft:!1,unlisted:!1,editUrl:"https://github.com/facebook/docusaurus/tree/main/packages/create-docusaurus/templates/shared/docs/guides/codec-server.mdx",tags:[],version:"current",frontMatter:{},sidebar:"docs",previous:{title:"Bloblang",permalink:"/protoc-gen-go-temporal/docs/guides/bloblang"},next:{title:"Documentation",permalink:"/protoc-gen-go-temporal/docs/guides/documentation"}},i={},c=[{value:"Data Converter",id:"data-converter",level:2},{value:"Codec Server",id:"codec-server-1",level:2}];function u(e){const t={a:"a",admonition:"admonition",code:"code",h1:"h1",h2:"h2",p:"p",pre:"pre",...(0,o.R)(),...e.components};return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(t.h1,{id:"codec-server",children:"Codec Server"}),"\n",(0,n.jsx)(t.h2,{id:"data-converter",children:"Data Converter"}),"\n",(0,n.jsxs)(t.p,{children:["Temporal's ",(0,n.jsx)(t.a,{href:"https://pkg.go.dev/go.temporal.io/sdk/converter#GetDefaultDataConverter",children:"default data converter"})," will serialize protobuf types using the ",(0,n.jsx)(t.code,{children:"json/protobuf"})," encoding provided by the ",(0,n.jsx)(t.a,{href:"https://pkg.go.dev/go.temporal.io/sdk/converter#ProtoJSONPayloadConverter",children:"ProtoJSONPayloadConverter"}),", which allows the Temporal UI to automatically decode the underlying payload and render it as JSON. If you'd prefer to take advantage of protobuf's binary format for smaller payloads, you can provide an alternative data converter to the Temporal client at initialization that prioritizes the ",(0,n.jsx)(t.a,{href:"https://pkg.go.dev/go.temporal.io/sdk/converter#ProtoPayloadConverter",children:"ProtoPayloadConverter"})," ahead of the ",(0,n.jsx)(t.code,{children:"ProtoJSONPayloadConverter"}),". See below for an example."]}),"\n",(0,n.jsx)(t.pre,{children:(0,n.jsx)(t.code,{className:"language-go",metastring:'title="worker/main.go"',children:'package main\n\nimport (\n\t"log"\n\t"log/slog"\n\t"os"\n\n\t"path/to/interal/example"\n\texamplev1 "path/to/gen/example/v1"\n\t"github.com/urfave/cli/v2"\n\t"go.temporal.io/sdk/client"\n\t"go.temporal.io/sdk/converter"\n\tsdklog "go.temporal.io/sdk/log"\n\t"go.temporal.io/sdk/worker"\n)\n\nfunc main() {\n\tapp, err := examplev1.NewExampleCli(\n\t\texamplev1.NewExampleCliOptions().\n\t\t\tWithClient(func(cmd *cli.Context) (client.Client, error) {\n\t\t\t\treturn client.Dial(client.Options{\n\t\t\t\t\tDataConverter: converter.NewCompositeDataConverter(\n\t\t\t\t\t\tconverter.NewNilPayloadConverter(),\n\t\t\t\t\t\tconverter.NewByteSlicePayloadConverter(),\n\t\t\t\t\t\tconverter.NewProtoPayloadConverter(),\n\t\t\t\t\t),\n\t\t\t\t\tLogger: sdklog.NewStructuredLogger(slog.Default()),\n\t\t\t\t})\n\t\t\t}).\n\t\t\tWithWorker(func(cmd *cli.Context, c client.Client) (worker.Worker, error) {\n\t\t\t\tw := worker.New(c, examplev1.ExampleTaskQueue, worker.Options{})\n\t\t\t\texamplev1.RegisterExampleActivities(w, &example.Activities{})\n\t\t\t\texamplev1.RegisterExampleWorkflows(w, &example.Workflows{})\n\t\t\t\treturn w, nil\n\t\t\t}),\n\t)\n\tif err != nil {\n\t\tlog.Fatalf("error initializing example cli: %v", err)\n\t}\n\n if err := app.Run(os.Args); err != nil {\n log.Fatal(err)\n }\n}\n'})}),"\n",(0,n.jsx)(t.h2,{id:"codec-server-1",children:"Codec Server"}),"\n",(0,n.jsxs)(t.p,{children:["If you choose to use ",(0,n.jsx)(t.code,{children:"binary/protobuf"})," encoding, you'll lose the ability to view decoded payloads in the Temporal UI unless you configure the ",(0,n.jsx)(t.a,{href:"https://docs.temporal.io/dataconversion#codec-server",children:"Remote Codec Server"})," integration. This plugin can generate helpers that simplify the process of implementing a remote codec server for use with the Temporal UI to support conversion between ",(0,n.jsx)(t.code,{children:"binary/protobuf"})," and ",(0,n.jsx)(t.code,{children:"json/protobuf"})," or ",(0,n.jsx)(t.code,{children:"json/plain"})," payload encodings. See below for a simple example. For a more advanced example that supports different codecs per namespace, cors, and authentication, see the ",(0,n.jsx)(t.a,{href:"https://github.com/temporalio/samples-go/blob/main/codec-server/codec-server/main.go",children:"codec-server"})," go sample."]}),"\n",(0,n.jsx)(t.admonition,{type:"info",children:(0,n.jsxs)(t.p,{children:["This requires the ",(0,n.jsx)(t.a,{href:"/docs/configuration/plugin#enable-codec",children:"enable-codec"})," plugin option to be enabled"]})}),"\n",(0,n.jsx)(t.pre,{children:(0,n.jsx)(t.code,{className:"language-go",metastring:'title="codecserver/main.go"',children:'package main\n\nimport (\n\t"context"\n\t"errors"\n\t"log"\n\t"log/slog"\n\t"net/http"\n\t"os"\n\t"os/signal"\n\t"syscall"\n\n\texamplev1 "path/to/gen/example/v1"\n\t"github.com/cludden/protoc-gen-go-temporal/pkg/codec"\n\t"github.com/cludden/protoc-gen-go-temporal/pkg/scheme"\n\t"github.com/urfave/cli/v2"\n\t"go.temporal.io/sdk/converter"\n)\n\nfunc main() {\n\tapp, err := examplev1.NewExampleCli(/* ... */)\n\tif err != nil {\n\t\tlog.Fatalf("error initializing example cli: %v", err)\n\t}\n\n\tapp.Commands = append(app.Commands, &cli.Command{\n\t\tName: "codec",\n\t\tUsage: "run remote codec server",\n\t\tAction: func(cmd *cli.Context) error {\n\t\t\thandler := converter.NewPayloadCodecHTTPHandler(\n\t\t\t\tcodec.NewProtoJSONCodec(\n\t\t\t\t\tscheme.New(\n\t\t\t\t\t\texamplev1.WithExampleSchemeTypes(),\n\t\t\t\t\t),\n\t\t\t\t),\n\t\t\t)\n\n\t\t\tsrv := &http.Server{\n\t\t\t\tAddr: "0.0.0.0:8080",\n\t\t\t\tHandler: handler,\n\t\t\t}\n\n\t\t\tgo func() {\n\t\t\t\tsigChan := make(chan os.Signal, 1)\n\t\t\t\tsignal.Notify(sigChan, syscall.SIGINT, syscall.SIGTERM)\n\t\t\t\t<-sigChan\n\n\t\t\t\tif err := srv.Shutdown(context.Background()); err != nil {\n\t\t\t\t\tlog.Fatalf("error shutting down server: %v", err)\n\t\t\t\t}\n\t\t\t}()\n\n\t\t\tif err := srv.ListenAndServe(); err != nil && !errors.Is(err, http.ErrServerClosed) {\n\t\t\t\tlog.Fatalf("server error: %v", err)\n\t\t\t}\n\t\t\treturn nil\n\t\t},\n\t})\n\n\t// run cli\n\tif err := app.Run(os.Args); err != nil {\n\t\tlog.Fatal(err)\n\t}\n}\n'})}),"\n",(0,n.jsxs)(t.p,{children:["See the ",(0,n.jsx)(t.a,{href:"/docs/examples/codecserver/",children:"codecserver"})," example for more details."]})]})}function d(e={}){const{wrapper:t}={...(0,o.R)(),...e.components};return t?(0,n.jsx)(t,{...e,children:(0,n.jsx)(u,{...e})}):u(e)}},9365:(e,t,r)=>{r.d(t,{A:()=>l});r(6540);var n=r(4164);const o={tabItem:"tabItem_Ymn6"};var a=r(4848);function l(e){let{children:t,hidden:r,className:l}=e;return(0,a.jsx)("div",{role:"tabpanel",className:(0,n.A)(o.tabItem,l),hidden:r,children:t})}},1470:(e,t,r)=>{r.d(t,{A:()=>k});var n=r(6540),o=r(4164),a=r(3104),l=r(6347),s=r(205),i=r(7485),c=r(1682),u=r(9466);function d(e){return n.Children.toArray(e).filter((e=>"\n"!==e)).map((e=>{if(!e||(0,n.isValidElement)(e)&&function(e){const{props:t}=e;return!!t&&"object"==typeof t&&"value"in t}(e))return e;throw new Error(`Docusaurus error: Bad child <${"string"==typeof e.type?e.type:e.type.name}>: all children of the component should be , and every should have a unique "value" prop.`)}))?.filter(Boolean)??[]}function p(e){const{values:t,children:r}=e;return(0,n.useMemo)((()=>{const e=t??function(e){return d(e).map((e=>{let{props:{value:t,label:r,attributes:n,default:o}}=e;return{value:t,label:r,attributes:n,default:o}}))}(r);return function(e){const t=(0,c.X)(e,((e,t)=>e.value===t.value));if(t.length>0)throw new Error(`Docusaurus error: Duplicate values "${t.map((e=>e.value)).join(", ")}" found in . Every value needs to be unique.`)}(e),e}),[t,r])}function m(e){let{value:t,tabValues:r}=e;return r.some((e=>e.value===t))}function h(e){let{queryString:t=!1,groupId:r}=e;const o=(0,l.W6)(),a=function(e){let{queryString:t=!1,groupId:r}=e;if("string"==typeof t)return t;if(!1===t)return null;if(!0===t&&!r)throw new Error('Docusaurus error: The component groupId prop is required if queryString=true, because this value is used as the search param name. You can also provide an explicit value such as queryString="my-search-param".');return r??null}({queryString:t,groupId:r});return[(0,i.aZ)(a),(0,n.useCallback)((e=>{if(!a)return;const t=new URLSearchParams(o.location.search);t.set(a,e),o.replace({...o.location,search:t.toString()})}),[a,o])]}function v(e){const{defaultValue:t,queryString:r=!1,groupId:o}=e,a=p(e),[l,i]=(0,n.useState)((()=>function(e){let{defaultValue:t,tabValues:r}=e;if(0===r.length)throw new Error("Docusaurus error: the component requires at least one children component");if(t){if(!m({value:t,tabValues:r}))throw new Error(`Docusaurus error: The has a defaultValue "${t}" but none of its children has the corresponding value. Available values are: ${r.map((e=>e.value)).join(", ")}. If you intend to show no default tab, use defaultValue={null} instead.`);return t}const n=r.find((e=>e.default))??r[0];if(!n)throw new Error("Unexpected error: 0 tabValues");return n.value}({defaultValue:t,tabValues:a}))),[c,d]=h({queryString:r,groupId:o}),[v,g]=function(e){let{groupId:t}=e;const r=function(e){return e?`docusaurus.tab.${e}`:null}(t),[o,a]=(0,u.Dv)(r);return[o,(0,n.useCallback)((e=>{r&&a.set(e)}),[r,a])]}({groupId:o}),f=(()=>{const e=c??v;return m({value:e,tabValues:a})?e:null})();(0,s.A)((()=>{f&&i(f)}),[f]);return{selectedValue:l,selectValue:(0,n.useCallback)((e=>{if(!m({value:e,tabValues:a}))throw new Error(`Can't select invalid tab value=${e}`);i(e),d(e),g(e)}),[d,g,a]),tabValues:a}}var g=r(2303);const f={tabList:"tabList__CuJ",tabItem:"tabItem_LNqP"};var b=r(4848);function x(e){let{className:t,block:r,selectedValue:n,selectValue:l,tabValues:s}=e;const i=[],{blockElementScrollPositionUntilNextRender:c}=(0,a.a_)(),u=e=>{const t=e.currentTarget,r=i.indexOf(t),o=s[r].value;o!==n&&(c(t),l(o))},d=e=>{let t=null;switch(e.key){case"Enter":u(e);break;case"ArrowRight":{const r=i.indexOf(e.currentTarget)+1;t=i[r]??i[0];break}case"ArrowLeft":{const r=i.indexOf(e.currentTarget)-1;t=i[r]??i[i.length-1];break}}t?.focus()};return(0,b.jsx)("ul",{role:"tablist","aria-orientation":"horizontal",className:(0,o.A)("tabs",{"tabs--block":r},t),children:s.map((e=>{let{value:t,label:r,attributes:a}=e;return(0,b.jsx)("li",{role:"tab",tabIndex:n===t?0:-1,"aria-selected":n===t,ref:e=>i.push(e),onKeyDown:d,onClick:u,...a,className:(0,o.A)("tabs__item",f.tabItem,a?.className,{"tabs__item--active":n===t}),children:r??t},t)}))})}function y(e){let{lazy:t,children:r,selectedValue:o}=e;const a=(Array.isArray(r)?r:[r]).filter(Boolean);if(t){const e=a.find((e=>e.props.value===o));return e?(0,n.cloneElement)(e,{className:"margin-top--md"}):null}return(0,b.jsx)("div",{className:"margin-top--md",children:a.map(((e,t)=>(0,n.cloneElement)(e,{key:t,hidden:e.props.value!==o})))})}function w(e){const t=v(e);return(0,b.jsxs)("div",{className:(0,o.A)("tabs-container",f.tabList),children:[(0,b.jsx)(x,{...e,...t}),(0,b.jsx)(y,{...e,...t})]})}function k(e){const t=(0,g.A)();return(0,b.jsx)(w,{...e,children:d(e.children)},String(t))}},8453:(e,t,r)=>{r.d(t,{R:()=>l,x:()=>s});var n=r(6540);const o={},a=n.createContext(o);function l(e){const t=n.useContext(a);return n.useMemo((function(){return"function"==typeof e?e(t):{...t,...e}}),[t,e])}function s(e){let t;return t=e.disableParentContext?"function"==typeof e.components?e.components(o):e.components||o:l(e.components),n.createElement(a.Provider,{value:t},e.children)}}}]); \ No newline at end of file diff --git a/assets/js/2c4b19b8.5bec1ad8.js b/assets/js/2c4b19b8.5bec1ad8.js deleted file mode 100644 index 8975af36..00000000 --- a/assets/js/2c4b19b8.5bec1ad8.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunkdocs=self.webpackChunkdocs||[]).push([[6940],{2922:(e,t,r)=>{r.r(t),r.d(t,{assets:()=>i,contentTitle:()=>l,default:()=>d,frontMatter:()=>a,metadata:()=>s,toc:()=>c});var n=r(4848),o=r(8453);r(1470),r(9365);const a={},l="Codec Server",s={id:"guides/codec-server",title:"Codec Server",description:"Data Converter",source:"@site/docs/guides/codec-server.mdx",sourceDirName:"guides",slug:"/guides/codec-server",permalink:"/docs/guides/codec-server",draft:!1,unlisted:!1,editUrl:"https://github.com/facebook/docusaurus/tree/main/packages/create-docusaurus/templates/shared/docs/guides/codec-server.mdx",tags:[],version:"current",frontMatter:{},sidebar:"docs",previous:{title:"Bloblang",permalink:"/docs/guides/bloblang"},next:{title:"Documentation",permalink:"/docs/guides/documentation"}},i={},c=[{value:"Data Converter",id:"data-converter",level:2},{value:"Codec Server",id:"codec-server-1",level:2}];function u(e){const t={a:"a",admonition:"admonition",code:"code",h1:"h1",h2:"h2",p:"p",pre:"pre",...(0,o.R)(),...e.components};return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(t.h1,{id:"codec-server",children:"Codec Server"}),"\n",(0,n.jsx)(t.h2,{id:"data-converter",children:"Data Converter"}),"\n",(0,n.jsxs)(t.p,{children:["Temporal's ",(0,n.jsx)(t.a,{href:"https://pkg.go.dev/go.temporal.io/sdk/converter#GetDefaultDataConverter",children:"default data converter"})," will serialize protobuf types using the ",(0,n.jsx)(t.code,{children:"json/protobuf"})," encoding provided by the ",(0,n.jsx)(t.a,{href:"https://pkg.go.dev/go.temporal.io/sdk/converter#ProtoJSONPayloadConverter",children:"ProtoJSONPayloadConverter"}),", which allows the Temporal UI to automatically decode the underlying payload and render it as JSON. If you'd prefer to take advantage of protobuf's binary format for smaller payloads, you can provide an alternative data converter to the Temporal client at initialization that prioritizes the ",(0,n.jsx)(t.a,{href:"https://pkg.go.dev/go.temporal.io/sdk/converter#ProtoPayloadConverter",children:"ProtoPayloadConverter"})," ahead of the ",(0,n.jsx)(t.code,{children:"ProtoJSONPayloadConverter"}),". See below for an example."]}),"\n",(0,n.jsx)(t.pre,{children:(0,n.jsx)(t.code,{className:"language-go",metastring:'title="worker/main.go"',children:'package main\n\nimport (\n\t"log"\n\t"log/slog"\n\t"os"\n\n\t"path/to/interal/example"\n\texamplev1 "path/to/gen/example/v1"\n\t"github.com/urfave/cli/v2"\n\t"go.temporal.io/sdk/client"\n\t"go.temporal.io/sdk/converter"\n\tsdklog "go.temporal.io/sdk/log"\n\t"go.temporal.io/sdk/worker"\n)\n\nfunc main() {\n\tapp, err := examplev1.NewExampleCli(\n\t\texamplev1.NewExampleCliOptions().\n\t\t\tWithClient(func(cmd *cli.Context) (client.Client, error) {\n\t\t\t\treturn client.Dial(client.Options{\n\t\t\t\t\tDataConverter: converter.NewCompositeDataConverter(\n\t\t\t\t\t\tconverter.NewNilPayloadConverter(),\n\t\t\t\t\t\tconverter.NewByteSlicePayloadConverter(),\n\t\t\t\t\t\tconverter.NewProtoPayloadConverter(),\n\t\t\t\t\t),\n\t\t\t\t\tLogger: sdklog.NewStructuredLogger(slog.Default()),\n\t\t\t\t})\n\t\t\t}).\n\t\t\tWithWorker(func(cmd *cli.Context, c client.Client) (worker.Worker, error) {\n\t\t\t\tw := worker.New(c, examplev1.ExampleTaskQueue, worker.Options{})\n\t\t\t\texamplev1.RegisterExampleActivities(w, &example.Activities{})\n\t\t\t\texamplev1.RegisterExampleWorkflows(w, &example.Workflows{})\n\t\t\t\treturn w, nil\n\t\t\t}),\n\t)\n\tif err != nil {\n\t\tlog.Fatalf("error initializing example cli: %v", err)\n\t}\n\n if err := app.Run(os.Args); err != nil {\n log.Fatal(err)\n }\n}\n'})}),"\n",(0,n.jsx)(t.h2,{id:"codec-server-1",children:"Codec Server"}),"\n",(0,n.jsxs)(t.p,{children:["If you choose to use ",(0,n.jsx)(t.code,{children:"binary/protobuf"})," encoding, you'll lose the ability to view decoded payloads in the Temporal UI unless you configure the ",(0,n.jsx)(t.a,{href:"https://docs.temporal.io/dataconversion#codec-server",children:"Remote Codec Server"})," integration. This plugin can generate helpers that simplify the process of implementing a remote codec server for use with the Temporal UI to support conversion between ",(0,n.jsx)(t.code,{children:"binary/protobuf"})," and ",(0,n.jsx)(t.code,{children:"json/protobuf"})," or ",(0,n.jsx)(t.code,{children:"json/plain"})," payload encodings. See below for a simple example. For a more advanced example that supports different codecs per namespace, cors, and authentication, see the ",(0,n.jsx)(t.a,{href:"https://github.com/temporalio/samples-go/blob/main/codec-server/codec-server/main.go",children:"codec-server"})," go sample."]}),"\n",(0,n.jsx)(t.admonition,{type:"info",children:(0,n.jsxs)(t.p,{children:["This requires the ",(0,n.jsx)(t.a,{href:"/docs/configuration/plugin#enable-codec",children:"enable-codec"})," plugin option to be enabled"]})}),"\n",(0,n.jsx)(t.pre,{children:(0,n.jsx)(t.code,{className:"language-go",metastring:'title="codecserver/main.go"',children:'package main\n\nimport (\n\t"context"\n\t"errors"\n\t"log"\n\t"log/slog"\n\t"net/http"\n\t"os"\n\t"os/signal"\n\t"syscall"\n\n\texamplev1 "path/to/gen/example/v1"\n\t"github.com/cludden/protoc-gen-go-temporal/pkg/codec"\n\t"github.com/cludden/protoc-gen-go-temporal/pkg/scheme"\n\t"github.com/urfave/cli/v2"\n\t"go.temporal.io/sdk/converter"\n)\n\nfunc main() {\n\tapp, err := examplev1.NewExampleCli(/* ... */)\n\tif err != nil {\n\t\tlog.Fatalf("error initializing example cli: %v", err)\n\t}\n\n\tapp.Commands = append(app.Commands, &cli.Command{\n\t\tName: "codec",\n\t\tUsage: "run remote codec server",\n\t\tAction: func(cmd *cli.Context) error {\n\t\t\thandler := converter.NewPayloadCodecHTTPHandler(\n\t\t\t\tcodec.NewProtoJSONCodec(\n\t\t\t\t\tscheme.New(\n\t\t\t\t\t\texamplev1.WithExampleSchemeTypes(),\n\t\t\t\t\t),\n\t\t\t\t),\n\t\t\t)\n\n\t\t\tsrv := &http.Server{\n\t\t\t\tAddr: "0.0.0.0:8080",\n\t\t\t\tHandler: handler,\n\t\t\t}\n\n\t\t\tgo func() {\n\t\t\t\tsigChan := make(chan os.Signal, 1)\n\t\t\t\tsignal.Notify(sigChan, syscall.SIGINT, syscall.SIGTERM)\n\t\t\t\t<-sigChan\n\n\t\t\t\tif err := srv.Shutdown(context.Background()); err != nil {\n\t\t\t\t\tlog.Fatalf("error shutting down server: %v", err)\n\t\t\t\t}\n\t\t\t}()\n\n\t\t\tif err := srv.ListenAndServe(); err != nil && !errors.Is(err, http.ErrServerClosed) {\n\t\t\t\tlog.Fatalf("server error: %v", err)\n\t\t\t}\n\t\t\treturn nil\n\t\t},\n\t})\n\n\t// run cli\n\tif err := app.Run(os.Args); err != nil {\n\t\tlog.Fatal(err)\n\t}\n}\n'})}),"\n",(0,n.jsxs)(t.p,{children:["See the ",(0,n.jsx)(t.a,{href:"/docs/examples/codecserver/",children:"codecserver"})," example for more details."]})]})}function d(e={}){const{wrapper:t}={...(0,o.R)(),...e.components};return t?(0,n.jsx)(t,{...e,children:(0,n.jsx)(u,{...e})}):u(e)}},9365:(e,t,r)=>{r.d(t,{A:()=>l});r(6540);var n=r(4164);const o={tabItem:"tabItem_Ymn6"};var a=r(4848);function l(e){let{children:t,hidden:r,className:l}=e;return(0,a.jsx)("div",{role:"tabpanel",className:(0,n.A)(o.tabItem,l),hidden:r,children:t})}},1470:(e,t,r)=>{r.d(t,{A:()=>k});var n=r(6540),o=r(4164),a=r(3104),l=r(6347),s=r(205),i=r(7485),c=r(1682),u=r(9466);function d(e){return n.Children.toArray(e).filter((e=>"\n"!==e)).map((e=>{if(!e||(0,n.isValidElement)(e)&&function(e){const{props:t}=e;return!!t&&"object"==typeof t&&"value"in t}(e))return e;throw new Error(`Docusaurus error: Bad child <${"string"==typeof e.type?e.type:e.type.name}>: all children of the component should be , and every should have a unique "value" prop.`)}))?.filter(Boolean)??[]}function p(e){const{values:t,children:r}=e;return(0,n.useMemo)((()=>{const e=t??function(e){return d(e).map((e=>{let{props:{value:t,label:r,attributes:n,default:o}}=e;return{value:t,label:r,attributes:n,default:o}}))}(r);return function(e){const t=(0,c.X)(e,((e,t)=>e.value===t.value));if(t.length>0)throw new Error(`Docusaurus error: Duplicate values "${t.map((e=>e.value)).join(", ")}" found in . Every value needs to be unique.`)}(e),e}),[t,r])}function m(e){let{value:t,tabValues:r}=e;return r.some((e=>e.value===t))}function h(e){let{queryString:t=!1,groupId:r}=e;const o=(0,l.W6)(),a=function(e){let{queryString:t=!1,groupId:r}=e;if("string"==typeof t)return t;if(!1===t)return null;if(!0===t&&!r)throw new Error('Docusaurus error: The component groupId prop is required if queryString=true, because this value is used as the search param name. You can also provide an explicit value such as queryString="my-search-param".');return r??null}({queryString:t,groupId:r});return[(0,i.aZ)(a),(0,n.useCallback)((e=>{if(!a)return;const t=new URLSearchParams(o.location.search);t.set(a,e),o.replace({...o.location,search:t.toString()})}),[a,o])]}function v(e){const{defaultValue:t,queryString:r=!1,groupId:o}=e,a=p(e),[l,i]=(0,n.useState)((()=>function(e){let{defaultValue:t,tabValues:r}=e;if(0===r.length)throw new Error("Docusaurus error: the component requires at least one children component");if(t){if(!m({value:t,tabValues:r}))throw new Error(`Docusaurus error: The has a defaultValue "${t}" but none of its children has the corresponding value. Available values are: ${r.map((e=>e.value)).join(", ")}. If you intend to show no default tab, use defaultValue={null} instead.`);return t}const n=r.find((e=>e.default))??r[0];if(!n)throw new Error("Unexpected error: 0 tabValues");return n.value}({defaultValue:t,tabValues:a}))),[c,d]=h({queryString:r,groupId:o}),[v,g]=function(e){let{groupId:t}=e;const r=function(e){return e?`docusaurus.tab.${e}`:null}(t),[o,a]=(0,u.Dv)(r);return[o,(0,n.useCallback)((e=>{r&&a.set(e)}),[r,a])]}({groupId:o}),f=(()=>{const e=c??v;return m({value:e,tabValues:a})?e:null})();(0,s.A)((()=>{f&&i(f)}),[f]);return{selectedValue:l,selectValue:(0,n.useCallback)((e=>{if(!m({value:e,tabValues:a}))throw new Error(`Can't select invalid tab value=${e}`);i(e),d(e),g(e)}),[d,g,a]),tabValues:a}}var g=r(2303);const f={tabList:"tabList__CuJ",tabItem:"tabItem_LNqP"};var b=r(4848);function x(e){let{className:t,block:r,selectedValue:n,selectValue:l,tabValues:s}=e;const i=[],{blockElementScrollPositionUntilNextRender:c}=(0,a.a_)(),u=e=>{const t=e.currentTarget,r=i.indexOf(t),o=s[r].value;o!==n&&(c(t),l(o))},d=e=>{let t=null;switch(e.key){case"Enter":u(e);break;case"ArrowRight":{const r=i.indexOf(e.currentTarget)+1;t=i[r]??i[0];break}case"ArrowLeft":{const r=i.indexOf(e.currentTarget)-1;t=i[r]??i[i.length-1];break}}t?.focus()};return(0,b.jsx)("ul",{role:"tablist","aria-orientation":"horizontal",className:(0,o.A)("tabs",{"tabs--block":r},t),children:s.map((e=>{let{value:t,label:r,attributes:a}=e;return(0,b.jsx)("li",{role:"tab",tabIndex:n===t?0:-1,"aria-selected":n===t,ref:e=>i.push(e),onKeyDown:d,onClick:u,...a,className:(0,o.A)("tabs__item",f.tabItem,a?.className,{"tabs__item--active":n===t}),children:r??t},t)}))})}function y(e){let{lazy:t,children:r,selectedValue:o}=e;const a=(Array.isArray(r)?r:[r]).filter(Boolean);if(t){const e=a.find((e=>e.props.value===o));return e?(0,n.cloneElement)(e,{className:"margin-top--md"}):null}return(0,b.jsx)("div",{className:"margin-top--md",children:a.map(((e,t)=>(0,n.cloneElement)(e,{key:t,hidden:e.props.value!==o})))})}function w(e){const t=v(e);return(0,b.jsxs)("div",{className:(0,o.A)("tabs-container",f.tabList),children:[(0,b.jsx)(x,{...e,...t}),(0,b.jsx)(y,{...e,...t})]})}function k(e){const t=(0,g.A)();return(0,b.jsx)(w,{...e,children:d(e.children)},String(t))}},8453:(e,t,r)=>{r.d(t,{R:()=>l,x:()=>s});var n=r(6540);const o={},a=n.createContext(o);function l(e){const t=n.useContext(a);return n.useMemo((function(){return"function"==typeof e?e(t):{...t,...e}}),[t,e])}function s(e){let t;return t=e.disableParentContext?"function"==typeof e.components?e.components(o):e.components||o:l(e.components),n.createElement(a.Provider,{value:t},e.children)}}}]); \ No newline at end of file diff --git a/assets/js/3021cf83.a3597eae.js b/assets/js/3021cf83.a3597eae.js deleted file mode 100644 index e6583f34..00000000 --- a/assets/js/3021cf83.a3597eae.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunkdocs=self.webpackChunkdocs||[]).push([[2857],{6942:(e,t,n)=>{n.r(t),n.d(t,{assets:()=>c,contentTitle:()=>i,default:()=>g,frontMatter:()=>l,metadata:()=>u,toc:()=>d});var r=n(4848),o=n(8453),a=n(1470),s=n(9365);const l={},i="Getting Started",u={id:"getting-started",title:"Getting Started",description:"Setup",source:"@site/docs/getting-started.mdx",sourceDirName:".",slug:"/getting-started",permalink:"/docs/getting-started",draft:!1,unlisted:!1,editUrl:"https://github.com/facebook/docusaurus/tree/main/packages/create-docusaurus/templates/shared/docs/getting-started.mdx",tags:[],version:"current",frontMatter:{},sidebar:"docs",previous:{title:"Install",permalink:"/docs/install"},next:{title:"Plugin",permalink:"/docs/configuration/plugin"}},c={},d=[{value:"Setup",id:"setup",level:2},{value:"1. Create example project",id:"1-create-example-project",level:3},{value:"2. Create buf.yaml",id:"2-create-bufyaml",level:3},{value:"3. Create buf.gen.yaml",id:"3-create-bufgenyaml",level:3},{value:"4. Create buf.work.yaml",id:"4-create-bufworkyaml",level:3},{value:"Generate",id:"generate",level:2},{value:"5. Define schema",id:"5-define-schema",level:3},{value:"6. Generate go code",id:"6-generate-go-code",level:3},{value:"Implement",id:"implement",level:2},{value:"7. Implement worker",id:"7-implement-worker",level:3},{value:"Run",id:"run",level:2},{value:"8. Start Temporal",id:"8-start-temporal",level:3},{value:"9. Start worker",id:"9-start-worker",level:3},{value:"10. Start a workflow",id:"10-start-a-workflow",level:3}];function p(e){const t={a:"a",code:"code",h1:"h1",h2:"h2",h3:"h3",p:"p",pre:"pre",...(0,o.R)(),...e.components};return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(t.h1,{id:"getting-started",children:"Getting Started"}),"\n",(0,r.jsx)(t.h2,{id:"setup",children:"Setup"}),"\n",(0,r.jsx)(t.h3,{id:"1-create-example-project",children:"1. Create example project"}),"\n",(0,r.jsx)(t.p,{children:"Create a new project and initialize go and buf modules"}),"\n",(0,r.jsx)(t.pre,{children:(0,r.jsx)(t.code,{className:"language-shell",children:'mkdir -p example/proto\ncd example\ngo mod init example\ngo get -u "github.com/cludden/protoc-gen-go-temporal@$(curl --silent https://api.github.com/repos/cludden/protoc-gen-go-temporal/releases/latest|jq -r .tag_name)"\ngo mod tidy\ncd proto\nbuf mod init\n'})}),"\n",(0,r.jsxs)(t.h3,{id:"2-create-bufyaml",children:["2. Create ",(0,r.jsx)(t.code,{children:"buf.yaml"})]}),"\n",(0,r.jsxs)(t.p,{children:["Configure buf module and add ",(0,r.jsx)(t.code,{children:"buf.build/cludden/protoc-gen-go-temporal"})," as a proto dependency to ",(0,r.jsx)(t.code,{children:"proto/buf.yaml"})]}),"\n",(0,r.jsx)(t.pre,{children:(0,r.jsx)(t.code,{className:"language-yaml",metastring:'title="proto/buf.yaml"',children:"version: v1\ndeps:\n - buf.build/cludden/protoc-gen-go-temporal\nbreaking:\n use:\n - FILE\nlint:\n allow_comment_ignores: true\n use:\n - BASIC\n"})}),"\n",(0,r.jsxs)(t.h3,{id:"3-create-bufgenyaml",children:["3. Create ",(0,r.jsx)(t.code,{children:"buf.gen.yaml"})]}),"\n",(0,r.jsx)(t.p,{children:"Configure buf code generation"}),"\n",(0,r.jsx)(t.pre,{children:(0,r.jsx)(t.code,{className:"language-yaml",metastring:'title="buf.gen.yaml"',children:"version: v1\nmanaged:\n enabled: true\n go_package_prefix:\n default: example/gen\n except:\n - buf.build/cludden/protoc-gen-go-temporal\nplugins:\n - plugin: go\n out: gen\n opt: paths=source_relative\n - plugin: go_temporal\n out: gen\n opt: paths=source_relative,cli-enabled=true,cli-categories=true,workflow-update-enabled=true,docs-out=./proto/README.md\n strategy: all\n"})}),"\n",(0,r.jsxs)(t.h3,{id:"4-create-bufworkyaml",children:["4. Create ",(0,r.jsx)(t.code,{children:"buf.work.yaml"})]}),"\n",(0,r.jsx)(t.p,{children:"Configure buf workspace"}),"\n",(0,r.jsx)(t.pre,{children:(0,r.jsx)(t.code,{className:"language-yaml",metastring:'title="buf.work.yaml"',children:"version: v1\ndirectories:\n - proto\n"})}),"\n",(0,r.jsx)(t.h2,{id:"generate",children:"Generate"}),"\n",(0,r.jsx)(t.h3,{id:"5-define-schema",children:"5. Define schema"}),"\n",(0,r.jsx)(t.pre,{children:(0,r.jsx)(t.code,{className:"language-protobuf",metastring:'title="proto/example/v1/example.proto"',children:'syntax="proto3";\n\npackage example.v1;\n\nimport "google/protobuf/empty.proto";\nimport "temporal/v1/temporal.proto";\n\nservice Example {\n option (temporal.v1.service) = {\n task_queue: "example-v1"\n };\n\n // CreateFoo creates a new foo operation\n rpc CreateFoo(CreateFooRequest) returns (CreateFooResponse) {\n option (temporal.v1.workflow) = {\n execution_timeout: { seconds: 3600 } // foos can take awhile to create\n id_reuse_policy: WORKFLOW_ID_REUSE_POLICY_ALLOW_DUPLICATE\n id: \'create-foo/${! name.slug() }\'\n query: { ref: "GetFooProgress" }\n signal: { ref: "SetFooProgress", start: true }\n update: { ref: "UpdateFooProgress" }\n };\n }\n\n // GetFooProgress returns the status of a CreateFoo operation\n rpc GetFooProgress(google.protobuf.Empty) returns (GetFooProgressResponse) {\n option (temporal.v1.query) = {};\n }\n\n // Notify sends a notification\n rpc Notify(NotifyRequest) returns (google.protobuf.Empty) {\n option (temporal.v1.activity) = {\n start_to_close_timeout: { seconds: 30 }\n retry_policy: {\n max_attempts: 3\n }\n };\n }\n\n // SetFooProgress sets the current status of a CreateFoo operation\n rpc SetFooProgress(SetFooProgressRequest) returns (google.protobuf.Empty) {\n option (temporal.v1.signal) = {};\n }\n\n // UpdateFooProgress sets the current status of a CreateFoo operation\n rpc UpdateFooProgress(SetFooProgressRequest) returns (GetFooProgressResponse) {\n option (temporal.v1.update) = {\n id: \'update-progress/${! progress.string() }\',\n };\n }\n}\n\n// CreateFooRequest describes the input to a CreateFoo workflow\nmessage CreateFooRequest {\n // unique foo name\n string name = 1;\n}\n\n// SampleWorkflowWithMutexResponse describes the output from a CreateFoo workflow\nmessage CreateFooResponse {\n Foo foo = 1; \n}\n\n// Foo describes an illustrative foo resource\nmessage Foo {\n string name = 1;\n Status status = 2;\n\n enum Status {\n FOO_STATUS_UNSPECIFIED = 0;\n FOO_STATUS_READY = 1;\n FOO_STATUS_CREATING = 2;\n }\n}\n\n// GetFooProgressResponse describes the output from a GetFooProgress query\nmessage GetFooProgressResponse {\n float progress = 1;\n Foo.Status status = 2;\n}\n\n// NotifyRequest describes the input to a Notify activity\nmessage NotifyRequest {\n string message = 1;\n}\n\n// SetFooProgressRequest describes the input to a SetFooProgress signal\nmessage SetFooProgressRequest {\n // value of current workflow progress\n float progress = 1;\n}\n'})}),"\n",(0,r.jsx)(t.h3,{id:"6-generate-go-code",children:"6. Generate go code"}),"\n",(0,r.jsx)(t.p,{children:"Generate temporal worker, client, and cli types, methods, interfaces, and functions"}),"\n",(0,r.jsx)(t.pre,{children:(0,r.jsx)(t.code,{className:"language-shell",children:"buf mod update\ncd ..\nbuf generate\n"})}),"\n",(0,r.jsx)(t.h2,{id:"implement",children:"Implement"}),"\n",(0,r.jsx)(t.h3,{id:"7-implement-worker",children:"7. Implement worker"}),"\n",(0,r.jsx)(t.p,{children:"Implement the required Workflow and Activity interfaces and create a new Temporal worker using the generated helpers"}),"\n",(0,r.jsx)(t.pre,{children:(0,r.jsx)(t.code,{className:"language-go",metastring:'title="main.go"',children:'package main\n\nimport (\n\t"context"\n\t"fmt"\n\t"log"\n\t"os"\n\n\texamplev1 "example/gen/example/v1"\n\n\t"github.com/urfave/cli/v2"\n\t"go.temporal.io/sdk/activity"\n\t"go.temporal.io/sdk/client"\n\tsdklog "go.temporal.io/sdk/log"\n\t"go.temporal.io/sdk/worker"\n\t"go.temporal.io/sdk/workflow"\n)\n\ntype (\n\t// Workflows manages shared state for workflow constructors and is used to\n\t// register workflows with a worker\n\tWorkflows struct{}\n\n\t// Activities manages shared state for activities and is used to register\n\t// activities with a worker\n\tActivities struct{}\n\n\t// CreateFooWorkflow manages workflow state for a CreateFoo workflow\n\tCreateFooWorkflow struct {\n\t\t// it embeds the generated workflow Input type that contains the workflow\n\t\t// input and signal helpers\n\t\t*examplev1.CreateFooWorkflowInput\n\n\t\tlog sdklog.Logger\n\t\tprogress float32\n\t\tstatus examplev1.Foo_Status\n\t}\n)\n\n// CreateFoo implements a CreateFoo workflow constructor on the shared Workflows struct\n// that initializes a new CreateFooWorkflow for each execution\nfunc (w *Workflows) CreateFoo(ctx workflow.Context, input *examplev1.CreateFooWorkflowInput) (examplev1.CreateFooWorkflow, error) {\n\treturn &CreateFooWorkflow{\n\t\tCreateFooWorkflowInput: input,\n\t\tlog: workflow.GetLogger(ctx),\n\t\tstatus: examplev1.Foo_FOO_STATUS_CREATING,\n\t}, nil\n}\n\n// Execute defines the entrypoint to a CreateFooWorkflow\nfunc (wf *CreateFooWorkflow) Execute(ctx workflow.Context) (*examplev1.CreateFooResponse, error) {\n\t// listen for signals using generated signal provided by workflow input\n\tworkflow.Go(ctx, func(ctx workflow.Context) {\n\t\tfor {\n\t\t\tsignal, _ := wf.SetFooProgress.Receive(ctx)\n\t\t\twf.UpdateFooProgress(ctx, signal)\n\t\t}\n\t})\n\n\t// execute Notify activity using generated helper\n\tif err := examplev1.Notify(ctx, &examplev1.NotifyRequest{\n\t\tMessage: fmt.Sprintf("creating foo resource (%s)", wf.Req.GetName()),\n\t}); err != nil {\n\t\treturn nil, fmt.Errorf("error sending notification: %w", err)\n\t}\n\n\t// block until progress has reached 100 via signals and/or updates\n\tif err := workflow.Await(ctx, func() bool {\n\t\treturn wf.status == examplev1.Foo_FOO_STATUS_READY\n\t}); err != nil {\n\t\treturn nil, fmt.Errorf("error awaiting ready status: %w", err)\n\t}\n\n\treturn &examplev1.CreateFooResponse{\n\t\tFoo: &examplev1.Foo{\n\t\t\tName: wf.Req.GetName(),\n\t\t\tStatus: wf.status,\n\t\t},\n\t}, nil\n}\n\n// GetFooProgress defines the handler for a GetFooProgress query\nfunc (wf *CreateFooWorkflow) GetFooProgress() (*examplev1.GetFooProgressResponse, error) {\n\treturn &examplev1.GetFooProgressResponse{Progress: wf.progress, Status: wf.status}, nil\n}\n\n// UpdateFooProgress defines the handler for an UpdateFooProgress update\nfunc (wf *CreateFooWorkflow) UpdateFooProgress(ctx workflow.Context, req *examplev1.SetFooProgressRequest) (*examplev1.GetFooProgressResponse, error) {\n\twf.progress = req.GetProgress()\n\tswitch {\n\tcase wf.progress < 0:\n\t\twf.progress, wf.status = 0, examplev1.Foo_FOO_STATUS_CREATING\n\tcase wf.progress < 100:\n\t\twf.status = examplev1.Foo_FOO_STATUS_CREATING\n\tcase wf.progress >= 100:\n\t\twf.progress, wf.status = 100, examplev1.Foo_FOO_STATUS_READY\n\t}\n\treturn &examplev1.GetFooProgressResponse{Progress: wf.progress, Status: wf.status}, nil\n}\n\n// Notify defines the implementation for a Notify activity\nfunc (a *Activities) Notify(ctx context.Context, req *examplev1.NotifyRequest) error {\n\tactivity.GetLogger(ctx).Info("notification", "message", req.GetMessage())\n\treturn nil\n}\n\nfunc main() {\n\t// initialize the generated cli application\n\tapp, err := examplev1.NewExampleCli(\n\t\texamplev1.NewExampleCliOptions().WithWorker(func(cmd *cli.Context, c client.Client) (worker.Worker, error) {\n\t\t\t// register activities and workflows using generated helpers\n\t\t\tw := worker.New(c, examplev1.ExampleTaskQueue, worker.Options{})\n\t\t\texamplev1.RegisterExampleActivities(w, &Activities{})\n\t\t\texamplev1.RegisterExampleWorkflows(w, &Workflows{})\n\t\t\treturn w, nil\n\t\t}),\n\t)\n\tif err != nil {\n\t\tlog.Fatalf("error initializing example cli: %v", err)\n\t}\n\n\t// run cli\n\tif err := app.Run(os.Args); err != nil {\n\t\tlog.Fatal(err)\n\t}\n}\n'})}),"\n",(0,r.jsx)(t.h2,{id:"run",children:"Run"}),"\n",(0,r.jsx)(t.h3,{id:"8-start-temporal",children:"8. Start Temporal"}),"\n",(0,r.jsxs)(t.p,{children:["Start temporal and visit the UI at ",(0,r.jsx)(t.a,{href:"http://localhost:8233",children:"http://localhost:8233"}),"."]}),"\n",(0,r.jsx)(t.pre,{children:(0,r.jsx)(t.code,{className:"language-sh",children:'temporal server start-dev \\\n --dynamic-config-value "frontend.enableUpdateWorkflowExecution=true" \\\n --dynamic-config-value "frontend.enableUpdateWorkflowExecutionAsyncAccepted=true"\n'})}),"\n",(0,r.jsx)(t.h3,{id:"9-start-worker",children:"9. Start worker"}),"\n",(0,r.jsx)(t.p,{children:"In a different terminal, start the worker."}),"\n",(0,r.jsx)(t.pre,{children:(0,r.jsx)(t.code,{className:"language-sh",children:"go mod tidy\ngo run main.go worker\n"})}),"\n",(0,r.jsx)(t.h3,{id:"10-start-a-workflow",children:"10. Start a workflow"}),"\n",(0,r.jsx)(t.p,{children:"In a different terminal, start a workflow."}),"\n",(0,r.jsxs)(a.A,{children:[(0,r.jsxs)(s.A,{value:"cli",label:"CLI",children:[(0,r.jsx)(t.pre,{children:(0,r.jsx)(t.code,{className:"language-sh",metastring:'title="View CLI options"',children:"go run main.go -h\n"})}),(0,r.jsx)(t.pre,{children:(0,r.jsx)(t.code,{className:"language-sh",metastring:'title="Execute a workflow"',children:"go run main.go create-foo -d --name test\n"})}),(0,r.jsx)(t.pre,{children:(0,r.jsx)(t.code,{className:"language-sh",metastring:'title="Send a signal"',children:"go run main.go set-foo-progress -w create-foo/test --progress 5.7\n"})}),(0,r.jsx)(t.pre,{children:(0,r.jsx)(t.code,{className:"language-sh",metastring:'title="Query the workflow"',children:"go run main.go get-foo-progress -w create-foo/test\n"})}),(0,r.jsx)(t.pre,{children:(0,r.jsx)(t.code,{className:"language-sh",metastring:'title="Update the workflow"',children:"go run main.go update-foo-progress -w create-foo/test --progress 100\n"})}),(0,r.jsx)(t.pre,{children:(0,r.jsx)(t.code,{className:"language-json",metastring:'title="Query the completed workflow"',children:"go run main.go get-foo-progress -w create-foo/test\n"})})]}),(0,r.jsx)(s.A,{value:"client",label:"Client",children:(0,r.jsx)(t.pre,{children:(0,r.jsx)(t.code,{className:"language-go",metastring:'title="cmd/client/main.go"',children:'package main\n\nimport (\n "context"\n "log"\n\n examplev1 "github.com/cludden/protoc-gen-go-temporal/gen/example/v1"\n "go.temporal.io/sdk/client"\n)\n\nfunc main() {\n c, _ := client.Dial(client.Options{})\n client, ctx := examplev1.NewClient(c), context.Background()\n\n run, _ := client.CreateFooAsync(ctx, &examplev1.CreateFooRequest{Name: "test"})\n log.Printf("started workflow: workflow_id=%s, run_id=%s\\n", run.ID(), run.RunID())\n\n log.Println("signalling progress")\n _ = run.SetFooProgress(ctx, &examplev1.SetFooProgressRequest{Progress: 5.7})\n\n progress, _ := run.GetFooProgress(ctx)\n log.Printf("queried progress: %s\\n", progress.String())\n\n update, _ := run.UpdateFooProgress(ctx, &examplev1.SetFooProgressRequest{Progress: 100})\n log.Printf("updated progress: %s\\n", update.String())\n\n resp, _ := run.Get(ctx)\n log.Printf("workflow completed: %s\\n", resp.String())\n}\n'})})})]})]})}function g(e={}){const{wrapper:t}={...(0,o.R)(),...e.components};return t?(0,r.jsx)(t,{...e,children:(0,r.jsx)(p,{...e})}):p(e)}},9365:(e,t,n)=>{n.d(t,{A:()=>s});n(6540);var r=n(4164);const o={tabItem:"tabItem_Ymn6"};var a=n(4848);function s(e){let{children:t,hidden:n,className:s}=e;return(0,a.jsx)("div",{role:"tabpanel",className:(0,r.A)(o.tabItem,s),hidden:n,children:t})}},1470:(e,t,n)=>{n.d(t,{A:()=>F});var r=n(6540),o=n(4164),a=n(3104),s=n(6347),l=n(205),i=n(7485),u=n(1682),c=n(9466);function d(e){return r.Children.toArray(e).filter((e=>"\n"!==e)).map((e=>{if(!e||(0,r.isValidElement)(e)&&function(e){const{props:t}=e;return!!t&&"object"==typeof t&&"value"in t}(e))return e;throw new Error(`Docusaurus error: Bad child <${"string"==typeof e.type?e.type:e.type.name}>: all children of the component should be , and every should have a unique "value" prop.`)}))?.filter(Boolean)??[]}function p(e){const{values:t,children:n}=e;return(0,r.useMemo)((()=>{const e=t??function(e){return d(e).map((e=>{let{props:{value:t,label:n,attributes:r,default:o}}=e;return{value:t,label:n,attributes:r,default:o}}))}(n);return function(e){const t=(0,u.X)(e,((e,t)=>e.value===t.value));if(t.length>0)throw new Error(`Docusaurus error: Duplicate values "${t.map((e=>e.value)).join(", ")}" found in . Every value needs to be unique.`)}(e),e}),[t,n])}function g(e){let{value:t,tabValues:n}=e;return n.some((e=>e.value===t))}function m(e){let{queryString:t=!1,groupId:n}=e;const o=(0,s.W6)(),a=function(e){let{queryString:t=!1,groupId:n}=e;if("string"==typeof t)return t;if(!1===t)return null;if(!0===t&&!n)throw new Error('Docusaurus error: The component groupId prop is required if queryString=true, because this value is used as the search param name. You can also provide an explicit value such as queryString="my-search-param".');return n??null}({queryString:t,groupId:n});return[(0,i.aZ)(a),(0,r.useCallback)((e=>{if(!a)return;const t=new URLSearchParams(o.location.search);t.set(a,e),o.replace({...o.location,search:t.toString()})}),[a,o])]}function f(e){const{defaultValue:t,queryString:n=!1,groupId:o}=e,a=p(e),[s,i]=(0,r.useState)((()=>function(e){let{defaultValue:t,tabValues:n}=e;if(0===n.length)throw new Error("Docusaurus error: the component requires at least one children component");if(t){if(!g({value:t,tabValues:n}))throw new Error(`Docusaurus error: The has a defaultValue "${t}" but none of its children has the corresponding value. Available values are: ${n.map((e=>e.value)).join(", ")}. If you intend to show no default tab, use defaultValue={null} instead.`);return t}const r=n.find((e=>e.default))??n[0];if(!r)throw new Error("Unexpected error: 0 tabValues");return r.value}({defaultValue:t,tabValues:a}))),[u,d]=m({queryString:n,groupId:o}),[f,h]=function(e){let{groupId:t}=e;const n=function(e){return e?`docusaurus.tab.${e}`:null}(t),[o,a]=(0,c.Dv)(n);return[o,(0,r.useCallback)((e=>{n&&a.set(e)}),[n,a])]}({groupId:o}),w=(()=>{const e=u??f;return g({value:e,tabValues:a})?e:null})();(0,l.A)((()=>{w&&i(w)}),[w]);return{selectedValue:s,selectValue:(0,r.useCallback)((e=>{if(!g({value:e,tabValues:a}))throw new Error(`Can't select invalid tab value=${e}`);i(e),d(e),h(e)}),[d,h,a]),tabValues:a}}var h=n(2303);const w={tabList:"tabList__CuJ",tabItem:"tabItem_LNqP"};var x=n(4848);function v(e){let{className:t,block:n,selectedValue:r,selectValue:s,tabValues:l}=e;const i=[],{blockElementScrollPositionUntilNextRender:u}=(0,a.a_)(),c=e=>{const t=e.currentTarget,n=i.indexOf(t),o=l[n].value;o!==r&&(u(t),s(o))},d=e=>{let t=null;switch(e.key){case"Enter":c(e);break;case"ArrowRight":{const n=i.indexOf(e.currentTarget)+1;t=i[n]??i[0];break}case"ArrowLeft":{const n=i.indexOf(e.currentTarget)-1;t=i[n]??i[i.length-1];break}}t?.focus()};return(0,x.jsx)("ul",{role:"tablist","aria-orientation":"horizontal",className:(0,o.A)("tabs",{"tabs--block":n},t),children:l.map((e=>{let{value:t,label:n,attributes:a}=e;return(0,x.jsx)("li",{role:"tab",tabIndex:r===t?0:-1,"aria-selected":r===t,ref:e=>i.push(e),onKeyDown:d,onClick:c,...a,className:(0,o.A)("tabs__item",w.tabItem,a?.className,{"tabs__item--active":r===t}),children:n??t},t)}))})}function b(e){let{lazy:t,children:n,selectedValue:o}=e;const a=(Array.isArray(n)?n:[n]).filter(Boolean);if(t){const e=a.find((e=>e.props.value===o));return e?(0,r.cloneElement)(e,{className:"margin-top--md"}):null}return(0,x.jsx)("div",{className:"margin-top--md",children:a.map(((e,t)=>(0,r.cloneElement)(e,{key:t,hidden:e.props.value!==o})))})}function k(e){const t=f(e);return(0,x.jsxs)("div",{className:(0,o.A)("tabs-container",w.tabList),children:[(0,x.jsx)(v,{...e,...t}),(0,x.jsx)(b,{...e,...t})]})}function F(e){const t=(0,h.A)();return(0,x.jsx)(k,{...e,children:d(e.children)},String(t))}},8453:(e,t,n)=>{n.d(t,{R:()=>s,x:()=>l});var r=n(6540);const o={},a=r.createContext(o);function s(e){const t=r.useContext(a);return r.useMemo((function(){return"function"==typeof e?e(t):{...t,...e}}),[t,e])}function l(e){let t;return t=e.disableParentContext?"function"==typeof e.components?e.components(o):e.components||o:s(e.components),r.createElement(a.Provider,{value:t},e.children)}}}]); \ No newline at end of file diff --git a/assets/js/3021cf83.cad4733b.js b/assets/js/3021cf83.cad4733b.js new file mode 100644 index 00000000..db7b0659 --- /dev/null +++ b/assets/js/3021cf83.cad4733b.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunkdocs=self.webpackChunkdocs||[]).push([[2857],{6942:(e,t,n)=>{n.r(t),n.d(t,{assets:()=>u,contentTitle:()=>i,default:()=>g,frontMatter:()=>l,metadata:()=>c,toc:()=>d});var r=n(4848),o=n(8453),a=n(1470),s=n(9365);const l={},i="Getting Started",c={id:"getting-started",title:"Getting Started",description:"Setup",source:"@site/docs/getting-started.mdx",sourceDirName:".",slug:"/getting-started",permalink:"/protoc-gen-go-temporal/docs/getting-started",draft:!1,unlisted:!1,editUrl:"https://github.com/facebook/docusaurus/tree/main/packages/create-docusaurus/templates/shared/docs/getting-started.mdx",tags:[],version:"current",frontMatter:{},sidebar:"docs",previous:{title:"Install",permalink:"/protoc-gen-go-temporal/docs/install"},next:{title:"Plugin",permalink:"/protoc-gen-go-temporal/docs/configuration/plugin"}},u={},d=[{value:"Setup",id:"setup",level:2},{value:"1. Create example project",id:"1-create-example-project",level:3},{value:"2. Create buf.yaml",id:"2-create-bufyaml",level:3},{value:"3. Create buf.gen.yaml",id:"3-create-bufgenyaml",level:3},{value:"4. Create buf.work.yaml",id:"4-create-bufworkyaml",level:3},{value:"Generate",id:"generate",level:2},{value:"5. Define schema",id:"5-define-schema",level:3},{value:"6. Generate go code",id:"6-generate-go-code",level:3},{value:"Implement",id:"implement",level:2},{value:"7. Implement worker",id:"7-implement-worker",level:3},{value:"Run",id:"run",level:2},{value:"8. Start Temporal",id:"8-start-temporal",level:3},{value:"9. Start worker",id:"9-start-worker",level:3},{value:"10. Start a workflow",id:"10-start-a-workflow",level:3}];function p(e){const t={a:"a",code:"code",h1:"h1",h2:"h2",h3:"h3",p:"p",pre:"pre",...(0,o.R)(),...e.components};return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(t.h1,{id:"getting-started",children:"Getting Started"}),"\n",(0,r.jsx)(t.h2,{id:"setup",children:"Setup"}),"\n",(0,r.jsx)(t.h3,{id:"1-create-example-project",children:"1. Create example project"}),"\n",(0,r.jsx)(t.p,{children:"Create a new project and initialize go and buf modules"}),"\n",(0,r.jsx)(t.pre,{children:(0,r.jsx)(t.code,{className:"language-shell",children:'mkdir -p example/proto\ncd example\ngo mod init example\ngo get -u "github.com/cludden/protoc-gen-go-temporal@$(curl --silent https://api.github.com/repos/cludden/protoc-gen-go-temporal/releases/latest|jq -r .tag_name)"\ngo mod tidy\ncd proto\nbuf mod init\n'})}),"\n",(0,r.jsxs)(t.h3,{id:"2-create-bufyaml",children:["2. Create ",(0,r.jsx)(t.code,{children:"buf.yaml"})]}),"\n",(0,r.jsxs)(t.p,{children:["Configure buf module and add ",(0,r.jsx)(t.code,{children:"buf.build/cludden/protoc-gen-go-temporal"})," as a proto dependency to ",(0,r.jsx)(t.code,{children:"proto/buf.yaml"})]}),"\n",(0,r.jsx)(t.pre,{children:(0,r.jsx)(t.code,{className:"language-yaml",metastring:'title="proto/buf.yaml"',children:"version: v1\ndeps:\n - buf.build/cludden/protoc-gen-go-temporal\nbreaking:\n use:\n - FILE\nlint:\n allow_comment_ignores: true\n use:\n - BASIC\n"})}),"\n",(0,r.jsxs)(t.h3,{id:"3-create-bufgenyaml",children:["3. Create ",(0,r.jsx)(t.code,{children:"buf.gen.yaml"})]}),"\n",(0,r.jsx)(t.p,{children:"Configure buf code generation"}),"\n",(0,r.jsx)(t.pre,{children:(0,r.jsx)(t.code,{className:"language-yaml",metastring:'title="buf.gen.yaml"',children:"version: v1\nmanaged:\n enabled: true\n go_package_prefix:\n default: example/gen\n except:\n - buf.build/cludden/protoc-gen-go-temporal\nplugins:\n - plugin: go\n out: gen\n opt: paths=source_relative\n - plugin: go_temporal\n out: gen\n opt: paths=source_relative,cli-enabled=true,cli-categories=true,workflow-update-enabled=true,docs-out=./proto/README.md\n strategy: all\n"})}),"\n",(0,r.jsxs)(t.h3,{id:"4-create-bufworkyaml",children:["4. Create ",(0,r.jsx)(t.code,{children:"buf.work.yaml"})]}),"\n",(0,r.jsx)(t.p,{children:"Configure buf workspace"}),"\n",(0,r.jsx)(t.pre,{children:(0,r.jsx)(t.code,{className:"language-yaml",metastring:'title="buf.work.yaml"',children:"version: v1\ndirectories:\n - proto\n"})}),"\n",(0,r.jsx)(t.h2,{id:"generate",children:"Generate"}),"\n",(0,r.jsx)(t.h3,{id:"5-define-schema",children:"5. Define schema"}),"\n",(0,r.jsx)(t.pre,{children:(0,r.jsx)(t.code,{className:"language-protobuf",metastring:'title="proto/example/v1/example.proto"',children:'syntax="proto3";\n\npackage example.v1;\n\nimport "google/protobuf/empty.proto";\nimport "temporal/v1/temporal.proto";\n\nservice Example {\n option (temporal.v1.service) = {\n task_queue: "example-v1"\n };\n\n // CreateFoo creates a new foo operation\n rpc CreateFoo(CreateFooRequest) returns (CreateFooResponse) {\n option (temporal.v1.workflow) = {\n execution_timeout: { seconds: 3600 } // foos can take awhile to create\n id_reuse_policy: WORKFLOW_ID_REUSE_POLICY_ALLOW_DUPLICATE\n id: \'create-foo/${! name.slug() }\'\n query: { ref: "GetFooProgress" }\n signal: { ref: "SetFooProgress", start: true }\n update: { ref: "UpdateFooProgress" }\n };\n }\n\n // GetFooProgress returns the status of a CreateFoo operation\n rpc GetFooProgress(google.protobuf.Empty) returns (GetFooProgressResponse) {\n option (temporal.v1.query) = {};\n }\n\n // Notify sends a notification\n rpc Notify(NotifyRequest) returns (google.protobuf.Empty) {\n option (temporal.v1.activity) = {\n start_to_close_timeout: { seconds: 30 }\n retry_policy: {\n max_attempts: 3\n }\n };\n }\n\n // SetFooProgress sets the current status of a CreateFoo operation\n rpc SetFooProgress(SetFooProgressRequest) returns (google.protobuf.Empty) {\n option (temporal.v1.signal) = {};\n }\n\n // UpdateFooProgress sets the current status of a CreateFoo operation\n rpc UpdateFooProgress(SetFooProgressRequest) returns (GetFooProgressResponse) {\n option (temporal.v1.update) = {\n id: \'update-progress/${! progress.string() }\',\n };\n }\n}\n\n// CreateFooRequest describes the input to a CreateFoo workflow\nmessage CreateFooRequest {\n // unique foo name\n string name = 1;\n}\n\n// SampleWorkflowWithMutexResponse describes the output from a CreateFoo workflow\nmessage CreateFooResponse {\n Foo foo = 1; \n}\n\n// Foo describes an illustrative foo resource\nmessage Foo {\n string name = 1;\n Status status = 2;\n\n enum Status {\n FOO_STATUS_UNSPECIFIED = 0;\n FOO_STATUS_READY = 1;\n FOO_STATUS_CREATING = 2;\n }\n}\n\n// GetFooProgressResponse describes the output from a GetFooProgress query\nmessage GetFooProgressResponse {\n float progress = 1;\n Foo.Status status = 2;\n}\n\n// NotifyRequest describes the input to a Notify activity\nmessage NotifyRequest {\n string message = 1;\n}\n\n// SetFooProgressRequest describes the input to a SetFooProgress signal\nmessage SetFooProgressRequest {\n // value of current workflow progress\n float progress = 1;\n}\n'})}),"\n",(0,r.jsx)(t.h3,{id:"6-generate-go-code",children:"6. Generate go code"}),"\n",(0,r.jsx)(t.p,{children:"Generate temporal worker, client, and cli types, methods, interfaces, and functions"}),"\n",(0,r.jsx)(t.pre,{children:(0,r.jsx)(t.code,{className:"language-shell",children:"buf mod update\ncd ..\nbuf generate\n"})}),"\n",(0,r.jsx)(t.h2,{id:"implement",children:"Implement"}),"\n",(0,r.jsx)(t.h3,{id:"7-implement-worker",children:"7. Implement worker"}),"\n",(0,r.jsx)(t.p,{children:"Implement the required Workflow and Activity interfaces and create a new Temporal worker using the generated helpers"}),"\n",(0,r.jsx)(t.pre,{children:(0,r.jsx)(t.code,{className:"language-go",metastring:'title="main.go"',children:'package main\n\nimport (\n\t"context"\n\t"fmt"\n\t"log"\n\t"os"\n\n\texamplev1 "example/gen/example/v1"\n\n\t"github.com/urfave/cli/v2"\n\t"go.temporal.io/sdk/activity"\n\t"go.temporal.io/sdk/client"\n\tsdklog "go.temporal.io/sdk/log"\n\t"go.temporal.io/sdk/worker"\n\t"go.temporal.io/sdk/workflow"\n)\n\ntype (\n\t// Workflows manages shared state for workflow constructors and is used to\n\t// register workflows with a worker\n\tWorkflows struct{}\n\n\t// Activities manages shared state for activities and is used to register\n\t// activities with a worker\n\tActivities struct{}\n\n\t// CreateFooWorkflow manages workflow state for a CreateFoo workflow\n\tCreateFooWorkflow struct {\n\t\t// it embeds the generated workflow Input type that contains the workflow\n\t\t// input and signal helpers\n\t\t*examplev1.CreateFooWorkflowInput\n\n\t\tlog sdklog.Logger\n\t\tprogress float32\n\t\tstatus examplev1.Foo_Status\n\t}\n)\n\n// CreateFoo implements a CreateFoo workflow constructor on the shared Workflows struct\n// that initializes a new CreateFooWorkflow for each execution\nfunc (w *Workflows) CreateFoo(ctx workflow.Context, input *examplev1.CreateFooWorkflowInput) (examplev1.CreateFooWorkflow, error) {\n\treturn &CreateFooWorkflow{\n\t\tCreateFooWorkflowInput: input,\n\t\tlog: workflow.GetLogger(ctx),\n\t\tstatus: examplev1.Foo_FOO_STATUS_CREATING,\n\t}, nil\n}\n\n// Execute defines the entrypoint to a CreateFooWorkflow\nfunc (wf *CreateFooWorkflow) Execute(ctx workflow.Context) (*examplev1.CreateFooResponse, error) {\n\t// listen for signals using generated signal provided by workflow input\n\tworkflow.Go(ctx, func(ctx workflow.Context) {\n\t\tfor {\n\t\t\tsignal, _ := wf.SetFooProgress.Receive(ctx)\n\t\t\twf.UpdateFooProgress(ctx, signal)\n\t\t}\n\t})\n\n\t// execute Notify activity using generated helper\n\tif err := examplev1.Notify(ctx, &examplev1.NotifyRequest{\n\t\tMessage: fmt.Sprintf("creating foo resource (%s)", wf.Req.GetName()),\n\t}); err != nil {\n\t\treturn nil, fmt.Errorf("error sending notification: %w", err)\n\t}\n\n\t// block until progress has reached 100 via signals and/or updates\n\tif err := workflow.Await(ctx, func() bool {\n\t\treturn wf.status == examplev1.Foo_FOO_STATUS_READY\n\t}); err != nil {\n\t\treturn nil, fmt.Errorf("error awaiting ready status: %w", err)\n\t}\n\n\treturn &examplev1.CreateFooResponse{\n\t\tFoo: &examplev1.Foo{\n\t\t\tName: wf.Req.GetName(),\n\t\t\tStatus: wf.status,\n\t\t},\n\t}, nil\n}\n\n// GetFooProgress defines the handler for a GetFooProgress query\nfunc (wf *CreateFooWorkflow) GetFooProgress() (*examplev1.GetFooProgressResponse, error) {\n\treturn &examplev1.GetFooProgressResponse{Progress: wf.progress, Status: wf.status}, nil\n}\n\n// UpdateFooProgress defines the handler for an UpdateFooProgress update\nfunc (wf *CreateFooWorkflow) UpdateFooProgress(ctx workflow.Context, req *examplev1.SetFooProgressRequest) (*examplev1.GetFooProgressResponse, error) {\n\twf.progress = req.GetProgress()\n\tswitch {\n\tcase wf.progress < 0:\n\t\twf.progress, wf.status = 0, examplev1.Foo_FOO_STATUS_CREATING\n\tcase wf.progress < 100:\n\t\twf.status = examplev1.Foo_FOO_STATUS_CREATING\n\tcase wf.progress >= 100:\n\t\twf.progress, wf.status = 100, examplev1.Foo_FOO_STATUS_READY\n\t}\n\treturn &examplev1.GetFooProgressResponse{Progress: wf.progress, Status: wf.status}, nil\n}\n\n// Notify defines the implementation for a Notify activity\nfunc (a *Activities) Notify(ctx context.Context, req *examplev1.NotifyRequest) error {\n\tactivity.GetLogger(ctx).Info("notification", "message", req.GetMessage())\n\treturn nil\n}\n\nfunc main() {\n\t// initialize the generated cli application\n\tapp, err := examplev1.NewExampleCli(\n\t\texamplev1.NewExampleCliOptions().WithWorker(func(cmd *cli.Context, c client.Client) (worker.Worker, error) {\n\t\t\t// register activities and workflows using generated helpers\n\t\t\tw := worker.New(c, examplev1.ExampleTaskQueue, worker.Options{})\n\t\t\texamplev1.RegisterExampleActivities(w, &Activities{})\n\t\t\texamplev1.RegisterExampleWorkflows(w, &Workflows{})\n\t\t\treturn w, nil\n\t\t}),\n\t)\n\tif err != nil {\n\t\tlog.Fatalf("error initializing example cli: %v", err)\n\t}\n\n\t// run cli\n\tif err := app.Run(os.Args); err != nil {\n\t\tlog.Fatal(err)\n\t}\n}\n'})}),"\n",(0,r.jsx)(t.h2,{id:"run",children:"Run"}),"\n",(0,r.jsx)(t.h3,{id:"8-start-temporal",children:"8. Start Temporal"}),"\n",(0,r.jsxs)(t.p,{children:["Start temporal and visit the UI at ",(0,r.jsx)(t.a,{href:"http://localhost:8233",children:"http://localhost:8233"}),"."]}),"\n",(0,r.jsx)(t.pre,{children:(0,r.jsx)(t.code,{className:"language-sh",children:'temporal server start-dev \\\n --dynamic-config-value "frontend.enableUpdateWorkflowExecution=true" \\\n --dynamic-config-value "frontend.enableUpdateWorkflowExecutionAsyncAccepted=true"\n'})}),"\n",(0,r.jsx)(t.h3,{id:"9-start-worker",children:"9. Start worker"}),"\n",(0,r.jsx)(t.p,{children:"In a different terminal, start the worker."}),"\n",(0,r.jsx)(t.pre,{children:(0,r.jsx)(t.code,{className:"language-sh",children:"go mod tidy\ngo run main.go worker\n"})}),"\n",(0,r.jsx)(t.h3,{id:"10-start-a-workflow",children:"10. Start a workflow"}),"\n",(0,r.jsx)(t.p,{children:"In a different terminal, start a workflow."}),"\n",(0,r.jsxs)(a.A,{children:[(0,r.jsxs)(s.A,{value:"cli",label:"CLI",children:[(0,r.jsx)(t.pre,{children:(0,r.jsx)(t.code,{className:"language-sh",metastring:'title="View CLI options"',children:"go run main.go -h\n"})}),(0,r.jsx)(t.pre,{children:(0,r.jsx)(t.code,{className:"language-sh",metastring:'title="Execute a workflow"',children:"go run main.go create-foo -d --name test\n"})}),(0,r.jsx)(t.pre,{children:(0,r.jsx)(t.code,{className:"language-sh",metastring:'title="Send a signal"',children:"go run main.go set-foo-progress -w create-foo/test --progress 5.7\n"})}),(0,r.jsx)(t.pre,{children:(0,r.jsx)(t.code,{className:"language-sh",metastring:'title="Query the workflow"',children:"go run main.go get-foo-progress -w create-foo/test\n"})}),(0,r.jsx)(t.pre,{children:(0,r.jsx)(t.code,{className:"language-sh",metastring:'title="Update the workflow"',children:"go run main.go update-foo-progress -w create-foo/test --progress 100\n"})}),(0,r.jsx)(t.pre,{children:(0,r.jsx)(t.code,{className:"language-json",metastring:'title="Query the completed workflow"',children:"go run main.go get-foo-progress -w create-foo/test\n"})})]}),(0,r.jsx)(s.A,{value:"client",label:"Client",children:(0,r.jsx)(t.pre,{children:(0,r.jsx)(t.code,{className:"language-go",metastring:'title="cmd/client/main.go"',children:'package main\n\nimport (\n "context"\n "log"\n\n examplev1 "github.com/cludden/protoc-gen-go-temporal/gen/example/v1"\n "go.temporal.io/sdk/client"\n)\n\nfunc main() {\n c, _ := client.Dial(client.Options{})\n client, ctx := examplev1.NewClient(c), context.Background()\n\n run, _ := client.CreateFooAsync(ctx, &examplev1.CreateFooRequest{Name: "test"})\n log.Printf("started workflow: workflow_id=%s, run_id=%s\\n", run.ID(), run.RunID())\n\n log.Println("signalling progress")\n _ = run.SetFooProgress(ctx, &examplev1.SetFooProgressRequest{Progress: 5.7})\n\n progress, _ := run.GetFooProgress(ctx)\n log.Printf("queried progress: %s\\n", progress.String())\n\n update, _ := run.UpdateFooProgress(ctx, &examplev1.SetFooProgressRequest{Progress: 100})\n log.Printf("updated progress: %s\\n", update.String())\n\n resp, _ := run.Get(ctx)\n log.Printf("workflow completed: %s\\n", resp.String())\n}\n'})})})]})]})}function g(e={}){const{wrapper:t}={...(0,o.R)(),...e.components};return t?(0,r.jsx)(t,{...e,children:(0,r.jsx)(p,{...e})}):p(e)}},9365:(e,t,n)=>{n.d(t,{A:()=>s});n(6540);var r=n(4164);const o={tabItem:"tabItem_Ymn6"};var a=n(4848);function s(e){let{children:t,hidden:n,className:s}=e;return(0,a.jsx)("div",{role:"tabpanel",className:(0,r.A)(o.tabItem,s),hidden:n,children:t})}},1470:(e,t,n)=>{n.d(t,{A:()=>F});var r=n(6540),o=n(4164),a=n(3104),s=n(6347),l=n(205),i=n(7485),c=n(1682),u=n(9466);function d(e){return r.Children.toArray(e).filter((e=>"\n"!==e)).map((e=>{if(!e||(0,r.isValidElement)(e)&&function(e){const{props:t}=e;return!!t&&"object"==typeof t&&"value"in t}(e))return e;throw new Error(`Docusaurus error: Bad child <${"string"==typeof e.type?e.type:e.type.name}>: all children of the component should be , and every should have a unique "value" prop.`)}))?.filter(Boolean)??[]}function p(e){const{values:t,children:n}=e;return(0,r.useMemo)((()=>{const e=t??function(e){return d(e).map((e=>{let{props:{value:t,label:n,attributes:r,default:o}}=e;return{value:t,label:n,attributes:r,default:o}}))}(n);return function(e){const t=(0,c.X)(e,((e,t)=>e.value===t.value));if(t.length>0)throw new Error(`Docusaurus error: Duplicate values "${t.map((e=>e.value)).join(", ")}" found in . Every value needs to be unique.`)}(e),e}),[t,n])}function g(e){let{value:t,tabValues:n}=e;return n.some((e=>e.value===t))}function m(e){let{queryString:t=!1,groupId:n}=e;const o=(0,s.W6)(),a=function(e){let{queryString:t=!1,groupId:n}=e;if("string"==typeof t)return t;if(!1===t)return null;if(!0===t&&!n)throw new Error('Docusaurus error: The component groupId prop is required if queryString=true, because this value is used as the search param name. You can also provide an explicit value such as queryString="my-search-param".');return n??null}({queryString:t,groupId:n});return[(0,i.aZ)(a),(0,r.useCallback)((e=>{if(!a)return;const t=new URLSearchParams(o.location.search);t.set(a,e),o.replace({...o.location,search:t.toString()})}),[a,o])]}function f(e){const{defaultValue:t,queryString:n=!1,groupId:o}=e,a=p(e),[s,i]=(0,r.useState)((()=>function(e){let{defaultValue:t,tabValues:n}=e;if(0===n.length)throw new Error("Docusaurus error: the component requires at least one children component");if(t){if(!g({value:t,tabValues:n}))throw new Error(`Docusaurus error: The has a defaultValue "${t}" but none of its children has the corresponding value. Available values are: ${n.map((e=>e.value)).join(", ")}. If you intend to show no default tab, use defaultValue={null} instead.`);return t}const r=n.find((e=>e.default))??n[0];if(!r)throw new Error("Unexpected error: 0 tabValues");return r.value}({defaultValue:t,tabValues:a}))),[c,d]=m({queryString:n,groupId:o}),[f,h]=function(e){let{groupId:t}=e;const n=function(e){return e?`docusaurus.tab.${e}`:null}(t),[o,a]=(0,u.Dv)(n);return[o,(0,r.useCallback)((e=>{n&&a.set(e)}),[n,a])]}({groupId:o}),w=(()=>{const e=c??f;return g({value:e,tabValues:a})?e:null})();(0,l.A)((()=>{w&&i(w)}),[w]);return{selectedValue:s,selectValue:(0,r.useCallback)((e=>{if(!g({value:e,tabValues:a}))throw new Error(`Can't select invalid tab value=${e}`);i(e),d(e),h(e)}),[d,h,a]),tabValues:a}}var h=n(2303);const w={tabList:"tabList__CuJ",tabItem:"tabItem_LNqP"};var x=n(4848);function v(e){let{className:t,block:n,selectedValue:r,selectValue:s,tabValues:l}=e;const i=[],{blockElementScrollPositionUntilNextRender:c}=(0,a.a_)(),u=e=>{const t=e.currentTarget,n=i.indexOf(t),o=l[n].value;o!==r&&(c(t),s(o))},d=e=>{let t=null;switch(e.key){case"Enter":u(e);break;case"ArrowRight":{const n=i.indexOf(e.currentTarget)+1;t=i[n]??i[0];break}case"ArrowLeft":{const n=i.indexOf(e.currentTarget)-1;t=i[n]??i[i.length-1];break}}t?.focus()};return(0,x.jsx)("ul",{role:"tablist","aria-orientation":"horizontal",className:(0,o.A)("tabs",{"tabs--block":n},t),children:l.map((e=>{let{value:t,label:n,attributes:a}=e;return(0,x.jsx)("li",{role:"tab",tabIndex:r===t?0:-1,"aria-selected":r===t,ref:e=>i.push(e),onKeyDown:d,onClick:u,...a,className:(0,o.A)("tabs__item",w.tabItem,a?.className,{"tabs__item--active":r===t}),children:n??t},t)}))})}function b(e){let{lazy:t,children:n,selectedValue:o}=e;const a=(Array.isArray(n)?n:[n]).filter(Boolean);if(t){const e=a.find((e=>e.props.value===o));return e?(0,r.cloneElement)(e,{className:"margin-top--md"}):null}return(0,x.jsx)("div",{className:"margin-top--md",children:a.map(((e,t)=>(0,r.cloneElement)(e,{key:t,hidden:e.props.value!==o})))})}function k(e){const t=f(e);return(0,x.jsxs)("div",{className:(0,o.A)("tabs-container",w.tabList),children:[(0,x.jsx)(v,{...e,...t}),(0,x.jsx)(b,{...e,...t})]})}function F(e){const t=(0,h.A)();return(0,x.jsx)(k,{...e,children:d(e.children)},String(t))}},8453:(e,t,n)=>{n.d(t,{R:()=>s,x:()=>l});var r=n(6540);const o={},a=r.createContext(o);function s(e){const t=r.useContext(a);return r.useMemo((function(){return"function"==typeof e?e(t):{...t,...e}}),[t,e])}function l(e){let t;return t=e.disableParentContext?"function"==typeof e.components?e.components(o):e.components||o:s(e.components),r.createElement(a.Provider,{value:t},e.children)}}}]); \ No newline at end of file diff --git a/assets/js/30a24c52.4c1347b4.js b/assets/js/30a24c52.4c1347b4.js deleted file mode 100644 index 25dd63cf..00000000 --- a/assets/js/30a24c52.4c1347b4.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunkdocs=self.webpackChunkdocs||[]).push([[3669],{6833:l=>{l.exports=JSON.parse('{"label":"hello","permalink":"/blog/tags/hello","allTagsPath":"/blog/tags","count":2,"unlisted":false}')}}]); \ No newline at end of file diff --git a/assets/js/328da6b0.1f94afe3.js b/assets/js/328da6b0.1f94afe3.js deleted file mode 100644 index f03432d1..00000000 --- a/assets/js/328da6b0.1f94afe3.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunkdocs=self.webpackChunkdocs||[]).push([[4163],{2503:(e,t,n)=>{n.r(t),n.d(t,{assets:()=>l,contentTitle:()=>o,default:()=>d,frontMatter:()=>s,metadata:()=>u,toc:()=>i});var r=n(4848),a=n(8453);n(1470),n(9365);const s={},o="Cross Namespace (xns)",u={id:"guides/xns",title:"Cross Namespace (xns)",description:"Coming Soon...",source:"@site/docs/guides/xns.mdx",sourceDirName:"guides",slug:"/guides/xns",permalink:"/docs/guides/xns",draft:!1,unlisted:!1,editUrl:"https://github.com/facebook/docusaurus/tree/main/packages/create-docusaurus/templates/shared/docs/guides/xns.mdx",tags:[],version:"current",frontMatter:{},sidebar:"docs",previous:{title:"Child Workflows",permalink:"/docs/guides/child-workflows"},next:{title:"Bloblang",permalink:"/docs/guides/bloblang"}},l={},i=[];function c(e){const t={h1:"h1",p:"p",strong:"strong",...(0,a.R)(),...e.components};return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(t.h1,{id:"cross-namespace-xns",children:"Cross Namespace (xns)"}),"\n",(0,r.jsx)(t.p,{children:(0,r.jsx)(t.strong,{children:"Coming Soon..."})})]})}function d(e={}){const{wrapper:t}={...(0,a.R)(),...e.components};return t?(0,r.jsx)(t,{...e,children:(0,r.jsx)(c,{...e})}):c(e)}},9365:(e,t,n)=>{n.d(t,{A:()=>o});n(6540);var r=n(4164);const a={tabItem:"tabItem_Ymn6"};var s=n(4848);function o(e){let{children:t,hidden:n,className:o}=e;return(0,s.jsx)("div",{role:"tabpanel",className:(0,r.A)(a.tabItem,o),hidden:n,children:t})}},1470:(e,t,n)=>{n.d(t,{A:()=>k});var r=n(6540),a=n(4164),s=n(3104),o=n(6347),u=n(205),l=n(7485),i=n(1682),c=n(9466);function d(e){return r.Children.toArray(e).filter((e=>"\n"!==e)).map((e=>{if(!e||(0,r.isValidElement)(e)&&function(e){const{props:t}=e;return!!t&&"object"==typeof t&&"value"in t}(e))return e;throw new Error(`Docusaurus error: Bad child <${"string"==typeof e.type?e.type:e.type.name}>: all children of the component should be , and every should have a unique "value" prop.`)}))?.filter(Boolean)??[]}function p(e){const{values:t,children:n}=e;return(0,r.useMemo)((()=>{const e=t??function(e){return d(e).map((e=>{let{props:{value:t,label:n,attributes:r,default:a}}=e;return{value:t,label:n,attributes:r,default:a}}))}(n);return function(e){const t=(0,i.X)(e,((e,t)=>e.value===t.value));if(t.length>0)throw new Error(`Docusaurus error: Duplicate values "${t.map((e=>e.value)).join(", ")}" found in . Every value needs to be unique.`)}(e),e}),[t,n])}function f(e){let{value:t,tabValues:n}=e;return n.some((e=>e.value===t))}function m(e){let{queryString:t=!1,groupId:n}=e;const a=(0,o.W6)(),s=function(e){let{queryString:t=!1,groupId:n}=e;if("string"==typeof t)return t;if(!1===t)return null;if(!0===t&&!n)throw new Error('Docusaurus error: The component groupId prop is required if queryString=true, because this value is used as the search param name. You can also provide an explicit value such as queryString="my-search-param".');return n??null}({queryString:t,groupId:n});return[(0,l.aZ)(s),(0,r.useCallback)((e=>{if(!s)return;const t=new URLSearchParams(a.location.search);t.set(s,e),a.replace({...a.location,search:t.toString()})}),[s,a])]}function b(e){const{defaultValue:t,queryString:n=!1,groupId:a}=e,s=p(e),[o,l]=(0,r.useState)((()=>function(e){let{defaultValue:t,tabValues:n}=e;if(0===n.length)throw new Error("Docusaurus error: the component requires at least one children component");if(t){if(!f({value:t,tabValues:n}))throw new Error(`Docusaurus error: The has a defaultValue "${t}" but none of its children has the corresponding value. Available values are: ${n.map((e=>e.value)).join(", ")}. If you intend to show no default tab, use defaultValue={null} instead.`);return t}const r=n.find((e=>e.default))??n[0];if(!r)throw new Error("Unexpected error: 0 tabValues");return r.value}({defaultValue:t,tabValues:s}))),[i,d]=m({queryString:n,groupId:a}),[b,h]=function(e){let{groupId:t}=e;const n=function(e){return e?`docusaurus.tab.${e}`:null}(t),[a,s]=(0,c.Dv)(n);return[a,(0,r.useCallback)((e=>{n&&s.set(e)}),[n,s])]}({groupId:a}),g=(()=>{const e=i??b;return f({value:e,tabValues:s})?e:null})();(0,u.A)((()=>{g&&l(g)}),[g]);return{selectedValue:o,selectValue:(0,r.useCallback)((e=>{if(!f({value:e,tabValues:s}))throw new Error(`Can't select invalid tab value=${e}`);l(e),d(e),h(e)}),[d,h,s]),tabValues:s}}var h=n(2303);const g={tabList:"tabList__CuJ",tabItem:"tabItem_LNqP"};var v=n(4848);function x(e){let{className:t,block:n,selectedValue:r,selectValue:o,tabValues:u}=e;const l=[],{blockElementScrollPositionUntilNextRender:i}=(0,s.a_)(),c=e=>{const t=e.currentTarget,n=l.indexOf(t),a=u[n].value;a!==r&&(i(t),o(a))},d=e=>{let t=null;switch(e.key){case"Enter":c(e);break;case"ArrowRight":{const n=l.indexOf(e.currentTarget)+1;t=l[n]??l[0];break}case"ArrowLeft":{const n=l.indexOf(e.currentTarget)-1;t=l[n]??l[l.length-1];break}}t?.focus()};return(0,v.jsx)("ul",{role:"tablist","aria-orientation":"horizontal",className:(0,a.A)("tabs",{"tabs--block":n},t),children:u.map((e=>{let{value:t,label:n,attributes:s}=e;return(0,v.jsx)("li",{role:"tab",tabIndex:r===t?0:-1,"aria-selected":r===t,ref:e=>l.push(e),onKeyDown:d,onClick:c,...s,className:(0,a.A)("tabs__item",g.tabItem,s?.className,{"tabs__item--active":r===t}),children:n??t},t)}))})}function w(e){let{lazy:t,children:n,selectedValue:a}=e;const s=(Array.isArray(n)?n:[n]).filter(Boolean);if(t){const e=s.find((e=>e.props.value===a));return e?(0,r.cloneElement)(e,{className:"margin-top--md"}):null}return(0,v.jsx)("div",{className:"margin-top--md",children:s.map(((e,t)=>(0,r.cloneElement)(e,{key:t,hidden:e.props.value!==a})))})}function y(e){const t=b(e);return(0,v.jsxs)("div",{className:(0,a.A)("tabs-container",g.tabList),children:[(0,v.jsx)(x,{...e,...t}),(0,v.jsx)(w,{...e,...t})]})}function k(e){const t=(0,h.A)();return(0,v.jsx)(y,{...e,children:d(e.children)},String(t))}},8453:(e,t,n)=>{n.d(t,{R:()=>o,x:()=>u});var r=n(6540);const a={},s=r.createContext(a);function o(e){const t=r.useContext(s);return r.useMemo((function(){return"function"==typeof e?e(t):{...t,...e}}),[t,e])}function u(e){let t;return t=e.disableParentContext?"function"==typeof e.components?e.components(a):e.components||a:o(e.components),r.createElement(s.Provider,{value:t},e.children)}}}]); \ No newline at end of file diff --git a/assets/js/328da6b0.466b6b12.js b/assets/js/328da6b0.466b6b12.js new file mode 100644 index 00000000..9c58b9ad --- /dev/null +++ b/assets/js/328da6b0.466b6b12.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunkdocs=self.webpackChunkdocs||[]).push([[4163],{2503:(e,t,r)=>{r.r(t),r.d(t,{assets:()=>l,contentTitle:()=>o,default:()=>d,frontMatter:()=>s,metadata:()=>u,toc:()=>c});var n=r(4848),a=r(8453);r(1470),r(9365);const s={},o="Cross Namespace (xns)",u={id:"guides/xns",title:"Cross Namespace (xns)",description:"Coming Soon...",source:"@site/docs/guides/xns.mdx",sourceDirName:"guides",slug:"/guides/xns",permalink:"/protoc-gen-go-temporal/docs/guides/xns",draft:!1,unlisted:!1,editUrl:"https://github.com/facebook/docusaurus/tree/main/packages/create-docusaurus/templates/shared/docs/guides/xns.mdx",tags:[],version:"current",frontMatter:{},sidebar:"docs",previous:{title:"Child Workflows",permalink:"/protoc-gen-go-temporal/docs/guides/child-workflows"},next:{title:"Bloblang",permalink:"/protoc-gen-go-temporal/docs/guides/bloblang"}},l={},c=[];function i(e){const t={h1:"h1",p:"p",strong:"strong",...(0,a.R)(),...e.components};return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(t.h1,{id:"cross-namespace-xns",children:"Cross Namespace (xns)"}),"\n",(0,n.jsx)(t.p,{children:(0,n.jsx)(t.strong,{children:"Coming Soon..."})})]})}function d(e={}){const{wrapper:t}={...(0,a.R)(),...e.components};return t?(0,n.jsx)(t,{...e,children:(0,n.jsx)(i,{...e})}):i(e)}},9365:(e,t,r)=>{r.d(t,{A:()=>o});r(6540);var n=r(4164);const a={tabItem:"tabItem_Ymn6"};var s=r(4848);function o(e){let{children:t,hidden:r,className:o}=e;return(0,s.jsx)("div",{role:"tabpanel",className:(0,n.A)(a.tabItem,o),hidden:r,children:t})}},1470:(e,t,r)=>{r.d(t,{A:()=>k});var n=r(6540),a=r(4164),s=r(3104),o=r(6347),u=r(205),l=r(7485),c=r(1682),i=r(9466);function d(e){return n.Children.toArray(e).filter((e=>"\n"!==e)).map((e=>{if(!e||(0,n.isValidElement)(e)&&function(e){const{props:t}=e;return!!t&&"object"==typeof t&&"value"in t}(e))return e;throw new Error(`Docusaurus error: Bad child <${"string"==typeof e.type?e.type:e.type.name}>: all children of the component should be , and every should have a unique "value" prop.`)}))?.filter(Boolean)??[]}function p(e){const{values:t,children:r}=e;return(0,n.useMemo)((()=>{const e=t??function(e){return d(e).map((e=>{let{props:{value:t,label:r,attributes:n,default:a}}=e;return{value:t,label:r,attributes:n,default:a}}))}(r);return function(e){const t=(0,c.X)(e,((e,t)=>e.value===t.value));if(t.length>0)throw new Error(`Docusaurus error: Duplicate values "${t.map((e=>e.value)).join(", ")}" found in . Every value needs to be unique.`)}(e),e}),[t,r])}function f(e){let{value:t,tabValues:r}=e;return r.some((e=>e.value===t))}function m(e){let{queryString:t=!1,groupId:r}=e;const a=(0,o.W6)(),s=function(e){let{queryString:t=!1,groupId:r}=e;if("string"==typeof t)return t;if(!1===t)return null;if(!0===t&&!r)throw new Error('Docusaurus error: The component groupId prop is required if queryString=true, because this value is used as the search param name. You can also provide an explicit value such as queryString="my-search-param".');return r??null}({queryString:t,groupId:r});return[(0,l.aZ)(s),(0,n.useCallback)((e=>{if(!s)return;const t=new URLSearchParams(a.location.search);t.set(s,e),a.replace({...a.location,search:t.toString()})}),[s,a])]}function b(e){const{defaultValue:t,queryString:r=!1,groupId:a}=e,s=p(e),[o,l]=(0,n.useState)((()=>function(e){let{defaultValue:t,tabValues:r}=e;if(0===r.length)throw new Error("Docusaurus error: the component requires at least one children component");if(t){if(!f({value:t,tabValues:r}))throw new Error(`Docusaurus error: The has a defaultValue "${t}" but none of its children has the corresponding value. Available values are: ${r.map((e=>e.value)).join(", ")}. If you intend to show no default tab, use defaultValue={null} instead.`);return t}const n=r.find((e=>e.default))??r[0];if(!n)throw new Error("Unexpected error: 0 tabValues");return n.value}({defaultValue:t,tabValues:s}))),[c,d]=m({queryString:r,groupId:a}),[b,h]=function(e){let{groupId:t}=e;const r=function(e){return e?`docusaurus.tab.${e}`:null}(t),[a,s]=(0,i.Dv)(r);return[a,(0,n.useCallback)((e=>{r&&s.set(e)}),[r,s])]}({groupId:a}),g=(()=>{const e=c??b;return f({value:e,tabValues:s})?e:null})();(0,u.A)((()=>{g&&l(g)}),[g]);return{selectedValue:o,selectValue:(0,n.useCallback)((e=>{if(!f({value:e,tabValues:s}))throw new Error(`Can't select invalid tab value=${e}`);l(e),d(e),h(e)}),[d,h,s]),tabValues:s}}var h=r(2303);const g={tabList:"tabList__CuJ",tabItem:"tabItem_LNqP"};var v=r(4848);function x(e){let{className:t,block:r,selectedValue:n,selectValue:o,tabValues:u}=e;const l=[],{blockElementScrollPositionUntilNextRender:c}=(0,s.a_)(),i=e=>{const t=e.currentTarget,r=l.indexOf(t),a=u[r].value;a!==n&&(c(t),o(a))},d=e=>{let t=null;switch(e.key){case"Enter":i(e);break;case"ArrowRight":{const r=l.indexOf(e.currentTarget)+1;t=l[r]??l[0];break}case"ArrowLeft":{const r=l.indexOf(e.currentTarget)-1;t=l[r]??l[l.length-1];break}}t?.focus()};return(0,v.jsx)("ul",{role:"tablist","aria-orientation":"horizontal",className:(0,a.A)("tabs",{"tabs--block":r},t),children:u.map((e=>{let{value:t,label:r,attributes:s}=e;return(0,v.jsx)("li",{role:"tab",tabIndex:n===t?0:-1,"aria-selected":n===t,ref:e=>l.push(e),onKeyDown:d,onClick:i,...s,className:(0,a.A)("tabs__item",g.tabItem,s?.className,{"tabs__item--active":n===t}),children:r??t},t)}))})}function w(e){let{lazy:t,children:r,selectedValue:a}=e;const s=(Array.isArray(r)?r:[r]).filter(Boolean);if(t){const e=s.find((e=>e.props.value===a));return e?(0,n.cloneElement)(e,{className:"margin-top--md"}):null}return(0,v.jsx)("div",{className:"margin-top--md",children:s.map(((e,t)=>(0,n.cloneElement)(e,{key:t,hidden:e.props.value!==a})))})}function y(e){const t=b(e);return(0,v.jsxs)("div",{className:(0,a.A)("tabs-container",g.tabList),children:[(0,v.jsx)(x,{...e,...t}),(0,v.jsx)(w,{...e,...t})]})}function k(e){const t=(0,h.A)();return(0,v.jsx)(y,{...e,children:d(e.children)},String(t))}},8453:(e,t,r)=>{r.d(t,{R:()=>o,x:()=>u});var n=r(6540);const a={},s=n.createContext(a);function o(e){const t=n.useContext(s);return n.useMemo((function(){return"function"==typeof e?e(t):{...t,...e}}),[t,e])}function u(e){let t;return t=e.disableParentContext?"function"==typeof e.components?e.components(a):e.components||a:o(e.components),n.createElement(s.Provider,{value:t},e.children)}}}]); \ No newline at end of file diff --git a/assets/js/35b74448.354bc6fd.js b/assets/js/35b74448.354bc6fd.js new file mode 100644 index 00000000..71765c38 --- /dev/null +++ b/assets/js/35b74448.354bc6fd.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunkdocs=self.webpackChunkdocs||[]).push([[9614],{5765:(e,t,n)=>{n.r(t),n.d(t,{assets:()=>u,contentTitle:()=>s,default:()=>d,frontMatter:()=>o,metadata:()=>l,toc:()=>i});var r=n(4848),a=n(8453);n(1470),n(9365);const o={},s="Bloblang",l={id:"guides/bloblang",title:"Bloblang",description:"Default workflow IDs, update IDs, and search attributes can be defined using Bloblang expressions via the ${!} interpolation syntax. The expression is evaluated against the protojson serialized input, allowing it to leverage fields from the input parameter, as well as Bloblang's native functions and methods.",source:"@site/docs/guides/bloblang.mdx",sourceDirName:"guides",slug:"/guides/bloblang",permalink:"/protoc-gen-go-temporal/docs/guides/bloblang",draft:!1,unlisted:!1,editUrl:"https://github.com/facebook/docusaurus/tree/main/packages/create-docusaurus/templates/shared/docs/guides/bloblang.mdx",tags:[],version:"current",frontMatter:{},sidebar:"docs",previous:{title:"Cross Namespace (xns)",permalink:"/protoc-gen-go-temporal/docs/guides/xns"},next:{title:"Codec Server",permalink:"/protoc-gen-go-temporal/docs/guides/codec-server"}},u={},i=[{value:"Example",id:"example",level:2}];function c(e){const t={a:"a",code:"code",h1:"h1",h2:"h2",p:"p",pre:"pre",...(0,a.R)(),...e.components};return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(t.h1,{id:"bloblang",children:"Bloblang"}),"\n",(0,r.jsxs)(t.p,{children:["Default workflow IDs, update IDs, and search attributes can be defined using ",(0,r.jsx)(t.a,{href:"https://www.benthos.dev/docs/guides/bloblang/about",children:"Bloblang"})," expressions via the ",(0,r.jsx)(t.code,{children:"${!}"})," interpolation syntax. The expression is evaluated against the protojson serialized input, allowing it to leverage fields from the input parameter, as well as Bloblang's native ",(0,r.jsx)(t.a,{href:"https://www.benthos.dev/docs/guides/bloblang/functions",children:"functions"})," and ",(0,r.jsx)(t.a,{href:"https://www.benthos.dev/docs/guides/bloblang/methods",children:"methods"}),"."]}),"\n",(0,r.jsx)(t.h2,{id:"example",children:"Example"}),"\n",(0,r.jsx)(t.pre,{children:(0,r.jsx)(t.code,{className:"language-protobuf",metastring:'title="example.proto"',children:'syntax="proto3"\n\npackage example.v1;\n\nimport "google/protobuf/empty.proto";\nimport "temporal/v1/temporal.proto";\n\nservice Example {\n rpc SayGreeting(SayGreetingRequest) returns (google.protobuf.Empty) {\n option (temporal.v1.workflow) = {\n id: \'say-greeting/${! greeting.or("hello").capitalize() }/${! subject.or("world").capitalize() }/${! uuid_v4() }\'\n };\n }\n}\n\nmessage SayGreetingRequest {\n string greeting = 1;\n string subject = 2;\n}\n'})}),"\n",(0,r.jsx)(t.pre,{children:(0,r.jsx)(t.code,{className:"language-go",metastring:'title="main.go"',children:'c, _ := client.Dial(client.Options{})\nexample := examplev1.NewClient(c)\n\nrun, _ := example.ExecuteSayGreeting(context.Background(), &examplev1.SayGreetingRequest{})\nrequire.Regexp(`^say-greeting/Hello/World/[a-f0-9-]{32}$`, run.ID())\n\nrun, _ := example.ExecuteSayGreeting(context.Background(), &examplev1.SayGreetingRequest{\n Greeting: "howdy",\n Subject: "stranger",\n})\nrequire.Regexp(`^say-greeting/Howdy/Stranger/[a-f0-9-]{32}$`, run.ID())\n'})})]})}function d(e={}){const{wrapper:t}={...(0,a.R)(),...e.components};return t?(0,r.jsx)(t,{...e,children:(0,r.jsx)(c,{...e})}):c(e)}},9365:(e,t,n)=>{n.d(t,{A:()=>s});n(6540);var r=n(4164);const a={tabItem:"tabItem_Ymn6"};var o=n(4848);function s(e){let{children:t,hidden:n,className:s}=e;return(0,o.jsx)("div",{role:"tabpanel",className:(0,r.A)(a.tabItem,s),hidden:n,children:t})}},1470:(e,t,n)=>{n.d(t,{A:()=>j});var r=n(6540),a=n(4164),o=n(3104),s=n(6347),l=n(205),u=n(7485),i=n(1682),c=n(9466);function d(e){return r.Children.toArray(e).filter((e=>"\n"!==e)).map((e=>{if(!e||(0,r.isValidElement)(e)&&function(e){const{props:t}=e;return!!t&&"object"==typeof t&&"value"in t}(e))return e;throw new Error(`Docusaurus error: Bad child <${"string"==typeof e.type?e.type:e.type.name}>: all children of the component should be , and every should have a unique "value" prop.`)}))?.filter(Boolean)??[]}function p(e){const{values:t,children:n}=e;return(0,r.useMemo)((()=>{const e=t??function(e){return d(e).map((e=>{let{props:{value:t,label:n,attributes:r,default:a}}=e;return{value:t,label:n,attributes:r,default:a}}))}(n);return function(e){const t=(0,i.X)(e,((e,t)=>e.value===t.value));if(t.length>0)throw new Error(`Docusaurus error: Duplicate values "${t.map((e=>e.value)).join(", ")}" found in . Every value needs to be unique.`)}(e),e}),[t,n])}function g(e){let{value:t,tabValues:n}=e;return n.some((e=>e.value===t))}function b(e){let{queryString:t=!1,groupId:n}=e;const a=(0,s.W6)(),o=function(e){let{queryString:t=!1,groupId:n}=e;if("string"==typeof t)return t;if(!1===t)return null;if(!0===t&&!n)throw new Error('Docusaurus error: The component groupId prop is required if queryString=true, because this value is used as the search param name. You can also provide an explicit value such as queryString="my-search-param".');return n??null}({queryString:t,groupId:n});return[(0,u.aZ)(o),(0,r.useCallback)((e=>{if(!o)return;const t=new URLSearchParams(a.location.search);t.set(o,e),a.replace({...a.location,search:t.toString()})}),[o,a])]}function m(e){const{defaultValue:t,queryString:n=!1,groupId:a}=e,o=p(e),[s,u]=(0,r.useState)((()=>function(e){let{defaultValue:t,tabValues:n}=e;if(0===n.length)throw new Error("Docusaurus error: the component requires at least one children component");if(t){if(!g({value:t,tabValues:n}))throw new Error(`Docusaurus error: The has a defaultValue "${t}" but none of its children has the corresponding value. Available values are: ${n.map((e=>e.value)).join(", ")}. If you intend to show no default tab, use defaultValue={null} instead.`);return t}const r=n.find((e=>e.default))??n[0];if(!r)throw new Error("Unexpected error: 0 tabValues");return r.value}({defaultValue:t,tabValues:o}))),[i,d]=b({queryString:n,groupId:a}),[m,h]=function(e){let{groupId:t}=e;const n=function(e){return e?`docusaurus.tab.${e}`:null}(t),[a,o]=(0,c.Dv)(n);return[a,(0,r.useCallback)((e=>{n&&o.set(e)}),[n,o])]}({groupId:a}),f=(()=>{const e=i??m;return g({value:e,tabValues:o})?e:null})();(0,l.A)((()=>{f&&u(f)}),[f]);return{selectedValue:s,selectValue:(0,r.useCallback)((e=>{if(!g({value:e,tabValues:o}))throw new Error(`Can't select invalid tab value=${e}`);u(e),d(e),h(e)}),[d,h,o]),tabValues:o}}var h=n(2303);const f={tabList:"tabList__CuJ",tabItem:"tabItem_LNqP"};var v=n(4848);function x(e){let{className:t,block:n,selectedValue:r,selectValue:s,tabValues:l}=e;const u=[],{blockElementScrollPositionUntilNextRender:i}=(0,o.a_)(),c=e=>{const t=e.currentTarget,n=u.indexOf(t),a=l[n].value;a!==r&&(i(t),s(a))},d=e=>{let t=null;switch(e.key){case"Enter":c(e);break;case"ArrowRight":{const n=u.indexOf(e.currentTarget)+1;t=u[n]??u[0];break}case"ArrowLeft":{const n=u.indexOf(e.currentTarget)-1;t=u[n]??u[u.length-1];break}}t?.focus()};return(0,v.jsx)("ul",{role:"tablist","aria-orientation":"horizontal",className:(0,a.A)("tabs",{"tabs--block":n},t),children:l.map((e=>{let{value:t,label:n,attributes:o}=e;return(0,v.jsx)("li",{role:"tab",tabIndex:r===t?0:-1,"aria-selected":r===t,ref:e=>u.push(e),onKeyDown:d,onClick:c,...o,className:(0,a.A)("tabs__item",f.tabItem,o?.className,{"tabs__item--active":r===t}),children:n??t},t)}))})}function w(e){let{lazy:t,children:n,selectedValue:a}=e;const o=(Array.isArray(n)?n:[n]).filter(Boolean);if(t){const e=o.find((e=>e.props.value===a));return e?(0,r.cloneElement)(e,{className:"margin-top--md"}):null}return(0,v.jsx)("div",{className:"margin-top--md",children:o.map(((e,t)=>(0,r.cloneElement)(e,{key:t,hidden:e.props.value!==a})))})}function y(e){const t=m(e);return(0,v.jsxs)("div",{className:(0,a.A)("tabs-container",f.tabList),children:[(0,v.jsx)(x,{...e,...t}),(0,v.jsx)(w,{...e,...t})]})}function j(e){const t=(0,h.A)();return(0,v.jsx)(y,{...e,children:d(e.children)},String(t))}},8453:(e,t,n)=>{n.d(t,{R:()=>s,x:()=>l});var r=n(6540);const a={},o=r.createContext(a);function s(e){const t=r.useContext(o);return r.useMemo((function(){return"function"==typeof e?e(t):{...t,...e}}),[t,e])}function l(e){let t;return t=e.disableParentContext?"function"==typeof e.components?e.components(a):e.components||a:s(e.components),r.createElement(o.Provider,{value:t},e.children)}}}]); \ No newline at end of file diff --git a/assets/js/35b74448.b3ffa949.js b/assets/js/35b74448.b3ffa949.js deleted file mode 100644 index 561b9fee..00000000 --- a/assets/js/35b74448.b3ffa949.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunkdocs=self.webpackChunkdocs||[]).push([[9614],{5765:(e,t,n)=>{n.r(t),n.d(t,{assets:()=>u,contentTitle:()=>o,default:()=>d,frontMatter:()=>s,metadata:()=>l,toc:()=>i});var r=n(4848),a=n(8453);n(1470),n(9365);const s={},o="Bloblang",l={id:"guides/bloblang",title:"Bloblang",description:"Default workflow IDs, update IDs, and search attributes can be defined using Bloblang expressions via the ${!} interpolation syntax. The expression is evaluated against the protojson serialized input, allowing it to leverage fields from the input parameter, as well as Bloblang's native functions and methods.",source:"@site/docs/guides/bloblang.mdx",sourceDirName:"guides",slug:"/guides/bloblang",permalink:"/docs/guides/bloblang",draft:!1,unlisted:!1,editUrl:"https://github.com/facebook/docusaurus/tree/main/packages/create-docusaurus/templates/shared/docs/guides/bloblang.mdx",tags:[],version:"current",frontMatter:{},sidebar:"docs",previous:{title:"Cross Namespace (xns)",permalink:"/docs/guides/xns"},next:{title:"Codec Server",permalink:"/docs/guides/codec-server"}},u={},i=[{value:"Example",id:"example",level:2}];function c(e){const t={a:"a",code:"code",h1:"h1",h2:"h2",p:"p",pre:"pre",...(0,a.R)(),...e.components};return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(t.h1,{id:"bloblang",children:"Bloblang"}),"\n",(0,r.jsxs)(t.p,{children:["Default workflow IDs, update IDs, and search attributes can be defined using ",(0,r.jsx)(t.a,{href:"https://www.benthos.dev/docs/guides/bloblang/about",children:"Bloblang"})," expressions via the ",(0,r.jsx)(t.code,{children:"${!}"})," interpolation syntax. The expression is evaluated against the protojson serialized input, allowing it to leverage fields from the input parameter, as well as Bloblang's native ",(0,r.jsx)(t.a,{href:"https://www.benthos.dev/docs/guides/bloblang/functions",children:"functions"})," and ",(0,r.jsx)(t.a,{href:"https://www.benthos.dev/docs/guides/bloblang/methods",children:"methods"}),"."]}),"\n",(0,r.jsx)(t.h2,{id:"example",children:"Example"}),"\n",(0,r.jsx)(t.pre,{children:(0,r.jsx)(t.code,{className:"language-protobuf",metastring:'title="example.proto"',children:'syntax="proto3"\n\npackage example.v1;\n\nimport "google/protobuf/empty.proto";\nimport "temporal/v1/temporal.proto";\n\nservice Example {\n rpc SayGreeting(SayGreetingRequest) returns (google.protobuf.Empty) {\n option (temporal.v1.workflow) = {\n id: \'say-greeting/${! greeting.or("hello").capitalize() }/${! subject.or("world").capitalize() }/${! uuid_v4() }\'\n };\n }\n}\n\nmessage SayGreetingRequest {\n string greeting = 1;\n string subject = 2;\n}\n'})}),"\n",(0,r.jsx)(t.pre,{children:(0,r.jsx)(t.code,{className:"language-go",metastring:'title="main.go"',children:'c, _ := client.Dial(client.Options{})\nexample := examplev1.NewClient(c)\n\nrun, _ := example.ExecuteSayGreeting(context.Background(), &examplev1.SayGreetingRequest{})\nrequire.Regexp(`^say-greeting/Hello/World/[a-f0-9-]{32}$`, run.ID())\n\nrun, _ := example.ExecuteSayGreeting(context.Background(), &examplev1.SayGreetingRequest{\n Greeting: "howdy",\n Subject: "stranger",\n})\nrequire.Regexp(`^say-greeting/Howdy/Stranger/[a-f0-9-]{32}$`, run.ID())\n'})})]})}function d(e={}){const{wrapper:t}={...(0,a.R)(),...e.components};return t?(0,r.jsx)(t,{...e,children:(0,r.jsx)(c,{...e})}):c(e)}},9365:(e,t,n)=>{n.d(t,{A:()=>o});n(6540);var r=n(4164);const a={tabItem:"tabItem_Ymn6"};var s=n(4848);function o(e){let{children:t,hidden:n,className:o}=e;return(0,s.jsx)("div",{role:"tabpanel",className:(0,r.A)(a.tabItem,o),hidden:n,children:t})}},1470:(e,t,n)=>{n.d(t,{A:()=>j});var r=n(6540),a=n(4164),s=n(3104),o=n(6347),l=n(205),u=n(7485),i=n(1682),c=n(9466);function d(e){return r.Children.toArray(e).filter((e=>"\n"!==e)).map((e=>{if(!e||(0,r.isValidElement)(e)&&function(e){const{props:t}=e;return!!t&&"object"==typeof t&&"value"in t}(e))return e;throw new Error(`Docusaurus error: Bad child <${"string"==typeof e.type?e.type:e.type.name}>: all children of the component should be , and every should have a unique "value" prop.`)}))?.filter(Boolean)??[]}function p(e){const{values:t,children:n}=e;return(0,r.useMemo)((()=>{const e=t??function(e){return d(e).map((e=>{let{props:{value:t,label:n,attributes:r,default:a}}=e;return{value:t,label:n,attributes:r,default:a}}))}(n);return function(e){const t=(0,i.X)(e,((e,t)=>e.value===t.value));if(t.length>0)throw new Error(`Docusaurus error: Duplicate values "${t.map((e=>e.value)).join(", ")}" found in . Every value needs to be unique.`)}(e),e}),[t,n])}function g(e){let{value:t,tabValues:n}=e;return n.some((e=>e.value===t))}function b(e){let{queryString:t=!1,groupId:n}=e;const a=(0,o.W6)(),s=function(e){let{queryString:t=!1,groupId:n}=e;if("string"==typeof t)return t;if(!1===t)return null;if(!0===t&&!n)throw new Error('Docusaurus error: The component groupId prop is required if queryString=true, because this value is used as the search param name. You can also provide an explicit value such as queryString="my-search-param".');return n??null}({queryString:t,groupId:n});return[(0,u.aZ)(s),(0,r.useCallback)((e=>{if(!s)return;const t=new URLSearchParams(a.location.search);t.set(s,e),a.replace({...a.location,search:t.toString()})}),[s,a])]}function h(e){const{defaultValue:t,queryString:n=!1,groupId:a}=e,s=p(e),[o,u]=(0,r.useState)((()=>function(e){let{defaultValue:t,tabValues:n}=e;if(0===n.length)throw new Error("Docusaurus error: the component requires at least one children component");if(t){if(!g({value:t,tabValues:n}))throw new Error(`Docusaurus error: The has a defaultValue "${t}" but none of its children has the corresponding value. Available values are: ${n.map((e=>e.value)).join(", ")}. If you intend to show no default tab, use defaultValue={null} instead.`);return t}const r=n.find((e=>e.default))??n[0];if(!r)throw new Error("Unexpected error: 0 tabValues");return r.value}({defaultValue:t,tabValues:s}))),[i,d]=b({queryString:n,groupId:a}),[h,m]=function(e){let{groupId:t}=e;const n=function(e){return e?`docusaurus.tab.${e}`:null}(t),[a,s]=(0,c.Dv)(n);return[a,(0,r.useCallback)((e=>{n&&s.set(e)}),[n,s])]}({groupId:a}),f=(()=>{const e=i??h;return g({value:e,tabValues:s})?e:null})();(0,l.A)((()=>{f&&u(f)}),[f]);return{selectedValue:o,selectValue:(0,r.useCallback)((e=>{if(!g({value:e,tabValues:s}))throw new Error(`Can't select invalid tab value=${e}`);u(e),d(e),m(e)}),[d,m,s]),tabValues:s}}var m=n(2303);const f={tabList:"tabList__CuJ",tabItem:"tabItem_LNqP"};var v=n(4848);function x(e){let{className:t,block:n,selectedValue:r,selectValue:o,tabValues:l}=e;const u=[],{blockElementScrollPositionUntilNextRender:i}=(0,s.a_)(),c=e=>{const t=e.currentTarget,n=u.indexOf(t),a=l[n].value;a!==r&&(i(t),o(a))},d=e=>{let t=null;switch(e.key){case"Enter":c(e);break;case"ArrowRight":{const n=u.indexOf(e.currentTarget)+1;t=u[n]??u[0];break}case"ArrowLeft":{const n=u.indexOf(e.currentTarget)-1;t=u[n]??u[u.length-1];break}}t?.focus()};return(0,v.jsx)("ul",{role:"tablist","aria-orientation":"horizontal",className:(0,a.A)("tabs",{"tabs--block":n},t),children:l.map((e=>{let{value:t,label:n,attributes:s}=e;return(0,v.jsx)("li",{role:"tab",tabIndex:r===t?0:-1,"aria-selected":r===t,ref:e=>u.push(e),onKeyDown:d,onClick:c,...s,className:(0,a.A)("tabs__item",f.tabItem,s?.className,{"tabs__item--active":r===t}),children:n??t},t)}))})}function w(e){let{lazy:t,children:n,selectedValue:a}=e;const s=(Array.isArray(n)?n:[n]).filter(Boolean);if(t){const e=s.find((e=>e.props.value===a));return e?(0,r.cloneElement)(e,{className:"margin-top--md"}):null}return(0,v.jsx)("div",{className:"margin-top--md",children:s.map(((e,t)=>(0,r.cloneElement)(e,{key:t,hidden:e.props.value!==a})))})}function y(e){const t=h(e);return(0,v.jsxs)("div",{className:(0,a.A)("tabs-container",f.tabList),children:[(0,v.jsx)(x,{...e,...t}),(0,v.jsx)(w,{...e,...t})]})}function j(e){const t=(0,m.A)();return(0,v.jsx)(y,{...e,children:d(e.children)},String(t))}},8453:(e,t,n)=>{n.d(t,{R:()=>o,x:()=>l});var r=n(6540);const a={},s=r.createContext(a);function o(e){const t=r.useContext(s);return r.useMemo((function(){return"function"==typeof e?e(t):{...t,...e}}),[t,e])}function l(e){let t;return t=e.disableParentContext?"function"==typeof e.components?e.components(a):e.components||a:o(e.components),r.createElement(s.Provider,{value:t},e.children)}}}]); \ No newline at end of file diff --git a/assets/js/36041992.5adb5a46.js b/assets/js/36041992.5adb5a46.js new file mode 100644 index 00000000..954328e1 --- /dev/null +++ b/assets/js/36041992.5adb5a46.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunkdocs=self.webpackChunkdocs||[]).push([[8351],{2679:(e,t,o)=>{o.r(t),o.d(t,{assets:()=>u,contentTitle:()=>d,default:()=>h,frontMatter:()=>p,metadata:()=>g,toc:()=>f});var n=o(4848),r=o(8453),s=o(1432);const i='syntax="proto3";\n\npackage example.v1;\n\nimport "google/protobuf/empty.proto";\nimport "temporal/v1/temporal.proto";\n\nservice Example {\n option (temporal.v1.service) = {\n task_queue: "example-v1"\n };\n\n // CreateFoo creates a new foo operation\n rpc CreateFoo(CreateFooRequest) returns (CreateFooResponse) {\n option (temporal.v1.workflow) = {\n execution_timeout: { seconds: 3600 }\n id: \'create-foo/${! name.slug() }\'\n id_reuse_policy: WORKFLOW_ID_REUSE_POLICY_ALLOW_DUPLICATE\n query: { ref: "GetFooProgress" }\n signal: { ref: "SetFooProgress", start: true }\n update: { ref: "UpdateFooProgress" }\n };\n }\n\n // GetFooProgress returns the status of a CreateFoo operation\n rpc GetFooProgress(google.protobuf.Empty) returns (GetFooProgressResponse) {\n option (temporal.v1.query) = {};\n }\n\n // Notify sends a notification\n rpc Notify(NotifyRequest) returns (google.protobuf.Empty) {\n option (temporal.v1.activity) = {\n start_to_close_timeout: { seconds: 30 }\n retry_policy: {\n max_attempts: 3\n }\n };\n }\n\n // SetFooProgress sets the current status of a CreateFoo operation\n rpc SetFooProgress(SetFooProgressRequest) returns (google.protobuf.Empty) {\n option (temporal.v1.signal) = {};\n }\n\n // UpdateFooProgress sets the current status of a CreateFoo operation\n rpc UpdateFooProgress(SetFooProgressRequest) returns (GetFooProgressResponse) {\n option (temporal.v1.update) = {\n id: \'update-progress/${! progress.string() }\'\n };\n }\n}\n\n// CreateFooRequest describes the input to a CreateFoo workflow\nmessage CreateFooRequest {\n // unique foo name\n string name = 1;\n}\n\n// SampleWorkflowWithMutexResponse describes the output from a CreateFoo workflow\nmessage CreateFooResponse {\n Foo foo = 1; \n}\n\n// Foo describes an illustrative foo resource\nmessage Foo {\n string name = 1;\n Status status = 2;\n\n enum Status {\n FOO_STATUS_UNSPECIFIED = 0;\n FOO_STATUS_READY = 1;\n FOO_STATUS_CREATING = 2;\n }\n}\n\n// GetFooProgressResponse describes the output from a GetFooProgress query\nmessage GetFooProgressResponse {\n float progress = 1;\n Foo.Status status = 2;\n}\n\n// NotifyRequest describes the input to a Notify activity\nmessage NotifyRequest {\n string message = 1;\n}\n\n// SetFooProgressRequest describes the input to a SetFooProgress signal\nmessage SetFooProgressRequest {\n // value of current workflow progress\n float progress = 1;\n}\n',a='package example\n\nimport (\n\t"context"\n\t"fmt"\n\n\texamplev1 "github.com/cludden/protoc-gen-go-temporal/gen/example/v1"\n\t"go.temporal.io/sdk/activity"\n\t"go.temporal.io/sdk/log"\n\t"go.temporal.io/sdk/workflow"\n)\n\ntype (\n\t// Workflows manages shared state for workflow constructors and is used to\n\t// register workflows with a worker\n\tWorkflows struct{}\n\n\t// Activities manages shared state for activities and is used to register\n\t// activities with a worker\n\tActivities struct{}\n\n\t// CreateFooWorkflow manages workflow state for a CreateFoo workflow\n\tCreateFooWorkflow struct {\n\t\t// it embeds the generated workflow Input type that contains the workflow\n\t\t// input and signal helpers\n\t\t*examplev1.CreateFooWorkflowInput\n\n\t\tlog log.Logger\n\t\tprogress float32\n\t\tstatus examplev1.Foo_Status\n\t}\n)\n\n// CreateFoo implements a CreateFoo workflow constructor on the shared Workflows struct\n// that initializes a new CreateFooWorkflow for each execution\nfunc (w *Workflows) CreateFoo(ctx workflow.Context, input *examplev1.CreateFooWorkflowInput) (examplev1.CreateFooWorkflow, error) {\n\treturn &CreateFooWorkflow{\n\t\tCreateFooWorkflowInput: input,\n\t\tlog: workflow.GetLogger(ctx),\n\t\tstatus: examplev1.Foo_FOO_STATUS_CREATING,\n\t}, nil\n}\n\n// Execute defines the entrypoint to a CreateFooWorkflow\nfunc (wf *CreateFooWorkflow) Execute(ctx workflow.Context) (*examplev1.CreateFooResponse, error) {\n\t// listen for signals using generated signal provided by workflow input\n\tworkflow.Go(ctx, func(ctx workflow.Context) {\n\t\tfor {\n\t\t\tsignal, _ := wf.SetFooProgress.Receive(ctx)\n\t\t\twf.UpdateFooProgress(ctx, signal)\n\t\t}\n\t})\n\n\t// execute Notify activity using generated helper\n\tif err := examplev1.Notify(ctx, &examplev1.NotifyRequest{\n\t\tMessage: fmt.Sprintf("creating foo resource (%s)", wf.Req.GetName()),\n\t}); err != nil {\n\t\treturn nil, fmt.Errorf("error sending notification: %w", err)\n\t}\n\n\t// block until progress has reached 100 via signals and/or updates\n\tif err := workflow.Await(ctx, func() bool {\n\t\treturn wf.status == examplev1.Foo_FOO_STATUS_READY\n\t}); err != nil {\n\t\treturn nil, fmt.Errorf("error awaiting ready status: %w", err)\n\t}\n\n\treturn &examplev1.CreateFooResponse{\n\t\tFoo: &examplev1.Foo{\n\t\t\tName: wf.Req.GetName(),\n\t\t\tStatus: wf.status,\n\t\t},\n\t}, nil\n}\n\n// GetFooProgress defines the handler for a GetFooProgress query\nfunc (wf *CreateFooWorkflow) GetFooProgress() (*examplev1.GetFooProgressResponse, error) {\n\treturn &examplev1.GetFooProgressResponse{Progress: wf.progress, Status: wf.status}, nil\n}\n\n// UpdateFooProgress defines the handler for an UpdateFooProgress update\nfunc (wf *CreateFooWorkflow) UpdateFooProgress(ctx workflow.Context, req *examplev1.SetFooProgressRequest) (*examplev1.GetFooProgressResponse, error) {\n\twf.progress = req.GetProgress()\n\tswitch {\n\tcase wf.progress < 0:\n\t\twf.progress, wf.status = 0, examplev1.Foo_FOO_STATUS_CREATING\n\tcase wf.progress < 100:\n\t\twf.status = examplev1.Foo_FOO_STATUS_CREATING\n\tcase wf.progress >= 100:\n\t\twf.progress, wf.status = 100, examplev1.Foo_FOO_STATUS_READY\n\t}\n\treturn &examplev1.GetFooProgressResponse{Progress: wf.progress, Status: wf.status}, nil\n}\n\n// Notify defines the implementation for a Notify activity\nfunc (a *Activities) Notify(ctx context.Context, req *examplev1.NotifyRequest) error {\n\tactivity.GetLogger(ctx).Info("notification", "message", req.GetMessage())\n\treturn nil\n}\n',l='package main\n\nimport (\n\t"log"\n\t"os"\n\n\t"github.com/cludden/protoc-gen-go-temporal/examples/example"\n\texamplev1 "github.com/cludden/protoc-gen-go-temporal/gen/example/v1"\n\t"github.com/urfave/cli/v2"\n\t"go.temporal.io/sdk/client"\n\t"go.temporal.io/sdk/worker"\n)\n\nfunc main() {\n\t// initialize the generated cli application\n\tapp, err := examplev1.NewExampleCli(\n\t\texamplev1.NewExampleCliOptions().WithWorker(func(cmd *cli.Context, c client.Client) (worker.Worker, error) {\n\t\t\t// register activities and workflows using generated helpers\n\t\t\tw := worker.New(c, examplev1.ExampleTaskQueue, worker.Options{})\n\t\t\texamplev1.RegisterExampleActivities(w, &example.Activities{})\n\t\t\texamplev1.RegisterExampleWorkflows(w, &example.Workflows{})\n\t\t\treturn w, nil\n\t\t}),\n\t)\n\tif err != nil {\n\t\tlog.Fatalf("error initializing example cli: %v", err)\n\t}\n\n\t// run cli\n\tif err := app.Run(os.Args); err != nil {\n\t\tlog.Fatal(err)\n\t}\n}\n',c='package main\n\nimport (\n\t"context"\n\t"log"\n\n\texamplev1 "github.com/cludden/protoc-gen-go-temporal/gen/example/v1"\n\t"go.temporal.io/sdk/client"\n)\n\nfunc main() {\n\t// initialize service client with sdk client\n\tc, _ := client.Dial(client.Options{})\n\tclient, ctx := examplev1.NewExampleClient(c), context.Background()\n\n\t// execute a workflow asynchronously\n\trun, _ := client.CreateFooAsync(ctx, &examplev1.CreateFooRequest{Name: "test"})\n\tlog.Printf("started workflow: workflow_id=%s, run_id=%s\\n", run.ID(), run.RunID())\n\n\t// send a signal to the workflow\n\tlog.Println("signalling progress")\n\t_ = run.SetFooProgress(ctx, &examplev1.SetFooProgressRequest{Progress: 5.7})\n\n\t// query the workflow\n\tprogress, _ := run.GetFooProgress(ctx)\n\tlog.Printf("queried progress: %s\\n", progress.String())\n\n\t// update the workflow\n\tupdate, _ := run.UpdateFooProgress(ctx, &examplev1.SetFooProgressRequest{Progress: 100})\n\tlog.Printf("updated progress: %s\\n", update.String())\n\n\t// block on workflow completion\n\tresp, _ := run.Get(ctx)\n\tlog.Printf("workflow completed: %s\\n", resp.String())\n}\n',p={sidebar_position:1},d="About",g={id:"about",title:"About",description:"A protoc plugin for generating typed Temporal clients and workers in Go from protobuf schemas. This plugin allows:",source:"@site/docs/about.mdx",sourceDirName:".",slug:"/about",permalink:"/protoc-gen-go-temporal/docs/about",draft:!1,unlisted:!1,editUrl:"https://github.com/facebook/docusaurus/tree/main/packages/create-docusaurus/templates/shared/docs/about.mdx",tags:[],version:"current",sidebarPosition:1,frontMatter:{sidebar_position:1},sidebar:"docs",next:{title:"Install",permalink:"/protoc-gen-go-temporal/docs/install"}},u={},f=[{value:"How It Works",id:"how-it-works",level:2},{value:"Features",id:"features",level:2},{value:"Inspiration",id:"inspiration",level:2}];function m(e){const t={a:"a",code:"code",em:"em",h1:"h1",h2:"h2",li:"li",p:"p",pre:"pre",strong:"strong",ul:"ul",...(0,r.R)(),...e.components},{Details:o}=t;return o||function(e,t){throw new Error("Expected "+(t?"component":"object")+" `"+e+"` to be defined: you likely forgot to import, pass, or provide it.")}("Details",!0),(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(t.h1,{id:"about",children:"About"}),"\n",(0,n.jsx)(t.p,{children:"A protoc plugin for generating typed Temporal clients and workers in Go from protobuf schemas. This plugin allows:"}),"\n",(0,n.jsxs)(t.ul,{children:["\n",(0,n.jsx)(t.li,{children:"workflow authors to configure sensible defaults and guardrails"}),"\n",(0,n.jsx)(t.li,{children:"simplifies the implementation and testing of Temporal workers"}),"\n",(0,n.jsx)(t.li,{children:"and streamlines integration by providing typed client SDKs and a generated CLI application"}),"\n"]}),"\n",(0,n.jsx)("iframe",{width:"560",height:"315",src:"https://www.youtube.com/embed/fqKDWZDj-c0?si=3Wgvj_nP2BnSVcum&start=912",title:"YouTube video player",frameborder:"0",allow:"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share",referrerpolicy:"strict-origin-when-cross-origin",allowFullScreen:!0}),"\n",(0,n.jsx)(t.h2,{id:"how-it-works",children:"How It Works"}),"\n",(0,n.jsxs)(o,{children:[(0,n.jsxs)("summary",{children:["1. ",(0,n.jsx)(t.strong,{children:"Annotate"})," your protobuf services and methods with Temporal options provided by this plugin"]}),(0,n.jsx)(s.A,{language:"protobuf",title:"example.proto",children:i})]}),"\n",(0,n.jsxs)(o,{children:[(0,n.jsxs)("summary",{children:["2. ",(0,n.jsx)(t.strong,{children:"Generate"})," Go code that includes types, methods, and functions for implementing Temporal clients, workers, and cli applications"]}),(0,n.jsx)(t.pre,{children:(0,n.jsx)(t.code,{className:"language-shell",children:"buf generate\n"})})]}),"\n",(0,n.jsxs)(o,{children:[(0,n.jsxs)("summary",{children:["3. ",(0,n.jsx)(t.strong,{children:"Implement"})," the required Workflow and Activity interfaces"]}),(0,n.jsx)(s.A,{language:"go",title:"example.go",children:a})]}),"\n",(0,n.jsxs)(o,{children:[(0,n.jsxs)("summary",{children:["4. ",(0,n.jsx)(t.strong,{children:"Run"})," your Temporal worker using the generated helpers and interact with it using the generated client and/or cli"]}),(0,n.jsx)(t.p,{children:(0,n.jsx)(t.em,{children:"Sample worker entrypoint"})}),(0,n.jsx)(s.A,{language:"go",title:"main.go",children:l}),(0,n.jsx)(t.p,{children:(0,n.jsx)(t.em,{children:"Sample client usage"})}),(0,n.jsx)(s.A,{language:"go",title:"client.go",children:c}),(0,n.jsx)(t.p,{children:(0,n.jsx)(t.em,{children:"Sample CLI usage"})}),(0,n.jsx)(t.pre,{children:(0,n.jsx)(t.code,{className:"language-bash",metastring:'title="go run main.go -h"',children:"NAME:\n example - A new cli application\n\nUSAGE:\n example [global options] command [command options] [arguments...]\n\nCOMMANDS:\n worker runs a example.v1.Example worker process\n help, h Shows a list of commands or help for one command\n QUERIES:\n get-foo-progress GetFooProgress returns the status of a CreateFoo operation\n SIGNALS:\n set-foo-progress SetFooProgress sets the current status of a CreateFoo operation\n UPDATES:\n update-foo-progress UpdateFooProgress sets the current status of a CreateFoo operation\n WORKFLOWS:\n create-foo CreateFoo creates a new foo operation\n create-foo-with-set-foo-progress sends a example.v1.Example.SetFooProgress signal to a example.v1.Example.CreateFoo workflow, starting it if necessary\n\nGLOBAL OPTIONS:\n --help, -h show help\n"})}),(0,n.jsx)(t.pre,{children:(0,n.jsx)(t.code,{className:"language-sh",metastring:'title="go run main.go create-foo -d --name test"',children:"success\nworkflow id: create-foo/test\nrun id: 44cacae1-6a13-4b4a-8db7-d29eaafd1499\n"})}),(0,n.jsx)(t.pre,{children:(0,n.jsx)(t.code,{className:"language-sh",metastring:'title="go run main.go set-foo-progress -w create-foo/test --progress 5.7"',children:"success\n"})}),(0,n.jsx)(t.pre,{children:(0,n.jsx)(t.code,{className:"language-json",metastring:'title="go run main.go get-foo-progress -w create-foo/test"',children:'{\n "progress": 5.7,\n "status": "FOO_STATUS_CREATING"\n}\n'})}),(0,n.jsx)(t.pre,{children:(0,n.jsx)(t.code,{className:"language-json",metastring:'title="go run main.go update-foo-progress -w create-foo/test --progress 100"',children:'{\n "progress": 100,\n "status": "FOO_STATUS_READY"\n}\n'})}),(0,n.jsx)(t.pre,{children:(0,n.jsx)(t.code,{className:"language-json",metastring:'title="go run main.go get-foo-progress -w create-foo/test"',children:'{\n "progress": 100,\n "status": "FOO_STATUS_READY"\n}\n'})})]}),"\n",(0,n.jsx)(t.h2,{id:"features",children:"Features"}),"\n",(0,n.jsxs)(t.p,{children:["Generated ",(0,n.jsx)(t.strong,{children:"Client"})," with:"]}),"\n",(0,n.jsxs)(t.ul,{children:["\n",(0,n.jsx)(t.li,{children:"methods for executing workflows, queries, signals, and updates"}),"\n",(0,n.jsx)(t.li,{children:"methods for cancelling or terminating workflows"}),"\n",(0,n.jsxs)(t.li,{children:["default ",(0,n.jsx)(t.code,{children:"client.StartWorkflowOptions"})," and ",(0,n.jsx)(t.code,{children:"client.UpdateWorkflowWithOptionsRequest"})]}),"\n",(0,n.jsxs)(t.li,{children:["dynamic workflow ids, update ids, and search attributes via ",(0,n.jsx)(t.a,{href:"#bloblang-expressions",children:"Bloblang expressions"})]}),"\n",(0,n.jsx)(t.li,{children:"default timeouts, id reuse policies, retry policies, wait policies"}),"\n"]}),"\n",(0,n.jsxs)(t.p,{children:["Generated ",(0,n.jsx)(t.strong,{children:"Worker"})," resources with:"]}),"\n",(0,n.jsxs)(t.ul,{children:["\n",(0,n.jsx)(t.li,{children:"functions for calling activities and local activities from workflows"}),"\n",(0,n.jsx)(t.li,{children:"functions for executing child workflows and signalling external workflows"}),"\n",(0,n.jsxs)(t.li,{children:["default ",(0,n.jsx)(t.code,{children:"workflow.ActivityOptions"}),", ",(0,n.jsx)(t.code,{children:"workflow.ChildWorkflowOptions"})]}),"\n",(0,n.jsx)(t.li,{children:"default timeouts, parent cose policies, retry policies"}),"\n"]}),"\n",(0,n.jsxs)(t.p,{children:["Optional ",(0,n.jsx)(t.strong,{children:"CLI"})," with:"]}),"\n",(0,n.jsxs)(t.ul,{children:["\n",(0,n.jsx)(t.li,{children:"commands for executing workflows, synchronously or asynchronously"}),"\n",(0,n.jsx)(t.li,{children:"commands for starting workflows with signals, synchronously or asynchronously"}),"\n",(0,n.jsx)(t.li,{children:"commands for querying existing workflows"}),"\n",(0,n.jsx)(t.li,{children:"commands for sending signals to existing workflows"}),"\n",(0,n.jsx)(t.li,{children:"typed flags for conventiently specifying workflow, query, and signal inputs"}),"\n"]}),"\n",(0,n.jsxs)(t.p,{children:["Generated ",(0,n.jsx)(t.a,{href:"/docs/guides/xns",children:"Cross-Namespace (XNS)"})," helpers: ",(0,n.jsx)(t.strong,{children:"[Experimental]"})]}),"\n",(0,n.jsxs)(t.ul,{children:["\n",(0,n.jsx)(t.li,{children:"with support for invoking a service's workflows, queries, signals, and updates from workflows in a different temporal namespace"}),"\n"]}),"\n",(0,n.jsxs)(t.p,{children:["Generated ",(0,n.jsx)(t.a,{href:"/docs/guides/codec-server",children:"Remote Codec Server"})," helpers"]}),"\n",(0,n.jsxs)(t.p,{children:["Generated ",(0,n.jsx)(t.a,{href:"/docs/guides/documentation",children:"Markdown Documentation"})]}),"\n",(0,n.jsx)(t.h2,{id:"inspiration",children:"Inspiration"}),"\n",(0,n.jsxs)(t.p,{children:["This project was inspired by ",(0,n.jsx)(t.a,{href:"https://github.com/cretz/",children:"Chad Retz's"})," awesome ",(0,n.jsx)(t.a,{href:"https://github.com/cretz/temporal-sdk-go-advanced",children:"github.com/cretz/temporal-sdk-go-advanced"})," and ",(0,n.jsx)(t.a,{href:"https://github.com/jlegrone/",children:"Jacob LeGrone's"})," excellent Replay talk on ",(0,n.jsx)(t.a,{href:"https://youtu.be/LxgkAoTSI8Q?si=ZGwwbfbMz48MkPhj&t=681",children:"Temporal @ Datadog"})]}),"\n",(0,n.jsx)("iframe",{width:"560",height:"315",src:"https://www.youtube.com/embed/LxgkAoTSI8Q?si=L3O5it48sy38dsx7&start=681",title:"YouTube video player",frameborder:"0",allow:"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share",referrerpolicy:"strict-origin-when-cross-origin",allowFullScreen:!0})]})}function h(e={}){const{wrapper:t}={...(0,r.R)(),...e.components};return t?(0,n.jsx)(t,{...e,children:(0,n.jsx)(m,{...e})}):m(e)}}}]); \ No newline at end of file diff --git a/assets/js/36041992.892c8dd8.js b/assets/js/36041992.892c8dd8.js deleted file mode 100644 index b1c80162..00000000 --- a/assets/js/36041992.892c8dd8.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunkdocs=self.webpackChunkdocs||[]).push([[8351],{2679:(e,t,o)=>{o.r(t),o.d(t,{assets:()=>u,contentTitle:()=>d,default:()=>h,frontMatter:()=>p,metadata:()=>g,toc:()=>f});var n=o(4848),r=o(8453),s=o(1432);const i='syntax="proto3";\n\npackage example.v1;\n\nimport "google/protobuf/empty.proto";\nimport "temporal/v1/temporal.proto";\n\nservice Example {\n option (temporal.v1.service) = {\n task_queue: "example-v1"\n };\n\n // CreateFoo creates a new foo operation\n rpc CreateFoo(CreateFooRequest) returns (CreateFooResponse) {\n option (temporal.v1.workflow) = {\n execution_timeout: { seconds: 3600 }\n id: \'create-foo/${! name.slug() }\'\n id_reuse_policy: WORKFLOW_ID_REUSE_POLICY_ALLOW_DUPLICATE\n query: { ref: "GetFooProgress" }\n signal: { ref: "SetFooProgress", start: true }\n update: { ref: "UpdateFooProgress" }\n };\n }\n\n // GetFooProgress returns the status of a CreateFoo operation\n rpc GetFooProgress(google.protobuf.Empty) returns (GetFooProgressResponse) {\n option (temporal.v1.query) = {};\n }\n\n // Notify sends a notification\n rpc Notify(NotifyRequest) returns (google.protobuf.Empty) {\n option (temporal.v1.activity) = {\n start_to_close_timeout: { seconds: 30 }\n retry_policy: {\n max_attempts: 3\n }\n };\n }\n\n // SetFooProgress sets the current status of a CreateFoo operation\n rpc SetFooProgress(SetFooProgressRequest) returns (google.protobuf.Empty) {\n option (temporal.v1.signal) = {};\n }\n\n // UpdateFooProgress sets the current status of a CreateFoo operation\n rpc UpdateFooProgress(SetFooProgressRequest) returns (GetFooProgressResponse) {\n option (temporal.v1.update) = {\n id: \'update-progress/${! progress.string() }\'\n };\n }\n}\n\n// CreateFooRequest describes the input to a CreateFoo workflow\nmessage CreateFooRequest {\n // unique foo name\n string name = 1;\n}\n\n// SampleWorkflowWithMutexResponse describes the output from a CreateFoo workflow\nmessage CreateFooResponse {\n Foo foo = 1; \n}\n\n// Foo describes an illustrative foo resource\nmessage Foo {\n string name = 1;\n Status status = 2;\n\n enum Status {\n FOO_STATUS_UNSPECIFIED = 0;\n FOO_STATUS_READY = 1;\n FOO_STATUS_CREATING = 2;\n }\n}\n\n// GetFooProgressResponse describes the output from a GetFooProgress query\nmessage GetFooProgressResponse {\n float progress = 1;\n Foo.Status status = 2;\n}\n\n// NotifyRequest describes the input to a Notify activity\nmessage NotifyRequest {\n string message = 1;\n}\n\n// SetFooProgressRequest describes the input to a SetFooProgress signal\nmessage SetFooProgressRequest {\n // value of current workflow progress\n float progress = 1;\n}\n',a='package example\n\nimport (\n\t"context"\n\t"fmt"\n\n\texamplev1 "github.com/cludden/protoc-gen-go-temporal/gen/example/v1"\n\t"go.temporal.io/sdk/activity"\n\t"go.temporal.io/sdk/log"\n\t"go.temporal.io/sdk/workflow"\n)\n\ntype (\n\t// Workflows manages shared state for workflow constructors and is used to\n\t// register workflows with a worker\n\tWorkflows struct{}\n\n\t// Activities manages shared state for activities and is used to register\n\t// activities with a worker\n\tActivities struct{}\n\n\t// CreateFooWorkflow manages workflow state for a CreateFoo workflow\n\tCreateFooWorkflow struct {\n\t\t// it embeds the generated workflow Input type that contains the workflow\n\t\t// input and signal helpers\n\t\t*examplev1.CreateFooWorkflowInput\n\n\t\tlog log.Logger\n\t\tprogress float32\n\t\tstatus examplev1.Foo_Status\n\t}\n)\n\n// CreateFoo implements a CreateFoo workflow constructor on the shared Workflows struct\n// that initializes a new CreateFooWorkflow for each execution\nfunc (w *Workflows) CreateFoo(ctx workflow.Context, input *examplev1.CreateFooWorkflowInput) (examplev1.CreateFooWorkflow, error) {\n\treturn &CreateFooWorkflow{\n\t\tCreateFooWorkflowInput: input,\n\t\tlog: workflow.GetLogger(ctx),\n\t\tstatus: examplev1.Foo_FOO_STATUS_CREATING,\n\t}, nil\n}\n\n// Execute defines the entrypoint to a CreateFooWorkflow\nfunc (wf *CreateFooWorkflow) Execute(ctx workflow.Context) (*examplev1.CreateFooResponse, error) {\n\t// listen for signals using generated signal provided by workflow input\n\tworkflow.Go(ctx, func(ctx workflow.Context) {\n\t\tfor {\n\t\t\tsignal, _ := wf.SetFooProgress.Receive(ctx)\n\t\t\twf.UpdateFooProgress(ctx, signal)\n\t\t}\n\t})\n\n\t// execute Notify activity using generated helper\n\tif err := examplev1.Notify(ctx, &examplev1.NotifyRequest{\n\t\tMessage: fmt.Sprintf("creating foo resource (%s)", wf.Req.GetName()),\n\t}); err != nil {\n\t\treturn nil, fmt.Errorf("error sending notification: %w", err)\n\t}\n\n\t// block until progress has reached 100 via signals and/or updates\n\tif err := workflow.Await(ctx, func() bool {\n\t\treturn wf.status == examplev1.Foo_FOO_STATUS_READY\n\t}); err != nil {\n\t\treturn nil, fmt.Errorf("error awaiting ready status: %w", err)\n\t}\n\n\treturn &examplev1.CreateFooResponse{\n\t\tFoo: &examplev1.Foo{\n\t\t\tName: wf.Req.GetName(),\n\t\t\tStatus: wf.status,\n\t\t},\n\t}, nil\n}\n\n// GetFooProgress defines the handler for a GetFooProgress query\nfunc (wf *CreateFooWorkflow) GetFooProgress() (*examplev1.GetFooProgressResponse, error) {\n\treturn &examplev1.GetFooProgressResponse{Progress: wf.progress, Status: wf.status}, nil\n}\n\n// UpdateFooProgress defines the handler for an UpdateFooProgress update\nfunc (wf *CreateFooWorkflow) UpdateFooProgress(ctx workflow.Context, req *examplev1.SetFooProgressRequest) (*examplev1.GetFooProgressResponse, error) {\n\twf.progress = req.GetProgress()\n\tswitch {\n\tcase wf.progress < 0:\n\t\twf.progress, wf.status = 0, examplev1.Foo_FOO_STATUS_CREATING\n\tcase wf.progress < 100:\n\t\twf.status = examplev1.Foo_FOO_STATUS_CREATING\n\tcase wf.progress >= 100:\n\t\twf.progress, wf.status = 100, examplev1.Foo_FOO_STATUS_READY\n\t}\n\treturn &examplev1.GetFooProgressResponse{Progress: wf.progress, Status: wf.status}, nil\n}\n\n// Notify defines the implementation for a Notify activity\nfunc (a *Activities) Notify(ctx context.Context, req *examplev1.NotifyRequest) error {\n\tactivity.GetLogger(ctx).Info("notification", "message", req.GetMessage())\n\treturn nil\n}\n',l='package main\n\nimport (\n\t"log"\n\t"os"\n\n\t"github.com/cludden/protoc-gen-go-temporal/examples/example"\n\texamplev1 "github.com/cludden/protoc-gen-go-temporal/gen/example/v1"\n\t"github.com/urfave/cli/v2"\n\t"go.temporal.io/sdk/client"\n\t"go.temporal.io/sdk/worker"\n)\n\nfunc main() {\n\t// initialize the generated cli application\n\tapp, err := examplev1.NewExampleCli(\n\t\texamplev1.NewExampleCliOptions().WithWorker(func(cmd *cli.Context, c client.Client) (worker.Worker, error) {\n\t\t\t// register activities and workflows using generated helpers\n\t\t\tw := worker.New(c, examplev1.ExampleTaskQueue, worker.Options{})\n\t\t\texamplev1.RegisterExampleActivities(w, &example.Activities{})\n\t\t\texamplev1.RegisterExampleWorkflows(w, &example.Workflows{})\n\t\t\treturn w, nil\n\t\t}),\n\t)\n\tif err != nil {\n\t\tlog.Fatalf("error initializing example cli: %v", err)\n\t}\n\n\t// run cli\n\tif err := app.Run(os.Args); err != nil {\n\t\tlog.Fatal(err)\n\t}\n}\n',c='package main\n\nimport (\n\t"context"\n\t"log"\n\n\texamplev1 "github.com/cludden/protoc-gen-go-temporal/gen/example/v1"\n\t"go.temporal.io/sdk/client"\n)\n\nfunc main() {\n\t// initialize service client with sdk client\n\tc, _ := client.Dial(client.Options{})\n\tclient, ctx := examplev1.NewExampleClient(c), context.Background()\n\n\t// execute a workflow asynchronously\n\trun, _ := client.CreateFooAsync(ctx, &examplev1.CreateFooRequest{Name: "test"})\n\tlog.Printf("started workflow: workflow_id=%s, run_id=%s\\n", run.ID(), run.RunID())\n\n\t// send a signal to the workflow\n\tlog.Println("signalling progress")\n\t_ = run.SetFooProgress(ctx, &examplev1.SetFooProgressRequest{Progress: 5.7})\n\n\t// query the workflow\n\tprogress, _ := run.GetFooProgress(ctx)\n\tlog.Printf("queried progress: %s\\n", progress.String())\n\n\t// update the workflow\n\tupdate, _ := run.UpdateFooProgress(ctx, &examplev1.SetFooProgressRequest{Progress: 100})\n\tlog.Printf("updated progress: %s\\n", update.String())\n\n\t// block on workflow completion\n\tresp, _ := run.Get(ctx)\n\tlog.Printf("workflow completed: %s\\n", resp.String())\n}\n',p={sidebar_position:1},d="About",g={id:"about",title:"About",description:"A protoc plugin for generating typed Temporal clients and workers in Go from protobuf schemas. This plugin allows:",source:"@site/docs/about.mdx",sourceDirName:".",slug:"/about",permalink:"/docs/about",draft:!1,unlisted:!1,editUrl:"https://github.com/facebook/docusaurus/tree/main/packages/create-docusaurus/templates/shared/docs/about.mdx",tags:[],version:"current",sidebarPosition:1,frontMatter:{sidebar_position:1},sidebar:"docs",next:{title:"Install",permalink:"/docs/install"}},u={},f=[{value:"How It Works",id:"how-it-works",level:2},{value:"Features",id:"features",level:2},{value:"Inspiration",id:"inspiration",level:2}];function m(e){const t={a:"a",code:"code",em:"em",h1:"h1",h2:"h2",li:"li",p:"p",pre:"pre",strong:"strong",ul:"ul",...(0,r.R)(),...e.components},{Details:o}=t;return o||function(e,t){throw new Error("Expected "+(t?"component":"object")+" `"+e+"` to be defined: you likely forgot to import, pass, or provide it.")}("Details",!0),(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(t.h1,{id:"about",children:"About"}),"\n",(0,n.jsx)(t.p,{children:"A protoc plugin for generating typed Temporal clients and workers in Go from protobuf schemas. This plugin allows:"}),"\n",(0,n.jsxs)(t.ul,{children:["\n",(0,n.jsx)(t.li,{children:"workflow authors to configure sensible defaults and guardrails"}),"\n",(0,n.jsx)(t.li,{children:"simplifies the implementation and testing of Temporal workers"}),"\n",(0,n.jsx)(t.li,{children:"and streamlines integration by providing typed client SDKs and a generated CLI application"}),"\n"]}),"\n",(0,n.jsx)("iframe",{width:"560",height:"315",src:"https://www.youtube.com/embed/fqKDWZDj-c0?si=3Wgvj_nP2BnSVcum&start=912",title:"YouTube video player",frameborder:"0",allow:"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share",referrerpolicy:"strict-origin-when-cross-origin",allowFullScreen:!0}),"\n",(0,n.jsx)(t.h2,{id:"how-it-works",children:"How It Works"}),"\n",(0,n.jsxs)(o,{children:[(0,n.jsxs)("summary",{children:["1. ",(0,n.jsx)(t.strong,{children:"Annotate"})," your protobuf services and methods with Temporal options provided by this plugin"]}),(0,n.jsx)(s.A,{language:"protobuf",title:"example.proto",children:i})]}),"\n",(0,n.jsxs)(o,{children:[(0,n.jsxs)("summary",{children:["2. ",(0,n.jsx)(t.strong,{children:"Generate"})," Go code that includes types, methods, and functions for implementing Temporal clients, workers, and cli applications"]}),(0,n.jsx)(t.pre,{children:(0,n.jsx)(t.code,{className:"language-shell",children:"buf generate\n"})})]}),"\n",(0,n.jsxs)(o,{children:[(0,n.jsxs)("summary",{children:["3. ",(0,n.jsx)(t.strong,{children:"Implement"})," the required Workflow and Activity interfaces"]}),(0,n.jsx)(s.A,{language:"go",title:"example.go",children:a})]}),"\n",(0,n.jsxs)(o,{children:[(0,n.jsxs)("summary",{children:["4. ",(0,n.jsx)(t.strong,{children:"Run"})," your Temporal worker using the generated helpers and interact with it using the generated client and/or cli"]}),(0,n.jsx)(t.p,{children:(0,n.jsx)(t.em,{children:"Sample worker entrypoint"})}),(0,n.jsx)(s.A,{language:"go",title:"main.go",children:l}),(0,n.jsx)(t.p,{children:(0,n.jsx)(t.em,{children:"Sample client usage"})}),(0,n.jsx)(s.A,{language:"go",title:"client.go",children:c}),(0,n.jsx)(t.p,{children:(0,n.jsx)(t.em,{children:"Sample CLI usage"})}),(0,n.jsx)(t.pre,{children:(0,n.jsx)(t.code,{className:"language-bash",metastring:'title="go run main.go -h"',children:"NAME:\n example - A new cli application\n\nUSAGE:\n example [global options] command [command options] [arguments...]\n\nCOMMANDS:\n worker runs a example.v1.Example worker process\n help, h Shows a list of commands or help for one command\n QUERIES:\n get-foo-progress GetFooProgress returns the status of a CreateFoo operation\n SIGNALS:\n set-foo-progress SetFooProgress sets the current status of a CreateFoo operation\n UPDATES:\n update-foo-progress UpdateFooProgress sets the current status of a CreateFoo operation\n WORKFLOWS:\n create-foo CreateFoo creates a new foo operation\n create-foo-with-set-foo-progress sends a example.v1.Example.SetFooProgress signal to a example.v1.Example.CreateFoo workflow, starting it if necessary\n\nGLOBAL OPTIONS:\n --help, -h show help\n"})}),(0,n.jsx)(t.pre,{children:(0,n.jsx)(t.code,{className:"language-sh",metastring:'title="go run main.go create-foo -d --name test"',children:"success\nworkflow id: create-foo/test\nrun id: 44cacae1-6a13-4b4a-8db7-d29eaafd1499\n"})}),(0,n.jsx)(t.pre,{children:(0,n.jsx)(t.code,{className:"language-sh",metastring:'title="go run main.go set-foo-progress -w create-foo/test --progress 5.7"',children:"success\n"})}),(0,n.jsx)(t.pre,{children:(0,n.jsx)(t.code,{className:"language-json",metastring:'title="go run main.go get-foo-progress -w create-foo/test"',children:'{\n "progress": 5.7,\n "status": "FOO_STATUS_CREATING"\n}\n'})}),(0,n.jsx)(t.pre,{children:(0,n.jsx)(t.code,{className:"language-json",metastring:'title="go run main.go update-foo-progress -w create-foo/test --progress 100"',children:'{\n "progress": 100,\n "status": "FOO_STATUS_READY"\n}\n'})}),(0,n.jsx)(t.pre,{children:(0,n.jsx)(t.code,{className:"language-json",metastring:'title="go run main.go get-foo-progress -w create-foo/test"',children:'{\n "progress": 100,\n "status": "FOO_STATUS_READY"\n}\n'})})]}),"\n",(0,n.jsx)(t.h2,{id:"features",children:"Features"}),"\n",(0,n.jsxs)(t.p,{children:["Generated ",(0,n.jsx)(t.strong,{children:"Client"})," with:"]}),"\n",(0,n.jsxs)(t.ul,{children:["\n",(0,n.jsx)(t.li,{children:"methods for executing workflows, queries, signals, and updates"}),"\n",(0,n.jsx)(t.li,{children:"methods for cancelling or terminating workflows"}),"\n",(0,n.jsxs)(t.li,{children:["default ",(0,n.jsx)(t.code,{children:"client.StartWorkflowOptions"})," and ",(0,n.jsx)(t.code,{children:"client.UpdateWorkflowWithOptionsRequest"})]}),"\n",(0,n.jsxs)(t.li,{children:["dynamic workflow ids, update ids, and search attributes via ",(0,n.jsx)(t.a,{href:"#bloblang-expressions",children:"Bloblang expressions"})]}),"\n",(0,n.jsx)(t.li,{children:"default timeouts, id reuse policies, retry policies, wait policies"}),"\n"]}),"\n",(0,n.jsxs)(t.p,{children:["Generated ",(0,n.jsx)(t.strong,{children:"Worker"})," resources with:"]}),"\n",(0,n.jsxs)(t.ul,{children:["\n",(0,n.jsx)(t.li,{children:"functions for calling activities and local activities from workflows"}),"\n",(0,n.jsx)(t.li,{children:"functions for executing child workflows and signalling external workflows"}),"\n",(0,n.jsxs)(t.li,{children:["default ",(0,n.jsx)(t.code,{children:"workflow.ActivityOptions"}),", ",(0,n.jsx)(t.code,{children:"workflow.ChildWorkflowOptions"})]}),"\n",(0,n.jsx)(t.li,{children:"default timeouts, parent cose policies, retry policies"}),"\n"]}),"\n",(0,n.jsxs)(t.p,{children:["Optional ",(0,n.jsx)(t.strong,{children:"CLI"})," with:"]}),"\n",(0,n.jsxs)(t.ul,{children:["\n",(0,n.jsx)(t.li,{children:"commands for executing workflows, synchronously or asynchronously"}),"\n",(0,n.jsx)(t.li,{children:"commands for starting workflows with signals, synchronously or asynchronously"}),"\n",(0,n.jsx)(t.li,{children:"commands for querying existing workflows"}),"\n",(0,n.jsx)(t.li,{children:"commands for sending signals to existing workflows"}),"\n",(0,n.jsx)(t.li,{children:"typed flags for conventiently specifying workflow, query, and signal inputs"}),"\n"]}),"\n",(0,n.jsxs)(t.p,{children:["Generated ",(0,n.jsx)(t.a,{href:"/docs/guides/xns",children:"Cross-Namespace (XNS)"})," helpers: ",(0,n.jsx)(t.strong,{children:"[Experimental]"})]}),"\n",(0,n.jsxs)(t.ul,{children:["\n",(0,n.jsx)(t.li,{children:"with support for invoking a service's workflows, queries, signals, and updates from workflows in a different temporal namespace"}),"\n"]}),"\n",(0,n.jsxs)(t.p,{children:["Generated ",(0,n.jsx)(t.a,{href:"/docs/guides/codec-server",children:"Remote Codec Server"})," helpers"]}),"\n",(0,n.jsxs)(t.p,{children:["Generated ",(0,n.jsx)(t.a,{href:"/docs/guides/documentation",children:"Markdown Documentation"})]}),"\n",(0,n.jsx)(t.h2,{id:"inspiration",children:"Inspiration"}),"\n",(0,n.jsxs)(t.p,{children:["This project was inspired by ",(0,n.jsx)(t.a,{href:"https://github.com/cretz/",children:"Chad Retz's"})," awesome ",(0,n.jsx)(t.a,{href:"https://github.com/cretz/temporal-sdk-go-advanced",children:"github.com/cretz/temporal-sdk-go-advanced"})," and ",(0,n.jsx)(t.a,{href:"https://github.com/jlegrone/",children:"Jacob LeGrone's"})," excellent Replay talk on ",(0,n.jsx)(t.a,{href:"https://youtu.be/LxgkAoTSI8Q?si=ZGwwbfbMz48MkPhj&t=681",children:"Temporal @ Datadog"})]}),"\n",(0,n.jsx)("iframe",{width:"560",height:"315",src:"https://www.youtube.com/embed/LxgkAoTSI8Q?si=L3O5it48sy38dsx7&start=681",title:"YouTube video player",frameborder:"0",allow:"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share",referrerpolicy:"strict-origin-when-cross-origin",allowFullScreen:!0})]})}function h(e={}){const{wrapper:t}={...(0,r.R)(),...e.components};return t?(0,n.jsx)(t,{...e,children:(0,n.jsx)(m,{...e})}):m(e)}}}]); \ No newline at end of file diff --git a/assets/js/393be207.2db108f6.js b/assets/js/393be207.2db108f6.js deleted file mode 100644 index 11b82d38..00000000 --- a/assets/js/393be207.2db108f6.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunkdocs=self.webpackChunkdocs||[]).push([[4134],{6602:(e,n,t)=>{t.r(n),t.d(n,{assets:()=>c,contentTitle:()=>s,default:()=>l,frontMatter:()=>r,metadata:()=>p,toc:()=>d});var o=t(4848),a=t(8453);const r={title:"Markdown page example"},s="Markdown page example",p={type:"mdx",permalink:"/markdown-page",source:"@site/src/pages/markdown-page.md",title:"Markdown page example",description:"You don't need React to write simple standalone pages.",frontMatter:{title:"Markdown page example"},unlisted:!1},c={},d=[];function i(e){const n={h1:"h1",p:"p",...(0,a.R)(),...e.components};return(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(n.h1,{id:"markdown-page-example",children:"Markdown page example"}),"\n",(0,o.jsx)(n.p,{children:"You don't need React to write simple standalone pages."})]})}function l(e={}){const{wrapper:n}={...(0,a.R)(),...e.components};return n?(0,o.jsx)(n,{...e,children:(0,o.jsx)(i,{...e})}):i(e)}},8453:(e,n,t)=>{t.d(n,{R:()=>s,x:()=>p});var o=t(6540);const a={},r=o.createContext(a);function s(e){const n=o.useContext(r);return o.useMemo((function(){return"function"==typeof e?e(n):{...n,...e}}),[n,e])}function p(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(a):e.components||a:s(e.components),o.createElement(r.Provider,{value:n},e.children)}}}]); \ No newline at end of file diff --git a/assets/js/393be207.67121378.js b/assets/js/393be207.67121378.js new file mode 100644 index 00000000..b32a0593 --- /dev/null +++ b/assets/js/393be207.67121378.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunkdocs=self.webpackChunkdocs||[]).push([[4134],{6602:(e,t,n)=>{n.r(t),n.d(t,{assets:()=>c,contentTitle:()=>s,default:()=>l,frontMatter:()=>r,metadata:()=>p,toc:()=>d});var o=n(4848),a=n(8453);const r={title:"Markdown page example"},s="Markdown page example",p={type:"mdx",permalink:"/protoc-gen-go-temporal/markdown-page",source:"@site/src/pages/markdown-page.md",title:"Markdown page example",description:"You don't need React to write simple standalone pages.",frontMatter:{title:"Markdown page example"},unlisted:!1},c={},d=[];function i(e){const t={h1:"h1",p:"p",...(0,a.R)(),...e.components};return(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(t.h1,{id:"markdown-page-example",children:"Markdown page example"}),"\n",(0,o.jsx)(t.p,{children:"You don't need React to write simple standalone pages."})]})}function l(e={}){const{wrapper:t}={...(0,a.R)(),...e.components};return t?(0,o.jsx)(t,{...e,children:(0,o.jsx)(i,{...e})}):i(e)}},8453:(e,t,n)=>{n.d(t,{R:()=>s,x:()=>p});var o=n(6540);const a={},r=o.createContext(a);function s(e){const t=o.useContext(r);return o.useMemo((function(){return"function"==typeof e?e(t):{...t,...e}}),[t,e])}function p(e){let t;return t=e.disableParentContext?"function"==typeof e.components?e.components(a):e.components||a:s(e.components),o.createElement(r.Provider,{value:t},e.children)}}}]); \ No newline at end of file diff --git a/assets/js/3b117d94.365fd472.js b/assets/js/3b117d94.365fd472.js new file mode 100644 index 00000000..35c2b3d8 --- /dev/null +++ b/assets/js/3b117d94.365fd472.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunkdocs=self.webpackChunkdocs||[]).push([[9184],{5681:o=>{o.exports=JSON.parse('{"label":"facebook","permalink":"/protoc-gen-go-temporal/blog/tags/facebook","allTagsPath":"/protoc-gen-go-temporal/blog/tags","count":1,"unlisted":false}')}}]); \ No newline at end of file diff --git a/assets/js/3fa420c0.51cf74bd.js b/assets/js/3fa420c0.51cf74bd.js new file mode 100644 index 00000000..84a69949 --- /dev/null +++ b/assets/js/3fa420c0.51cf74bd.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunkdocs=self.webpackChunkdocs||[]).push([[144],{1493:(e,t,n)=>{n.r(t),n.d(t,{assets:()=>u,contentTitle:()=>s,default:()=>d,frontMatter:()=>a,metadata:()=>l,toc:()=>i});var r=n(4848),o=n(8453);n(1470),n(9365);const a={},s="Query",l={id:"configuration/query",title:"Query",description:"Queries are defined as Protobuf RPCs annotated with the temporal.v1.query method option. They're mapped to workflows using the query workflow option. See the Queries guide for more usage details.",source:"@site/docs/configuration/query.mdx",sourceDirName:"configuration",slug:"/configuration/query",permalink:"/protoc-gen-go-temporal/docs/configuration/query",draft:!1,unlisted:!1,editUrl:"https://github.com/facebook/docusaurus/tree/main/packages/create-docusaurus/templates/shared/docs/configuration/query.mdx",tags:[],version:"current",frontMatter:{},sidebar:"docs",previous:{title:"Activity",permalink:"/protoc-gen-go-temporal/docs/configuration/activity"},next:{title:"Signal",permalink:"/protoc-gen-go-temporal/docs/configuration/signal"}},u={},i=[{value:"Options",id:"options",level:2},{value:"name",id:"name",level:3},{value:"xns",id:"xns",level:3}];function c(e){const t={a:"a",admonition:"admonition",code:"code",h1:"h1",h2:"h2",h3:"h3",p:"p",pre:"pre",...(0,o.R)(),...e.components};return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(t.h1,{id:"query",children:"Query"}),"\n",(0,r.jsxs)(t.p,{children:[(0,r.jsx)(t.a,{href:"https://docs.temporal.io/workflows#query",children:"Queries"})," are defined as Protobuf RPCs annotated with the ",(0,r.jsx)(t.code,{children:"temporal.v1.query"})," method option. They're mapped to workflows using the ",(0,r.jsx)(t.a,{href:"/docs/configuration/workflow#query",children:"query workflow option"}),". See the ",(0,r.jsx)(t.a,{href:"/docs/guides/queries",children:"Queries guide"})," for more usage details."]}),"\n",(0,r.jsx)(t.admonition,{type:"warning",children:(0,r.jsxs)(t.p,{children:["Query definitions must specify a non-empty output parameter. Query definitions can omit an input parameter by specifying the native ",(0,r.jsx)(t.code,{children:"google.protobuf.Empty"})," message type in its place. This requires an additional ",(0,r.jsx)(t.code,{children:"google/protobuf/empty.proto"})," protobuf import."]})}),"\n",(0,r.jsx)(t.pre,{children:(0,r.jsx)(t.code,{className:"language-protobuf",metastring:'title="example.proto"',children:'syntax="proto3";\n\npackage example.v1;\n\nimport "temporal/v1/temporal.proto";\n\nservice Example {\n // Hello returns a friendly greeting\n rpc Hello(HelloInput) returns (HelloOutput) {\n option (temporal.v1.workflow) = {\n query: { ref: \'GetHelloStatus\' }\n };\n }\n\n // GetHelloStatus retrieves the status of an existing Hello workflow\n rpc GetHelloStatus(GetHelloStatusInput) returns (GetHelloStatusOutput) {\n option (temporal.v1.query) = {};\n }\n}\n'})}),"\n",(0,r.jsx)(t.h2,{id:"options",children:"Options"}),"\n",(0,r.jsx)(t.h3,{id:"name",children:"name"}),"\n",(0,r.jsx)(t.p,{children:(0,r.jsx)(t.code,{children:"string"})}),"\n",(0,r.jsxs)(t.p,{children:["Fully qualified ",(0,r.jsx)(t.a,{href:"https://docs.temporal.io/workflows#query",children:"Query type name"}),". Defaults to protobuf method full name (e.g. ",(0,r.jsx)(t.code,{children:"example.v1.Example.GetHelloStatus"}),")"]}),"\n",(0,r.jsx)(t.pre,{children:(0,r.jsx)(t.code,{className:"language-protobuf",children:'service Example {\n rpc GetHelloStatus(GetHelloStatusInput) returns (GetHelloStatusOutput) {\n option (temporal.v1.query) = {\n name: "GetHelloStatus"\n };\n }\n}\n'})}),"\n",(0,r.jsx)(t.h3,{id:"xns",children:"xns"}),"\n",(0,r.jsx)(t.p,{children:(0,r.jsx)(t.a,{href:"https://buf.build/cludden/protoc-gen-go-temporal/docs/main:temporal.v1#temporal.v1.XNSActivityOptions",children:"temporal.v1.XNSActivityOptions"})}),"\n",(0,r.jsxs)(t.p,{children:["Used to configure ",(0,r.jsx)(t.a,{href:"/docs/guides/xns",children:"cross-namespace"})," activity options."]}),"\n",(0,r.jsx)(t.admonition,{type:"note",children:(0,r.jsxs)(t.p,{children:["This requires the ",(0,r.jsx)(t.a,{href:"/docs/configuration/plugin",children:"enable-xns"})," plugin option to be enabled."]})}),"\n",(0,r.jsx)(t.pre,{children:(0,r.jsx)(t.code,{className:"language-protobuf",children:"service Example {\n rpc GetHelloStatus(GetHelloStatusInput) returns (GetHelloStatusOutput) {\n option (temporal.v1.query) = {\n xns: {\n heartbeat_timeout: { seconds: 30 }\n heartbeat_interval: { seconds: 10 }\n start_to_close_timeout: { seconds: 300 }\n }\n };\n }\n}\n"})})]})}function d(e={}){const{wrapper:t}={...(0,o.R)(),...e.components};return t?(0,r.jsx)(t,{...e,children:(0,r.jsx)(c,{...e})}):c(e)}},9365:(e,t,n)=>{n.d(t,{A:()=>s});n(6540);var r=n(4164);const o={tabItem:"tabItem_Ymn6"};var a=n(4848);function s(e){let{children:t,hidden:n,className:s}=e;return(0,a.jsx)("div",{role:"tabpanel",className:(0,r.A)(o.tabItem,s),hidden:n,children:t})}},1470:(e,t,n)=>{n.d(t,{A:()=>w});var r=n(6540),o=n(4164),a=n(3104),s=n(6347),l=n(205),u=n(7485),i=n(1682),c=n(9466);function d(e){return r.Children.toArray(e).filter((e=>"\n"!==e)).map((e=>{if(!e||(0,r.isValidElement)(e)&&function(e){const{props:t}=e;return!!t&&"object"==typeof t&&"value"in t}(e))return e;throw new Error(`Docusaurus error: Bad child <${"string"==typeof e.type?e.type:e.type.name}>: all children of the component should be , and every should have a unique "value" prop.`)}))?.filter(Boolean)??[]}function p(e){const{values:t,children:n}=e;return(0,r.useMemo)((()=>{const e=t??function(e){return d(e).map((e=>{let{props:{value:t,label:n,attributes:r,default:o}}=e;return{value:t,label:n,attributes:r,default:o}}))}(n);return function(e){const t=(0,i.X)(e,((e,t)=>e.value===t.value));if(t.length>0)throw new Error(`Docusaurus error: Duplicate values "${t.map((e=>e.value)).join(", ")}" found in . Every value needs to be unique.`)}(e),e}),[t,n])}function h(e){let{value:t,tabValues:n}=e;return n.some((e=>e.value===t))}function m(e){let{queryString:t=!1,groupId:n}=e;const o=(0,s.W6)(),a=function(e){let{queryString:t=!1,groupId:n}=e;if("string"==typeof t)return t;if(!1===t)return null;if(!0===t&&!n)throw new Error('Docusaurus error: The component groupId prop is required if queryString=true, because this value is used as the search param name. You can also provide an explicit value such as queryString="my-search-param".');return n??null}({queryString:t,groupId:n});return[(0,u.aZ)(a),(0,r.useCallback)((e=>{if(!a)return;const t=new URLSearchParams(o.location.search);t.set(a,e),o.replace({...o.location,search:t.toString()})}),[a,o])]}function f(e){const{defaultValue:t,queryString:n=!1,groupId:o}=e,a=p(e),[s,u]=(0,r.useState)((()=>function(e){let{defaultValue:t,tabValues:n}=e;if(0===n.length)throw new Error("Docusaurus error: the component requires at least one children component");if(t){if(!h({value:t,tabValues:n}))throw new Error(`Docusaurus error: The has a defaultValue "${t}" but none of its children has the corresponding value. Available values are: ${n.map((e=>e.value)).join(", ")}. If you intend to show no default tab, use defaultValue={null} instead.`);return t}const r=n.find((e=>e.default))??n[0];if(!r)throw new Error("Unexpected error: 0 tabValues");return r.value}({defaultValue:t,tabValues:a}))),[i,d]=m({queryString:n,groupId:o}),[f,g]=function(e){let{groupId:t}=e;const n=function(e){return e?`docusaurus.tab.${e}`:null}(t),[o,a]=(0,c.Dv)(n);return[o,(0,r.useCallback)((e=>{n&&a.set(e)}),[n,a])]}({groupId:o}),b=(()=>{const e=i??f;return h({value:e,tabValues:a})?e:null})();(0,l.A)((()=>{b&&u(b)}),[b]);return{selectedValue:s,selectValue:(0,r.useCallback)((e=>{if(!h({value:e,tabValues:a}))throw new Error(`Can't select invalid tab value=${e}`);u(e),d(e),g(e)}),[d,g,a]),tabValues:a}}var g=n(2303);const b={tabList:"tabList__CuJ",tabItem:"tabItem_LNqP"};var v=n(4848);function x(e){let{className:t,block:n,selectedValue:r,selectValue:s,tabValues:l}=e;const u=[],{blockElementScrollPositionUntilNextRender:i}=(0,a.a_)(),c=e=>{const t=e.currentTarget,n=u.indexOf(t),o=l[n].value;o!==r&&(i(t),s(o))},d=e=>{let t=null;switch(e.key){case"Enter":c(e);break;case"ArrowRight":{const n=u.indexOf(e.currentTarget)+1;t=u[n]??u[0];break}case"ArrowLeft":{const n=u.indexOf(e.currentTarget)-1;t=u[n]??u[u.length-1];break}}t?.focus()};return(0,v.jsx)("ul",{role:"tablist","aria-orientation":"horizontal",className:(0,o.A)("tabs",{"tabs--block":n},t),children:l.map((e=>{let{value:t,label:n,attributes:a}=e;return(0,v.jsx)("li",{role:"tab",tabIndex:r===t?0:-1,"aria-selected":r===t,ref:e=>u.push(e),onKeyDown:d,onClick:c,...a,className:(0,o.A)("tabs__item",b.tabItem,a?.className,{"tabs__item--active":r===t}),children:n??t},t)}))})}function y(e){let{lazy:t,children:n,selectedValue:o}=e;const a=(Array.isArray(n)?n:[n]).filter(Boolean);if(t){const e=a.find((e=>e.props.value===o));return e?(0,r.cloneElement)(e,{className:"margin-top--md"}):null}return(0,v.jsx)("div",{className:"margin-top--md",children:a.map(((e,t)=>(0,r.cloneElement)(e,{key:t,hidden:e.props.value!==o})))})}function j(e){const t=f(e);return(0,v.jsxs)("div",{className:(0,o.A)("tabs-container",b.tabList),children:[(0,v.jsx)(x,{...e,...t}),(0,v.jsx)(y,{...e,...t})]})}function w(e){const t=(0,g.A)();return(0,v.jsx)(j,{...e,children:d(e.children)},String(t))}},8453:(e,t,n)=>{n.d(t,{R:()=>s,x:()=>l});var r=n(6540);const o={},a=r.createContext(o);function s(e){const t=r.useContext(a);return r.useMemo((function(){return"function"==typeof e?e(t):{...t,...e}}),[t,e])}function l(e){let t;return t=e.disableParentContext?"function"==typeof e.components?e.components(o):e.components||o:s(e.components),r.createElement(a.Provider,{value:t},e.children)}}}]); \ No newline at end of file diff --git a/assets/js/3fa420c0.5b86c265.js b/assets/js/3fa420c0.5b86c265.js deleted file mode 100644 index da9b505f..00000000 --- a/assets/js/3fa420c0.5b86c265.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunkdocs=self.webpackChunkdocs||[]).push([[144],{1493:(e,t,n)=>{n.r(t),n.d(t,{assets:()=>u,contentTitle:()=>s,default:()=>d,frontMatter:()=>a,metadata:()=>l,toc:()=>i});var r=n(4848),o=n(8453);n(1470),n(9365);const a={},s="Query",l={id:"configuration/query",title:"Query",description:"Queries are defined as Protobuf RPCs annotated with the temporal.v1.query method option. They're mapped to workflows using the query workflow option. See the Queries guide for more usage details.",source:"@site/docs/configuration/query.mdx",sourceDirName:"configuration",slug:"/configuration/query",permalink:"/docs/configuration/query",draft:!1,unlisted:!1,editUrl:"https://github.com/facebook/docusaurus/tree/main/packages/create-docusaurus/templates/shared/docs/configuration/query.mdx",tags:[],version:"current",frontMatter:{},sidebar:"docs",previous:{title:"Activity",permalink:"/docs/configuration/activity"},next:{title:"Signal",permalink:"/docs/configuration/signal"}},u={},i=[{value:"Options",id:"options",level:2},{value:"name",id:"name",level:3},{value:"xns",id:"xns",level:3}];function c(e){const t={a:"a",admonition:"admonition",code:"code",h1:"h1",h2:"h2",h3:"h3",p:"p",pre:"pre",...(0,o.R)(),...e.components};return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(t.h1,{id:"query",children:"Query"}),"\n",(0,r.jsxs)(t.p,{children:[(0,r.jsx)(t.a,{href:"https://docs.temporal.io/workflows#query",children:"Queries"})," are defined as Protobuf RPCs annotated with the ",(0,r.jsx)(t.code,{children:"temporal.v1.query"})," method option. They're mapped to workflows using the ",(0,r.jsx)(t.a,{href:"/docs/configuration/workflow#query",children:"query workflow option"}),". See the ",(0,r.jsx)(t.a,{href:"/docs/guides/queries",children:"Queries guide"})," for more usage details."]}),"\n",(0,r.jsx)(t.admonition,{type:"warning",children:(0,r.jsxs)(t.p,{children:["Query definitions must specify a non-empty output parameter. Query definitions can omit an input parameter by specifying the native ",(0,r.jsx)(t.code,{children:"google.protobuf.Empty"})," message type in its place. This requires an additional ",(0,r.jsx)(t.code,{children:"google/protobuf/empty.proto"})," protobuf import."]})}),"\n",(0,r.jsx)(t.pre,{children:(0,r.jsx)(t.code,{className:"language-protobuf",metastring:'title="example.proto"',children:'syntax="proto3";\n\npackage example.v1;\n\nimport "temporal/v1/temporal.proto";\n\nservice Example {\n // Hello returns a friendly greeting\n rpc Hello(HelloInput) returns (HelloOutput) {\n option (temporal.v1.workflow) = {\n query: { ref: \'GetHelloStatus\' }\n };\n }\n\n // GetHelloStatus retrieves the status of an existing Hello workflow\n rpc GetHelloStatus(GetHelloStatusInput) returns (GetHelloStatusOutput) {\n option (temporal.v1.query) = {};\n }\n}\n'})}),"\n",(0,r.jsx)(t.h2,{id:"options",children:"Options"}),"\n",(0,r.jsx)(t.h3,{id:"name",children:"name"}),"\n",(0,r.jsx)(t.p,{children:(0,r.jsx)(t.code,{children:"string"})}),"\n",(0,r.jsxs)(t.p,{children:["Fully qualified ",(0,r.jsx)(t.a,{href:"https://docs.temporal.io/workflows#query",children:"Query type name"}),". Defaults to protobuf method full name (e.g. ",(0,r.jsx)(t.code,{children:"example.v1.Example.GetHelloStatus"}),")"]}),"\n",(0,r.jsx)(t.pre,{children:(0,r.jsx)(t.code,{className:"language-protobuf",children:'service Example {\n rpc GetHelloStatus(GetHelloStatusInput) returns (GetHelloStatusOutput) {\n option (temporal.v1.query) = {\n name: "GetHelloStatus"\n };\n }\n}\n'})}),"\n",(0,r.jsx)(t.h3,{id:"xns",children:"xns"}),"\n",(0,r.jsx)(t.p,{children:(0,r.jsx)(t.a,{href:"https://buf.build/cludden/protoc-gen-go-temporal/docs/main:temporal.v1#temporal.v1.XNSActivityOptions",children:"temporal.v1.XNSActivityOptions"})}),"\n",(0,r.jsxs)(t.p,{children:["Used to configure ",(0,r.jsx)(t.a,{href:"/docs/guides/xns",children:"cross-namespace"})," activity options."]}),"\n",(0,r.jsx)(t.admonition,{type:"note",children:(0,r.jsxs)(t.p,{children:["This requires the ",(0,r.jsx)(t.a,{href:"/docs/configuration/plugin",children:"enable-xns"})," plugin option to be enabled."]})}),"\n",(0,r.jsx)(t.pre,{children:(0,r.jsx)(t.code,{className:"language-protobuf",children:"service Example {\n rpc GetHelloStatus(GetHelloStatusInput) returns (GetHelloStatusOutput) {\n option (temporal.v1.query) = {\n xns: {\n heartbeat_timeout: { seconds: 30 }\n heartbeat_interval: { seconds: 10 }\n start_to_close_timeout: { seconds: 300 }\n }\n };\n }\n}\n"})})]})}function d(e={}){const{wrapper:t}={...(0,o.R)(),...e.components};return t?(0,r.jsx)(t,{...e,children:(0,r.jsx)(c,{...e})}):c(e)}},9365:(e,t,n)=>{n.d(t,{A:()=>s});n(6540);var r=n(4164);const o={tabItem:"tabItem_Ymn6"};var a=n(4848);function s(e){let{children:t,hidden:n,className:s}=e;return(0,a.jsx)("div",{role:"tabpanel",className:(0,r.A)(o.tabItem,s),hidden:n,children:t})}},1470:(e,t,n)=>{n.d(t,{A:()=>w});var r=n(6540),o=n(4164),a=n(3104),s=n(6347),l=n(205),u=n(7485),i=n(1682),c=n(9466);function d(e){return r.Children.toArray(e).filter((e=>"\n"!==e)).map((e=>{if(!e||(0,r.isValidElement)(e)&&function(e){const{props:t}=e;return!!t&&"object"==typeof t&&"value"in t}(e))return e;throw new Error(`Docusaurus error: Bad child <${"string"==typeof e.type?e.type:e.type.name}>: all children of the component should be , and every should have a unique "value" prop.`)}))?.filter(Boolean)??[]}function p(e){const{values:t,children:n}=e;return(0,r.useMemo)((()=>{const e=t??function(e){return d(e).map((e=>{let{props:{value:t,label:n,attributes:r,default:o}}=e;return{value:t,label:n,attributes:r,default:o}}))}(n);return function(e){const t=(0,i.X)(e,((e,t)=>e.value===t.value));if(t.length>0)throw new Error(`Docusaurus error: Duplicate values "${t.map((e=>e.value)).join(", ")}" found in . Every value needs to be unique.`)}(e),e}),[t,n])}function h(e){let{value:t,tabValues:n}=e;return n.some((e=>e.value===t))}function f(e){let{queryString:t=!1,groupId:n}=e;const o=(0,s.W6)(),a=function(e){let{queryString:t=!1,groupId:n}=e;if("string"==typeof t)return t;if(!1===t)return null;if(!0===t&&!n)throw new Error('Docusaurus error: The component groupId prop is required if queryString=true, because this value is used as the search param name. You can also provide an explicit value such as queryString="my-search-param".');return n??null}({queryString:t,groupId:n});return[(0,u.aZ)(a),(0,r.useCallback)((e=>{if(!a)return;const t=new URLSearchParams(o.location.search);t.set(a,e),o.replace({...o.location,search:t.toString()})}),[a,o])]}function m(e){const{defaultValue:t,queryString:n=!1,groupId:o}=e,a=p(e),[s,u]=(0,r.useState)((()=>function(e){let{defaultValue:t,tabValues:n}=e;if(0===n.length)throw new Error("Docusaurus error: the component requires at least one children component");if(t){if(!h({value:t,tabValues:n}))throw new Error(`Docusaurus error: The has a defaultValue "${t}" but none of its children has the corresponding value. Available values are: ${n.map((e=>e.value)).join(", ")}. If you intend to show no default tab, use defaultValue={null} instead.`);return t}const r=n.find((e=>e.default))??n[0];if(!r)throw new Error("Unexpected error: 0 tabValues");return r.value}({defaultValue:t,tabValues:a}))),[i,d]=f({queryString:n,groupId:o}),[m,b]=function(e){let{groupId:t}=e;const n=function(e){return e?`docusaurus.tab.${e}`:null}(t),[o,a]=(0,c.Dv)(n);return[o,(0,r.useCallback)((e=>{n&&a.set(e)}),[n,a])]}({groupId:o}),g=(()=>{const e=i??m;return h({value:e,tabValues:a})?e:null})();(0,l.A)((()=>{g&&u(g)}),[g]);return{selectedValue:s,selectValue:(0,r.useCallback)((e=>{if(!h({value:e,tabValues:a}))throw new Error(`Can't select invalid tab value=${e}`);u(e),d(e),b(e)}),[d,b,a]),tabValues:a}}var b=n(2303);const g={tabList:"tabList__CuJ",tabItem:"tabItem_LNqP"};var v=n(4848);function x(e){let{className:t,block:n,selectedValue:r,selectValue:s,tabValues:l}=e;const u=[],{blockElementScrollPositionUntilNextRender:i}=(0,a.a_)(),c=e=>{const t=e.currentTarget,n=u.indexOf(t),o=l[n].value;o!==r&&(i(t),s(o))},d=e=>{let t=null;switch(e.key){case"Enter":c(e);break;case"ArrowRight":{const n=u.indexOf(e.currentTarget)+1;t=u[n]??u[0];break}case"ArrowLeft":{const n=u.indexOf(e.currentTarget)-1;t=u[n]??u[u.length-1];break}}t?.focus()};return(0,v.jsx)("ul",{role:"tablist","aria-orientation":"horizontal",className:(0,o.A)("tabs",{"tabs--block":n},t),children:l.map((e=>{let{value:t,label:n,attributes:a}=e;return(0,v.jsx)("li",{role:"tab",tabIndex:r===t?0:-1,"aria-selected":r===t,ref:e=>u.push(e),onKeyDown:d,onClick:c,...a,className:(0,o.A)("tabs__item",g.tabItem,a?.className,{"tabs__item--active":r===t}),children:n??t},t)}))})}function y(e){let{lazy:t,children:n,selectedValue:o}=e;const a=(Array.isArray(n)?n:[n]).filter(Boolean);if(t){const e=a.find((e=>e.props.value===o));return e?(0,r.cloneElement)(e,{className:"margin-top--md"}):null}return(0,v.jsx)("div",{className:"margin-top--md",children:a.map(((e,t)=>(0,r.cloneElement)(e,{key:t,hidden:e.props.value!==o})))})}function j(e){const t=m(e);return(0,v.jsxs)("div",{className:(0,o.A)("tabs-container",g.tabList),children:[(0,v.jsx)(x,{...e,...t}),(0,v.jsx)(y,{...e,...t})]})}function w(e){const t=(0,b.A)();return(0,v.jsx)(j,{...e,children:d(e.children)},String(t))}},8453:(e,t,n)=>{n.d(t,{R:()=>s,x:()=>l});var r=n(6540);const o={},a=r.createContext(o);function s(e){const t=r.useContext(a);return r.useMemo((function(){return"function"==typeof e?e(t):{...t,...e}}),[t,e])}function l(e){let t;return t=e.disableParentContext?"function"==typeof e.components?e.components(o):e.components||o:s(e.components),r.createElement(a.Provider,{value:t},e.children)}}}]); \ No newline at end of file diff --git a/assets/js/437149ac.0f69cc60.js b/assets/js/437149ac.0f69cc60.js new file mode 100644 index 00000000..6ef89352 --- /dev/null +++ b/assets/js/437149ac.0f69cc60.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunkdocs=self.webpackChunkdocs||[]).push([[8509],{7697:(e,t,r)=>{r.r(t),r.d(t,{assets:()=>u,contentTitle:()=>s,default:()=>d,frontMatter:()=>o,metadata:()=>l,toc:()=>i});var n=r(4848),a=r(8453);r(1470),r(9365);const o={},s="Child Workflows",l={id:"guides/child-workflows",title:"Child Workflows",description:"Coming Soon...",source:"@site/docs/guides/child-workflows.mdx",sourceDirName:"guides",slug:"/guides/child-workflows",permalink:"/protoc-gen-go-temporal/docs/guides/child-workflows",draft:!1,unlisted:!1,editUrl:"https://github.com/facebook/docusaurus/tree/main/packages/create-docusaurus/templates/shared/docs/guides/child-workflows.mdx",tags:[],version:"current",frontMatter:{},sidebar:"docs",previous:{title:"CLI",permalink:"/protoc-gen-go-temporal/docs/guides/cli"},next:{title:"Cross Namespace (xns)",permalink:"/protoc-gen-go-temporal/docs/guides/xns"}},u={},i=[];function c(e){const t={h1:"h1",p:"p",strong:"strong",...(0,a.R)(),...e.components};return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(t.h1,{id:"child-workflows",children:"Child Workflows"}),"\n",(0,n.jsx)(t.p,{children:(0,n.jsx)(t.strong,{children:"Coming Soon..."})})]})}function d(e={}){const{wrapper:t}={...(0,a.R)(),...e.components};return t?(0,n.jsx)(t,{...e,children:(0,n.jsx)(c,{...e})}):c(e)}},9365:(e,t,r)=>{r.d(t,{A:()=>s});r(6540);var n=r(4164);const a={tabItem:"tabItem_Ymn6"};var o=r(4848);function s(e){let{children:t,hidden:r,className:s}=e;return(0,o.jsx)("div",{role:"tabpanel",className:(0,n.A)(a.tabItem,s),hidden:r,children:t})}},1470:(e,t,r)=>{r.d(t,{A:()=>y});var n=r(6540),a=r(4164),o=r(3104),s=r(6347),l=r(205),u=r(7485),i=r(1682),c=r(9466);function d(e){return n.Children.toArray(e).filter((e=>"\n"!==e)).map((e=>{if(!e||(0,n.isValidElement)(e)&&function(e){const{props:t}=e;return!!t&&"object"==typeof t&&"value"in t}(e))return e;throw new Error(`Docusaurus error: Bad child <${"string"==typeof e.type?e.type:e.type.name}>: all children of the component should be , and every should have a unique "value" prop.`)}))?.filter(Boolean)??[]}function f(e){const{values:t,children:r}=e;return(0,n.useMemo)((()=>{const e=t??function(e){return d(e).map((e=>{let{props:{value:t,label:r,attributes:n,default:a}}=e;return{value:t,label:r,attributes:n,default:a}}))}(r);return function(e){const t=(0,i.X)(e,((e,t)=>e.value===t.value));if(t.length>0)throw new Error(`Docusaurus error: Duplicate values "${t.map((e=>e.value)).join(", ")}" found in . Every value needs to be unique.`)}(e),e}),[t,r])}function p(e){let{value:t,tabValues:r}=e;return r.some((e=>e.value===t))}function h(e){let{queryString:t=!1,groupId:r}=e;const a=(0,s.W6)(),o=function(e){let{queryString:t=!1,groupId:r}=e;if("string"==typeof t)return t;if(!1===t)return null;if(!0===t&&!r)throw new Error('Docusaurus error: The component groupId prop is required if queryString=true, because this value is used as the search param name. You can also provide an explicit value such as queryString="my-search-param".');return r??null}({queryString:t,groupId:r});return[(0,u.aZ)(o),(0,n.useCallback)((e=>{if(!o)return;const t=new URLSearchParams(a.location.search);t.set(o,e),a.replace({...a.location,search:t.toString()})}),[o,a])]}function m(e){const{defaultValue:t,queryString:r=!1,groupId:a}=e,o=f(e),[s,u]=(0,n.useState)((()=>function(e){let{defaultValue:t,tabValues:r}=e;if(0===r.length)throw new Error("Docusaurus error: the component requires at least one children component");if(t){if(!p({value:t,tabValues:r}))throw new Error(`Docusaurus error: The has a defaultValue "${t}" but none of its children has the corresponding value. Available values are: ${r.map((e=>e.value)).join(", ")}. If you intend to show no default tab, use defaultValue={null} instead.`);return t}const n=r.find((e=>e.default))??r[0];if(!n)throw new Error("Unexpected error: 0 tabValues");return n.value}({defaultValue:t,tabValues:o}))),[i,d]=h({queryString:r,groupId:a}),[m,b]=function(e){let{groupId:t}=e;const r=function(e){return e?`docusaurus.tab.${e}`:null}(t),[a,o]=(0,c.Dv)(r);return[a,(0,n.useCallback)((e=>{r&&o.set(e)}),[r,o])]}({groupId:a}),g=(()=>{const e=i??m;return p({value:e,tabValues:o})?e:null})();(0,l.A)((()=>{g&&u(g)}),[g]);return{selectedValue:s,selectValue:(0,n.useCallback)((e=>{if(!p({value:e,tabValues:o}))throw new Error(`Can't select invalid tab value=${e}`);u(e),d(e),b(e)}),[d,b,o]),tabValues:o}}var b=r(2303);const g={tabList:"tabList__CuJ",tabItem:"tabItem_LNqP"};var v=r(4848);function w(e){let{className:t,block:r,selectedValue:n,selectValue:s,tabValues:l}=e;const u=[],{blockElementScrollPositionUntilNextRender:i}=(0,o.a_)(),c=e=>{const t=e.currentTarget,r=u.indexOf(t),a=l[r].value;a!==n&&(i(t),s(a))},d=e=>{let t=null;switch(e.key){case"Enter":c(e);break;case"ArrowRight":{const r=u.indexOf(e.currentTarget)+1;t=u[r]??u[0];break}case"ArrowLeft":{const r=u.indexOf(e.currentTarget)-1;t=u[r]??u[u.length-1];break}}t?.focus()};return(0,v.jsx)("ul",{role:"tablist","aria-orientation":"horizontal",className:(0,a.A)("tabs",{"tabs--block":r},t),children:l.map((e=>{let{value:t,label:r,attributes:o}=e;return(0,v.jsx)("li",{role:"tab",tabIndex:n===t?0:-1,"aria-selected":n===t,ref:e=>u.push(e),onKeyDown:d,onClick:c,...o,className:(0,a.A)("tabs__item",g.tabItem,o?.className,{"tabs__item--active":n===t}),children:r??t},t)}))})}function k(e){let{lazy:t,children:r,selectedValue:a}=e;const o=(Array.isArray(r)?r:[r]).filter(Boolean);if(t){const e=o.find((e=>e.props.value===a));return e?(0,n.cloneElement)(e,{className:"margin-top--md"}):null}return(0,v.jsx)("div",{className:"margin-top--md",children:o.map(((e,t)=>(0,n.cloneElement)(e,{key:t,hidden:e.props.value!==a})))})}function x(e){const t=m(e);return(0,v.jsxs)("div",{className:(0,a.A)("tabs-container",g.tabList),children:[(0,v.jsx)(w,{...e,...t}),(0,v.jsx)(k,{...e,...t})]})}function y(e){const t=(0,b.A)();return(0,v.jsx)(x,{...e,children:d(e.children)},String(t))}},8453:(e,t,r)=>{r.d(t,{R:()=>s,x:()=>l});var n=r(6540);const a={},o=n.createContext(a);function s(e){const t=n.useContext(o);return n.useMemo((function(){return"function"==typeof e?e(t):{...t,...e}}),[t,e])}function l(e){let t;return t=e.disableParentContext?"function"==typeof e.components?e.components(a):e.components||a:s(e.components),n.createElement(o.Provider,{value:t},e.children)}}}]); \ No newline at end of file diff --git a/assets/js/437149ac.5fb56165.js b/assets/js/437149ac.5fb56165.js deleted file mode 100644 index 0f6e2d3b..00000000 --- a/assets/js/437149ac.5fb56165.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunkdocs=self.webpackChunkdocs||[]).push([[8509],{7697:(e,t,r)=>{r.r(t),r.d(t,{assets:()=>l,contentTitle:()=>s,default:()=>d,frontMatter:()=>o,metadata:()=>u,toc:()=>i});var n=r(4848),a=r(8453);r(1470),r(9365);const o={},s="Child Workflows",u={id:"guides/child-workflows",title:"Child Workflows",description:"Coming Soon...",source:"@site/docs/guides/child-workflows.mdx",sourceDirName:"guides",slug:"/guides/child-workflows",permalink:"/docs/guides/child-workflows",draft:!1,unlisted:!1,editUrl:"https://github.com/facebook/docusaurus/tree/main/packages/create-docusaurus/templates/shared/docs/guides/child-workflows.mdx",tags:[],version:"current",frontMatter:{},sidebar:"docs",previous:{title:"CLI",permalink:"/docs/guides/cli"},next:{title:"Cross Namespace (xns)",permalink:"/docs/guides/xns"}},l={},i=[];function c(e){const t={h1:"h1",p:"p",strong:"strong",...(0,a.R)(),...e.components};return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(t.h1,{id:"child-workflows",children:"Child Workflows"}),"\n",(0,n.jsx)(t.p,{children:(0,n.jsx)(t.strong,{children:"Coming Soon..."})})]})}function d(e={}){const{wrapper:t}={...(0,a.R)(),...e.components};return t?(0,n.jsx)(t,{...e,children:(0,n.jsx)(c,{...e})}):c(e)}},9365:(e,t,r)=>{r.d(t,{A:()=>s});r(6540);var n=r(4164);const a={tabItem:"tabItem_Ymn6"};var o=r(4848);function s(e){let{children:t,hidden:r,className:s}=e;return(0,o.jsx)("div",{role:"tabpanel",className:(0,n.A)(a.tabItem,s),hidden:r,children:t})}},1470:(e,t,r)=>{r.d(t,{A:()=>y});var n=r(6540),a=r(4164),o=r(3104),s=r(6347),u=r(205),l=r(7485),i=r(1682),c=r(9466);function d(e){return n.Children.toArray(e).filter((e=>"\n"!==e)).map((e=>{if(!e||(0,n.isValidElement)(e)&&function(e){const{props:t}=e;return!!t&&"object"==typeof t&&"value"in t}(e))return e;throw new Error(`Docusaurus error: Bad child <${"string"==typeof e.type?e.type:e.type.name}>: all children of the component should be , and every should have a unique "value" prop.`)}))?.filter(Boolean)??[]}function f(e){const{values:t,children:r}=e;return(0,n.useMemo)((()=>{const e=t??function(e){return d(e).map((e=>{let{props:{value:t,label:r,attributes:n,default:a}}=e;return{value:t,label:r,attributes:n,default:a}}))}(r);return function(e){const t=(0,i.X)(e,((e,t)=>e.value===t.value));if(t.length>0)throw new Error(`Docusaurus error: Duplicate values "${t.map((e=>e.value)).join(", ")}" found in . Every value needs to be unique.`)}(e),e}),[t,r])}function h(e){let{value:t,tabValues:r}=e;return r.some((e=>e.value===t))}function p(e){let{queryString:t=!1,groupId:r}=e;const a=(0,s.W6)(),o=function(e){let{queryString:t=!1,groupId:r}=e;if("string"==typeof t)return t;if(!1===t)return null;if(!0===t&&!r)throw new Error('Docusaurus error: The component groupId prop is required if queryString=true, because this value is used as the search param name. You can also provide an explicit value such as queryString="my-search-param".');return r??null}({queryString:t,groupId:r});return[(0,l.aZ)(o),(0,n.useCallback)((e=>{if(!o)return;const t=new URLSearchParams(a.location.search);t.set(o,e),a.replace({...a.location,search:t.toString()})}),[o,a])]}function m(e){const{defaultValue:t,queryString:r=!1,groupId:a}=e,o=f(e),[s,l]=(0,n.useState)((()=>function(e){let{defaultValue:t,tabValues:r}=e;if(0===r.length)throw new Error("Docusaurus error: the component requires at least one children component");if(t){if(!h({value:t,tabValues:r}))throw new Error(`Docusaurus error: The has a defaultValue "${t}" but none of its children has the corresponding value. Available values are: ${r.map((e=>e.value)).join(", ")}. If you intend to show no default tab, use defaultValue={null} instead.`);return t}const n=r.find((e=>e.default))??r[0];if(!n)throw new Error("Unexpected error: 0 tabValues");return n.value}({defaultValue:t,tabValues:o}))),[i,d]=p({queryString:r,groupId:a}),[m,b]=function(e){let{groupId:t}=e;const r=function(e){return e?`docusaurus.tab.${e}`:null}(t),[a,o]=(0,c.Dv)(r);return[a,(0,n.useCallback)((e=>{r&&o.set(e)}),[r,o])]}({groupId:a}),v=(()=>{const e=i??m;return h({value:e,tabValues:o})?e:null})();(0,u.A)((()=>{v&&l(v)}),[v]);return{selectedValue:s,selectValue:(0,n.useCallback)((e=>{if(!h({value:e,tabValues:o}))throw new Error(`Can't select invalid tab value=${e}`);l(e),d(e),b(e)}),[d,b,o]),tabValues:o}}var b=r(2303);const v={tabList:"tabList__CuJ",tabItem:"tabItem_LNqP"};var g=r(4848);function w(e){let{className:t,block:r,selectedValue:n,selectValue:s,tabValues:u}=e;const l=[],{blockElementScrollPositionUntilNextRender:i}=(0,o.a_)(),c=e=>{const t=e.currentTarget,r=l.indexOf(t),a=u[r].value;a!==n&&(i(t),s(a))},d=e=>{let t=null;switch(e.key){case"Enter":c(e);break;case"ArrowRight":{const r=l.indexOf(e.currentTarget)+1;t=l[r]??l[0];break}case"ArrowLeft":{const r=l.indexOf(e.currentTarget)-1;t=l[r]??l[l.length-1];break}}t?.focus()};return(0,g.jsx)("ul",{role:"tablist","aria-orientation":"horizontal",className:(0,a.A)("tabs",{"tabs--block":r},t),children:u.map((e=>{let{value:t,label:r,attributes:o}=e;return(0,g.jsx)("li",{role:"tab",tabIndex:n===t?0:-1,"aria-selected":n===t,ref:e=>l.push(e),onKeyDown:d,onClick:c,...o,className:(0,a.A)("tabs__item",v.tabItem,o?.className,{"tabs__item--active":n===t}),children:r??t},t)}))})}function k(e){let{lazy:t,children:r,selectedValue:a}=e;const o=(Array.isArray(r)?r:[r]).filter(Boolean);if(t){const e=o.find((e=>e.props.value===a));return e?(0,n.cloneElement)(e,{className:"margin-top--md"}):null}return(0,g.jsx)("div",{className:"margin-top--md",children:o.map(((e,t)=>(0,n.cloneElement)(e,{key:t,hidden:e.props.value!==a})))})}function x(e){const t=m(e);return(0,g.jsxs)("div",{className:(0,a.A)("tabs-container",v.tabList),children:[(0,g.jsx)(w,{...e,...t}),(0,g.jsx)(k,{...e,...t})]})}function y(e){const t=(0,b.A)();return(0,g.jsx)(x,{...e,children:d(e.children)},String(t))}},8453:(e,t,r)=>{r.d(t,{R:()=>s,x:()=>u});var n=r(6540);const a={},o=n.createContext(a);function s(e){const t=n.useContext(o);return n.useMemo((function(){return"function"==typeof e?e(t):{...t,...e}}),[t,e])}function u(e){let t;return t=e.disableParentContext?"function"==typeof e.components?e.components(a):e.components||a:s(e.components),n.createElement(o.Provider,{value:t},e.children)}}}]); \ No newline at end of file diff --git a/assets/js/474a3cec.1ebbdffb.js b/assets/js/474a3cec.1ebbdffb.js new file mode 100644 index 00000000..1b487c3d --- /dev/null +++ b/assets/js/474a3cec.1ebbdffb.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunkdocs=self.webpackChunkdocs||[]).push([[8599],{8016:o=>{o.exports=JSON.parse('{"permalink":"/protoc-gen-go-temporal/blog/tags/facebook","page":1,"postsPerPage":10,"totalPages":1,"totalCount":1,"blogDescription":"Blog","blogTitle":"Blog"}')}}]); \ No newline at end of file diff --git a/assets/js/4c9e35b1.9e712b60.js b/assets/js/4c9e35b1.9e712b60.js deleted file mode 100644 index a5efecc1..00000000 --- a/assets/js/4c9e35b1.9e712b60.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunkdocs=self.webpackChunkdocs||[]).push([[2161],{4722:e=>{e.exports=JSON.parse('{"permalink":"/blog/tags/hola","page":1,"postsPerPage":10,"totalPages":1,"totalCount":1,"blogDescription":"Blog","blogTitle":"Blog"}')}}]); \ No newline at end of file diff --git a/assets/js/53df995c.26a01b8c.js b/assets/js/53df995c.26a01b8c.js deleted file mode 100644 index bb639d6e..00000000 --- a/assets/js/53df995c.26a01b8c.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunkdocs=self.webpackChunkdocs||[]).push([[8507],{3818:(e,o,n)=>{n.r(o),n.d(o,{assets:()=>s,contentTitle:()=>a,default:()=>d,frontMatter:()=>l,metadata:()=>i,toc:()=>c});var r=n(4848),t=n(8453);n(1470),n(9365);const l={},a="Workflow",i={id:"configuration/workflow",title:"Workflow",description:"Workflows are defined as Protobuf RPCs annotated with the temporal.v1.workflow method option. See the Workflows guide for more usage details.",source:"@site/docs/configuration/workflow.mdx",sourceDirName:"configuration",slug:"/configuration/workflow",permalink:"/docs/configuration/workflow",draft:!1,unlisted:!1,editUrl:"https://github.com/facebook/docusaurus/tree/main/packages/create-docusaurus/templates/shared/docs/configuration/workflow.mdx",tags:[],version:"current",frontMatter:{},sidebar:"docs",previous:{title:"Service",permalink:"/docs/configuration/service"},next:{title:"Activity",permalink:"/docs/configuration/activity"}},s={},c=[{value:"Options",id:"options",level:2},{value:"execution_timeout",id:"execution_timeout",level:3},{value:"id",id:"id",level:3},{value:"id_reuse_policy",id:"id_reuse_policy",level:3},{value:"name",id:"name",level:3},{value:"parent_close_policy",id:"parent_close_policy",level:3},{value:"query",id:"query",level:3},{value:"retry_policy",id:"retry_policy",level:3},{value:"run_timeout",id:"run_timeout",level:3},{value:"search_attributes",id:"search_attributes",level:3},{value:"signal",id:"signal",level:3},{value:"task_queue",id:"task_queue",level:3},{value:"task_timeout",id:"task_timeout",level:3},{value:"update",id:"update",level:3},{value:"xns",id:"xns",level:3},{value:"wait_for_cancellation",id:"wait_for_cancellation",level:3}];function u(e){const o={a:"a",admonition:"admonition",code:"code",h1:"h1",h2:"h2",h3:"h3",p:"p",pre:"pre",...(0,t.R)(),...e.components};return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(o.h1,{id:"workflow",children:"Workflow"}),"\n",(0,r.jsxs)(o.p,{children:[(0,r.jsx)(o.a,{href:"https://docs.temporal.io/workflows",children:"Workflows"})," are defined as Protobuf RPCs annotated with the ",(0,r.jsx)(o.code,{children:"temporal.v1.workflow"})," method option. See the ",(0,r.jsx)(o.a,{href:"/docs/guides/workflows",children:"Workflows guide"})," for more usage details."]}),"\n",(0,r.jsx)(o.admonition,{type:"info",children:(0,r.jsxs)(o.p,{children:["Workflow definitions can omit an input and/or out parameter by specifying the native ",(0,r.jsx)(o.code,{children:"google.protobuf.Empty"})," message type in its place. This requires an additional ",(0,r.jsx)(o.code,{children:"google/protobuf/empty.proto"})," protobuf import."]})}),"\n",(0,r.jsx)(o.pre,{children:(0,r.jsx)(o.code,{className:"language-protobuf",metastring:'title="example.proto"',children:'syntax="proto3";\n\npackage example.v1;\n\nimport "temporal/v1/temporal.proto";\n\nservice Example {\n // Hello returns a friendly greeting\n rpc Hello(HelloInput) returns (HelloOutput) {\n option (temporal.v1.workflow) = {};\n }\n}\n'})}),"\n",(0,r.jsx)(o.h2,{id:"options",children:"Options"}),"\n",(0,r.jsx)(o.h3,{id:"execution_timeout",children:"execution_timeout"}),"\n",(0,r.jsx)(o.p,{children:(0,r.jsx)(o.a,{href:"https://protobuf.dev/reference/protobuf/google.protobuf/#duration",children:"google.protobuf.Duration"})}),"\n",(0,r.jsxs)(o.p,{children:["The timeout for duration of ",(0,r.jsx)(o.a,{href:"https://docs.temporal.io/workflows#time-constraints",children:"Workflow execution"}),". It includes retries and continue as new. Use ",(0,r.jsx)(o.a,{href:"#run_timeout",children:"run_timeout"})," to limit execution time of a single workflow run. Defaults to unlimited."]}),"\n",(0,r.jsx)(o.pre,{children:(0,r.jsx)(o.code,{className:"language-protobuf",children:"service Example {\n rpc Hello(HelloInput) returns (HelloOutput) {\n option (temporal.v1.workflow) = {\n execution_timeout: { seconds: 3600 } // 1h\n };\n }\n}\n"})}),"\n",(0,r.jsx)(o.h3,{id:"id",children:"id"}),"\n",(0,r.jsx)(o.p,{children:(0,r.jsx)(o.code,{children:"string"})}),"\n",(0,r.jsxs)(o.p,{children:["Specifies the default ",(0,r.jsx)(o.a,{href:"https://docs.temporal.io/workflows#workflow-id",children:"Workflow ID"})," as a ",(0,r.jsx)(o.a,{href:"/docs/guides/bloblang",children:"Bloblang expression"}),"."]}),"\n",(0,r.jsx)(o.pre,{children:(0,r.jsx)(o.code,{className:"language-protobuf",children:"service Example {\n rpc Hello(HelloInput) returns (HelloOutput) {\n option (temporal.v1.workflow) = {\n id: 'hello/${! name }/${! uuid_v4() }'\n };\n }\n}\n\nmessage HelloInput {\n string name = 1;\n}\n"})}),"\n",(0,r.jsx)(o.h3,{id:"id_reuse_policy",children:"id_reuse_policy"}),"\n",(0,r.jsx)(o.p,{children:(0,r.jsx)(o.a,{href:"https://buf.build/cludden/protoc-gen-go-temporal/docs/main:temporal.v1#temporal.v1.IDReusePolicy",children:"temporal.v1.IDReusePolicy"})}),"\n",(0,r.jsxs)(o.p,{children:["Whether server allow reuse of workflow ID, can be useful for dedupe logic if set to ",(0,r.jsx)(o.code,{children:"WORKFLOW_ID_REUSE_POLICY_REJECT_DUPLICATE"}),". Defaults to ",(0,r.jsx)(o.code,{children:"WORKFLOW_ID_REUSE_POLICY_ALLOW_DUPLICATE"}),". See ",(0,r.jsx)(o.a,{href:"https://docs.temporal.io/workflows#workflow-id-reuse-policy",children:"docs"})," for more details."]}),"\n",(0,r.jsx)(o.pre,{children:(0,r.jsx)(o.code,{className:"language-protobuf",children:"service Example {\n rpc Hello(HelloInput) returns (HelloOutput) {\n option (temporal.v1.workflow) = {\n id_reuse_policy: WORKFLOW_ID_REUSE_POLICY_ALLOW_DUPLICATE\n };\n }\n}\n"})}),"\n",(0,r.jsx)(o.h3,{id:"name",children:"name"}),"\n",(0,r.jsx)(o.p,{children:(0,r.jsx)(o.code,{children:"string"})}),"\n",(0,r.jsxs)(o.p,{children:["Fully qualified ",(0,r.jsx)(o.a,{href:"https://docs.temporal.io/workflows#workflow-type",children:"Workflow type name"}),". Defaults to protobuf method full name (e.g. ",(0,r.jsx)(o.code,{children:"example.v1.Example.Hello"}),")"]}),"\n",(0,r.jsx)(o.pre,{children:(0,r.jsx)(o.code,{className:"language-protobuf",children:'service Example {\n rpc Hello(HelloInput) returns (HelloOutput) {\n option (temporal.v1.workflow) = {\n name: "Hello"\n };\n }\n}\n'})}),"\n",(0,r.jsx)(o.h3,{id:"parent_close_policy",children:"parent_close_policy"}),"\n",(0,r.jsx)(o.p,{children:(0,r.jsx)(o.a,{href:"https://buf.build/cludden/protoc-gen-go-temporal/docs/main:temporal.v1#temporal.v1.ParentClosePolicy",children:"temporal.v1.ParentClosePolicy"})}),"\n",(0,r.jsxs)(o.p,{children:["When execution as a child workflow, this ",(0,r.jsx)(o.a,{href:"https://docs.temporal.io/workflows#parent-close-policy",children:"optional policy"})," determines what to do when the parent workflow is closed. Default to ",(0,r.jsx)(o.code,{children:"PARENT_CLOSE_POLICY_TERMINATE"}),"."]}),"\n",(0,r.jsx)(o.pre,{children:(0,r.jsx)(o.code,{className:"language-protobuf",children:"service Example {\n rpc Hello(HelloInput) returns (HelloOutput) {\n option (temporal.v1.workflow) = {\n parent_close_policy: PARENT_CLOSE_POLICY_REQUEST_CANCEL\n };\n }\n}\n"})}),"\n",(0,r.jsx)(o.h3,{id:"query",children:"query"}),"\n",(0,r.jsx)(o.p,{children:(0,r.jsx)(o.a,{href:"https://buf.build/cludden/protoc-gen-go-temporal/docs/main:temporal.v1#temporal.v1.WorkflowOptions.Query",children:"temporal.v1.WorkflowOptions.Query"})}),"\n",(0,r.jsxs)(o.p,{children:["Identifies a ",(0,r.jsx)(o.a,{href:"https://docs.temporal.io/workflows#query",children:"query"})," supported by the workflow. Can be specified 0, 1, or more times. See the ",(0,r.jsx)(o.a,{href:"/docs/guides/queries",children:"query docs"})," for more details."]}),"\n",(0,r.jsx)(o.pre,{children:(0,r.jsx)(o.code,{className:"language-protobuf",children:"service Example {\n rpc Hello(HelloInput) returns (HelloOutput) {\n option (temporal.v1.workflow) = {\n query: { ref: 'SomeQuery1' }\n query: { ref: 'SomeQuery2' }\n query: {\n // can reference a query definition from another service\n ref: 'example.v2.Example.SomeQuery3'\n }\n };\n }\n\n rpc SomeQuery1(SomeQuery1Input) returns (SomeQuery1Output) {\n option (temporal.v1.query) = {};\n }\n\n rpc SomeQuery2(SomeQuery2Input) returns (SomeQuery2Output) {\n option (temporal.v1.query) = {};\n }\n}\n"})}),"\n",(0,r.jsx)(o.h3,{id:"retry_policy",children:"retry_policy"}),"\n",(0,r.jsx)(o.p,{children:(0,r.jsx)(o.a,{href:"https://buf.build/cludden/protoc-gen-go-temporal/docs/main:temporal.v1#temporal.v1.RetryPolicy",children:"temporal.v1.RetryPolicy"})}),"\n",(0,r.jsxs)(o.p,{children:["Optional ",(0,r.jsx)(o.a,{href:"https://docs.temporal.io/retry-policies",children:"retry policy"})," for workflow. If a retry policy is specified, in case of workflow failure server will start new workflow execution if needed based on the retry policy."]}),"\n",(0,r.jsx)(o.pre,{children:(0,r.jsx)(o.code,{className:"language-protobuf",children:'service Example {\n rpc Hello(HelloInput) returns (HelloOutput) {\n option (temporal.v1.workflow) = {\n retry_policy: {\n max_attempts: 10\n initial_interval: { seconds: 5 }\n max_interval: { seconds: 60 }\n backoff_coefficient: 2.0\n non_retryable_error_types: ["SomeError", "SomeOtherError"]\n }\n };\n }\n}\n'})}),"\n",(0,r.jsx)(o.h3,{id:"run_timeout",children:"run_timeout"}),"\n",(0,r.jsx)(o.p,{children:(0,r.jsx)(o.a,{href:"https://protobuf.dev/reference/protobuf/google.protobuf/#duration",children:"google.protobuf.Duration"})}),"\n",(0,r.jsxs)(o.p,{children:["The timeout for duration of ",(0,r.jsx)(o.a,{href:"https://docs.temporal.io/workflows#time-constraints",children:"a single workflow run"}),". Defaults to ",(0,r.jsx)(o.a,{href:"#execution_timeout",children:"execution_timeout"}),"."]}),"\n",(0,r.jsx)(o.pre,{children:(0,r.jsx)(o.code,{className:"language-protobuf",children:"service Example {\n rpc Hello(HelloInput) returns (HelloOutput) {\n option (temporal.v1.workflow) = {\n execution_timeout: { seconds: 300 } // 5m\n };\n }\n}\n"})}),"\n",(0,r.jsx)(o.h3,{id:"search_attributes",children:"search_attributes"}),"\n",(0,r.jsx)(o.p,{children:(0,r.jsx)(o.code,{children:"string"})}),"\n",(0,r.jsxs)(o.p,{children:["Specifies the default ",(0,r.jsx)(o.a,{href:"https://docs.temporal.io/visibility#search-attribute",children:"Workflow search attributes"})," as a ",(0,r.jsx)(o.a,{href:"https://www.benthos.dev/docs/guides/bloblang/about/",children:"Bloblang mapping"}),". See the ",(0,r.jsx)(o.a,{href:"/docs/examples/searchattributes/",children:"Search Attributes example"})," for more details."]}),"\n",(0,r.jsx)(o.pre,{children:(0,r.jsx)(o.code,{className:"language-protobuf",children:"service Example {\n rpc Hello(HelloInput) returns (HelloOutput) {\n option (temporal.v1.workflow) = {\n search_attributes:\n 'Name = name.or(\"World\") \\n'\n 'CreatedAt = now().ts_parse(\"2006-01-02T15:04:05Z\") \\n'\n };\n }\n}\n"})}),"\n",(0,r.jsx)(o.h3,{id:"signal",children:"signal"}),"\n",(0,r.jsx)(o.p,{children:(0,r.jsx)(o.a,{href:"https://buf.build/cludden/protoc-gen-go-temporal/docs/main:temporal.v1#temporal.v1.WorkflowOptions.Signal",children:"temporal.v1.WorkflowOptions.Signal"})}),"\n",(0,r.jsxs)(o.p,{children:["Identifies a ",(0,r.jsx)(o.a,{href:"https://docs.temporal.io/workflows#signal",children:"signal"})," supported by the workflow. Can be specified 0, 1, or more times. See the ",(0,r.jsx)(o.a,{href:"/docs/guides/signals",children:"signal docs"})," for more details."]}),"\n",(0,r.jsx)(o.pre,{children:(0,r.jsx)(o.code,{className:"language-protobuf",children:"service Example {\n rpc Hello(HelloInput) returns (HelloOutput) {\n option (temporal.v1.workflow) = {\n signal: { ref: 'SomeSignal1' }\n signal: {\n ref: 'SomeSignal2'\n start: true // generates signal with start helpers\n }\n signal: {\n // can reference a signal definition from another service\n ref: 'example.v2.Example.SomeSignal3'\n }\n };\n }\n\n rpc SomeSignal1(SomeSignal1Input) returns (google.protobuf.Empty) {\n option (temporal.v1.signal) = {};\n }\n\n rpc SomeSignal2(SomeSignal2Input) returns (google.protobuf.Empty) {\n option (temporal.v1.signal) = {};\n }\n}\n"})}),"\n",(0,r.jsx)(o.h3,{id:"task_queue",children:"task_queue"}),"\n",(0,r.jsx)(o.p,{children:(0,r.jsx)(o.code,{children:"string"})}),"\n",(0,r.jsxs)(o.p,{children:["Overrides the default task queue for a particular workflow type. Defaults to Service's ",(0,r.jsx)(o.code,{children:"task_queue"})," if specified."]}),"\n",(0,r.jsx)(o.pre,{children:(0,r.jsx)(o.code,{className:"language-protobuf",children:'service Example {\n rpc Hello(HelloInput) returns (HelloOutput) {\n option (temporal.v1.workflow) = {\n task_queue: "example-v2"\n };\n }\n}\n'})}),"\n",(0,r.jsx)(o.h3,{id:"task_timeout",children:"task_timeout"}),"\n",(0,r.jsx)(o.p,{children:(0,r.jsx)(o.a,{href:"https://protobuf.dev/reference/protobuf/google.protobuf/#duration",children:"google.protobuf.Duration"})}),"\n",(0,r.jsxs)(o.p,{children:["The timeout for processing ",(0,r.jsx)(o.a,{href:"https://docs.temporal.io/workflows#workflow-task-timeout",children:"workflow task"})," from the time the worker pulled this task. If a workflow task is lost, it is retried after this timeout. Defaults to ",(0,r.jsx)(o.code,{children:"10s"}),"."]}),"\n",(0,r.jsx)(o.pre,{children:(0,r.jsx)(o.code,{className:"language-protobuf",children:"service Example {\n rpc Hello(HelloInput) returns (HelloOutput) {\n option (temporal.v1.workflow) = {\n task_timeout: { seconds: 10 }\n };\n }\n}\n"})}),"\n",(0,r.jsx)(o.h3,{id:"update",children:"update"}),"\n",(0,r.jsx)(o.p,{children:(0,r.jsx)(o.a,{href:"https://buf.build/cludden/protoc-gen-go-temporal/docs/main:temporal.v1#temporal.v1.WorkflowOptions.Update",children:"temporal.v1.WorkflowOptions.Update"})}),"\n",(0,r.jsxs)(o.p,{children:["Identifies an ",(0,r.jsx)(o.a,{href:"https://docs.temporal.io/workflows#update",children:"update"})," supported by the workflow. Can be specified 0, 1, or more times. See the ",(0,r.jsx)(o.a,{href:"/docs/guides/updates",children:"update docs"})," for more details."]}),"\n",(0,r.jsx)(o.admonition,{type:"note",children:(0,r.jsxs)(o.p,{children:["This requires the ",(0,r.jsx)(o.a,{href:"/docs/configuration/plugin#workflow-update-enabled",children:"workflow-update-enabled"})," plugin option to be enabled."]})}),"\n",(0,r.jsx)(o.pre,{children:(0,r.jsx)(o.code,{className:"language-protobuf",children:"service Example {\n rpc Hello(HelloInput) returns (HelloOutput) {\n option (temporal.v1.workflow) = {\n update: { ref: 'SomeUpdate1' }\n update: { ref: 'SomeUpdate2' }\n update: {\n // can reference an update definition from another service\n ref: 'example.v2.Example.SomeUpdate3'\n }\n };\n }\n\n rpc SomeUpdate1(SomeUpdate1Input) returns (SomeUpdate1Output) {\n option (temporal.v1.update) = {};\n }\n\n rpc SomeUpdate2(SomeUpdate2Input) returns (SomeUpdate2Output) {\n option (temporal.v1.update) = {};\n }\n}\n"})}),"\n",(0,r.jsx)(o.h3,{id:"xns",children:"xns"}),"\n",(0,r.jsx)(o.p,{children:(0,r.jsx)(o.a,{href:"https://buf.build/cludden/protoc-gen-go-temporal/docs/main:temporal.v1#temporal.v1.XNSActivityOptions",children:"temporal.v1.XNSActivityOptions"})}),"\n",(0,r.jsxs)(o.p,{children:["Used to configure ",(0,r.jsx)(o.a,{href:"/docs/guides/xns",children:"cross-namespace"})," activity options."]}),"\n",(0,r.jsx)(o.admonition,{type:"note",children:(0,r.jsxs)(o.p,{children:["This requires the ",(0,r.jsx)(o.a,{href:"/docs/configuration/plugin#enable-xns",children:"enable-xns"})," plugin option to be enabled."]})}),"\n",(0,r.jsx)(o.pre,{children:(0,r.jsx)(o.code,{className:"language-protobuf",children:"service Example {\n rpc Hello(HelloInput) returns (HelloOutput) {\n option (temporal.v1.workflow) = {\n xns: {\n heartbeat_timeout: { seconds: 30 }\n heartbeat_interval: { seconds: 10 }\n start_to_close_timeout: { seconds: 300 }\n }\n };\n }\n}\n"})}),"\n",(0,r.jsx)(o.h3,{id:"wait_for_cancellation",children:"wait_for_cancellation"}),"\n",(0,r.jsx)(o.p,{children:(0,r.jsx)(o.code,{children:"bool"})}),"\n",(0,r.jsxs)(o.p,{children:["Whether to wait for canceled ",(0,r.jsx)(o.a,{href:"https://docs.temporal.io/workflows#child-workflow",children:"child workflow"})," to be ended (child workflow can be ended as: completed/failed/timedout/terminated/canceled). Defaults to ",(0,r.jsx)(o.code,{children:"false"}),"."]}),"\n",(0,r.jsx)(o.pre,{children:(0,r.jsx)(o.code,{className:"language-protobuf",children:"service Example {\n rpc Hello(HelloInput) returns (HelloOutput) {\n option (temporal.v1.workflow) = {\n wait_for_cancellation: false\n };\n }\n}\n"})})]})}function d(e={}){const{wrapper:o}={...(0,t.R)(),...e.components};return o?(0,r.jsx)(o,{...e,children:(0,r.jsx)(u,{...e})}):u(e)}},9365:(e,o,n)=>{n.d(o,{A:()=>a});n(6540);var r=n(4164);const t={tabItem:"tabItem_Ymn6"};var l=n(4848);function a(e){let{children:o,hidden:n,className:a}=e;return(0,l.jsx)("div",{role:"tabpanel",className:(0,r.A)(t.tabItem,a),hidden:n,children:o})}},1470:(e,o,n)=>{n.d(o,{A:()=>k});var r=n(6540),t=n(4164),l=n(3104),a=n(6347),i=n(205),s=n(7485),c=n(1682),u=n(9466);function d(e){return r.Children.toArray(e).filter((e=>"\n"!==e)).map((e=>{if(!e||(0,r.isValidElement)(e)&&function(e){const{props:o}=e;return!!o&&"object"==typeof o&&"value"in o}(e))return e;throw new Error(`Docusaurus error: Bad child <${"string"==typeof e.type?e.type:e.type.name}>: all children of the component should be , and every should have a unique "value" prop.`)}))?.filter(Boolean)??[]}function p(e){const{values:o,children:n}=e;return(0,r.useMemo)((()=>{const e=o??function(e){return d(e).map((e=>{let{props:{value:o,label:n,attributes:r,default:t}}=e;return{value:o,label:n,attributes:r,default:t}}))}(n);return function(e){const o=(0,c.X)(e,((e,o)=>e.value===o.value));if(o.length>0)throw new Error(`Docusaurus error: Duplicate values "${o.map((e=>e.value)).join(", ")}" found in . Every value needs to be unique.`)}(e),e}),[o,n])}function h(e){let{value:o,tabValues:n}=e;return n.some((e=>e.value===o))}function f(e){let{queryString:o=!1,groupId:n}=e;const t=(0,a.W6)(),l=function(e){let{queryString:o=!1,groupId:n}=e;if("string"==typeof o)return o;if(!1===o)return null;if(!0===o&&!n)throw new Error('Docusaurus error: The component groupId prop is required if queryString=true, because this value is used as the search param name. You can also provide an explicit value such as queryString="my-search-param".');return n??null}({queryString:o,groupId:n});return[(0,s.aZ)(l),(0,r.useCallback)((e=>{if(!l)return;const o=new URLSearchParams(t.location.search);o.set(l,e),t.replace({...t.location,search:o.toString()})}),[l,t])]}function m(e){const{defaultValue:o,queryString:n=!1,groupId:t}=e,l=p(e),[a,s]=(0,r.useState)((()=>function(e){let{defaultValue:o,tabValues:n}=e;if(0===n.length)throw new Error("Docusaurus error: the component requires at least one children component");if(o){if(!h({value:o,tabValues:n}))throw new Error(`Docusaurus error: The has a defaultValue "${o}" but none of its children has the corresponding value. Available values are: ${n.map((e=>e.value)).join(", ")}. If you intend to show no default tab, use defaultValue={null} instead.`);return o}const r=n.find((e=>e.default))??n[0];if(!r)throw new Error("Unexpected error: 0 tabValues");return r.value}({defaultValue:o,tabValues:l}))),[c,d]=f({queryString:n,groupId:t}),[m,x]=function(e){let{groupId:o}=e;const n=function(e){return e?`docusaurus.tab.${e}`:null}(o),[t,l]=(0,u.Dv)(n);return[t,(0,r.useCallback)((e=>{n&&l.set(e)}),[n,l])]}({groupId:t}),w=(()=>{const e=c??m;return h({value:e,tabValues:l})?e:null})();(0,i.A)((()=>{w&&s(w)}),[w]);return{selectedValue:a,selectValue:(0,r.useCallback)((e=>{if(!h({value:e,tabValues:l}))throw new Error(`Can't select invalid tab value=${e}`);s(e),d(e),x(e)}),[d,x,l]),tabValues:l}}var x=n(2303);const w={tabList:"tabList__CuJ",tabItem:"tabItem_LNqP"};var g=n(4848);function v(e){let{className:o,block:n,selectedValue:r,selectValue:a,tabValues:i}=e;const s=[],{blockElementScrollPositionUntilNextRender:c}=(0,l.a_)(),u=e=>{const o=e.currentTarget,n=s.indexOf(o),t=i[n].value;t!==r&&(c(o),a(t))},d=e=>{let o=null;switch(e.key){case"Enter":u(e);break;case"ArrowRight":{const n=s.indexOf(e.currentTarget)+1;o=s[n]??s[0];break}case"ArrowLeft":{const n=s.indexOf(e.currentTarget)-1;o=s[n]??s[s.length-1];break}}o?.focus()};return(0,g.jsx)("ul",{role:"tablist","aria-orientation":"horizontal",className:(0,t.A)("tabs",{"tabs--block":n},o),children:i.map((e=>{let{value:o,label:n,attributes:l}=e;return(0,g.jsx)("li",{role:"tab",tabIndex:r===o?0:-1,"aria-selected":r===o,ref:e=>s.push(e),onKeyDown:d,onClick:u,...l,className:(0,t.A)("tabs__item",w.tabItem,l?.className,{"tabs__item--active":r===o}),children:n??o},o)}))})}function b(e){let{lazy:o,children:n,selectedValue:t}=e;const l=(Array.isArray(n)?n:[n]).filter(Boolean);if(o){const e=l.find((e=>e.props.value===t));return e?(0,r.cloneElement)(e,{className:"margin-top--md"}):null}return(0,g.jsx)("div",{className:"margin-top--md",children:l.map(((e,o)=>(0,r.cloneElement)(e,{key:o,hidden:e.props.value!==t})))})}function j(e){const o=m(e);return(0,g.jsxs)("div",{className:(0,t.A)("tabs-container",w.tabList),children:[(0,g.jsx)(v,{...e,...o}),(0,g.jsx)(b,{...e,...o})]})}function k(e){const o=(0,x.A)();return(0,g.jsx)(j,{...e,children:d(e.children)},String(o))}},8453:(e,o,n)=>{n.d(o,{R:()=>a,x:()=>i});var r=n(6540);const t={},l=r.createContext(t);function a(e){const o=r.useContext(l);return r.useMemo((function(){return"function"==typeof e?e(o):{...o,...e}}),[o,e])}function i(e){let o;return o=e.disableParentContext?"function"==typeof e.components?e.components(t):e.components||t:a(e.components),r.createElement(l.Provider,{value:o},e.children)}}}]); \ No newline at end of file diff --git a/assets/js/53df995c.e7704f75.js b/assets/js/53df995c.e7704f75.js new file mode 100644 index 00000000..593d5bec --- /dev/null +++ b/assets/js/53df995c.e7704f75.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunkdocs=self.webpackChunkdocs||[]).push([[8507],{3818:(e,o,n)=>{n.r(o),n.d(o,{assets:()=>s,contentTitle:()=>a,default:()=>p,frontMatter:()=>l,metadata:()=>i,toc:()=>c});var r=n(4848),t=n(8453);n(1470),n(9365);const l={},a="Workflow",i={id:"configuration/workflow",title:"Workflow",description:"Workflows are defined as Protobuf RPCs annotated with the temporal.v1.workflow method option. See the Workflows guide for more usage details.",source:"@site/docs/configuration/workflow.mdx",sourceDirName:"configuration",slug:"/configuration/workflow",permalink:"/protoc-gen-go-temporal/docs/configuration/workflow",draft:!1,unlisted:!1,editUrl:"https://github.com/facebook/docusaurus/tree/main/packages/create-docusaurus/templates/shared/docs/configuration/workflow.mdx",tags:[],version:"current",frontMatter:{},sidebar:"docs",previous:{title:"Service",permalink:"/protoc-gen-go-temporal/docs/configuration/service"},next:{title:"Activity",permalink:"/protoc-gen-go-temporal/docs/configuration/activity"}},s={},c=[{value:"Options",id:"options",level:2},{value:"execution_timeout",id:"execution_timeout",level:3},{value:"id",id:"id",level:3},{value:"id_reuse_policy",id:"id_reuse_policy",level:3},{value:"name",id:"name",level:3},{value:"parent_close_policy",id:"parent_close_policy",level:3},{value:"query",id:"query",level:3},{value:"retry_policy",id:"retry_policy",level:3},{value:"run_timeout",id:"run_timeout",level:3},{value:"search_attributes",id:"search_attributes",level:3},{value:"signal",id:"signal",level:3},{value:"task_queue",id:"task_queue",level:3},{value:"task_timeout",id:"task_timeout",level:3},{value:"update",id:"update",level:3},{value:"xns",id:"xns",level:3},{value:"wait_for_cancellation",id:"wait_for_cancellation",level:3}];function u(e){const o={a:"a",admonition:"admonition",code:"code",h1:"h1",h2:"h2",h3:"h3",p:"p",pre:"pre",...(0,t.R)(),...e.components};return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(o.h1,{id:"workflow",children:"Workflow"}),"\n",(0,r.jsxs)(o.p,{children:[(0,r.jsx)(o.a,{href:"https://docs.temporal.io/workflows",children:"Workflows"})," are defined as Protobuf RPCs annotated with the ",(0,r.jsx)(o.code,{children:"temporal.v1.workflow"})," method option. See the ",(0,r.jsx)(o.a,{href:"/docs/guides/workflows",children:"Workflows guide"})," for more usage details."]}),"\n",(0,r.jsx)(o.admonition,{type:"info",children:(0,r.jsxs)(o.p,{children:["Workflow definitions can omit an input and/or out parameter by specifying the native ",(0,r.jsx)(o.code,{children:"google.protobuf.Empty"})," message type in its place. This requires an additional ",(0,r.jsx)(o.code,{children:"google/protobuf/empty.proto"})," protobuf import."]})}),"\n",(0,r.jsx)(o.pre,{children:(0,r.jsx)(o.code,{className:"language-protobuf",metastring:'title="example.proto"',children:'syntax="proto3";\n\npackage example.v1;\n\nimport "temporal/v1/temporal.proto";\n\nservice Example {\n // Hello returns a friendly greeting\n rpc Hello(HelloInput) returns (HelloOutput) {\n option (temporal.v1.workflow) = {};\n }\n}\n'})}),"\n",(0,r.jsx)(o.h2,{id:"options",children:"Options"}),"\n",(0,r.jsx)(o.h3,{id:"execution_timeout",children:"execution_timeout"}),"\n",(0,r.jsx)(o.p,{children:(0,r.jsx)(o.a,{href:"https://protobuf.dev/reference/protobuf/google.protobuf/#duration",children:"google.protobuf.Duration"})}),"\n",(0,r.jsxs)(o.p,{children:["The timeout for duration of ",(0,r.jsx)(o.a,{href:"https://docs.temporal.io/workflows#time-constraints",children:"Workflow execution"}),". It includes retries and continue as new. Use ",(0,r.jsx)(o.a,{href:"#run_timeout",children:"run_timeout"})," to limit execution time of a single workflow run. Defaults to unlimited."]}),"\n",(0,r.jsx)(o.pre,{children:(0,r.jsx)(o.code,{className:"language-protobuf",children:"service Example {\n rpc Hello(HelloInput) returns (HelloOutput) {\n option (temporal.v1.workflow) = {\n execution_timeout: { seconds: 3600 } // 1h\n };\n }\n}\n"})}),"\n",(0,r.jsx)(o.h3,{id:"id",children:"id"}),"\n",(0,r.jsx)(o.p,{children:(0,r.jsx)(o.code,{children:"string"})}),"\n",(0,r.jsxs)(o.p,{children:["Specifies the default ",(0,r.jsx)(o.a,{href:"https://docs.temporal.io/workflows#workflow-id",children:"Workflow ID"})," as a ",(0,r.jsx)(o.a,{href:"/docs/guides/bloblang",children:"Bloblang expression"}),"."]}),"\n",(0,r.jsx)(o.pre,{children:(0,r.jsx)(o.code,{className:"language-protobuf",children:"service Example {\n rpc Hello(HelloInput) returns (HelloOutput) {\n option (temporal.v1.workflow) = {\n id: 'hello/${! name }/${! uuid_v4() }'\n };\n }\n}\n\nmessage HelloInput {\n string name = 1;\n}\n"})}),"\n",(0,r.jsx)(o.h3,{id:"id_reuse_policy",children:"id_reuse_policy"}),"\n",(0,r.jsx)(o.p,{children:(0,r.jsx)(o.a,{href:"https://buf.build/cludden/protoc-gen-go-temporal/docs/main:temporal.v1#temporal.v1.IDReusePolicy",children:"temporal.v1.IDReusePolicy"})}),"\n",(0,r.jsxs)(o.p,{children:["Whether server allow reuse of workflow ID, can be useful for dedupe logic if set to ",(0,r.jsx)(o.code,{children:"WORKFLOW_ID_REUSE_POLICY_REJECT_DUPLICATE"}),". Defaults to ",(0,r.jsx)(o.code,{children:"WORKFLOW_ID_REUSE_POLICY_ALLOW_DUPLICATE"}),". See ",(0,r.jsx)(o.a,{href:"https://docs.temporal.io/workflows#workflow-id-reuse-policy",children:"docs"})," for more details."]}),"\n",(0,r.jsx)(o.pre,{children:(0,r.jsx)(o.code,{className:"language-protobuf",children:"service Example {\n rpc Hello(HelloInput) returns (HelloOutput) {\n option (temporal.v1.workflow) = {\n id_reuse_policy: WORKFLOW_ID_REUSE_POLICY_ALLOW_DUPLICATE\n };\n }\n}\n"})}),"\n",(0,r.jsx)(o.h3,{id:"name",children:"name"}),"\n",(0,r.jsx)(o.p,{children:(0,r.jsx)(o.code,{children:"string"})}),"\n",(0,r.jsxs)(o.p,{children:["Fully qualified ",(0,r.jsx)(o.a,{href:"https://docs.temporal.io/workflows#workflow-type",children:"Workflow type name"}),". Defaults to protobuf method full name (e.g. ",(0,r.jsx)(o.code,{children:"example.v1.Example.Hello"}),")"]}),"\n",(0,r.jsx)(o.pre,{children:(0,r.jsx)(o.code,{className:"language-protobuf",children:'service Example {\n rpc Hello(HelloInput) returns (HelloOutput) {\n option (temporal.v1.workflow) = {\n name: "Hello"\n };\n }\n}\n'})}),"\n",(0,r.jsx)(o.h3,{id:"parent_close_policy",children:"parent_close_policy"}),"\n",(0,r.jsx)(o.p,{children:(0,r.jsx)(o.a,{href:"https://buf.build/cludden/protoc-gen-go-temporal/docs/main:temporal.v1#temporal.v1.ParentClosePolicy",children:"temporal.v1.ParentClosePolicy"})}),"\n",(0,r.jsxs)(o.p,{children:["When execution as a child workflow, this ",(0,r.jsx)(o.a,{href:"https://docs.temporal.io/workflows#parent-close-policy",children:"optional policy"})," determines what to do when the parent workflow is closed. Default to ",(0,r.jsx)(o.code,{children:"PARENT_CLOSE_POLICY_TERMINATE"}),"."]}),"\n",(0,r.jsx)(o.pre,{children:(0,r.jsx)(o.code,{className:"language-protobuf",children:"service Example {\n rpc Hello(HelloInput) returns (HelloOutput) {\n option (temporal.v1.workflow) = {\n parent_close_policy: PARENT_CLOSE_POLICY_REQUEST_CANCEL\n };\n }\n}\n"})}),"\n",(0,r.jsx)(o.h3,{id:"query",children:"query"}),"\n",(0,r.jsx)(o.p,{children:(0,r.jsx)(o.a,{href:"https://buf.build/cludden/protoc-gen-go-temporal/docs/main:temporal.v1#temporal.v1.WorkflowOptions.Query",children:"temporal.v1.WorkflowOptions.Query"})}),"\n",(0,r.jsxs)(o.p,{children:["Identifies a ",(0,r.jsx)(o.a,{href:"https://docs.temporal.io/workflows#query",children:"query"})," supported by the workflow. Can be specified 0, 1, or more times. See the ",(0,r.jsx)(o.a,{href:"/docs/guides/queries",children:"query docs"})," for more details."]}),"\n",(0,r.jsx)(o.pre,{children:(0,r.jsx)(o.code,{className:"language-protobuf",children:"service Example {\n rpc Hello(HelloInput) returns (HelloOutput) {\n option (temporal.v1.workflow) = {\n query: { ref: 'SomeQuery1' }\n query: { ref: 'SomeQuery2' }\n query: {\n // can reference a query definition from another service\n ref: 'example.v2.Example.SomeQuery3'\n }\n };\n }\n\n rpc SomeQuery1(SomeQuery1Input) returns (SomeQuery1Output) {\n option (temporal.v1.query) = {};\n }\n\n rpc SomeQuery2(SomeQuery2Input) returns (SomeQuery2Output) {\n option (temporal.v1.query) = {};\n }\n}\n"})}),"\n",(0,r.jsx)(o.h3,{id:"retry_policy",children:"retry_policy"}),"\n",(0,r.jsx)(o.p,{children:(0,r.jsx)(o.a,{href:"https://buf.build/cludden/protoc-gen-go-temporal/docs/main:temporal.v1#temporal.v1.RetryPolicy",children:"temporal.v1.RetryPolicy"})}),"\n",(0,r.jsxs)(o.p,{children:["Optional ",(0,r.jsx)(o.a,{href:"https://docs.temporal.io/retry-policies",children:"retry policy"})," for workflow. If a retry policy is specified, in case of workflow failure server will start new workflow execution if needed based on the retry policy."]}),"\n",(0,r.jsx)(o.pre,{children:(0,r.jsx)(o.code,{className:"language-protobuf",children:'service Example {\n rpc Hello(HelloInput) returns (HelloOutput) {\n option (temporal.v1.workflow) = {\n retry_policy: {\n max_attempts: 10\n initial_interval: { seconds: 5 }\n max_interval: { seconds: 60 }\n backoff_coefficient: 2.0\n non_retryable_error_types: ["SomeError", "SomeOtherError"]\n }\n };\n }\n}\n'})}),"\n",(0,r.jsx)(o.h3,{id:"run_timeout",children:"run_timeout"}),"\n",(0,r.jsx)(o.p,{children:(0,r.jsx)(o.a,{href:"https://protobuf.dev/reference/protobuf/google.protobuf/#duration",children:"google.protobuf.Duration"})}),"\n",(0,r.jsxs)(o.p,{children:["The timeout for duration of ",(0,r.jsx)(o.a,{href:"https://docs.temporal.io/workflows#time-constraints",children:"a single workflow run"}),". Defaults to ",(0,r.jsx)(o.a,{href:"#execution_timeout",children:"execution_timeout"}),"."]}),"\n",(0,r.jsx)(o.pre,{children:(0,r.jsx)(o.code,{className:"language-protobuf",children:"service Example {\n rpc Hello(HelloInput) returns (HelloOutput) {\n option (temporal.v1.workflow) = {\n execution_timeout: { seconds: 300 } // 5m\n };\n }\n}\n"})}),"\n",(0,r.jsx)(o.h3,{id:"search_attributes",children:"search_attributes"}),"\n",(0,r.jsx)(o.p,{children:(0,r.jsx)(o.code,{children:"string"})}),"\n",(0,r.jsxs)(o.p,{children:["Specifies the default ",(0,r.jsx)(o.a,{href:"https://docs.temporal.io/visibility#search-attribute",children:"Workflow search attributes"})," as a ",(0,r.jsx)(o.a,{href:"https://www.benthos.dev/docs/guides/bloblang/about/",children:"Bloblang mapping"}),". See the ",(0,r.jsx)(o.a,{href:"/docs/examples/searchattributes/",children:"Search Attributes example"})," for more details."]}),"\n",(0,r.jsx)(o.pre,{children:(0,r.jsx)(o.code,{className:"language-protobuf",children:"service Example {\n rpc Hello(HelloInput) returns (HelloOutput) {\n option (temporal.v1.workflow) = {\n search_attributes:\n 'Name = name.or(\"World\") \\n'\n 'CreatedAt = now().ts_parse(\"2006-01-02T15:04:05Z\") \\n'\n };\n }\n}\n"})}),"\n",(0,r.jsx)(o.h3,{id:"signal",children:"signal"}),"\n",(0,r.jsx)(o.p,{children:(0,r.jsx)(o.a,{href:"https://buf.build/cludden/protoc-gen-go-temporal/docs/main:temporal.v1#temporal.v1.WorkflowOptions.Signal",children:"temporal.v1.WorkflowOptions.Signal"})}),"\n",(0,r.jsxs)(o.p,{children:["Identifies a ",(0,r.jsx)(o.a,{href:"https://docs.temporal.io/workflows#signal",children:"signal"})," supported by the workflow. Can be specified 0, 1, or more times. See the ",(0,r.jsx)(o.a,{href:"/docs/guides/signals",children:"signal docs"})," for more details."]}),"\n",(0,r.jsx)(o.pre,{children:(0,r.jsx)(o.code,{className:"language-protobuf",children:"service Example {\n rpc Hello(HelloInput) returns (HelloOutput) {\n option (temporal.v1.workflow) = {\n signal: { ref: 'SomeSignal1' }\n signal: {\n ref: 'SomeSignal2'\n start: true // generates signal with start helpers\n }\n signal: {\n // can reference a signal definition from another service\n ref: 'example.v2.Example.SomeSignal3'\n }\n };\n }\n\n rpc SomeSignal1(SomeSignal1Input) returns (google.protobuf.Empty) {\n option (temporal.v1.signal) = {};\n }\n\n rpc SomeSignal2(SomeSignal2Input) returns (google.protobuf.Empty) {\n option (temporal.v1.signal) = {};\n }\n}\n"})}),"\n",(0,r.jsx)(o.h3,{id:"task_queue",children:"task_queue"}),"\n",(0,r.jsx)(o.p,{children:(0,r.jsx)(o.code,{children:"string"})}),"\n",(0,r.jsxs)(o.p,{children:["Overrides the default task queue for a particular workflow type. Defaults to Service's ",(0,r.jsx)(o.code,{children:"task_queue"})," if specified."]}),"\n",(0,r.jsx)(o.pre,{children:(0,r.jsx)(o.code,{className:"language-protobuf",children:'service Example {\n rpc Hello(HelloInput) returns (HelloOutput) {\n option (temporal.v1.workflow) = {\n task_queue: "example-v2"\n };\n }\n}\n'})}),"\n",(0,r.jsx)(o.h3,{id:"task_timeout",children:"task_timeout"}),"\n",(0,r.jsx)(o.p,{children:(0,r.jsx)(o.a,{href:"https://protobuf.dev/reference/protobuf/google.protobuf/#duration",children:"google.protobuf.Duration"})}),"\n",(0,r.jsxs)(o.p,{children:["The timeout for processing ",(0,r.jsx)(o.a,{href:"https://docs.temporal.io/workflows#workflow-task-timeout",children:"workflow task"})," from the time the worker pulled this task. If a workflow task is lost, it is retried after this timeout. Defaults to ",(0,r.jsx)(o.code,{children:"10s"}),"."]}),"\n",(0,r.jsx)(o.pre,{children:(0,r.jsx)(o.code,{className:"language-protobuf",children:"service Example {\n rpc Hello(HelloInput) returns (HelloOutput) {\n option (temporal.v1.workflow) = {\n task_timeout: { seconds: 10 }\n };\n }\n}\n"})}),"\n",(0,r.jsx)(o.h3,{id:"update",children:"update"}),"\n",(0,r.jsx)(o.p,{children:(0,r.jsx)(o.a,{href:"https://buf.build/cludden/protoc-gen-go-temporal/docs/main:temporal.v1#temporal.v1.WorkflowOptions.Update",children:"temporal.v1.WorkflowOptions.Update"})}),"\n",(0,r.jsxs)(o.p,{children:["Identifies an ",(0,r.jsx)(o.a,{href:"https://docs.temporal.io/workflows#update",children:"update"})," supported by the workflow. Can be specified 0, 1, or more times. See the ",(0,r.jsx)(o.a,{href:"/docs/guides/updates",children:"update docs"})," for more details."]}),"\n",(0,r.jsx)(o.admonition,{type:"note",children:(0,r.jsxs)(o.p,{children:["This requires the ",(0,r.jsx)(o.a,{href:"/docs/configuration/plugin#workflow-update-enabled",children:"workflow-update-enabled"})," plugin option to be enabled."]})}),"\n",(0,r.jsx)(o.pre,{children:(0,r.jsx)(o.code,{className:"language-protobuf",children:"service Example {\n rpc Hello(HelloInput) returns (HelloOutput) {\n option (temporal.v1.workflow) = {\n update: { ref: 'SomeUpdate1' }\n update: { ref: 'SomeUpdate2' }\n update: {\n // can reference an update definition from another service\n ref: 'example.v2.Example.SomeUpdate3'\n }\n };\n }\n\n rpc SomeUpdate1(SomeUpdate1Input) returns (SomeUpdate1Output) {\n option (temporal.v1.update) = {};\n }\n\n rpc SomeUpdate2(SomeUpdate2Input) returns (SomeUpdate2Output) {\n option (temporal.v1.update) = {};\n }\n}\n"})}),"\n",(0,r.jsx)(o.h3,{id:"xns",children:"xns"}),"\n",(0,r.jsx)(o.p,{children:(0,r.jsx)(o.a,{href:"https://buf.build/cludden/protoc-gen-go-temporal/docs/main:temporal.v1#temporal.v1.XNSActivityOptions",children:"temporal.v1.XNSActivityOptions"})}),"\n",(0,r.jsxs)(o.p,{children:["Used to configure ",(0,r.jsx)(o.a,{href:"/docs/guides/xns",children:"cross-namespace"})," activity options."]}),"\n",(0,r.jsx)(o.admonition,{type:"note",children:(0,r.jsxs)(o.p,{children:["This requires the ",(0,r.jsx)(o.a,{href:"/docs/configuration/plugin#enable-xns",children:"enable-xns"})," plugin option to be enabled."]})}),"\n",(0,r.jsx)(o.pre,{children:(0,r.jsx)(o.code,{className:"language-protobuf",children:"service Example {\n rpc Hello(HelloInput) returns (HelloOutput) {\n option (temporal.v1.workflow) = {\n xns: {\n heartbeat_timeout: { seconds: 30 }\n heartbeat_interval: { seconds: 10 }\n start_to_close_timeout: { seconds: 300 }\n }\n };\n }\n}\n"})}),"\n",(0,r.jsx)(o.h3,{id:"wait_for_cancellation",children:"wait_for_cancellation"}),"\n",(0,r.jsx)(o.p,{children:(0,r.jsx)(o.code,{children:"bool"})}),"\n",(0,r.jsxs)(o.p,{children:["Whether to wait for canceled ",(0,r.jsx)(o.a,{href:"https://docs.temporal.io/workflows#child-workflow",children:"child workflow"})," to be ended (child workflow can be ended as: completed/failed/timedout/terminated/canceled). Defaults to ",(0,r.jsx)(o.code,{children:"false"}),"."]}),"\n",(0,r.jsx)(o.pre,{children:(0,r.jsx)(o.code,{className:"language-protobuf",children:"service Example {\n rpc Hello(HelloInput) returns (HelloOutput) {\n option (temporal.v1.workflow) = {\n wait_for_cancellation: false\n };\n }\n}\n"})})]})}function p(e={}){const{wrapper:o}={...(0,t.R)(),...e.components};return o?(0,r.jsx)(o,{...e,children:(0,r.jsx)(u,{...e})}):u(e)}},9365:(e,o,n)=>{n.d(o,{A:()=>a});n(6540);var r=n(4164);const t={tabItem:"tabItem_Ymn6"};var l=n(4848);function a(e){let{children:o,hidden:n,className:a}=e;return(0,l.jsx)("div",{role:"tabpanel",className:(0,r.A)(t.tabItem,a),hidden:n,children:o})}},1470:(e,o,n)=>{n.d(o,{A:()=>k});var r=n(6540),t=n(4164),l=n(3104),a=n(6347),i=n(205),s=n(7485),c=n(1682),u=n(9466);function p(e){return r.Children.toArray(e).filter((e=>"\n"!==e)).map((e=>{if(!e||(0,r.isValidElement)(e)&&function(e){const{props:o}=e;return!!o&&"object"==typeof o&&"value"in o}(e))return e;throw new Error(`Docusaurus error: Bad child <${"string"==typeof e.type?e.type:e.type.name}>: all children of the component should be , and every should have a unique "value" prop.`)}))?.filter(Boolean)??[]}function d(e){const{values:o,children:n}=e;return(0,r.useMemo)((()=>{const e=o??function(e){return p(e).map((e=>{let{props:{value:o,label:n,attributes:r,default:t}}=e;return{value:o,label:n,attributes:r,default:t}}))}(n);return function(e){const o=(0,c.X)(e,((e,o)=>e.value===o.value));if(o.length>0)throw new Error(`Docusaurus error: Duplicate values "${o.map((e=>e.value)).join(", ")}" found in . Every value needs to be unique.`)}(e),e}),[o,n])}function h(e){let{value:o,tabValues:n}=e;return n.some((e=>e.value===o))}function f(e){let{queryString:o=!1,groupId:n}=e;const t=(0,a.W6)(),l=function(e){let{queryString:o=!1,groupId:n}=e;if("string"==typeof o)return o;if(!1===o)return null;if(!0===o&&!n)throw new Error('Docusaurus error: The component groupId prop is required if queryString=true, because this value is used as the search param name. You can also provide an explicit value such as queryString="my-search-param".');return n??null}({queryString:o,groupId:n});return[(0,s.aZ)(l),(0,r.useCallback)((e=>{if(!l)return;const o=new URLSearchParams(t.location.search);o.set(l,e),t.replace({...t.location,search:o.toString()})}),[l,t])]}function m(e){const{defaultValue:o,queryString:n=!1,groupId:t}=e,l=d(e),[a,s]=(0,r.useState)((()=>function(e){let{defaultValue:o,tabValues:n}=e;if(0===n.length)throw new Error("Docusaurus error: the component requires at least one children component");if(o){if(!h({value:o,tabValues:n}))throw new Error(`Docusaurus error: The has a defaultValue "${o}" but none of its children has the corresponding value. Available values are: ${n.map((e=>e.value)).join(", ")}. If you intend to show no default tab, use defaultValue={null} instead.`);return o}const r=n.find((e=>e.default))??n[0];if(!r)throw new Error("Unexpected error: 0 tabValues");return r.value}({defaultValue:o,tabValues:l}))),[c,p]=f({queryString:n,groupId:t}),[m,x]=function(e){let{groupId:o}=e;const n=function(e){return e?`docusaurus.tab.${e}`:null}(o),[t,l]=(0,u.Dv)(n);return[t,(0,r.useCallback)((e=>{n&&l.set(e)}),[n,l])]}({groupId:t}),w=(()=>{const e=c??m;return h({value:e,tabValues:l})?e:null})();(0,i.A)((()=>{w&&s(w)}),[w]);return{selectedValue:a,selectValue:(0,r.useCallback)((e=>{if(!h({value:e,tabValues:l}))throw new Error(`Can't select invalid tab value=${e}`);s(e),p(e),x(e)}),[p,x,l]),tabValues:l}}var x=n(2303);const w={tabList:"tabList__CuJ",tabItem:"tabItem_LNqP"};var g=n(4848);function v(e){let{className:o,block:n,selectedValue:r,selectValue:a,tabValues:i}=e;const s=[],{blockElementScrollPositionUntilNextRender:c}=(0,l.a_)(),u=e=>{const o=e.currentTarget,n=s.indexOf(o),t=i[n].value;t!==r&&(c(o),a(t))},p=e=>{let o=null;switch(e.key){case"Enter":u(e);break;case"ArrowRight":{const n=s.indexOf(e.currentTarget)+1;o=s[n]??s[0];break}case"ArrowLeft":{const n=s.indexOf(e.currentTarget)-1;o=s[n]??s[s.length-1];break}}o?.focus()};return(0,g.jsx)("ul",{role:"tablist","aria-orientation":"horizontal",className:(0,t.A)("tabs",{"tabs--block":n},o),children:i.map((e=>{let{value:o,label:n,attributes:l}=e;return(0,g.jsx)("li",{role:"tab",tabIndex:r===o?0:-1,"aria-selected":r===o,ref:e=>s.push(e),onKeyDown:p,onClick:u,...l,className:(0,t.A)("tabs__item",w.tabItem,l?.className,{"tabs__item--active":r===o}),children:n??o},o)}))})}function b(e){let{lazy:o,children:n,selectedValue:t}=e;const l=(Array.isArray(n)?n:[n]).filter(Boolean);if(o){const e=l.find((e=>e.props.value===t));return e?(0,r.cloneElement)(e,{className:"margin-top--md"}):null}return(0,g.jsx)("div",{className:"margin-top--md",children:l.map(((e,o)=>(0,r.cloneElement)(e,{key:o,hidden:e.props.value!==t})))})}function j(e){const o=m(e);return(0,g.jsxs)("div",{className:(0,t.A)("tabs-container",w.tabList),children:[(0,g.jsx)(v,{...e,...o}),(0,g.jsx)(b,{...e,...o})]})}function k(e){const o=(0,x.A)();return(0,g.jsx)(j,{...e,children:p(e.children)},String(o))}},8453:(e,o,n)=>{n.d(o,{R:()=>a,x:()=>i});var r=n(6540);const t={},l=r.createContext(t);function a(e){const o=r.useContext(l);return r.useMemo((function(){return"function"==typeof e?e(o):{...o,...e}}),[o,e])}function i(e){let o;return o=e.disableParentContext?"function"==typeof e.components?e.components(t):e.components||t:a(e.components),r.createElement(l.Provider,{value:o},e.children)}}}]); \ No newline at end of file diff --git a/assets/js/59362658.052dc88d.js b/assets/js/59362658.052dc88d.js new file mode 100644 index 00000000..ce6b0cad --- /dev/null +++ b/assets/js/59362658.052dc88d.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunkdocs=self.webpackChunkdocs||[]).push([[9325],{1180:(t,e,o)=>{o.r(e),o.d(e,{assets:()=>l,contentTitle:()=>a,default:()=>p,frontMatter:()=>n,metadata:()=>c,toc:()=>u});var s=o(4848),r=o(8453);const n={slug:"mdx-blog-post",title:"MDX Blog Post",authors:["slorber"],tags:["docusaurus"]},a=void 0,c={permalink:"/protoc-gen-go-temporal/blog/mdx-blog-post",editUrl:"https://github.com/facebook/docusaurus/tree/main/packages/create-docusaurus/templates/shared/blog/2021-08-01-mdx-blog-post.mdx",source:"@site/blog/2021-08-01-mdx-blog-post.mdx",title:"MDX Blog Post",description:"Blog posts support Docusaurus Markdown features, such as MDX.",date:"2021-08-01T00:00:00.000Z",formattedDate:"August 1, 2021",tags:[{label:"docusaurus",permalink:"/protoc-gen-go-temporal/blog/tags/docusaurus"}],readingTime:.175,hasTruncateMarker:!1,authors:[{name:"S\xe9bastien Lorber",title:"Docusaurus maintainer",url:"https://sebastienlorber.com",imageURL:"https://github.com/slorber.png",key:"slorber"}],frontMatter:{slug:"mdx-blog-post",title:"MDX Blog Post",authors:["slorber"],tags:["docusaurus"]},unlisted:!1,prevItem:{title:"Welcome",permalink:"/protoc-gen-go-temporal/blog/welcome"},nextItem:{title:"Long Blog Post",permalink:"/protoc-gen-go-temporal/blog/long-blog-post"}},l={authorsImageUrls:[void 0]},u=[];function i(t){const e={a:"a",admonition:"admonition",code:"code",p:"p",pre:"pre",...(0,r.R)(),...t.components};return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)(e.p,{children:["Blog posts support ",(0,s.jsx)(e.a,{href:"https://docusaurus.io/docs/markdown-features",children:"Docusaurus Markdown features"}),", such as ",(0,s.jsx)(e.a,{href:"https://mdxjs.com/",children:"MDX"}),"."]}),"\n",(0,s.jsxs)(e.admonition,{type:"tip",children:[(0,s.jsx)(e.p,{children:"Use the power of React to create interactive blog posts."}),(0,s.jsx)(e.pre,{children:(0,s.jsx)(e.code,{className:"language-js",children:"\n"})}),(0,s.jsx)("button",{onClick:()=>alert("button clicked!"),children:"Click me!"})]})]})}function p(t={}){const{wrapper:e}={...(0,r.R)(),...t.components};return e?(0,s.jsx)(e,{...t,children:(0,s.jsx)(i,{...t})}):i(t)}},8453:(t,e,o)=>{o.d(e,{R:()=>a,x:()=>c});var s=o(6540);const r={},n=s.createContext(r);function a(t){const e=s.useContext(n);return s.useMemo((function(){return"function"==typeof t?t(e):{...e,...t}}),[e,t])}function c(t){let e;return e=t.disableParentContext?"function"==typeof t.components?t.components(r):t.components||r:a(t.components),s.createElement(n.Provider,{value:e},t.children)}}}]); \ No newline at end of file diff --git a/assets/js/59362658.cd26dc5c.js b/assets/js/59362658.cd26dc5c.js deleted file mode 100644 index dd296a4e..00000000 --- a/assets/js/59362658.cd26dc5c.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunkdocs=self.webpackChunkdocs||[]).push([[9325],{1180:(t,e,o)=>{o.r(e),o.d(e,{assets:()=>u,contentTitle:()=>a,default:()=>d,frontMatter:()=>n,metadata:()=>c,toc:()=>l});var s=o(4848),r=o(8453);const n={slug:"mdx-blog-post",title:"MDX Blog Post",authors:["slorber"],tags:["docusaurus"]},a=void 0,c={permalink:"/blog/mdx-blog-post",editUrl:"https://github.com/facebook/docusaurus/tree/main/packages/create-docusaurus/templates/shared/blog/2021-08-01-mdx-blog-post.mdx",source:"@site/blog/2021-08-01-mdx-blog-post.mdx",title:"MDX Blog Post",description:"Blog posts support Docusaurus Markdown features, such as MDX.",date:"2021-08-01T00:00:00.000Z",formattedDate:"August 1, 2021",tags:[{label:"docusaurus",permalink:"/blog/tags/docusaurus"}],readingTime:.175,hasTruncateMarker:!1,authors:[{name:"S\xe9bastien Lorber",title:"Docusaurus maintainer",url:"https://sebastienlorber.com",imageURL:"https://github.com/slorber.png",key:"slorber"}],frontMatter:{slug:"mdx-blog-post",title:"MDX Blog Post",authors:["slorber"],tags:["docusaurus"]},unlisted:!1,prevItem:{title:"Welcome",permalink:"/blog/welcome"},nextItem:{title:"Long Blog Post",permalink:"/blog/long-blog-post"}},u={authorsImageUrls:[void 0]},l=[];function i(t){const e={a:"a",admonition:"admonition",code:"code",p:"p",pre:"pre",...(0,r.R)(),...t.components};return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)(e.p,{children:["Blog posts support ",(0,s.jsx)(e.a,{href:"https://docusaurus.io/docs/markdown-features",children:"Docusaurus Markdown features"}),", such as ",(0,s.jsx)(e.a,{href:"https://mdxjs.com/",children:"MDX"}),"."]}),"\n",(0,s.jsxs)(e.admonition,{type:"tip",children:[(0,s.jsx)(e.p,{children:"Use the power of React to create interactive blog posts."}),(0,s.jsx)(e.pre,{children:(0,s.jsx)(e.code,{className:"language-js",children:"\n"})}),(0,s.jsx)("button",{onClick:()=>alert("button clicked!"),children:"Click me!"})]})]})}function d(t={}){const{wrapper:e}={...(0,r.R)(),...t.components};return e?(0,s.jsx)(e,{...t,children:(0,s.jsx)(i,{...t})}):i(t)}},8453:(t,e,o)=>{o.d(e,{R:()=>a,x:()=>c});var s=o(6540);const r={},n=s.createContext(r);function a(t){const e=s.useContext(n);return s.useMemo((function(){return"function"==typeof t?t(e):{...e,...t}}),[e,t])}function c(t){let e;return e=t.disableParentContext?"function"==typeof t.components?t.components(r):t.components||r:a(t.components),s.createElement(n.Provider,{value:e},t.children)}}}]); \ No newline at end of file diff --git a/assets/js/608ae6a4.2a0abb3c.js b/assets/js/608ae6a4.2a0abb3c.js deleted file mode 100644 index 3cce8159..00000000 --- a/assets/js/608ae6a4.2a0abb3c.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunkdocs=self.webpackChunkdocs||[]).push([[4722],{1557:s=>{s.exports=JSON.parse('{"permalink":"/blog/tags/docusaurus","page":1,"postsPerPage":10,"totalPages":1,"totalCount":4,"blogDescription":"Blog","blogTitle":"Blog"}')}}]); \ No newline at end of file diff --git a/assets/js/66406991.9e0e48cf.js b/assets/js/66406991.9e0e48cf.js deleted file mode 100644 index eb71d3f9..00000000 --- a/assets/js/66406991.9e0e48cf.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunkdocs=self.webpackChunkdocs||[]).push([[4374],{576:e=>{e.exports=JSON.parse('{"permalink":"/blog/tags/hello","page":1,"postsPerPage":10,"totalPages":1,"totalCount":2,"blogDescription":"Blog","blogTitle":"Blog"}')}}]); \ No newline at end of file diff --git a/assets/js/6c2deb41.78d87bbb.js b/assets/js/6c2deb41.78d87bbb.js new file mode 100644 index 00000000..c125794a --- /dev/null +++ b/assets/js/6c2deb41.78d87bbb.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunkdocs=self.webpackChunkdocs||[]).push([[8408],{8984:o=>{o.exports=JSON.parse('[{"label":"facebook","permalink":"/protoc-gen-go-temporal/blog/tags/facebook","count":1},{"label":"hello","permalink":"/protoc-gen-go-temporal/blog/tags/hello","count":2},{"label":"docusaurus","permalink":"/protoc-gen-go-temporal/blog/tags/docusaurus","count":4},{"label":"hola","permalink":"/protoc-gen-go-temporal/blog/tags/hola","count":1}]')}}]); \ No newline at end of file diff --git a/assets/js/6c883624.21d51499.js b/assets/js/6c883624.21d51499.js new file mode 100644 index 00000000..7a175e81 --- /dev/null +++ b/assets/js/6c883624.21d51499.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunkdocs=self.webpackChunkdocs||[]).push([[5407],{7594:o=>{o.exports=JSON.parse('{"label":"hola","permalink":"/protoc-gen-go-temporal/blog/tags/hola","allTagsPath":"/protoc-gen-go-temporal/blog/tags","count":1,"unlisted":false}')}}]); \ No newline at end of file diff --git a/assets/js/7081f529.944ed5f5.js b/assets/js/7081f529.944ed5f5.js deleted file mode 100644 index 0d703729..00000000 --- a/assets/js/7081f529.944ed5f5.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunkdocs=self.webpackChunkdocs||[]).push([[5995],{528:(e,n,t)=>{t.r(n),t.d(n,{assets:()=>a,contentTitle:()=>s,default:()=>p,frontMatter:()=>i,metadata:()=>c,toc:()=>u});var o=t(4848),r=t(8453);const i={},s="Service",c={id:"configuration/service",title:"Service",description:"Service options apply to all Temporal resources defined within an individual protobuf service.",source:"@site/docs/configuration/service.mdx",sourceDirName:"configuration",slug:"/configuration/service",permalink:"/docs/configuration/service",draft:!1,unlisted:!1,editUrl:"https://github.com/facebook/docusaurus/tree/main/packages/create-docusaurus/templates/shared/docs/configuration/service.mdx",tags:[],version:"current",frontMatter:{},sidebar:"docs",previous:{title:"Plugin",permalink:"/docs/configuration/plugin"},next:{title:"Workflow",permalink:"/docs/configuration/workflow"}},a={},u=[{value:"Options",id:"options",level:2},{value:"task_queue",id:"task_queue",level:3}];function l(e){const n={a:"a",code:"code",h1:"h1",h2:"h2",h3:"h3",p:"p",pre:"pre",...(0,r.R)(),...e.components};return(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(n.h1,{id:"service",children:"Service"}),"\n",(0,o.jsx)(n.p,{children:"Service options apply to all Temporal resources defined within an individual protobuf service."}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{className:"language-protobuf",metastring:'title="example.proto"',children:'syntax="proto3";\n\npackage example.v1;\n\nimport "temporal/v1/temporal.proto";\n\nservice Example {\n option (temporal.v1.service) = {\n task_queue: "example-v1"\n };\n}\n'})}),"\n",(0,o.jsx)(n.h2,{id:"options",children:"Options"}),"\n",(0,o.jsx)(n.h3,{id:"task_queue",children:"task_queue"}),"\n",(0,o.jsx)(n.p,{children:(0,o.jsx)(n.code,{children:"string"})}),"\n",(0,o.jsxs)(n.p,{children:["Specifies the default ",(0,o.jsx)(n.a,{href:"https://docs.temporal.io/workers#task-queue",children:"Task Queue"})," name."]}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{className:"language-protobuf",children:"service Example {\n option (temporal.v1.service) = {\n task_queue: 'example-v1'\n };\n}\n"})})]})}function p(e={}){const{wrapper:n}={...(0,r.R)(),...e.components};return n?(0,o.jsx)(n,{...e,children:(0,o.jsx)(l,{...e})}):l(e)}},8453:(e,n,t)=>{t.d(n,{R:()=>s,x:()=>c});var o=t(6540);const r={},i=o.createContext(r);function s(e){const n=o.useContext(i);return o.useMemo((function(){return"function"==typeof e?e(n):{...n,...e}}),[n,e])}function c(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(r):e.components||r:s(e.components),o.createElement(i.Provider,{value:n},e.children)}}}]); \ No newline at end of file diff --git a/assets/js/7081f529.ff6ee44c.js b/assets/js/7081f529.ff6ee44c.js new file mode 100644 index 00000000..5cc555ef --- /dev/null +++ b/assets/js/7081f529.ff6ee44c.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunkdocs=self.webpackChunkdocs||[]).push([[5995],{528:(e,n,o)=>{o.r(n),o.d(n,{assets:()=>a,contentTitle:()=>s,default:()=>u,frontMatter:()=>i,metadata:()=>c,toc:()=>l});var t=o(4848),r=o(8453);const i={},s="Service",c={id:"configuration/service",title:"Service",description:"Service options apply to all Temporal resources defined within an individual protobuf service.",source:"@site/docs/configuration/service.mdx",sourceDirName:"configuration",slug:"/configuration/service",permalink:"/protoc-gen-go-temporal/docs/configuration/service",draft:!1,unlisted:!1,editUrl:"https://github.com/facebook/docusaurus/tree/main/packages/create-docusaurus/templates/shared/docs/configuration/service.mdx",tags:[],version:"current",frontMatter:{},sidebar:"docs",previous:{title:"Plugin",permalink:"/protoc-gen-go-temporal/docs/configuration/plugin"},next:{title:"Workflow",permalink:"/protoc-gen-go-temporal/docs/configuration/workflow"}},a={},l=[{value:"Options",id:"options",level:2},{value:"task_queue",id:"task_queue",level:3}];function p(e){const n={a:"a",code:"code",h1:"h1",h2:"h2",h3:"h3",p:"p",pre:"pre",...(0,r.R)(),...e.components};return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(n.h1,{id:"service",children:"Service"}),"\n",(0,t.jsx)(n.p,{children:"Service options apply to all Temporal resources defined within an individual protobuf service."}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-protobuf",metastring:'title="example.proto"',children:'syntax="proto3";\n\npackage example.v1;\n\nimport "temporal/v1/temporal.proto";\n\nservice Example {\n option (temporal.v1.service) = {\n task_queue: "example-v1"\n };\n}\n'})}),"\n",(0,t.jsx)(n.h2,{id:"options",children:"Options"}),"\n",(0,t.jsx)(n.h3,{id:"task_queue",children:"task_queue"}),"\n",(0,t.jsx)(n.p,{children:(0,t.jsx)(n.code,{children:"string"})}),"\n",(0,t.jsxs)(n.p,{children:["Specifies the default ",(0,t.jsx)(n.a,{href:"https://docs.temporal.io/workers#task-queue",children:"Task Queue"})," name."]}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-protobuf",children:"service Example {\n option (temporal.v1.service) = {\n task_queue: 'example-v1'\n };\n}\n"})})]})}function u(e={}){const{wrapper:n}={...(0,r.R)(),...e.components};return n?(0,t.jsx)(n,{...e,children:(0,t.jsx)(p,{...e})}):p(e)}},8453:(e,n,o)=>{o.d(n,{R:()=>s,x:()=>c});var t=o(6540);const r={},i=t.createContext(r);function s(e){const n=t.useContext(i);return t.useMemo((function(){return"function"==typeof e?e(n):{...n,...e}}),[n,e])}function c(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(r):e.components||r:s(e.components),t.createElement(i.Provider,{value:n},e.children)}}}]); \ No newline at end of file diff --git a/assets/js/73664a40.5c163397.js b/assets/js/73664a40.5c163397.js new file mode 100644 index 00000000..dae4d807 --- /dev/null +++ b/assets/js/73664a40.5c163397.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunkdocs=self.webpackChunkdocs||[]).push([[1972],{9581:(e,s,t)=>{t.r(s),t.d(s,{assets:()=>u,contentTitle:()=>n,default:()=>a,frontMatter:()=>r,metadata:()=>m,toc:()=>l});var i=t(4848),o=t(8453);const r={slug:"long-blog-post",title:"Long Blog Post",authors:"endi",tags:["hello","docusaurus"]},n=void 0,m={permalink:"/protoc-gen-go-temporal/blog/long-blog-post",editUrl:"https://github.com/facebook/docusaurus/tree/main/packages/create-docusaurus/templates/shared/blog/2019-05-29-long-blog-post.md",source:"@site/blog/2019-05-29-long-blog-post.md",title:"Long Blog Post",description:"This is the summary of a very long blog post,",date:"2019-05-29T00:00:00.000Z",formattedDate:"May 29, 2019",tags:[{label:"hello",permalink:"/protoc-gen-go-temporal/blog/tags/hello"},{label:"docusaurus",permalink:"/protoc-gen-go-temporal/blog/tags/docusaurus"}],readingTime:2.05,hasTruncateMarker:!0,authors:[{name:"Endilie Yacop Sucipto",title:"Maintainer of Docusaurus",url:"https://github.com/endiliey",imageURL:"https://github.com/endiliey.png",key:"endi"}],frontMatter:{slug:"long-blog-post",title:"Long Blog Post",authors:"endi",tags:["hello","docusaurus"]},unlisted:!1,prevItem:{title:"MDX Blog Post",permalink:"/protoc-gen-go-temporal/blog/mdx-blog-post"},nextItem:{title:"First Blog Post",permalink:"/protoc-gen-go-temporal/blog/first-blog-post"}},u={authorsImageUrls:[void 0]},l=[];function c(e){const s={code:"code",p:"p",...(0,o.R)(),...e.components};return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(s.p,{children:"This is the summary of a very long blog post,"}),"\n",(0,i.jsxs)(s.p,{children:["Use a ",(0,i.jsx)(s.code,{children:"\x3c!--"})," ",(0,i.jsx)(s.code,{children:"truncate"})," ",(0,i.jsx)(s.code,{children:"--\x3e"})," comment to limit blog post size in the list view."]}),"\n",(0,i.jsx)(s.p,{children:"Lorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque elementum dignissim ultricies. Fusce rhoncus ipsum tempor eros aliquam consequat. Lorem ipsum dolor sit amet"}),"\n",(0,i.jsx)(s.p,{children:"Lorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque elementum dignissim ultricies. Fusce rhoncus ipsum tempor eros aliquam consequat. Lorem ipsum dolor sit amet"}),"\n",(0,i.jsx)(s.p,{children:"Lorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque elementum dignissim ultricies. Fusce rhoncus ipsum tempor eros aliquam consequat. Lorem ipsum dolor sit amet"}),"\n",(0,i.jsx)(s.p,{children:"Lorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque elementum dignissim ultricies. Fusce rhoncus ipsum tempor eros aliquam consequat. Lorem ipsum dolor sit amet"}),"\n",(0,i.jsx)(s.p,{children:"Lorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque elementum dignissim ultricies. Fusce rhoncus ipsum tempor eros aliquam consequat. Lorem ipsum dolor sit amet"}),"\n",(0,i.jsx)(s.p,{children:"Lorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque elementum dignissim ultricies. Fusce rhoncus ipsum tempor eros aliquam consequat. Lorem ipsum dolor sit amet"}),"\n",(0,i.jsx)(s.p,{children:"Lorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque elementum dignissim ultricies. Fusce rhoncus ipsum tempor eros aliquam consequat. Lorem ipsum dolor sit amet"}),"\n",(0,i.jsx)(s.p,{children:"Lorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque elementum dignissim ultricies. Fusce rhoncus ipsum tempor eros aliquam consequat. Lorem ipsum dolor sit amet"}),"\n",(0,i.jsx)(s.p,{children:"Lorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque elementum dignissim ultricies. Fusce rhoncus ipsum tempor eros aliquam consequat. Lorem ipsum dolor sit amet"}),"\n",(0,i.jsx)(s.p,{children:"Lorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque elementum dignissim ultricies. Fusce rhoncus ipsum tempor eros aliquam consequat. Lorem ipsum dolor sit amet"}),"\n",(0,i.jsx)(s.p,{children:"Lorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque elementum dignissim ultricies. Fusce rhoncus ipsum tempor eros aliquam consequat. Lorem ipsum dolor sit amet"}),"\n",(0,i.jsx)(s.p,{children:"Lorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque elementum dignissim ultricies. Fusce rhoncus ipsum tempor eros aliquam consequat. Lorem ipsum dolor sit amet"}),"\n",(0,i.jsx)(s.p,{children:"Lorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque elementum dignissim ultricies. Fusce rhoncus ipsum tempor eros aliquam consequat. Lorem ipsum dolor sit amet"}),"\n",(0,i.jsx)(s.p,{children:"Lorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque elementum dignissim ultricies. Fusce rhoncus ipsum tempor eros aliquam consequat. Lorem ipsum dolor sit amet"}),"\n",(0,i.jsx)(s.p,{children:"Lorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque elementum dignissim ultricies. Fusce rhoncus ipsum tempor eros aliquam consequat. Lorem ipsum dolor sit amet"}),"\n",(0,i.jsx)(s.p,{children:"Lorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque elementum dignissim ultricies. Fusce rhoncus ipsum tempor eros aliquam consequat. Lorem ipsum dolor sit amet"})]})}function a(e={}){const{wrapper:s}={...(0,o.R)(),...e.components};return s?(0,i.jsx)(s,{...e,children:(0,i.jsx)(c,{...e})}):c(e)}},8453:(e,s,t)=>{t.d(s,{R:()=>n,x:()=>m});var i=t(6540);const o={},r=i.createContext(o);function n(e){const s=i.useContext(r);return i.useMemo((function(){return"function"==typeof e?e(s):{...s,...e}}),[s,e])}function m(e){let s;return s=e.disableParentContext?"function"==typeof e.components?e.components(o):e.components||o:n(e.components),i.createElement(r.Provider,{value:s},e.children)}}}]); \ No newline at end of file diff --git a/assets/js/73664a40.de7e10a7.js b/assets/js/73664a40.de7e10a7.js deleted file mode 100644 index ada56c47..00000000 --- a/assets/js/73664a40.de7e10a7.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunkdocs=self.webpackChunkdocs||[]).push([[1972],{9581:(e,s,i)=>{i.r(s),i.d(s,{assets:()=>m,contentTitle:()=>u,default:()=>a,frontMatter:()=>n,metadata:()=>r,toc:()=>l});var t=i(4848),o=i(8453);const n={slug:"long-blog-post",title:"Long Blog Post",authors:"endi",tags:["hello","docusaurus"]},u=void 0,r={permalink:"/blog/long-blog-post",editUrl:"https://github.com/facebook/docusaurus/tree/main/packages/create-docusaurus/templates/shared/blog/2019-05-29-long-blog-post.md",source:"@site/blog/2019-05-29-long-blog-post.md",title:"Long Blog Post",description:"This is the summary of a very long blog post,",date:"2019-05-29T00:00:00.000Z",formattedDate:"May 29, 2019",tags:[{label:"hello",permalink:"/blog/tags/hello"},{label:"docusaurus",permalink:"/blog/tags/docusaurus"}],readingTime:2.05,hasTruncateMarker:!0,authors:[{name:"Endilie Yacop Sucipto",title:"Maintainer of Docusaurus",url:"https://github.com/endiliey",imageURL:"https://github.com/endiliey.png",key:"endi"}],frontMatter:{slug:"long-blog-post",title:"Long Blog Post",authors:"endi",tags:["hello","docusaurus"]},unlisted:!1,prevItem:{title:"MDX Blog Post",permalink:"/blog/mdx-blog-post"},nextItem:{title:"First Blog Post",permalink:"/blog/first-blog-post"}},m={authorsImageUrls:[void 0]},l=[];function c(e){const s={code:"code",p:"p",...(0,o.R)(),...e.components};return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(s.p,{children:"This is the summary of a very long blog post,"}),"\n",(0,t.jsxs)(s.p,{children:["Use a ",(0,t.jsx)(s.code,{children:"\x3c!--"})," ",(0,t.jsx)(s.code,{children:"truncate"})," ",(0,t.jsx)(s.code,{children:"--\x3e"})," comment to limit blog post size in the list view."]}),"\n",(0,t.jsx)(s.p,{children:"Lorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque elementum dignissim ultricies. Fusce rhoncus ipsum tempor eros aliquam consequat. Lorem ipsum dolor sit amet"}),"\n",(0,t.jsx)(s.p,{children:"Lorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque elementum dignissim ultricies. Fusce rhoncus ipsum tempor eros aliquam consequat. Lorem ipsum dolor sit amet"}),"\n",(0,t.jsx)(s.p,{children:"Lorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque elementum dignissim ultricies. Fusce rhoncus ipsum tempor eros aliquam consequat. Lorem ipsum dolor sit amet"}),"\n",(0,t.jsx)(s.p,{children:"Lorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque elementum dignissim ultricies. Fusce rhoncus ipsum tempor eros aliquam consequat. Lorem ipsum dolor sit amet"}),"\n",(0,t.jsx)(s.p,{children:"Lorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque elementum dignissim ultricies. Fusce rhoncus ipsum tempor eros aliquam consequat. Lorem ipsum dolor sit amet"}),"\n",(0,t.jsx)(s.p,{children:"Lorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque elementum dignissim ultricies. Fusce rhoncus ipsum tempor eros aliquam consequat. Lorem ipsum dolor sit amet"}),"\n",(0,t.jsx)(s.p,{children:"Lorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque elementum dignissim ultricies. Fusce rhoncus ipsum tempor eros aliquam consequat. Lorem ipsum dolor sit amet"}),"\n",(0,t.jsx)(s.p,{children:"Lorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque elementum dignissim ultricies. Fusce rhoncus ipsum tempor eros aliquam consequat. Lorem ipsum dolor sit amet"}),"\n",(0,t.jsx)(s.p,{children:"Lorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque elementum dignissim ultricies. Fusce rhoncus ipsum tempor eros aliquam consequat. Lorem ipsum dolor sit amet"}),"\n",(0,t.jsx)(s.p,{children:"Lorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque elementum dignissim ultricies. Fusce rhoncus ipsum tempor eros aliquam consequat. Lorem ipsum dolor sit amet"}),"\n",(0,t.jsx)(s.p,{children:"Lorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque elementum dignissim ultricies. Fusce rhoncus ipsum tempor eros aliquam consequat. Lorem ipsum dolor sit amet"}),"\n",(0,t.jsx)(s.p,{children:"Lorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque elementum dignissim ultricies. Fusce rhoncus ipsum tempor eros aliquam consequat. Lorem ipsum dolor sit amet"}),"\n",(0,t.jsx)(s.p,{children:"Lorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque elementum dignissim ultricies. Fusce rhoncus ipsum tempor eros aliquam consequat. Lorem ipsum dolor sit amet"}),"\n",(0,t.jsx)(s.p,{children:"Lorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque elementum dignissim ultricies. Fusce rhoncus ipsum tempor eros aliquam consequat. Lorem ipsum dolor sit amet"}),"\n",(0,t.jsx)(s.p,{children:"Lorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque elementum dignissim ultricies. Fusce rhoncus ipsum tempor eros aliquam consequat. Lorem ipsum dolor sit amet"}),"\n",(0,t.jsx)(s.p,{children:"Lorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque elementum dignissim ultricies. Fusce rhoncus ipsum tempor eros aliquam consequat. Lorem ipsum dolor sit amet"})]})}function a(e={}){const{wrapper:s}={...(0,o.R)(),...e.components};return s?(0,t.jsx)(s,{...e,children:(0,t.jsx)(c,{...e})}):c(e)}},8453:(e,s,i)=>{i.d(s,{R:()=>u,x:()=>r});var t=i(6540);const o={},n=t.createContext(o);function u(e){const s=t.useContext(n);return t.useMemo((function(){return"function"==typeof e?e(s):{...s,...e}}),[s,e])}function r(e){let s;return s=e.disableParentContext?"function"==typeof e.components?e.components(o):e.components||o:u(e.components),t.createElement(n.Provider,{value:s},e.children)}}}]); \ No newline at end of file diff --git a/assets/js/7661071f.8bd2a584.js b/assets/js/7661071f.8bd2a584.js new file mode 100644 index 00000000..c5d40a8e --- /dev/null +++ b/assets/js/7661071f.8bd2a584.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunkdocs=self.webpackChunkdocs||[]).push([[8737],{4137:(e,o,s)=>{s.r(o),s.d(o,{assets:()=>c,contentTitle:()=>l,default:()=>d,frontMatter:()=>r,metadata:()=>a,toc:()=>u});var t=s(4848),n=s(8453);const r={slug:"welcome",title:"Welcome",authors:["slorber","yangshun"],tags:["facebook","hello","docusaurus"]},l=void 0,a={permalink:"/protoc-gen-go-temporal/blog/welcome",editUrl:"https://github.com/facebook/docusaurus/tree/main/packages/create-docusaurus/templates/shared/blog/2021-08-26-welcome/index.md",source:"@site/blog/2021-08-26-welcome/index.md",title:"Welcome",description:"Docusaurus blogging features are powered by the blog plugin.",date:"2021-08-26T00:00:00.000Z",formattedDate:"August 26, 2021",tags:[{label:"facebook",permalink:"/protoc-gen-go-temporal/blog/tags/facebook"},{label:"hello",permalink:"/protoc-gen-go-temporal/blog/tags/hello"},{label:"docusaurus",permalink:"/protoc-gen-go-temporal/blog/tags/docusaurus"}],readingTime:.405,hasTruncateMarker:!1,authors:[{name:"S\xe9bastien Lorber",title:"Docusaurus maintainer",url:"https://sebastienlorber.com",imageURL:"https://github.com/slorber.png",key:"slorber"},{name:"Yangshun Tay",title:"Front End Engineer @ Facebook",url:"https://github.com/yangshun",imageURL:"https://github.com/yangshun.png",key:"yangshun"}],frontMatter:{slug:"welcome",title:"Welcome",authors:["slorber","yangshun"],tags:["facebook","hello","docusaurus"]},unlisted:!1,nextItem:{title:"MDX Blog Post",permalink:"/protoc-gen-go-temporal/blog/mdx-blog-post"}},c={authorsImageUrls:[void 0,void 0]},u=[];function i(e){const o={a:"a",code:"code",img:"img",li:"li",p:"p",strong:"strong",ul:"ul",...(0,n.R)(),...e.components};return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)(o.p,{children:[(0,t.jsx)(o.a,{href:"https://docusaurus.io/docs/blog",children:"Docusaurus blogging features"})," are powered by the ",(0,t.jsx)(o.a,{href:"https://docusaurus.io/docs/api/plugins/@docusaurus/plugin-content-blog",children:"blog plugin"}),"."]}),"\n",(0,t.jsxs)(o.p,{children:["Simply add Markdown files (or folders) to the ",(0,t.jsx)(o.code,{children:"blog"})," directory."]}),"\n",(0,t.jsxs)(o.p,{children:["Regular blog authors can be added to ",(0,t.jsx)(o.code,{children:"authors.yml"}),"."]}),"\n",(0,t.jsx)(o.p,{children:"The blog post date can be extracted from filenames, such as:"}),"\n",(0,t.jsxs)(o.ul,{children:["\n",(0,t.jsx)(o.li,{children:(0,t.jsx)(o.code,{children:"2019-05-30-welcome.md"})}),"\n",(0,t.jsx)(o.li,{children:(0,t.jsx)(o.code,{children:"2019-05-30-welcome/index.md"})}),"\n"]}),"\n",(0,t.jsx)(o.p,{children:"A blog post folder can be convenient to co-locate blog post images:"}),"\n",(0,t.jsx)(o.p,{children:(0,t.jsx)(o.img,{alt:"Docusaurus Plushie",src:s(3449).A+"",width:"1500",height:"500"})}),"\n",(0,t.jsx)(o.p,{children:"The blog supports tags as well!"}),"\n",(0,t.jsxs)(o.p,{children:[(0,t.jsx)(o.strong,{children:"And if you don't want a blog"}),": just delete this directory, and use ",(0,t.jsx)(o.code,{children:"blog: false"})," in your Docusaurus config."]})]})}function d(e={}){const{wrapper:o}={...(0,n.R)(),...e.components};return o?(0,t.jsx)(o,{...e,children:(0,t.jsx)(i,{...e})}):i(e)}},3449:(e,o,s)=>{s.d(o,{A:()=>t});const t=s.p+"assets/images/docusaurus-plushie-banner-a60f7593abca1e3eef26a9afa244e4fb.jpeg"},8453:(e,o,s)=>{s.d(o,{R:()=>l,x:()=>a});var t=s(6540);const n={},r=t.createContext(n);function l(e){const o=t.useContext(r);return t.useMemo((function(){return"function"==typeof e?e(o):{...o,...e}}),[o,e])}function a(e){let o;return o=e.disableParentContext?"function"==typeof e.components?e.components(n):e.components||n:l(e.components),t.createElement(r.Provider,{value:o},e.children)}}}]); \ No newline at end of file diff --git a/assets/js/7661071f.b38144f9.js b/assets/js/7661071f.b38144f9.js deleted file mode 100644 index a4671d13..00000000 --- a/assets/js/7661071f.b38144f9.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunkdocs=self.webpackChunkdocs||[]).push([[8737],{4137:(e,o,s)=>{s.r(o),s.d(o,{assets:()=>c,contentTitle:()=>l,default:()=>d,frontMatter:()=>r,metadata:()=>a,toc:()=>u});var t=s(4848),n=s(8453);const r={slug:"welcome",title:"Welcome",authors:["slorber","yangshun"],tags:["facebook","hello","docusaurus"]},l=void 0,a={permalink:"/blog/welcome",editUrl:"https://github.com/facebook/docusaurus/tree/main/packages/create-docusaurus/templates/shared/blog/2021-08-26-welcome/index.md",source:"@site/blog/2021-08-26-welcome/index.md",title:"Welcome",description:"Docusaurus blogging features are powered by the blog plugin.",date:"2021-08-26T00:00:00.000Z",formattedDate:"August 26, 2021",tags:[{label:"facebook",permalink:"/blog/tags/facebook"},{label:"hello",permalink:"/blog/tags/hello"},{label:"docusaurus",permalink:"/blog/tags/docusaurus"}],readingTime:.405,hasTruncateMarker:!1,authors:[{name:"S\xe9bastien Lorber",title:"Docusaurus maintainer",url:"https://sebastienlorber.com",imageURL:"https://github.com/slorber.png",key:"slorber"},{name:"Yangshun Tay",title:"Front End Engineer @ Facebook",url:"https://github.com/yangshun",imageURL:"https://github.com/yangshun.png",key:"yangshun"}],frontMatter:{slug:"welcome",title:"Welcome",authors:["slorber","yangshun"],tags:["facebook","hello","docusaurus"]},unlisted:!1,nextItem:{title:"MDX Blog Post",permalink:"/blog/mdx-blog-post"}},c={authorsImageUrls:[void 0,void 0]},u=[];function i(e){const o={a:"a",code:"code",img:"img",li:"li",p:"p",strong:"strong",ul:"ul",...(0,n.R)(),...e.components};return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)(o.p,{children:[(0,t.jsx)(o.a,{href:"https://docusaurus.io/docs/blog",children:"Docusaurus blogging features"})," are powered by the ",(0,t.jsx)(o.a,{href:"https://docusaurus.io/docs/api/plugins/@docusaurus/plugin-content-blog",children:"blog plugin"}),"."]}),"\n",(0,t.jsxs)(o.p,{children:["Simply add Markdown files (or folders) to the ",(0,t.jsx)(o.code,{children:"blog"})," directory."]}),"\n",(0,t.jsxs)(o.p,{children:["Regular blog authors can be added to ",(0,t.jsx)(o.code,{children:"authors.yml"}),"."]}),"\n",(0,t.jsx)(o.p,{children:"The blog post date can be extracted from filenames, such as:"}),"\n",(0,t.jsxs)(o.ul,{children:["\n",(0,t.jsx)(o.li,{children:(0,t.jsx)(o.code,{children:"2019-05-30-welcome.md"})}),"\n",(0,t.jsx)(o.li,{children:(0,t.jsx)(o.code,{children:"2019-05-30-welcome/index.md"})}),"\n"]}),"\n",(0,t.jsx)(o.p,{children:"A blog post folder can be convenient to co-locate blog post images:"}),"\n",(0,t.jsx)(o.p,{children:(0,t.jsx)(o.img,{alt:"Docusaurus Plushie",src:s(3449).A+"",width:"1500",height:"500"})}),"\n",(0,t.jsx)(o.p,{children:"The blog supports tags as well!"}),"\n",(0,t.jsxs)(o.p,{children:[(0,t.jsx)(o.strong,{children:"And if you don't want a blog"}),": just delete this directory, and use ",(0,t.jsx)(o.code,{children:"blog: false"})," in your Docusaurus config."]})]})}function d(e={}){const{wrapper:o}={...(0,n.R)(),...e.components};return o?(0,t.jsx)(o,{...e,children:(0,t.jsx)(i,{...e})}):i(e)}},3449:(e,o,s)=>{s.d(o,{A:()=>t});const t=s.p+"assets/images/docusaurus-plushie-banner-a60f7593abca1e3eef26a9afa244e4fb.jpeg"},8453:(e,o,s)=>{s.d(o,{R:()=>l,x:()=>a});var t=s(6540);const n={},r=t.createContext(n);function l(e){const o=t.useContext(r);return t.useMemo((function(){return"function"==typeof e?e(o):{...o,...e}}),[o,e])}function a(e){let o;return o=e.disableParentContext?"function"==typeof e.components?e.components(n):e.components||n:l(e.components),t.createElement(r.Provider,{value:o},e.children)}}}]); \ No newline at end of file diff --git a/assets/js/77587487.6fcb8571.js b/assets/js/77587487.6fcb8571.js new file mode 100644 index 00000000..8a5f27fc --- /dev/null +++ b/assets/js/77587487.6fcb8571.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunkdocs=self.webpackChunkdocs||[]).push([[8232],{9339:(e,n,r)=>{r.r(n),r.d(n,{assets:()=>s,contentTitle:()=>i,default:()=>p,frontMatter:()=>l,metadata:()=>c,toc:()=>a});var o=r(4848),t=r(8453);const l={},i="Reference",c={id:"reference",title:"Reference",description:"This page provides an overview of the Go code generated by protoc-gen-go_temporal.",source:"@site/docs/reference.md",sourceDirName:".",slug:"/reference",permalink:"/protoc-gen-go-temporal/docs/reference",draft:!1,unlisted:!1,editUrl:"https://github.com/facebook/docusaurus/tree/main/packages/create-docusaurus/templates/shared/docs/reference.md",tags:[],version:"current",frontMatter:{}},s={},a=[{value:"Constants & Variables",id:"constants--variables",level:2},{value:"ActivityName",id:"activityname",level:3},{value:"QueryName",id:"queryname",level:3},{value:"SignalName",id:"signalname",level:3},{value:"TaskQueue",id:"taskqueue",level:3},{value:"UpdateIDExpression",id:"updateidexpression",level:3},{value:"UpdateName",id:"updatename",level:3},{value:"WorkflowIDExpression",id:"workflowidexpression",level:3},{value:"WorkflowName",id:"workflowname",level:3},{value:"WorkflowSearchAttributesMapping",id:"workflowsearchattributesmapping",level:3},{value:"Client",id:"client",level:2},{value:"Interface",id:"interface",level:3},{value:"NewClient function",id:"newclient-function",level:4},{value:"NewClientWithOptions function",id:"newclientwithoptions-function",level:4},{value:"GetWorkflow method",id:"getworkflow-method",level:4},{value:"Query method",id:"query-method",level:4},{value:"Signal method",id:"signal-method",level:4},{value:"SignalWithStartWorkflow method",id:"signalwithstartworkflow-method",level:4},{value:"SignalWithStartWorkflow method (asynchronous)",id:"signalwithstartworkflow-method-asynchronous",level:4},{value:"Update method",id:"update-method",level:4},{value:"Update method (asynchronous)",id:"update-method-asynchronous",level:4},{value:"Workflow method",id:"workflow-method",level:4},{value:"Workflow method (asynchronous)",id:"workflow-method-asynchronous",level:4},{value:"UpdateHandle interface",id:"updatehandle-interface",level:3},{value:"Get method",id:"get-method",level:4},{value:"RunID method",id:"runid-method",level:4},{value:"UpdateID method",id:"updateid-method",level:4},{value:"WorkflowID method",id:"workflowid-method",level:4},{value:"WorkflowOptions struct",id:"workflowoptions-struct",level:3},{value:"NewWorkflowOptions function",id:"newworkflowoptions-function",level:4},{value:"WithStartWorkflowOptions method",id:"withstartworkflowoptions-method",level:4},{value:"WorkflowRun interface",id:"workflowrun-interface",level:3},{value:"Cancel method",id:"cancel-method",level:4},{value:"Get method",id:"get-method-1",level:4},{value:"ID method",id:"id-method",level:4},{value:"Query method",id:"query-method-1",level:4},{value:"Run method",id:"run-method",level:4},{value:"RunID method",id:"runid-method-1",level:4},{value:"Signal method",id:"signal-method-1",level:4},{value:"Terminate method",id:"terminate-method",level:4},{value:"Update method",id:"update-method-1",level:4},{value:"Update method (asynchronous)",id:"update-method-asynchronous-1",level:4},{value:"Worker",id:"worker",level:2},{value:"Activities interface",id:"activities-interface",level:3},{value:"RegisterActivities function",id:"registeractivities-function",level:3},{value:"RegisterActivity function",id:"registeractivity-function",level:3},{value:"Activity function",id:"activity-function",level:3},{value:"ActivityAsync function",id:"activityasync-function",level:3},{value:"ActivityLocal function",id:"activitylocal-function",level:3},{value:"ActivityLocalAsync function",id:"activitylocalasync-function",level:3},{value:"ActivityFuture struct",id:"activityfuture-struct",level:3},{value:"Get method",id:"get-method-2",level:4},{value:"Select method",id:"select-method",level:4},{value:"ActivityOptions struct",id:"activityoptions-struct",level:3},{value:"NewActivityOptions function",id:"newactivityoptions-function",level:4},{value:"WithActivityOptions method",id:"withactivityoptions-method",level:4},{value:"LocalActivityOptions struct",id:"localactivityoptions-struct",level:3},{value:"Local method",id:"local-method",level:4},{value:"NewLocalActivityOptions function",id:"newlocalactivityoptions-function",level:4},{value:"WithLocalActivityOptions method",id:"withlocalactivityoptions-method",level:4},{value:"Signal struct",id:"signal-struct",level:3},{value:"Receive method",id:"receive-method",level:4},{value:"ReceiveAsync method",id:"receiveasync-method",level:4},{value:"Select method",id:"select-method-1",level:4},{value:"SignalExternal function",id:"signalexternal-function",level:3},{value:"SignalExternalAsync function",id:"signalexternalasync-function",level:3},{value:"Workflows interface",id:"workflows-interface",level:3},{value:"RegisterWorkflows function",id:"registerworkflows-function",level:3},{value:"RegisterWorkflow function",id:"registerworkflow-function",level:3},{value:"Workflow interface",id:"workflow-interface",level:3},{value:"WorkflowChild function",id:"workflowchild-function",level:3},{value:"WorkflowChildAsync function",id:"workflowchildasync-function",level:3},{value:"WorkflowChildOptions struct",id:"workflowchildoptions-struct",level:3},{value:"NewWorkflowChildOptions function",id:"newworkflowchildoptions-function",level:4},{value:"WithChildWorkflowOptions method",id:"withchildworkflowoptions-method",level:4},{value:"WorkflowInput struct",id:"workflowinput-struct",level:3},{value:"WorkflowChildRun struct",id:"workflowchildrun-struct",level:3},{value:"Get method",id:"get-method-3",level:4},{value:"Select method",id:"select-method-2",level:4},{value:"SelectStart method",id:"selectstart-method",level:4},{value:"Signal method",id:"signal-method-2",level:4},{value:"SignalAsync method",id:"signalasync-method",level:4},{value:"WaitStart method",id:"waitstart-method",level:4}];function d(e){const n={a:"a",code:"code",em:"em",h1:"h1",h2:"h2",h3:"h3",h4:"h4",hr:"hr",p:"p",pre:"pre",strong:"strong",...(0,t.R)(),...e.components};return(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(n.h1,{id:"reference",children:"Reference"}),"\n",(0,o.jsxs)(n.p,{children:["This page provides an overview of the Go code generated by ",(0,o.jsx)(n.code,{children:"protoc-gen-go_temporal"}),"."]}),"\n",(0,o.jsx)(n.h2,{id:"constants--variables",children:"Constants & Variables"}),"\n",(0,o.jsx)(n.h3,{id:"activityname",children:"ActivityName"}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{className:"language-go",children:"const ActivityName string\n"})}),"\n",(0,o.jsx)(n.p,{children:"String constants defining the canonical name for each activity"}),"\n",(0,o.jsx)(n.p,{children:(0,o.jsx)(n.a,{href:"#generated-code-reference",children:"top"})}),"\n",(0,o.jsx)(n.h3,{id:"queryname",children:"QueryName"}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{className:"language-go",children:"const QueryName string\n"})}),"\n",(0,o.jsx)(n.p,{children:"String constants defining the canonical name for each query"}),"\n",(0,o.jsx)(n.p,{children:(0,o.jsx)(n.a,{href:"#generated-code-reference",children:"top"})}),"\n",(0,o.jsx)(n.h3,{id:"signalname",children:"SignalName"}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{className:"language-go",children:"const SignalName string\n"})}),"\n",(0,o.jsx)(n.p,{children:"String constants defining the canonical name for each signal"}),"\n",(0,o.jsx)(n.p,{children:(0,o.jsx)(n.a,{href:"#generated-code-reference",children:"top"})}),"\n",(0,o.jsx)(n.h3,{id:"taskqueue",children:"TaskQueue"}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{className:"language-go",children:"const TaskQueue string\n"})}),"\n",(0,o.jsxs)(n.p,{children:["String constants defining the default task queue name for each service that defines the ",(0,o.jsx)(n.code,{children:"task_queue"})," option"]}),"\n",(0,o.jsx)(n.p,{children:(0,o.jsx)(n.a,{href:"#generated-code-reference",children:"top"})}),"\n",(0,o.jsx)(n.h3,{id:"updateidexpression",children:"UpdateIDExpression"}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{className:"language-go",children:"var IDExpression *expression.Expression\n"})}),"\n",(0,o.jsxs)(n.p,{children:["Expression variable referencing the parsed ID expression for each update that defines the ",(0,o.jsx)(n.code,{children:"id"})," option"]}),"\n",(0,o.jsx)(n.p,{children:(0,o.jsx)(n.a,{href:"#generated-code-reference",children:"top"})}),"\n",(0,o.jsx)(n.h3,{id:"updatename",children:"UpdateName"}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{className:"language-go",children:"const UpdateName string\n"})}),"\n",(0,o.jsx)(n.p,{children:"String constants defining the canonical name for each update"}),"\n",(0,o.jsx)(n.p,{children:(0,o.jsx)(n.a,{href:"#generated-code-reference",children:"top"})}),"\n",(0,o.jsx)(n.h3,{id:"workflowidexpression",children:"WorkflowIDExpression"}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{className:"language-go",children:"var IDExpression *expression.Expression\n"})}),"\n",(0,o.jsxs)(n.p,{children:["Expression variable referencing the parsed ID expression for each workflow that defines the ",(0,o.jsx)(n.code,{children:"id"})," option"]}),"\n",(0,o.jsx)(n.p,{children:(0,o.jsx)(n.a,{href:"#generated-code-reference",children:"top"})}),"\n",(0,o.jsx)(n.h3,{id:"workflowname",children:"WorkflowName"}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{className:"language-go",children:"const WorkflowName string\n"})}),"\n",(0,o.jsx)(n.p,{children:"String constant defining the canonical name for each workflow"}),"\n",(0,o.jsx)(n.p,{children:(0,o.jsx)(n.a,{href:"#generated-code-reference",children:"top"})}),"\n",(0,o.jsx)(n.h3,{id:"workflowsearchattributesmapping",children:"WorkflowSearchAttributesMapping"}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{className:"language-go",children:"var SearchAttributesMapping *expression.Expression\n"})}),"\n",(0,o.jsxs)(n.p,{children:["Expression variable referencing the parsed search attributes expression for each workflow that defines the ",(0,o.jsx)(n.code,{children:"search_attributes"})," option"]}),"\n",(0,o.jsx)(n.p,{children:(0,o.jsx)(n.a,{href:"#generated-code-reference",children:"top"})}),"\n",(0,o.jsx)(n.h2,{id:"client",children:"Client"}),"\n",(0,o.jsx)(n.h3,{id:"interface",children:"Interface"}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{className:"language-go",children:"type Client interface {}\n"})}),"\n",(0,o.jsx)(n.p,{children:"Interface describing the generated client for each service. A generated client provides typed methods for executing a given service's workflows, queries, signals, and updates."}),"\n",(0,o.jsx)(n.p,{children:(0,o.jsx)(n.strong,{children:"Example"})}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{className:"language-protobuf",children:"package example.v1;\n\nservice Example {\n option (temporal.v1.service) = {\n task_queue: 'example-v1'\n };\n\n rpc Hello(HelloRequest) returns (HelloResponse) {\n option (temporal.v1.workflow) = {\n id: 'hello/${!uuid_v4()}'\n execution_timeout: { seconds: 5 }\n };\n }\n}\n"})}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{className:"language-go",children:"type ExampleClient interface {\n // Hello executes a(n) example.v1.Example.Hello workflow and blocks until error\n // or response received\n Hello(ctx context.Context, req *HelloRequest, opts ...*HelloOptions) (*HelloResponse, error)\n\n // HelloAsync starts a(n) example.v1.Example.Hello workflow and returns a handle\n // to the workflow run\n HelloAsync(ctx context.Context, req *HelloRequest, opts ...*HelloOptions) (HelloRun, error)\n \n // GetHello retrieves a handle to an existing example.v1.Example.Hello workflow\n // execution\n GetHello(ctx context.Context, workflowID, runID string) (HelloRun, error)\n}\n"})}),"\n",(0,o.jsx)(n.p,{children:(0,o.jsx)(n.a,{href:"#generated-code-reference",children:"top"})}),"\n",(0,o.jsx)(n.hr,{}),"\n",(0,o.jsx)(n.h4,{id:"newclient-function",children:"NewClient function"}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{className:"language-go",children:"func NewClient(client.Client) Client\n"})}),"\n",(0,o.jsxs)(n.p,{children:["Constructor function that returns a new ",(0,o.jsx)(n.a,{href:"#interface",children:"client interface"})," implementation for the underlying Temporal client"]}),"\n",(0,o.jsx)(n.p,{children:(0,o.jsx)(n.strong,{children:"Example"})}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{className:"language-protobuf",children:"service Example {\n option (temporal.v1.service) = {\n task_queue: 'example-v1'\n };\n\n rpc Hello(HelloRequest) returns (HelloResponse) {\n option (temporal.v1.workflow) = {\n id: 'hello/${!uuid_v4()}'\n execution_timeout: { seconds: 5 }\n };\n }\n}\n"})}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{className:"language-go",children:'func main() {\n c, _ := client.Dial(client.Options{})\n example := examplev1.NewExampleClient(c)\n resp, _ := example.Hello(context.Background(), &examplev1.HelloRequest{})\n log.Printf("hello workflow response: %s", resp.String())\n}\n'})}),"\n",(0,o.jsx)(n.p,{children:(0,o.jsx)(n.a,{href:"#generated-code-reference",children:"top"})}),"\n",(0,o.jsx)(n.hr,{}),"\n",(0,o.jsx)(n.h4,{id:"newclientwithoptions-function",children:"NewClientWithOptions function"}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{className:"language-go",children:"func NewClientWithOptions(client.Client, client.Options) (Client, error)\n"})}),"\n",(0,o.jsxs)(n.p,{children:["Constructor function that returns a new ",(0,o.jsx)(n.a,{href:"#interface",children:"client interface"})," implementation for the underlying Temporal client and provided client options."]}),"\n",(0,o.jsx)(n.p,{children:(0,o.jsx)(n.a,{href:"#generated-code-reference",children:"top"})}),"\n",(0,o.jsx)(n.hr,{}),"\n",(0,o.jsx)(n.h4,{id:"getworkflow-method",children:"GetWorkflow method"}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{className:"language-go",children:"func (Client) WithAsync(\n ctx context.Context,\n workflowID string,\n runID string,\n) (Run, error)\n"})}),"\n",(0,o.jsxs)(n.p,{children:["Returns a ",(0,o.jsx)(n.a,{href:"#workflowrun-interface",children:"WorkflowRun"})," for an existing workflow execution. If an empty string (",(0,o.jsx)(n.code,{children:'""'}),") is provided for ",(0,o.jsx)(n.code,{children:"runID"}),", the latest workflow execution will be used."]}),"\n",(0,o.jsx)(n.p,{children:(0,o.jsx)(n.strong,{children:"Example"})}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{className:"language-protobuf",children:"service Example {\n rpc Foo(FooRequest) returns (FooResponse) {\n option (temporal.v1.workflow) = {};\n }\n}\n"})}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{className:"language-go",children:"type ExampleClient interface {\n GetFoo(ctx context.Context, workflowID, runID string) (FooRun, error)\n}\n"})}),"\n",(0,o.jsx)(n.p,{children:(0,o.jsx)(n.a,{href:"#generated-code-reference",children:"top"})}),"\n",(0,o.jsx)(n.hr,{}),"\n",(0,o.jsx)(n.h4,{id:"query-method",children:"Query method"}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{className:"language-go",children:"func (Client) (\n ctx context.Context, \n workflowId string,\n runId string,\n [req *Request],\n) ([*Response], error)\n"})}),"\n",(0,o.jsxs)(n.p,{children:["Executes the corresponding query on an existing workflow execution using the configured default options. Passing an empty string as the ",(0,o.jsx)(n.code,{children:"runID"})," will target the ",(0,o.jsx)(n.em,{children:"latest"})," workflow execution with ",(0,o.jsx)(n.code,{children:"workflowID"}),"."]}),"\n",(0,o.jsx)(n.p,{children:(0,o.jsx)(n.strong,{children:"Example"})}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{className:"language-protobuf",children:"service Example {\n rpc Foo(google.protobuf.Empty) returns (FooResponse) {\n option (temporal.v1.query) = {};\n }\n\n rpc Bar(BarRequest) returns (BarResponse) {\n option (temporal.v1.query) = {};\n }\n}\n"})}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{className:"language-go",children:"type ExampleClient interface {\n Foo(ctx context.Context, workflowID, runID string) error\n Bar(ctx context.Context, workflowID, runID string, req *BarRequest) (*BarResponse, error)\n}\n"})}),"\n",(0,o.jsx)(n.p,{children:(0,o.jsx)(n.a,{href:"#generated-code-reference",children:"top"})}),"\n",(0,o.jsx)(n.hr,{}),"\n",(0,o.jsx)(n.h4,{id:"signal-method",children:"Signal method"}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{className:"language-go",children:"func (Client) (\n ctx context.Context, \n workflowID string,\n runID string,\n [req *Request],\n) error\n"})}),"\n",(0,o.jsx)(n.p,{children:"Executes the corresponding signal on an existing workflow execution using the configured default options"}),"\n",(0,o.jsx)(n.p,{children:(0,o.jsx)(n.strong,{children:"Example"})}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{className:"language-protobuf",children:"service Example {\n rpc Foo(google.protobuf.Empty) returns (google.protobuf.Empty) {\n option (temporal.v1.signal) = {};\n }\n\n rpc Bar(BarRequest) returns (google.protobuf.Empty) {\n option (temporal.v1.signal) = {};\n }\n}\n"})}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{className:"language-go",children:"type ExampleClient interface {\n Foo(ctx context.Context, workflowID, runID string) error\n Bar(ctx context.Context, workflowID, runID string, req *BarRequest) error\n}\n"})}),"\n",(0,o.jsx)(n.p,{children:(0,o.jsx)(n.a,{href:"#generated-code-reference",children:"top"})}),"\n",(0,o.jsx)(n.hr,{}),"\n",(0,o.jsx)(n.h4,{id:"signalwithstartworkflow-method",children:"SignalWithStartWorkflow method"}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{className:"language-go",children:"func (Client) With(\n ctx context.Context,\n [req *Request],\n [signal *Request],\n opts ...*Options,\n) ([*Response], error)\n"})}),"\n",(0,o.jsx)(n.p,{children:"Executes the corresponding signal against an existing workflow execution using the configured default options, starting it if necessary, and blocking until the workflow completes or errors"}),"\n",(0,o.jsx)(n.p,{children:(0,o.jsx)(n.strong,{children:"Example"})}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{className:"language-protobuf",children:"service Example {\n rpc Foo(FooRequest) returns (FooResponse) {\n option (temporal.v1.workflow) = {\n signal: { ref: 'Bar', start: true }\n };\n }\n\n rpc Bar(BarRequest) returns (google.protobuf.Empty) {\n option (temporal.v1.signal) = {};\n }\n}\n"})}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{className:"language-go",children:"type ExampleClient interface {\n FooWithBar(\n ctx context.Context, \n req *FooRequest, \n signal *BarRequest, \n opts ...*FooOptions,\n ) (*FooResponse, error)\n}\n"})}),"\n",(0,o.jsx)(n.p,{children:(0,o.jsx)(n.a,{href:"#generated-code-reference",children:"top"})}),"\n",(0,o.jsx)(n.hr,{}),"\n",(0,o.jsx)(n.h4,{id:"signalwithstartworkflow-method-asynchronous",children:"SignalWithStartWorkflow method (asynchronous)"}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{className:"language-go",children:"func (Client) WithAsync(\n ctx context.Context,\n [req *Request],\n [signal *Request],\n opts ...*Options,\n) (Run, error)\n"})}),"\n",(0,o.jsxs)(n.p,{children:["Executes the corresponding signal against an existing workflow execution using the configured default options, starting it if necessary, and returning a ",(0,o.jsx)(n.a,{href:"#workflowrun-interface",children:"WorkflowRun"})," for the workflow execution"]}),"\n",(0,o.jsx)(n.p,{children:(0,o.jsx)(n.strong,{children:"Example"})}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{className:"language-protobuf",children:"service Example {\n rpc Foo(FooRequest) returns (FooResponse) {\n option (temporal.v1.workflow) = {\n signal: { ref: 'Bar', start: true }\n };\n }\n\n rpc Bar(BarRequest) returns (google.protobuf.Empty) {\n option (temporal.v1.signal) = {};\n }\n}\n"})}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{className:"language-go",children:"type ExampleClient interface {\n FooWithBarAsync(\n ctx context.Context, \n req *FooRequest, \n signal *BarRequest, \n opts ...*FooOptions,\n ) (FooRun, error)\n}\n"})}),"\n",(0,o.jsx)(n.p,{children:(0,o.jsx)(n.a,{href:"#generated-code-reference",children:"top"})}),"\n",(0,o.jsx)(n.hr,{}),"\n",(0,o.jsx)(n.h4,{id:"update-method",children:"Update method"}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{className:"language-go",children:"func (Client) (\n ctx context.Context, \n workflowID string, \n runID string, \n [req *Request],\n opts ...*Options,\n) ([*Response], error)\n"})}),"\n",(0,o.jsx)(n.p,{children:"Executes the corresponding update on an existing workflow execution using the configured default options, blocking until update completes or errors"}),"\n",(0,o.jsx)(n.p,{children:(0,o.jsx)(n.strong,{children:"Example"})}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{className:"language-protobuf",children:"service Example {\n rpc Foo(google.protobuf.Empty) returns (google.protobuf.Empty) {\n option (temporal.v1.update) = {};\n }\n\n rpc Bar(BarRequest) returns (google.protobuf.Empty) {\n option (temporal.v1.update) = {};\n }\n\n rpc Baz(google.protobuf.Empty) returns (BazResponse) {\n option (temporal.v1.update) = {};\n }\n\n rpc Qux(QuxRequest) returns (QuxResponse) {\n option (temporal.v1.update) = {};\n }\n}\n"})}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{className:"language-go",children:"type ExampleClient interface {\n Foo(ctx context.Context, workflowID, runID string, opts ...*FooOptions) error\n Bar(ctx context.Context, workflowID, runID string, req *BarRequest, opts ...*BarOptions) error\n Baz(ctx context.Context, workflowID, runID string, opts ...*BazOptions) (*BazResponse, error)\n Qux(ctx context.Context, workflowID, runID string, req *QuxRequest, opts ...*QuxOptions) (*QuxResponse, error)\n}\n"})}),"\n",(0,o.jsx)(n.p,{children:(0,o.jsx)(n.a,{href:"#generated-code-reference",children:"top"})}),"\n",(0,o.jsx)(n.hr,{}),"\n",(0,o.jsx)(n.h4,{id:"update-method-asynchronous",children:"Update method (asynchronous)"}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{className:"language-go",children:"func (Client) Async(\n ctx context.Context, \n workflowID string, \n runID string, \n [req *Request],\n opts ...*Options,\n) (Handle, error)\n"})}),"\n",(0,o.jsxs)(n.p,{children:["Executes the corresponding update on an existing workflow execution using the configured default options, returning an ",(0,o.jsx)(n.a,{href:"#updatehandle-interface",children:"UpdateHandle"})," for the update execution"]}),"\n",(0,o.jsx)(n.p,{children:(0,o.jsx)(n.strong,{children:"Example"})}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{className:"language-protobuf",children:"service Example {\n rpc Foo(FooRequest) returns (FooResponse) {\n option (temporal.v1.update) = {};\n }\n}\n"})}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{className:"language-go",children:"type ExampleClient interface {\n FooAsync(ctx context.Context, workflowID, runID string, req *FooRequest, opts ...*FooOptions) (FooHandle, error)\n}\n"})}),"\n",(0,o.jsx)(n.p,{children:(0,o.jsx)(n.a,{href:"#generated-code-reference",children:"top"})}),"\n",(0,o.jsx)(n.hr,{}),"\n",(0,o.jsx)(n.h4,{id:"workflow-method",children:"Workflow method"}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{className:"language-go",children:"func (Client) (\n ctx context.Context, \n [req *Request],\n opts ...*Options,\n) ([*Response], error)\n"})}),"\n",(0,o.jsx)(n.p,{children:"Executes the corresponding workflow using the configured default options, blocking until workflow completes or errors"}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{className:"language-protobuf",children:"service Example {\n rpc Foo(google.protobuf.Empty) returns (google.protobuf.Empty) {\n option (temporal.v1.workflow) = {};\n }\n\n rpc Bar(BarRequest) returns (google.protobuf.Empty) {\n option (temporal.v1.workflow) = {};\n }\n\n rpc Baz(google.protobuf.Empty) returns (BazResponse) {\n option (temporal.v1.workflow) = {};\n }\n\n rpc Qux(QuxRequest) returns (QuxResponse) {\n option (temporal.v1.workflow) = {};\n }\n}\n"})}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{className:"language-go",children:"type ExampleClient interface {\n Foo(ctx context.Context, opts ...*FooOptions) error\n Bar(ctx context.Context, req *BarRequest, opts ...*BarOptions) error\n Baz(ctx context.Context, opts ...*BazOptions) (*BazResponse, error)\n Qux(ctx context.Context, req *QuxRequest, opts ...*QuxOptions) (*QuxResponse, error)\n}\n"})}),"\n",(0,o.jsx)(n.p,{children:(0,o.jsx)(n.a,{href:"#generated-code-reference",children:"top"})}),"\n",(0,o.jsx)(n.hr,{}),"\n",(0,o.jsx)(n.h4,{id:"workflow-method-asynchronous",children:"Workflow method (asynchronous)"}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{className:"language-go",children:"func (Client) Async(\n ctx context.Context, \n [req *Request],\n opts ...*Options,\n) (Run, error)\n"})}),"\n",(0,o.jsxs)(n.p,{children:["Executes the corresponding workflow using the configured default options, returning a ",(0,o.jsx)(n.a,{href:"#workflowrun-interface",children:"WorkflowRun"})," for the workflow execution"]}),"\n",(0,o.jsx)(n.p,{children:(0,o.jsx)(n.strong,{children:"Example"})}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{className:"language-protobuf",children:"service Example {\n rpc Foo(FooRequest) returns (FooResponse) {\n option (temporal.v1.workflow) = {};\n }\n}\n"})}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{className:"language-go",children:"type ExampleClient interface {\n FooAsync(ctx context.Context, workflowID, runID string, req *FooRequest, opts ...*FooOptions) (FooRun, error)\n}\n"})}),"\n",(0,o.jsx)(n.p,{children:(0,o.jsx)(n.a,{href:"#generated-code-reference",children:"top"})}),"\n",(0,o.jsx)(n.h3,{id:"updatehandle-interface",children:"UpdateHandle interface"}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{className:"language-go",children:"type Handle interface {}\n"})}),"\n",(0,o.jsx)(n.p,{children:"Interface describing an update execution handle returned by asynchronous update methods"}),"\n",(0,o.jsx)(n.p,{children:(0,o.jsx)(n.a,{href:"#generated-code-reference",children:"top"})}),"\n",(0,o.jsx)(n.hr,{}),"\n",(0,o.jsx)(n.h4,{id:"get-method",children:"Get method"}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{className:"language-go",children:"func (Handle) Get(ctx context.Context) ([*Response], error)\n"})}),"\n",(0,o.jsx)(n.p,{children:"Returns the update result, blocking until update completes or errors"}),"\n",(0,o.jsx)(n.p,{children:(0,o.jsx)(n.a,{href:"#generated-code-reference",children:"top"})}),"\n",(0,o.jsx)(n.hr,{}),"\n",(0,o.jsx)(n.h4,{id:"runid-method",children:"RunID method"}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{className:"language-go",children:"func (Handle) RunID() string\n"})}),"\n",(0,o.jsx)(n.p,{children:"Returns the workflow execution ID"}),"\n",(0,o.jsx)(n.p,{children:(0,o.jsx)(n.a,{href:"#generated-code-reference",children:"top"})}),"\n",(0,o.jsx)(n.hr,{}),"\n",(0,o.jsx)(n.h4,{id:"updateid-method",children:"UpdateID method"}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{className:"language-go",children:"func (Handle) UpdateID() string\n"})}),"\n",(0,o.jsx)(n.p,{children:"Returns the update ID"}),"\n",(0,o.jsx)(n.p,{children:(0,o.jsx)(n.a,{href:"#generated-code-reference",children:"top"})}),"\n",(0,o.jsx)(n.hr,{}),"\n",(0,o.jsx)(n.h4,{id:"workflowid-method",children:"WorkflowID method"}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{className:"language-go",children:"func (Handle) WorkflowID() string\n"})}),"\n",(0,o.jsx)(n.p,{children:"Returns the workflow ID"}),"\n",(0,o.jsx)(n.p,{children:(0,o.jsx)(n.a,{href:"#generated-code-reference",children:"top"})}),"\n",(0,o.jsx)(n.h3,{id:"workflowoptions-struct",children:"WorkflowOptions struct"}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{className:"language-go",children:"type Options struct {}\n"})}),"\n",(0,o.jsx)(n.p,{children:"Optional configuration for workfow methods"}),"\n",(0,o.jsx)(n.p,{children:(0,o.jsx)(n.strong,{children:"Example"})}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{className:"language-protobuf",children:"service Example {\n rpc Foo(google.protobuf.Empty) returns (google.protobuf.Empty) {\n option (temporal.v1.workflow) = {\n execution_timeout: { seconds: 60 }\n };\n }\n}\n"})}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{className:"language-go",children:"func example(ctx context.Context, example examplev1.ExampleClient) error {\n return example.Foo(ctx, examplev1.NewFooOptions().\n WithStartWorkflowOptions(client.StartWorkflowOptions{\n ExecutionTimeout: time.Seconds*30\n }),\n )\n}\n"})}),"\n",(0,o.jsx)(n.p,{children:(0,o.jsx)(n.a,{href:"#generated-code-reference",children:"top"})}),"\n",(0,o.jsx)(n.hr,{}),"\n",(0,o.jsx)(n.h4,{id:"newworkflowoptions-function",children:"NewWorkflowOptions function"}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{className:"language-go",children:"func NewOptions() *Options\n"})}),"\n",(0,o.jsx)(n.p,{children:"Returns a new workflow options value for the corresponding workflow"}),"\n",(0,o.jsx)(n.p,{children:(0,o.jsx)(n.a,{href:"#generated-code-reference",children:"top"})}),"\n",(0,o.jsx)(n.hr,{}),"\n",(0,o.jsx)(n.h4,{id:"withstartworkflowoptions-method",children:"WithStartWorkflowOptions method"}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{className:"language-go",children:"func (*Options) WithStartWorkflowOptions(client.StartWorkflowOptions) *Options\n"})}),"\n",(0,o.jsx)(n.p,{children:"Sets dynamic workflow options for an individual workflow execution"}),"\n",(0,o.jsx)(n.p,{children:(0,o.jsx)(n.a,{href:"#generated-code-reference",children:"top"})}),"\n",(0,o.jsx)(n.h3,{id:"workflowrun-interface",children:"WorkflowRun interface"}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{className:"language-go",children:"type Run interface {}\n"})}),"\n",(0,o.jsx)(n.p,{children:"Interface describing a workflow execution handle returned by asynchronous workflow methods"}),"\n",(0,o.jsx)(n.p,{children:(0,o.jsx)(n.a,{href:"#generated-code-reference",children:"top"})}),"\n",(0,o.jsx)(n.hr,{}),"\n",(0,o.jsx)(n.h4,{id:"cancel-method",children:"Cancel method"}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{className:"language-go",children:"type (Run) Cancel(context.Context) error\n"})}),"\n",(0,o.jsx)(n.p,{children:"Cancels the workflow execution"}),"\n",(0,o.jsx)(n.p,{children:(0,o.jsx)(n.a,{href:"#generated-code-reference",children:"top"})}),"\n",(0,o.jsx)(n.hr,{}),"\n",(0,o.jsx)(n.h4,{id:"get-method-1",children:"Get method"}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{className:"language-go",children:"type (Run) Get(context.Context) ([*Response], error)\n"})}),"\n",(0,o.jsx)(n.p,{children:"Returns the workflow result, blocking until workflow completes or errors"}),"\n",(0,o.jsx)(n.p,{children:(0,o.jsx)(n.a,{href:"#generated-code-reference",children:"top"})}),"\n",(0,o.jsx)(n.hr,{}),"\n",(0,o.jsx)(n.h4,{id:"id-method",children:"ID method"}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{className:"language-go",children:"type (Run) ID() string\n"})}),"\n",(0,o.jsx)(n.p,{children:"Returns the workflow ID"}),"\n",(0,o.jsx)(n.p,{children:(0,o.jsx)(n.a,{href:"#generated-code-reference",children:"top"})}),"\n",(0,o.jsx)(n.hr,{}),"\n",(0,o.jsx)(n.h4,{id:"query-method-1",children:"Query method"}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{className:"language-go",children:"type (Run) (context.Context, [*Request]) ([*Response], error)\n"})}),"\n",(0,o.jsx)(n.p,{children:"Executes the corresponding query against the workflow execution using the configured default options"}),"\n",(0,o.jsx)(n.p,{children:(0,o.jsx)(n.a,{href:"#generated-code-reference",children:"top"})}),"\n",(0,o.jsx)(n.hr,{}),"\n",(0,o.jsx)(n.h4,{id:"run-method",children:"Run method"}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{className:"language-go",children:"type (Run) Run() client.WorkflowRun\n"})}),"\n",(0,o.jsxs)(n.p,{children:["Returns the inner ",(0,o.jsx)(n.a,{href:"https://pkg.go.dev/go.temporal.io/sdk/client#WorkflowRun",children:"client.WorkflowRun"})]}),"\n",(0,o.jsx)(n.p,{children:(0,o.jsx)(n.a,{href:"#generated-code-reference",children:"top"})}),"\n",(0,o.jsx)(n.hr,{}),"\n",(0,o.jsx)(n.h4,{id:"runid-method-1",children:"RunID method"}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{className:"language-go",children:"type (Run) RunID() string\n"})}),"\n",(0,o.jsx)(n.p,{children:"Returns the workflow execution ID"}),"\n",(0,o.jsx)(n.p,{children:(0,o.jsx)(n.a,{href:"#generated-code-reference",children:"top"})}),"\n",(0,o.jsx)(n.hr,{}),"\n",(0,o.jsx)(n.h4,{id:"signal-method-1",children:"Signal method"}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{className:"language-go",children:"type (Run) (context.Context, [*Request]) error\n"})}),"\n",(0,o.jsx)(n.p,{children:"Executes the corresponding signal against the workflow execution using the configured default options"}),"\n",(0,o.jsx)(n.p,{children:(0,o.jsx)(n.a,{href:"#generated-code-reference",children:"top"})}),"\n",(0,o.jsx)(n.hr,{}),"\n",(0,o.jsx)(n.h4,{id:"terminate-method",children:"Terminate method"}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{className:"language-go",children:"type (Run) Terminate(\n ctx context.Context,\n reason string,\n details ...any,\n) error\n"})}),"\n",(0,o.jsx)(n.p,{children:"Terminates the workflow execution"}),"\n",(0,o.jsx)(n.p,{children:(0,o.jsx)(n.a,{href:"#generated-code-reference",children:"top"})}),"\n",(0,o.jsx)(n.hr,{}),"\n",(0,o.jsx)(n.h4,{id:"update-method-1",children:"Update method"}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{className:"language-go",children:"type (Run) (\n context.Context, \n [*Request],\n ...*Options,\n) ([*Response], error)\n"})}),"\n",(0,o.jsx)(n.p,{children:"Executes the corresponding update against the workflow execution using the configured default options, blocking until the update completes or errors"}),"\n",(0,o.jsx)(n.p,{children:(0,o.jsx)(n.a,{href:"#generated-code-reference",children:"top"})}),"\n",(0,o.jsx)(n.hr,{}),"\n",(0,o.jsx)(n.h4,{id:"update-method-asynchronous-1",children:"Update method (asynchronous)"}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{className:"language-go",children:"type (Run) (\n context.Context, \n [*Request],\n ...*Options,\n) (Handle, error)\n"})}),"\n",(0,o.jsxs)(n.p,{children:["Executes the corresponding query against the workflow execution using the configured default options, returning an ",(0,o.jsx)(n.a,{href:"#updatehandle-interface",children:"UpdateHandle"})," for the update execution"]}),"\n",(0,o.jsx)(n.p,{children:(0,o.jsx)(n.a,{href:"#generated-code-reference",children:"top"})}),"\n",(0,o.jsx)(n.h2,{id:"worker",children:"Worker"}),"\n",(0,o.jsx)(n.h3,{id:"activities-interface",children:"Activities interface"}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{className:"language-go",children:"type Activities interface {}\n"})}),"\n",(0,o.jsx)(n.p,{children:"Interface used to describe the required Activities struct implementation"}),"\n",(0,o.jsx)(n.p,{children:(0,o.jsx)(n.strong,{children:"Example"})}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{className:"language-protobuf",children:"service Example {\n rpc Foo(google.protobuf.Empty) returns (google.protobuf.Empty) {\n option (temporal.v1.activity) = {};\n }\n\n rpc Bar(BarRequest) returns (google.protobuf.Empty) {\n option (temporal.v1.activity) = {};\n }\n\n rpc Baz(google.protobuf.Empty) returns (BazResponse) {\n option (temporal.v1.activity) = {};\n }\n\n rpc Qux(QuxRequest) returns (QuxResponse) {\n option (temporal.v1.activity) = {};\n }\n}\n"})}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{className:"language-go",children:"type ExampleActivities interface {\n Foo(context.Context) error\n Bar(context.Context, *BarRequest) error\n Baz(context.Context) (*BazResponse, error)\n Qux(context.Context, *QuxRequest) (*QuxResponse, error)\n}\n"})}),"\n",(0,o.jsx)(n.p,{children:(0,o.jsx)(n.a,{href:"#generated-code-reference",children:"top"})}),"\n",(0,o.jsx)(n.h3,{id:"registeractivities-function",children:"RegisterActivities function"}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{className:"language-go",children:"func RegisterActivities(worker.ActivityRegistry, Activities)\n"})}),"\n",(0,o.jsx)(n.p,{children:"Registers all service activities with the provided registry"}),"\n",(0,o.jsx)(n.p,{children:(0,o.jsx)(n.a,{href:"#generated-code-reference",children:"top"})}),"\n",(0,o.jsx)(n.h3,{id:"registeractivity-function",children:"RegisterActivity function"}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{className:"language-go",children:"func RegisterActivity(\n worker.ActivityRegistry, \n func(context.Context, [*Request]) ([*Response], error),\n)\n"})}),"\n",(0,o.jsx)(n.p,{children:"Registers the activity with the provided registry"}),"\n",(0,o.jsx)(n.p,{children:(0,o.jsx)(n.a,{href:"#generated-code-reference",children:"top"})}),"\n",(0,o.jsx)(n.h3,{id:"activity-function",children:"Activity function"}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{className:"language-go",children:"func (\n workflow.Context, \n [*Request],\n ...*ActivityOptions,\n) ([*Response], error)\n"})}),"\n",(0,o.jsx)(n.p,{children:"Executes the corresponding activity, blocking until activity completes or errors"}),"\n",(0,o.jsx)(n.p,{children:(0,o.jsx)(n.strong,{children:"Example"})}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{className:"language-protobuf",children:"service Example {\n rpc Foo(google.protobuf.Empty) returns (google.protobuf.Empty) {\n option (temporal.v1.workflow) = {};\n }\n\n rpc Bar(BarRequest) returns (BarResponse) {\n option (temporal.v1.activity) = {};\n }\n}\n"})}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{className:"language-go",children:'type (\n Activities struct {}\n\n FooWorkflow struct {\n *examplev1.FooInput\n }\n)\n\nfunc (a *Activities) Bar(ctx context.Context, req *BarRequest) (*BarResponse, error) {\n return nil, nil\n}\n\nfunc (w *FooWorkflow) Execute(ctx workflow.Context) error {\n bar, err := examplev1.Bar(ctx, &examplev1.BarRequest{})\n workflow.GetLogger(ctx).Info("executed bar activity", "result", bar)\n return err\n}\n'})}),"\n",(0,o.jsx)(n.p,{children:(0,o.jsx)(n.a,{href:"#generated-code-reference",children:"top"})}),"\n",(0,o.jsx)(n.h3,{id:"activityasync-function",children:"ActivityAsync function"}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{className:"language-go",children:"func Async(\n workflow.Context, \n [*Request],\n ... *ActivityOptions,\n) (Future, error)\n"})}),"\n",(0,o.jsxs)(n.p,{children:["Executes the corresponding activity, returning an ",(0,o.jsx)(n.a,{href:"#activityfuture-interface",children:"ActivityFuture"})," for the activity execution"]}),"\n",(0,o.jsx)(n.p,{children:(0,o.jsx)(n.a,{href:"#generated-code-reference",children:"top"})}),"\n",(0,o.jsx)(n.p,{children:(0,o.jsx)(n.strong,{children:"Example"})}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{className:"language-protobuf",children:"service Example {\n rpc Foo(google.protobuf.Empty) returns (google.protobuf.Empty) {\n option (temporal.v1.workflow) = {};\n }\n\n rpc Bar(BarRequest) returns (BarResponse) {\n option (temporal.v1.activity) = {};\n }\n}\n"})}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{className:"language-go",children:'type (\n Activities struct {}\n\n FooWorkflow struct {\n *examplev1.FooInput\n }\n)\n\nfunc (a *Activities) Bar(ctx context.Context, req *BarRequest) (*BarResponse, error) {\n return nil, nil\n}\n\nfunc (w *FooWorkflow) Execute(ctx workflow.Context) error {\n f, err := examplev1.BarAsync(ctx, &examplev1.BarRequest{})\n if err != nil {\n return fmt.Errorf("error starting bar activity: %w", err)\n }\n bar, err := f.Get(ctx)\n workflow.GetLogger(ctx).Info("executed bar activity", "result", bar)\n return err\n}\n'})}),"\n",(0,o.jsx)(n.p,{children:(0,o.jsx)(n.a,{href:"#generated-code-reference",children:"top"})}),"\n",(0,o.jsx)(n.h3,{id:"activitylocal-function",children:"ActivityLocal function"}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{className:"language-go",children:"func Local(\n workflow.Context, \n [*Request],\n ... *ActivityLocalOptions,\n) ([*Response], error)\n"})}),"\n",(0,o.jsxs)(n.p,{children:["Executes the corresponding activity as a ",(0,o.jsx)(n.a,{href:"https://docs.temporal.io/activities#local-activity",children:"local activity"}),", blocking until local activity completes or errors"]}),"\n",(0,o.jsx)(n.p,{children:(0,o.jsx)(n.a,{href:"#generated-code-reference",children:"top"})}),"\n",(0,o.jsx)(n.h3,{id:"activitylocalasync-function",children:"ActivityLocalAsync function"}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{className:"language-go",children:"func LocalAsync(\n workflow.Context, \n [*Request],\n ... *ActivityLocalOptions,\n) (Future, error)\n"})}),"\n",(0,o.jsxs)(n.p,{children:["Executes the corresponding activity as a ",(0,o.jsx)(n.a,{href:"https://docs.temporal.io/activities#local-activity",children:"local activity"}),", returning an ",(0,o.jsx)(n.a,{href:"#activityfuture-interface",children:"ActivityFuture"})," for the local activity execution"]}),"\n",(0,o.jsx)(n.p,{children:(0,o.jsx)(n.a,{href:"#generated-code-reference",children:"top"})}),"\n",(0,o.jsx)(n.h3,{id:"activityfuture-struct",children:"ActivityFuture struct"}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{className:"language-go",children:"type Future struct {\n Future workflow.Future\n}\n"})}),"\n",(0,o.jsx)(n.p,{children:"Struct providing an interface execution handle returned by asynchronous activity methods"}),"\n",(0,o.jsx)(n.p,{children:(0,o.jsx)(n.a,{href:"#generated-code-reference",children:"top"})}),"\n",(0,o.jsx)(n.hr,{}),"\n",(0,o.jsx)(n.h4,{id:"get-method-2",children:"Get method"}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{className:"language-go",children:"func (*Future) Get(context.Context) ([*Response], error)\n"})}),"\n",(0,o.jsx)(n.p,{children:"Returns the activity result, blocking until activity completes or errors"}),"\n",(0,o.jsx)(n.p,{children:(0,o.jsx)(n.a,{href:"#generated-code-reference",children:"top"})}),"\n",(0,o.jsx)(n.hr,{}),"\n",(0,o.jsx)(n.h4,{id:"select-method",children:"Select method"}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{className:"language-go",children:"func (*Future) Select(workflow.Selector, func(Future)) workflow.Selector\n"})}),"\n",(0,o.jsx)(n.p,{children:"Registers the activity execution callback with the given selector"}),"\n",(0,o.jsx)(n.p,{children:(0,o.jsx)(n.a,{href:"#generated-code-reference",children:"top"})}),"\n",(0,o.jsx)(n.h3,{id:"activityoptions-struct",children:"ActivityOptions struct"}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{className:"language-go",children:"type ActivityOptions struct {}\n"})}),"\n",(0,o.jsx)(n.p,{children:"Optional configuration for activity methods"}),"\n",(0,o.jsx)(n.p,{children:(0,o.jsx)(n.a,{href:"#generated-code-reference",children:"top"})}),"\n",(0,o.jsx)(n.hr,{}),"\n",(0,o.jsx)(n.h4,{id:"newactivityoptions-function",children:"NewActivityOptions function"}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{className:"language-go",children:"func NewActivityOptions() *ActivityOptions\n"})}),"\n",(0,o.jsx)(n.p,{children:"Returns a new activity options value"}),"\n",(0,o.jsx)(n.p,{children:(0,o.jsx)(n.a,{href:"#generated-code-reference",children:"top"})}),"\n",(0,o.jsx)(n.hr,{}),"\n",(0,o.jsx)(n.h4,{id:"withactivityoptions-method",children:"WithActivityOptions method"}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{className:"language-go",children:"func (*ActivityOptions) WithActivityOptions(workflow.ActivityOptions) *ActivityOptions\n"})}),"\n",(0,o.jsx)(n.p,{children:"Sets dynamic activity options for an individual activity execution"}),"\n",(0,o.jsx)(n.p,{children:(0,o.jsx)(n.strong,{children:"Example"})}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{className:"language-protobuf",children:"service Example {\n rpc Foo(google.protobuf.Empty) returns (google.protobuf.Empty) {\n option (temporal.v1.workflow) = {};\n }\n\n rpc Bar(BarRequest) returns (BarResponse) {\n option (temporal.v1.activity) = {};\n }\n}\n"})}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{className:"language-go",children:'type (\n Activities struct {}\n\n FooWorkflow struct {\n *examplev1.FooInput\n }\n)\n\nfunc (a *Activities) Bar(ctx context.Context, req *BarRequest) (*BarResponse, error) {\n return nil, nil\n}\n\nfunc (w *FooWorkflow) Execute(ctx workflow.Context) error {\n opts := workflow.GetActivityOptions(ctx)\n opts.StartToCloseTimeout = time.Second*30\n bar, err := examplev1.Bar(\n ctx, \n &examplev1.BarRequest{}, \n examplev1.NewBarActivityOptions().\n WithActivityOptions(opts),\n )\n workflow.GetLogger(ctx).Info("executed bar activity", "result", bar)\n return err\n}\n'})}),"\n",(0,o.jsx)(n.p,{children:(0,o.jsx)(n.a,{href:"#generated-code-reference",children:"top"})}),"\n",(0,o.jsx)(n.h3,{id:"localactivityoptions-struct",children:"LocalActivityOptions struct"}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{className:"language-go",children:"type LocalActivityOptions struct {}\n"})}),"\n",(0,o.jsx)(n.p,{children:"Optional configuration for local activity methods"}),"\n",(0,o.jsx)(n.p,{children:(0,o.jsx)(n.a,{href:"#generated-code-reference",children:"top"})}),"\n",(0,o.jsx)(n.hr,{}),"\n",(0,o.jsx)(n.h4,{id:"local-method",children:"Local method"}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{className:"language-go",children:"func (*LocalActivityOptions) Local(\n func(context.Context, [*Request]) ([*Response], error)\n) *LocalActivityOptions\n"})}),"\n",(0,o.jsx)(n.p,{children:"Sets the activity definition to use for the local execution"}),"\n",(0,o.jsx)(n.p,{children:(0,o.jsx)(n.strong,{children:"Example"})}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{className:"language-protobuf",children:"service Example {\n rpc Foo(google.protobuf.Empty) returns (google.protobuf.Empty) {\n option (temporal.v1.workflow) = {};\n }\n\n rpc Bar(BarRequest) returns (BarResponse) {\n option (temporal.v1.activity) = {};\n }\n}\n"})}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{className:"language-go",children:'type (\n FooWorkflow struct {\n *examplev1.FooInput\n }\n)\n\nfunc (w *FooWorkflow) Execute(ctx workflow.Context) error {\n bar, err := examplev1.BarLocal(\n ctx, \n &examplev1.BarRequest{}, \n examplev1.NewBarActivityOptions().\n Local(func(ctx context.Context, req *BarRequest) (*BarResponse, error) {\n return nil, nil\n }),\n )\n workflow.GetLogger(ctx).Info("executed local bar activity", "result", bar)\n return err\n}\n'})}),"\n",(0,o.jsx)(n.p,{children:(0,o.jsx)(n.a,{href:"#generated-code-reference",children:"top"})}),"\n",(0,o.jsx)(n.hr,{}),"\n",(0,o.jsx)(n.h4,{id:"newlocalactivityoptions-function",children:"NewLocalActivityOptions function"}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{className:"language-go",children:"func NewLocalActivityOptions() *LocalActivityOptions\n"})}),"\n",(0,o.jsx)(n.p,{children:"Returns a new activity local options value"}),"\n",(0,o.jsx)(n.p,{children:(0,o.jsx)(n.a,{href:"#generated-code-reference",children:"top"})}),"\n",(0,o.jsx)(n.hr,{}),"\n",(0,o.jsx)(n.h4,{id:"withlocalactivityoptions-method",children:"WithLocalActivityOptions method"}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{className:"language-go",children:"func (*LocalActivityOptions) WithLocalActivityOptions(workflow.LocalActivityOptions) *LocalActivityOptions\n"})}),"\n",(0,o.jsx)(n.p,{children:"Sets dynamic activity options for an individual local activity execution"}),"\n",(0,o.jsx)(n.p,{children:(0,o.jsx)(n.strong,{children:"Example"})}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{className:"language-protobuf",children:"service Example {\n rpc Foo(google.protobuf.Empty) returns (google.protobuf.Empty) {\n option (temporal.v1.workflow) = {};\n }\n\n rpc Bar(BarRequest) returns (BarResponse) {\n option (temporal.v1.activity) = {};\n }\n}\n"})}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{className:"language-go",children:'type (\n Activities struct {}\n\n FooWorkflow struct {\n *examplev1.FooInput\n }\n)\n\nfunc (a *Activities) Bar(ctx context.Context, req *BarRequest) (*BarResponse, error) {\n return nil, nil\n}\n\nfunc (w *FooWorkflow) Execute(ctx workflow.Context) error {\n opts := workflow.GetLocalActivityOptions(ctx)\n opts.StartToCloseTimeout = time.Second*30\n bar, err := examplev1.BarLocal(\n ctx, \n &examplev1.BarRequest{}, \n examplev1.NewBarActivityOptions().\n WithLocalActivityOptions(opts),\n )\n workflow.GetLogger(ctx).Info("executed local bar activity", "result", bar)\n return err\n}\n'})}),"\n",(0,o.jsx)(n.p,{children:(0,o.jsx)(n.a,{href:"#generated-code-reference",children:"top"})}),"\n",(0,o.jsx)(n.h3,{id:"signal-struct",children:"Signal struct"}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{className:"language-go",children:"type Signal struct {\n Channel workflow.ReceiveChannel\n}\n"})}),"\n",(0,o.jsx)(n.p,{children:"Struct providing types and methods to simplify interacting with the corresponding signal from a workflow definition"}),"\n",(0,o.jsx)(n.p,{children:(0,o.jsx)(n.strong,{children:"Example"})}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{className:"language-protobuf",children:"service Example {\n rpc Foo(google.protobuf.Empty) returns (google.protobuf.Empty) {\n option (temporal.v1.workflow) = {\n signal: { ref: 'Bar' }\n };\n }\n\n rpc Bar(BarRequest) returns (google.protobuf.Empty) {\n option (temporal.v1.signal) = {};\n }\n}\n"})}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{className:"language-go",children:'type (\n Workflows struct{}\n\n FooWorkflow struct {\n *examplev1.FooInput\n }\n)\n\nfunc (wfs *Workflows) Foo(ctx workflow.Context, input *examplev1.FooInput) (examplev1.FooWorkflow, error) {\n return &FooWorkflow{input}, nil\n}\n\nfunc (w *FooWorkflow) Execute(ctx workflow.Context) error {\n workflow.NewSelector(ctx).\n AddReceive(w.Bar.Channel, func(workflow.ReceiveChannel, bool) {\n bar := w.Bar.ReceiveAsync()\n workflow.GetLogger(ctx).Info("received bar signal", "signal", bar)\n }).\n Select(ctx)\n return nil\n}\n'})}),"\n",(0,o.jsx)(n.p,{children:(0,o.jsx)(n.a,{href:"#generated-code-reference",children:"top"})}),"\n",(0,o.jsx)(n.hr,{}),"\n",(0,o.jsx)(n.h4,{id:"receive-method",children:"Receive method"}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{className:"language-go",children:"func (*Signal) Receive(workflow.Context) ([*Request], bool)\n"})}),"\n",(0,o.jsx)(n.p,{children:"Returns the next signal request and boolean indicating whether the channel is closed, blocking until the signal is received."}),"\n",(0,o.jsx)(n.p,{children:(0,o.jsx)(n.strong,{children:"Example"})}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{className:"language-protobuf",children:"service Example {\n rpc Foo(google.protobuf.Empty) returns (google.protobuf.Empty) {\n option (temporal.v1.workflow) = {\n signal: { ref: 'Bar' }\n };\n }\n\n rpc Bar(BarRequest) returns (google.protobuf.Empty) {\n option (temporal.v1.signal) = {};\n }\n}\n"})}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{className:"language-go",children:'type (\n Workflows struct{}\n\n FooWorkflow struct {\n *examplev1.FooInput\n }\n)\n\nfunc (wfs *Workflows) Foo(ctx workflow.Context, input *examplev1.FooInput) (examplev1.FooWorkflow, error) {\n return &FooWorkflow{input}, nil\n}\n\nfunc (w *FooWorkflow) Execute(ctx workflow.Context) error {\n bar, _ := w.Bar.Receive(ctx)\n workflow.GetLogger(ctx).Info("received bar signal", "signal", bar)\n return nil\n}\n'})}),"\n",(0,o.jsx)(n.p,{children:(0,o.jsx)(n.a,{href:"#generated-code-reference",children:"top"})}),"\n",(0,o.jsx)(n.hr,{}),"\n",(0,o.jsx)(n.h4,{id:"receiveasync-method",children:"ReceiveAsync method"}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{className:"language-go",children:"func (*Signal) ReceiveAsync() (*Request | bool)\n"})}),"\n",(0,o.jsx)(n.p,{children:"Returns the next signal request if available (bool if signal has no request payload), or nil otherwise."}),"\n",(0,o.jsx)(n.p,{children:(0,o.jsx)(n.strong,{children:"Example"})}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{className:"language-protobuf",children:"service Example {\n rpc Foo(google.protobuf.Empty) returns (google.protobuf.Empty) {\n option (temporal.v1.workflow) = {\n signal: { ref: 'Bar', start: true }\n };\n }\n\n rpc Bar(BarRequest) returns (google.protobuf.Empty) {\n option (temporal.v1.signal) = {};\n }\n}\n"})}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{className:"language-go",children:'type (\n Workflows struct{}\n\n FooWorkflow struct {\n *examplev1.FooInput\n }\n)\n\nfunc (wfs *Workflows) Foo(ctx workflow.Context, input *examplev1.FooInput) (examplev1.FooWorkflow, error) {\n return &FooWorkflow{input}, nil\n}\n\nfunc (w *FooWorkflow) Execute(ctx workflow.Context) error {\n bar := w.Bar.ReceiveAsync()\n if bar != nil {\n workflow.GetLogger(ctx).Info("workflow started with bar signal", "signal", bar)\n }\n return nil\n}\n'})}),"\n",(0,o.jsx)(n.p,{children:(0,o.jsx)(n.a,{href:"#generated-code-reference",children:"top"})}),"\n",(0,o.jsx)(n.hr,{}),"\n",(0,o.jsx)(n.h4,{id:"select-method-1",children:"Select method"}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{className:"language-go",children:"func (*Signal) Select(\n workflow.Selector,\n func([*Request]),\n) workflow.Selector\n"})}),"\n",(0,o.jsx)(n.p,{children:"Registers the provided signal callback with the provided selector"}),"\n",(0,o.jsx)(n.p,{children:(0,o.jsx)(n.a,{href:"#generated-code-reference",children:"top"})}),"\n",(0,o.jsx)(n.h3,{id:"signalexternal-function",children:"SignalExternal function"}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{className:"language-go",children:"func External(\n ctx workflow.Context, \n workflowID string,\n runID string,\n signal [*Request],\n) error\n"})}),"\n",(0,o.jsx)(n.p,{children:"Sends the corresponding signal to an existing workflow execution."}),"\n",(0,o.jsx)(n.p,{children:(0,o.jsx)(n.strong,{children:"Example"})}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{className:"language-protobuf",children:"service Example {\n rpc Foo(google.protobuf.Empty) returns (google.protobuf.Empty) {\n option (temporal.v1.workflow) = {};\n }\n\n rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty) {\n option (temporal.v1.workflow) = {\n signal: { ref: 'Baz' }\n };\n }\n\n rpc Baz(BazRequest) returns (google.protobuf.Empty) {\n option (temporal.v1.signal) = {};\n }\n}\n"})}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{className:"language-go",children:'type (\n FooWorkflow struct {\n *examplev1.FooInput\n }\n\n BarWorkflow struct {\n *examplev1.BarInput\n }\n)\n\nfunc (w *FooWorkflow) Execute(ctx workflow.Context) error {\n return examplev1.BazExternal(ctx, "barID", "", &examplev1.BazRequest{})\n}\n\nfunc (w *FooWorkflow) Execute(ctx workflow.Context) error {\n baz, _ := w.Baz.Receive(ctx)\n workflow.GetLogger(ctx).Info("received baz signal", "signal", baz)\n return nil\n}\n'})}),"\n",(0,o.jsx)(n.p,{children:(0,o.jsx)(n.a,{href:"#generated-code-reference",children:"top"})}),"\n",(0,o.jsx)(n.h3,{id:"signalexternalasync-function",children:"SignalExternalAsync function"}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{className:"language-go",children:"func ExternalAsync(\n ctx workflow.Context, \n workflowID string,\n runID string,\n signal [*Request],\n) workflow.Future\n"})}),"\n",(0,o.jsx)(n.p,{children:"Sends the corresponding signal to an existing workflow execution, returning a workflow future."}),"\n",(0,o.jsx)(n.p,{children:(0,o.jsx)(n.a,{href:"#generated-code-reference",children:"top"})}),"\n",(0,o.jsx)(n.h3,{id:"workflows-interface",children:"Workflows interface"}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{className:"language-go",children:"type Workflows interface {}\n"})}),"\n",(0,o.jsx)(n.p,{children:"Interface used to describe the required Workflows struct implementation"}),"\n",(0,o.jsx)(n.p,{children:(0,o.jsx)(n.strong,{children:"Example"})}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{className:"language-protobuf",children:"service Example {\n rpc Foo(google.protobuf.Empty) returns (google.protobuf.Empty) {\n option (temporal.v1.workflow) = {};\n }\n}\n"})}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{className:"language-go",children:"type ExampleWorkflows interface {\n Foo(context.Context, *examplev1.FooInput) (examplev1.FooWorkflow, error)\n}\n"})}),"\n",(0,o.jsx)(n.p,{children:(0,o.jsx)(n.a,{href:"#generated-code-reference",children:"top"})}),"\n",(0,o.jsx)(n.h3,{id:"registerworkflows-function",children:"RegisterWorkflows function"}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{className:"language-go",children:"func RegisterWorkflows(worker.WorkflowRegistry, examplev1.Workflows)\n"})}),"\n",(0,o.jsx)(n.p,{children:"Registers all service workflows with the provided registry"}),"\n",(0,o.jsx)(n.p,{children:(0,o.jsx)(n.a,{href:"#generated-code-reference",children:"top"})}),"\n",(0,o.jsx)(n.h3,{id:"registerworkflow-function",children:"RegisterWorkflow function"}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{className:"language-go",children:"func RegisterWorkflow(\n worker.WorkflowRegistry,\n func(workflow.Context, *examplev1.Input) (examplev1.Workflow, error)\n)\n"})}),"\n",(0,o.jsx)(n.p,{children:"Registers the workflow with the provided registry"}),"\n",(0,o.jsx)(n.p,{children:(0,o.jsx)(n.a,{href:"#generated-code-reference",children:"top"})}),"\n",(0,o.jsx)(n.h3,{id:"workflow-interface",children:"Workflow interface"}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{className:"language-go",children:"type Workflow {\n Execute(workflow.Context) ([*Response], error)\n ([*Request]) (*Response, error)\n ([*Request]) ([*Response], error)\n Validate([*Request]) error\n}\n"})}),"\n",(0,o.jsx)(n.p,{children:"Interface used to describe a required Workflow struct implementation"}),"\n",(0,o.jsx)(n.p,{children:(0,o.jsx)(n.strong,{children:"Example"})}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{className:"language-protobuf",children:"service Example {\n rpc Foo(FooRequest) returns (FooResponse) {\n option (temporal.v1.workflow) = {\n query: { ref: 'QueryFoo' }\n update: { ref: 'UpdateFoo' }\n };\n }\n\n rpc QueryFoo(QueryFooRequest) returns (QueryFooResponse) {\n option (temporal.v1.query) = {};\n }\n\n rpc UpdateFoo(UpdateFooRequest) returns (UpdateFooResponse) {\n option (temporal.v1.update) = {\n validate: true\n };\n }\n}\n"})}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{className:"language-go",children:"type FooWorkflow struct {\n *examplev1.FooInput\n}\n\nfunc (w *FooWorkflow) Execute(ctx workflow.Context) (*examplev1.FooResponse, error) {\n return &examplev1.FooResponse{}, nil\n}\n\nfunc (w *FooWorkflow) QueryFoo(req *examplev1.QueryFooRequest) (*examplev1.QueryFooResponse, error) {\n return &examplev1.QueryFooResponse{}, nil\n}\n\nfunc (w *FooWorkflow) UpdateFoo(ctx workflow.Context, req *examplev1.UpdateFooRequest) (*examplev1.UpdateFooResponse, error) {\n return &examplev1.UpdateFooResponse{}, nil\n}\n\nfunc (w *FooWorkflow) UpdateFoo(ctx workflow.Context, req *examplev1.UpdateFooRequest) error {\n return nil\n}\n"})}),"\n",(0,o.jsx)(n.p,{children:(0,o.jsx)(n.a,{href:"#generated-code-reference",children:"top"})}),"\n",(0,o.jsx)(n.h3,{id:"workflowchild-function",children:"WorkflowChild function"}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{className:"language-go",children:"func Child(\n workflow.Context,\n [*Request], \n ...*ChildOptions,\n) ([*Response], error)\n"})}),"\n",(0,o.jsx)(n.p,{children:"Executes the corresponding child workflow, blocking until child workflow completes or errors"}),"\n",(0,o.jsx)(n.p,{children:(0,o.jsx)(n.strong,{children:"Example"})}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{className:"language-protobuf",children:"service Example {\n rpc Foo(google.protobuf.Empty) returns (google.protobuf.Empty) {\n option (temporal.v1.workflow) = {};\n }\n\n rpc Bar(BarRequest) returns (BarResponse) {\n option (temporal.v1.workflow) = {};\n }\n}\n"})}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{className:"language-go",children:'type (\n FooWorkflow struct {\n *examplev1.FooInput\n }\n\n BarWorkflow struct {\n *examplev1.BarInput\n }\n)\n\nfunc (w *FooWorkflow) Execute(ctx workflow.Context) error {\n bar, err := examplev1.BarChild(ctx, &examplev1.BarRequest{})\n workflow.GetLogger(ctx).Info("executed bar child workflow", "response", bar)\n return err\n}\n\nfunc (w *BarWorkflow) Execute(ctx workflow.Context) (*examplev1.BarResponse, error) {\n return &examplev1.BarResponse{}, nil\n}\n'})}),"\n",(0,o.jsx)(n.p,{children:(0,o.jsx)(n.a,{href:"#generated-code-reference",children:"top"})}),"\n",(0,o.jsx)(n.h3,{id:"workflowchildasync-function",children:"WorkflowChildAsync function"}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{className:"language-go",children:"func Child(\n workflow.Context,\n [*Request], \n ...*ChildOptions,\n) ([*ChildRun], error)\n"})}),"\n",(0,o.jsxs)(n.p,{children:["Executes the corresponding child workflow, returning a ",(0,o.jsx)(n.a,{href:"#workflowchildrun-struct",children:"WorkflowChildRun"})," for the child workflow execution"]}),"\n",(0,o.jsx)(n.p,{children:(0,o.jsx)(n.a,{href:"#generated-code-reference",children:"top"})}),"\n",(0,o.jsx)(n.h3,{id:"workflowchildoptions-struct",children:"WorkflowChildOptions struct"}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{className:"language-go",children:"type ChildOptions struct {}\n"})}),"\n",(0,o.jsx)(n.p,{children:"Optional configuration for child workfow functions"}),"\n",(0,o.jsx)(n.p,{children:(0,o.jsx)(n.a,{href:"#generated-code-reference",children:"top"})}),"\n",(0,o.jsx)(n.hr,{}),"\n",(0,o.jsx)(n.h4,{id:"newworkflowchildoptions-function",children:"NewWorkflowChildOptions function"}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{className:"language-go",children:"func NewChildOptions() *ChildOptions\n"})}),"\n",(0,o.jsx)(n.p,{children:"Returns a new workflow child options value for the corresponding workflow"}),"\n",(0,o.jsx)(n.p,{children:(0,o.jsx)(n.a,{href:"#generated-code-reference",children:"top"})}),"\n",(0,o.jsx)(n.hr,{}),"\n",(0,o.jsx)(n.h4,{id:"withchildworkflowoptions-method",children:"WithChildWorkflowOptions method"}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{className:"language-go",children:"func (*Options) WithChildWorkflowOptions(workflow.ChildWorkflowOptions) *ChildOptions\n"})}),"\n",(0,o.jsx)(n.p,{children:"Sets dynamic workflow options for an individual workflow execution"}),"\n",(0,o.jsx)(n.p,{children:(0,o.jsx)(n.a,{href:"#generated-code-reference",children:"top"})}),"\n",(0,o.jsx)(n.h3,{id:"workflowinput-struct",children:"WorkflowInput struct"}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{className:"language-go",children:"type Input struct {\n [Req *Request]\n [ *Signal]\n}\n"})}),"\n",(0,o.jsx)(n.p,{children:"Struct that contains references to workflow inputs and signals"}),"\n",(0,o.jsx)(n.p,{children:(0,o.jsx)(n.strong,{children:"Example"})}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{className:"language-protobuf",children:"service Example {\n rpc Foo(FooRequest) returns (google.protobuf.Empty) {\n option (temporal.v1.workflow) = {\n signal: { ref: 'Bar' }\n signal: { ref: 'Baz' }\n };\n }\n\n rpc Bar(BarRequest) returns (google.protobuf.Empty) {\n option (temporal.v1.workflow) = {};\n }\n\n rpc Baz(BazRequest) returns (google.protobuf.Empty) {\n option (temporal.v1.workflow) = {};\n }\n}\n"})}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{className:"language-go",children:'type (\n Workflows struct {}\n\n FooWorkflow struct {\n *examplev1.FooInput\n log log.Logger\n }\n)\n\nfunc (w *Workflows) Foo(ctx workflow.Context, input *examplev1.FooInput) (examplev1.FooWorkflow, error) {\n return &FooWorkflow{input, workflow.GetLogger(ctx)}, nil\n}\n\nfunc (w *FooWorkflow) Execute(ctx workflow.Context) error {\n w.log.Info("starting foo workflow", "request", w.Req)\n for bar, baz := 0, 0; bar + baz < 2; {\n sel := workflow.NewSelector(ctx)\n if bar == 0 {\n w.Bar.Select(ctx, func(signal *examplev1.BarRequest) {\n w.log.Info("received bar signal", "signal", signal)\n bar++\n })\n }\n if baz == 0 {\n w.Baz.Select(ctx, func(signal *examplev1.BazRequest) {\n w.log.Info("received baz signal", "signal", signal)\n baz++\n })\n }\n sel.Select(ctx)\n }\n return nil\n}\n'})}),"\n",(0,o.jsx)(n.p,{children:(0,o.jsx)(n.a,{href:"#generated-code-reference",children:"top"})}),"\n",(0,o.jsx)(n.h3,{id:"workflowchildrun-struct",children:"WorkflowChildRun struct"}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{className:"language-go",children:"type ChildRun struct {\n Future workflow.ChildWorkflowFuture\n}\n"})}),"\n",(0,o.jsx)(n.p,{children:"Struct providing a child workflow execution handle returned by asynchronous child workflow methods"}),"\n",(0,o.jsx)(n.p,{children:(0,o.jsx)(n.a,{href:"#generated-code-reference",children:"top"})}),"\n",(0,o.jsx)(n.hr,{}),"\n",(0,o.jsx)(n.h4,{id:"get-method-3",children:"Get method"}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{className:"language-go",children:"func (*ChildRun) Get(workflow.Context) ([*Response], error)\n"})}),"\n",(0,o.jsx)(n.p,{children:"Returns the child workflow result, blocking until child workflow completes or errors"}),"\n",(0,o.jsx)(n.p,{children:(0,o.jsx)(n.a,{href:"#generated-code-reference",children:"top"})}),"\n",(0,o.jsx)(n.hr,{}),"\n",(0,o.jsx)(n.h4,{id:"select-method-2",children:"Select method"}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{className:"language-go",children:"func (*ChildRun) Select(\n workflow.Selector,\n func(*ChildRun)\n) workflow.Selector\n"})}),"\n",(0,o.jsx)(n.p,{children:"Registers the child workflow execution and a callback with the provided selector"}),"\n",(0,o.jsx)(n.p,{children:(0,o.jsx)(n.a,{href:"#generated-code-reference",children:"top"})}),"\n",(0,o.jsx)(n.hr,{}),"\n",(0,o.jsx)(n.h4,{id:"selectstart-method",children:"SelectStart method"}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{className:"language-go",children:"func (*ChildRun) Select(\n workflow.Selector,\n func(*ChildRun)\n) workflow.Selector\n"})}),"\n",(0,o.jsx)(n.p,{children:"Registers the start of the child workflow execution and a callback with the provided selector"}),"\n",(0,o.jsx)(n.p,{children:(0,o.jsx)(n.a,{href:"#generated-code-reference",children:"top"})}),"\n",(0,o.jsx)(n.hr,{}),"\n",(0,o.jsx)(n.h4,{id:"signal-method-2",children:"Signal method"}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{className:"language-go",children:"func (*ChildRun) (workflow.Context, [*Request]) error\n"})}),"\n",(0,o.jsx)(n.p,{children:"Sends the corresponding signal to the child workflow execution"}),"\n",(0,o.jsx)(n.p,{children:(0,o.jsx)(n.a,{href:"#generated-code-reference",children:"top"})}),"\n",(0,o.jsx)(n.hr,{}),"\n",(0,o.jsx)(n.h4,{id:"signalasync-method",children:"SignalAsync method"}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{className:"language-go",children:"func (*ChildRun) (workflow.Context, [*Request]) workflow.Future\n"})}),"\n",(0,o.jsx)(n.p,{children:"Sends the corresponding signal to the child workflow execution"}),"\n",(0,o.jsx)(n.p,{children:(0,o.jsx)(n.a,{href:"#generated-code-reference",children:"top"})}),"\n",(0,o.jsx)(n.hr,{}),"\n",(0,o.jsx)(n.h4,{id:"waitstart-method",children:"WaitStart method"}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{className:"language-go",children:"func (*ChildRun) WaitStart(workflow.Context) (*workflow.Execution, error)\n"})}),"\n",(0,o.jsx)(n.p,{children:"Blocks until the child workflow execution has started"}),"\n",(0,o.jsx)(n.p,{children:(0,o.jsx)(n.a,{href:"#generated-code-reference",children:"top"})})]})}function p(e={}){const{wrapper:n}={...(0,t.R)(),...e.components};return n?(0,o.jsx)(n,{...e,children:(0,o.jsx)(d,{...e})}):d(e)}},8453:(e,n,r)=>{r.d(n,{R:()=>i,x:()=>c});var o=r(6540);const t={},l=o.createContext(t);function i(e){const n=o.useContext(l);return o.useMemo((function(){return"function"==typeof e?e(n):{...n,...e}}),[n,e])}function c(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(t):e.components||t:i(e.components),o.createElement(l.Provider,{value:n},e.children)}}}]); \ No newline at end of file diff --git a/assets/js/77587487.8b4b83d6.js b/assets/js/77587487.8b4b83d6.js deleted file mode 100644 index 700f296e..00000000 --- a/assets/js/77587487.8b4b83d6.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunkdocs=self.webpackChunkdocs||[]).push([[8232],{9339:(e,n,r)=>{r.r(n),r.d(n,{assets:()=>s,contentTitle:()=>i,default:()=>p,frontMatter:()=>l,metadata:()=>c,toc:()=>a});var o=r(4848),t=r(8453);const l={},i="Reference",c={id:"reference",title:"Reference",description:"This page provides an overview of the Go code generated by protoc-gen-go_temporal.",source:"@site/docs/reference.md",sourceDirName:".",slug:"/reference",permalink:"/docs/reference",draft:!1,unlisted:!1,editUrl:"https://github.com/facebook/docusaurus/tree/main/packages/create-docusaurus/templates/shared/docs/reference.md",tags:[],version:"current",frontMatter:{}},s={},a=[{value:"Constants & Variables",id:"constants--variables",level:2},{value:"ActivityName",id:"activityname",level:3},{value:"QueryName",id:"queryname",level:3},{value:"SignalName",id:"signalname",level:3},{value:"TaskQueue",id:"taskqueue",level:3},{value:"UpdateIDExpression",id:"updateidexpression",level:3},{value:"UpdateName",id:"updatename",level:3},{value:"WorkflowIDExpression",id:"workflowidexpression",level:3},{value:"WorkflowName",id:"workflowname",level:3},{value:"WorkflowSearchAttributesMapping",id:"workflowsearchattributesmapping",level:3},{value:"Client",id:"client",level:2},{value:"Interface",id:"interface",level:3},{value:"NewClient function",id:"newclient-function",level:4},{value:"NewClientWithOptions function",id:"newclientwithoptions-function",level:4},{value:"GetWorkflow method",id:"getworkflow-method",level:4},{value:"Query method",id:"query-method",level:4},{value:"Signal method",id:"signal-method",level:4},{value:"SignalWithStartWorkflow method",id:"signalwithstartworkflow-method",level:4},{value:"SignalWithStartWorkflow method (asynchronous)",id:"signalwithstartworkflow-method-asynchronous",level:4},{value:"Update method",id:"update-method",level:4},{value:"Update method (asynchronous)",id:"update-method-asynchronous",level:4},{value:"Workflow method",id:"workflow-method",level:4},{value:"Workflow method (asynchronous)",id:"workflow-method-asynchronous",level:4},{value:"UpdateHandle interface",id:"updatehandle-interface",level:3},{value:"Get method",id:"get-method",level:4},{value:"RunID method",id:"runid-method",level:4},{value:"UpdateID method",id:"updateid-method",level:4},{value:"WorkflowID method",id:"workflowid-method",level:4},{value:"WorkflowOptions struct",id:"workflowoptions-struct",level:3},{value:"NewWorkflowOptions function",id:"newworkflowoptions-function",level:4},{value:"WithStartWorkflowOptions method",id:"withstartworkflowoptions-method",level:4},{value:"WorkflowRun interface",id:"workflowrun-interface",level:3},{value:"Cancel method",id:"cancel-method",level:4},{value:"Get method",id:"get-method-1",level:4},{value:"ID method",id:"id-method",level:4},{value:"Query method",id:"query-method-1",level:4},{value:"Run method",id:"run-method",level:4},{value:"RunID method",id:"runid-method-1",level:4},{value:"Signal method",id:"signal-method-1",level:4},{value:"Terminate method",id:"terminate-method",level:4},{value:"Update method",id:"update-method-1",level:4},{value:"Update method (asynchronous)",id:"update-method-asynchronous-1",level:4},{value:"Worker",id:"worker",level:2},{value:"Activities interface",id:"activities-interface",level:3},{value:"RegisterActivities function",id:"registeractivities-function",level:3},{value:"RegisterActivity function",id:"registeractivity-function",level:3},{value:"Activity function",id:"activity-function",level:3},{value:"ActivityAsync function",id:"activityasync-function",level:3},{value:"ActivityLocal function",id:"activitylocal-function",level:3},{value:"ActivityLocalAsync function",id:"activitylocalasync-function",level:3},{value:"ActivityFuture struct",id:"activityfuture-struct",level:3},{value:"Get method",id:"get-method-2",level:4},{value:"Select method",id:"select-method",level:4},{value:"ActivityOptions struct",id:"activityoptions-struct",level:3},{value:"NewActivityOptions function",id:"newactivityoptions-function",level:4},{value:"WithActivityOptions method",id:"withactivityoptions-method",level:4},{value:"LocalActivityOptions struct",id:"localactivityoptions-struct",level:3},{value:"Local method",id:"local-method",level:4},{value:"NewLocalActivityOptions function",id:"newlocalactivityoptions-function",level:4},{value:"WithLocalActivityOptions method",id:"withlocalactivityoptions-method",level:4},{value:"Signal struct",id:"signal-struct",level:3},{value:"Receive method",id:"receive-method",level:4},{value:"ReceiveAsync method",id:"receiveasync-method",level:4},{value:"Select method",id:"select-method-1",level:4},{value:"SignalExternal function",id:"signalexternal-function",level:3},{value:"SignalExternalAsync function",id:"signalexternalasync-function",level:3},{value:"Workflows interface",id:"workflows-interface",level:3},{value:"RegisterWorkflows function",id:"registerworkflows-function",level:3},{value:"RegisterWorkflow function",id:"registerworkflow-function",level:3},{value:"Workflow interface",id:"workflow-interface",level:3},{value:"WorkflowChild function",id:"workflowchild-function",level:3},{value:"WorkflowChildAsync function",id:"workflowchildasync-function",level:3},{value:"WorkflowChildOptions struct",id:"workflowchildoptions-struct",level:3},{value:"NewWorkflowChildOptions function",id:"newworkflowchildoptions-function",level:4},{value:"WithChildWorkflowOptions method",id:"withchildworkflowoptions-method",level:4},{value:"WorkflowInput struct",id:"workflowinput-struct",level:3},{value:"WorkflowChildRun struct",id:"workflowchildrun-struct",level:3},{value:"Get method",id:"get-method-3",level:4},{value:"Select method",id:"select-method-2",level:4},{value:"SelectStart method",id:"selectstart-method",level:4},{value:"Signal method",id:"signal-method-2",level:4},{value:"SignalAsync method",id:"signalasync-method",level:4},{value:"WaitStart method",id:"waitstart-method",level:4}];function d(e){const n={a:"a",code:"code",em:"em",h1:"h1",h2:"h2",h3:"h3",h4:"h4",hr:"hr",p:"p",pre:"pre",strong:"strong",...(0,t.R)(),...e.components};return(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(n.h1,{id:"reference",children:"Reference"}),"\n",(0,o.jsxs)(n.p,{children:["This page provides an overview of the Go code generated by ",(0,o.jsx)(n.code,{children:"protoc-gen-go_temporal"}),"."]}),"\n",(0,o.jsx)(n.h2,{id:"constants--variables",children:"Constants & Variables"}),"\n",(0,o.jsx)(n.h3,{id:"activityname",children:"ActivityName"}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{className:"language-go",children:"const ActivityName string\n"})}),"\n",(0,o.jsx)(n.p,{children:"String constants defining the canonical name for each activity"}),"\n",(0,o.jsx)(n.p,{children:(0,o.jsx)(n.a,{href:"#generated-code-reference",children:"top"})}),"\n",(0,o.jsx)(n.h3,{id:"queryname",children:"QueryName"}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{className:"language-go",children:"const QueryName string\n"})}),"\n",(0,o.jsx)(n.p,{children:"String constants defining the canonical name for each query"}),"\n",(0,o.jsx)(n.p,{children:(0,o.jsx)(n.a,{href:"#generated-code-reference",children:"top"})}),"\n",(0,o.jsx)(n.h3,{id:"signalname",children:"SignalName"}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{className:"language-go",children:"const SignalName string\n"})}),"\n",(0,o.jsx)(n.p,{children:"String constants defining the canonical name for each signal"}),"\n",(0,o.jsx)(n.p,{children:(0,o.jsx)(n.a,{href:"#generated-code-reference",children:"top"})}),"\n",(0,o.jsx)(n.h3,{id:"taskqueue",children:"TaskQueue"}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{className:"language-go",children:"const TaskQueue string\n"})}),"\n",(0,o.jsxs)(n.p,{children:["String constants defining the default task queue name for each service that defines the ",(0,o.jsx)(n.code,{children:"task_queue"})," option"]}),"\n",(0,o.jsx)(n.p,{children:(0,o.jsx)(n.a,{href:"#generated-code-reference",children:"top"})}),"\n",(0,o.jsx)(n.h3,{id:"updateidexpression",children:"UpdateIDExpression"}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{className:"language-go",children:"var IDExpression *expression.Expression\n"})}),"\n",(0,o.jsxs)(n.p,{children:["Expression variable referencing the parsed ID expression for each update that defines the ",(0,o.jsx)(n.code,{children:"id"})," option"]}),"\n",(0,o.jsx)(n.p,{children:(0,o.jsx)(n.a,{href:"#generated-code-reference",children:"top"})}),"\n",(0,o.jsx)(n.h3,{id:"updatename",children:"UpdateName"}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{className:"language-go",children:"const UpdateName string\n"})}),"\n",(0,o.jsx)(n.p,{children:"String constants defining the canonical name for each update"}),"\n",(0,o.jsx)(n.p,{children:(0,o.jsx)(n.a,{href:"#generated-code-reference",children:"top"})}),"\n",(0,o.jsx)(n.h3,{id:"workflowidexpression",children:"WorkflowIDExpression"}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{className:"language-go",children:"var IDExpression *expression.Expression\n"})}),"\n",(0,o.jsxs)(n.p,{children:["Expression variable referencing the parsed ID expression for each workflow that defines the ",(0,o.jsx)(n.code,{children:"id"})," option"]}),"\n",(0,o.jsx)(n.p,{children:(0,o.jsx)(n.a,{href:"#generated-code-reference",children:"top"})}),"\n",(0,o.jsx)(n.h3,{id:"workflowname",children:"WorkflowName"}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{className:"language-go",children:"const WorkflowName string\n"})}),"\n",(0,o.jsx)(n.p,{children:"String constant defining the canonical name for each workflow"}),"\n",(0,o.jsx)(n.p,{children:(0,o.jsx)(n.a,{href:"#generated-code-reference",children:"top"})}),"\n",(0,o.jsx)(n.h3,{id:"workflowsearchattributesmapping",children:"WorkflowSearchAttributesMapping"}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{className:"language-go",children:"var SearchAttributesMapping *expression.Expression\n"})}),"\n",(0,o.jsxs)(n.p,{children:["Expression variable referencing the parsed search attributes expression for each workflow that defines the ",(0,o.jsx)(n.code,{children:"search_attributes"})," option"]}),"\n",(0,o.jsx)(n.p,{children:(0,o.jsx)(n.a,{href:"#generated-code-reference",children:"top"})}),"\n",(0,o.jsx)(n.h2,{id:"client",children:"Client"}),"\n",(0,o.jsx)(n.h3,{id:"interface",children:"Interface"}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{className:"language-go",children:"type Client interface {}\n"})}),"\n",(0,o.jsx)(n.p,{children:"Interface describing the generated client for each service. A generated client provides typed methods for executing a given service's workflows, queries, signals, and updates."}),"\n",(0,o.jsx)(n.p,{children:(0,o.jsx)(n.strong,{children:"Example"})}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{className:"language-protobuf",children:"package example.v1;\n\nservice Example {\n option (temporal.v1.service) = {\n task_queue: 'example-v1'\n };\n\n rpc Hello(HelloRequest) returns (HelloResponse) {\n option (temporal.v1.workflow) = {\n id: 'hello/${!uuid_v4()}'\n execution_timeout: { seconds: 5 }\n };\n }\n}\n"})}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{className:"language-go",children:"type ExampleClient interface {\n // Hello executes a(n) example.v1.Example.Hello workflow and blocks until error\n // or response received\n Hello(ctx context.Context, req *HelloRequest, opts ...*HelloOptions) (*HelloResponse, error)\n\n // HelloAsync starts a(n) example.v1.Example.Hello workflow and returns a handle\n // to the workflow run\n HelloAsync(ctx context.Context, req *HelloRequest, opts ...*HelloOptions) (HelloRun, error)\n \n // GetHello retrieves a handle to an existing example.v1.Example.Hello workflow\n // execution\n GetHello(ctx context.Context, workflowID, runID string) (HelloRun, error)\n}\n"})}),"\n",(0,o.jsx)(n.p,{children:(0,o.jsx)(n.a,{href:"#generated-code-reference",children:"top"})}),"\n",(0,o.jsx)(n.hr,{}),"\n",(0,o.jsx)(n.h4,{id:"newclient-function",children:"NewClient function"}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{className:"language-go",children:"func NewClient(client.Client) Client\n"})}),"\n",(0,o.jsxs)(n.p,{children:["Constructor function that returns a new ",(0,o.jsx)(n.a,{href:"#interface",children:"client interface"})," implementation for the underlying Temporal client"]}),"\n",(0,o.jsx)(n.p,{children:(0,o.jsx)(n.strong,{children:"Example"})}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{className:"language-protobuf",children:"service Example {\n option (temporal.v1.service) = {\n task_queue: 'example-v1'\n };\n\n rpc Hello(HelloRequest) returns (HelloResponse) {\n option (temporal.v1.workflow) = {\n id: 'hello/${!uuid_v4()}'\n execution_timeout: { seconds: 5 }\n };\n }\n}\n"})}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{className:"language-go",children:'func main() {\n c, _ := client.Dial(client.Options{})\n example := examplev1.NewExampleClient(c)\n resp, _ := example.Hello(context.Background(), &examplev1.HelloRequest{})\n log.Printf("hello workflow response: %s", resp.String())\n}\n'})}),"\n",(0,o.jsx)(n.p,{children:(0,o.jsx)(n.a,{href:"#generated-code-reference",children:"top"})}),"\n",(0,o.jsx)(n.hr,{}),"\n",(0,o.jsx)(n.h4,{id:"newclientwithoptions-function",children:"NewClientWithOptions function"}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{className:"language-go",children:"func NewClientWithOptions(client.Client, client.Options) (Client, error)\n"})}),"\n",(0,o.jsxs)(n.p,{children:["Constructor function that returns a new ",(0,o.jsx)(n.a,{href:"#interface",children:"client interface"})," implementation for the underlying Temporal client and provided client options."]}),"\n",(0,o.jsx)(n.p,{children:(0,o.jsx)(n.a,{href:"#generated-code-reference",children:"top"})}),"\n",(0,o.jsx)(n.hr,{}),"\n",(0,o.jsx)(n.h4,{id:"getworkflow-method",children:"GetWorkflow method"}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{className:"language-go",children:"func (Client) WithAsync(\n ctx context.Context,\n workflowID string,\n runID string,\n) (Run, error)\n"})}),"\n",(0,o.jsxs)(n.p,{children:["Returns a ",(0,o.jsx)(n.a,{href:"#workflowrun-interface",children:"WorkflowRun"})," for an existing workflow execution. If an empty string (",(0,o.jsx)(n.code,{children:'""'}),") is provided for ",(0,o.jsx)(n.code,{children:"runID"}),", the latest workflow execution will be used."]}),"\n",(0,o.jsx)(n.p,{children:(0,o.jsx)(n.strong,{children:"Example"})}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{className:"language-protobuf",children:"service Example {\n rpc Foo(FooRequest) returns (FooResponse) {\n option (temporal.v1.workflow) = {};\n }\n}\n"})}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{className:"language-go",children:"type ExampleClient interface {\n GetFoo(ctx context.Context, workflowID, runID string) (FooRun, error)\n}\n"})}),"\n",(0,o.jsx)(n.p,{children:(0,o.jsx)(n.a,{href:"#generated-code-reference",children:"top"})}),"\n",(0,o.jsx)(n.hr,{}),"\n",(0,o.jsx)(n.h4,{id:"query-method",children:"Query method"}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{className:"language-go",children:"func (Client) (\n ctx context.Context, \n workflowId string,\n runId string,\n [req *Request],\n) ([*Response], error)\n"})}),"\n",(0,o.jsxs)(n.p,{children:["Executes the corresponding query on an existing workflow execution using the configured default options. Passing an empty string as the ",(0,o.jsx)(n.code,{children:"runID"})," will target the ",(0,o.jsx)(n.em,{children:"latest"})," workflow execution with ",(0,o.jsx)(n.code,{children:"workflowID"}),"."]}),"\n",(0,o.jsx)(n.p,{children:(0,o.jsx)(n.strong,{children:"Example"})}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{className:"language-protobuf",children:"service Example {\n rpc Foo(google.protobuf.Empty) returns (FooResponse) {\n option (temporal.v1.query) = {};\n }\n\n rpc Bar(BarRequest) returns (BarResponse) {\n option (temporal.v1.query) = {};\n }\n}\n"})}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{className:"language-go",children:"type ExampleClient interface {\n Foo(ctx context.Context, workflowID, runID string) error\n Bar(ctx context.Context, workflowID, runID string, req *BarRequest) (*BarResponse, error)\n}\n"})}),"\n",(0,o.jsx)(n.p,{children:(0,o.jsx)(n.a,{href:"#generated-code-reference",children:"top"})}),"\n",(0,o.jsx)(n.hr,{}),"\n",(0,o.jsx)(n.h4,{id:"signal-method",children:"Signal method"}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{className:"language-go",children:"func (Client) (\n ctx context.Context, \n workflowID string,\n runID string,\n [req *Request],\n) error\n"})}),"\n",(0,o.jsx)(n.p,{children:"Executes the corresponding signal on an existing workflow execution using the configured default options"}),"\n",(0,o.jsx)(n.p,{children:(0,o.jsx)(n.strong,{children:"Example"})}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{className:"language-protobuf",children:"service Example {\n rpc Foo(google.protobuf.Empty) returns (google.protobuf.Empty) {\n option (temporal.v1.signal) = {};\n }\n\n rpc Bar(BarRequest) returns (google.protobuf.Empty) {\n option (temporal.v1.signal) = {};\n }\n}\n"})}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{className:"language-go",children:"type ExampleClient interface {\n Foo(ctx context.Context, workflowID, runID string) error\n Bar(ctx context.Context, workflowID, runID string, req *BarRequest) error\n}\n"})}),"\n",(0,o.jsx)(n.p,{children:(0,o.jsx)(n.a,{href:"#generated-code-reference",children:"top"})}),"\n",(0,o.jsx)(n.hr,{}),"\n",(0,o.jsx)(n.h4,{id:"signalwithstartworkflow-method",children:"SignalWithStartWorkflow method"}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{className:"language-go",children:"func (Client) With(\n ctx context.Context,\n [req *Request],\n [signal *Request],\n opts ...*Options,\n) ([*Response], error)\n"})}),"\n",(0,o.jsx)(n.p,{children:"Executes the corresponding signal against an existing workflow execution using the configured default options, starting it if necessary, and blocking until the workflow completes or errors"}),"\n",(0,o.jsx)(n.p,{children:(0,o.jsx)(n.strong,{children:"Example"})}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{className:"language-protobuf",children:"service Example {\n rpc Foo(FooRequest) returns (FooResponse) {\n option (temporal.v1.workflow) = {\n signal: { ref: 'Bar', start: true }\n };\n }\n\n rpc Bar(BarRequest) returns (google.protobuf.Empty) {\n option (temporal.v1.signal) = {};\n }\n}\n"})}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{className:"language-go",children:"type ExampleClient interface {\n FooWithBar(\n ctx context.Context, \n req *FooRequest, \n signal *BarRequest, \n opts ...*FooOptions,\n ) (*FooResponse, error)\n}\n"})}),"\n",(0,o.jsx)(n.p,{children:(0,o.jsx)(n.a,{href:"#generated-code-reference",children:"top"})}),"\n",(0,o.jsx)(n.hr,{}),"\n",(0,o.jsx)(n.h4,{id:"signalwithstartworkflow-method-asynchronous",children:"SignalWithStartWorkflow method (asynchronous)"}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{className:"language-go",children:"func (Client) WithAsync(\n ctx context.Context,\n [req *Request],\n [signal *Request],\n opts ...*Options,\n) (Run, error)\n"})}),"\n",(0,o.jsxs)(n.p,{children:["Executes the corresponding signal against an existing workflow execution using the configured default options, starting it if necessary, and returning a ",(0,o.jsx)(n.a,{href:"#workflowrun-interface",children:"WorkflowRun"})," for the workflow execution"]}),"\n",(0,o.jsx)(n.p,{children:(0,o.jsx)(n.strong,{children:"Example"})}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{className:"language-protobuf",children:"service Example {\n rpc Foo(FooRequest) returns (FooResponse) {\n option (temporal.v1.workflow) = {\n signal: { ref: 'Bar', start: true }\n };\n }\n\n rpc Bar(BarRequest) returns (google.protobuf.Empty) {\n option (temporal.v1.signal) = {};\n }\n}\n"})}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{className:"language-go",children:"type ExampleClient interface {\n FooWithBarAsync(\n ctx context.Context, \n req *FooRequest, \n signal *BarRequest, \n opts ...*FooOptions,\n ) (FooRun, error)\n}\n"})}),"\n",(0,o.jsx)(n.p,{children:(0,o.jsx)(n.a,{href:"#generated-code-reference",children:"top"})}),"\n",(0,o.jsx)(n.hr,{}),"\n",(0,o.jsx)(n.h4,{id:"update-method",children:"Update method"}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{className:"language-go",children:"func (Client) (\n ctx context.Context, \n workflowID string, \n runID string, \n [req *Request],\n opts ...*Options,\n) ([*Response], error)\n"})}),"\n",(0,o.jsx)(n.p,{children:"Executes the corresponding update on an existing workflow execution using the configured default options, blocking until update completes or errors"}),"\n",(0,o.jsx)(n.p,{children:(0,o.jsx)(n.strong,{children:"Example"})}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{className:"language-protobuf",children:"service Example {\n rpc Foo(google.protobuf.Empty) returns (google.protobuf.Empty) {\n option (temporal.v1.update) = {};\n }\n\n rpc Bar(BarRequest) returns (google.protobuf.Empty) {\n option (temporal.v1.update) = {};\n }\n\n rpc Baz(google.protobuf.Empty) returns (BazResponse) {\n option (temporal.v1.update) = {};\n }\n\n rpc Qux(QuxRequest) returns (QuxResponse) {\n option (temporal.v1.update) = {};\n }\n}\n"})}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{className:"language-go",children:"type ExampleClient interface {\n Foo(ctx context.Context, workflowID, runID string, opts ...*FooOptions) error\n Bar(ctx context.Context, workflowID, runID string, req *BarRequest, opts ...*BarOptions) error\n Baz(ctx context.Context, workflowID, runID string, opts ...*BazOptions) (*BazResponse, error)\n Qux(ctx context.Context, workflowID, runID string, req *QuxRequest, opts ...*QuxOptions) (*QuxResponse, error)\n}\n"})}),"\n",(0,o.jsx)(n.p,{children:(0,o.jsx)(n.a,{href:"#generated-code-reference",children:"top"})}),"\n",(0,o.jsx)(n.hr,{}),"\n",(0,o.jsx)(n.h4,{id:"update-method-asynchronous",children:"Update method (asynchronous)"}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{className:"language-go",children:"func (Client) Async(\n ctx context.Context, \n workflowID string, \n runID string, \n [req *Request],\n opts ...*Options,\n) (Handle, error)\n"})}),"\n",(0,o.jsxs)(n.p,{children:["Executes the corresponding update on an existing workflow execution using the configured default options, returning an ",(0,o.jsx)(n.a,{href:"#updatehandle-interface",children:"UpdateHandle"})," for the update execution"]}),"\n",(0,o.jsx)(n.p,{children:(0,o.jsx)(n.strong,{children:"Example"})}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{className:"language-protobuf",children:"service Example {\n rpc Foo(FooRequest) returns (FooResponse) {\n option (temporal.v1.update) = {};\n }\n}\n"})}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{className:"language-go",children:"type ExampleClient interface {\n FooAsync(ctx context.Context, workflowID, runID string, req *FooRequest, opts ...*FooOptions) (FooHandle, error)\n}\n"})}),"\n",(0,o.jsx)(n.p,{children:(0,o.jsx)(n.a,{href:"#generated-code-reference",children:"top"})}),"\n",(0,o.jsx)(n.hr,{}),"\n",(0,o.jsx)(n.h4,{id:"workflow-method",children:"Workflow method"}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{className:"language-go",children:"func (Client) (\n ctx context.Context, \n [req *Request],\n opts ...*Options,\n) ([*Response], error)\n"})}),"\n",(0,o.jsx)(n.p,{children:"Executes the corresponding workflow using the configured default options, blocking until workflow completes or errors"}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{className:"language-protobuf",children:"service Example {\n rpc Foo(google.protobuf.Empty) returns (google.protobuf.Empty) {\n option (temporal.v1.workflow) = {};\n }\n\n rpc Bar(BarRequest) returns (google.protobuf.Empty) {\n option (temporal.v1.workflow) = {};\n }\n\n rpc Baz(google.protobuf.Empty) returns (BazResponse) {\n option (temporal.v1.workflow) = {};\n }\n\n rpc Qux(QuxRequest) returns (QuxResponse) {\n option (temporal.v1.workflow) = {};\n }\n}\n"})}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{className:"language-go",children:"type ExampleClient interface {\n Foo(ctx context.Context, opts ...*FooOptions) error\n Bar(ctx context.Context, req *BarRequest, opts ...*BarOptions) error\n Baz(ctx context.Context, opts ...*BazOptions) (*BazResponse, error)\n Qux(ctx context.Context, req *QuxRequest, opts ...*QuxOptions) (*QuxResponse, error)\n}\n"})}),"\n",(0,o.jsx)(n.p,{children:(0,o.jsx)(n.a,{href:"#generated-code-reference",children:"top"})}),"\n",(0,o.jsx)(n.hr,{}),"\n",(0,o.jsx)(n.h4,{id:"workflow-method-asynchronous",children:"Workflow method (asynchronous)"}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{className:"language-go",children:"func (Client) Async(\n ctx context.Context, \n [req *Request],\n opts ...*Options,\n) (Run, error)\n"})}),"\n",(0,o.jsxs)(n.p,{children:["Executes the corresponding workflow using the configured default options, returning a ",(0,o.jsx)(n.a,{href:"#workflowrun-interface",children:"WorkflowRun"})," for the workflow execution"]}),"\n",(0,o.jsx)(n.p,{children:(0,o.jsx)(n.strong,{children:"Example"})}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{className:"language-protobuf",children:"service Example {\n rpc Foo(FooRequest) returns (FooResponse) {\n option (temporal.v1.workflow) = {};\n }\n}\n"})}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{className:"language-go",children:"type ExampleClient interface {\n FooAsync(ctx context.Context, workflowID, runID string, req *FooRequest, opts ...*FooOptions) (FooRun, error)\n}\n"})}),"\n",(0,o.jsx)(n.p,{children:(0,o.jsx)(n.a,{href:"#generated-code-reference",children:"top"})}),"\n",(0,o.jsx)(n.h3,{id:"updatehandle-interface",children:"UpdateHandle interface"}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{className:"language-go",children:"type Handle interface {}\n"})}),"\n",(0,o.jsx)(n.p,{children:"Interface describing an update execution handle returned by asynchronous update methods"}),"\n",(0,o.jsx)(n.p,{children:(0,o.jsx)(n.a,{href:"#generated-code-reference",children:"top"})}),"\n",(0,o.jsx)(n.hr,{}),"\n",(0,o.jsx)(n.h4,{id:"get-method",children:"Get method"}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{className:"language-go",children:"func (Handle) Get(ctx context.Context) ([*Response], error)\n"})}),"\n",(0,o.jsx)(n.p,{children:"Returns the update result, blocking until update completes or errors"}),"\n",(0,o.jsx)(n.p,{children:(0,o.jsx)(n.a,{href:"#generated-code-reference",children:"top"})}),"\n",(0,o.jsx)(n.hr,{}),"\n",(0,o.jsx)(n.h4,{id:"runid-method",children:"RunID method"}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{className:"language-go",children:"func (Handle) RunID() string\n"})}),"\n",(0,o.jsx)(n.p,{children:"Returns the workflow execution ID"}),"\n",(0,o.jsx)(n.p,{children:(0,o.jsx)(n.a,{href:"#generated-code-reference",children:"top"})}),"\n",(0,o.jsx)(n.hr,{}),"\n",(0,o.jsx)(n.h4,{id:"updateid-method",children:"UpdateID method"}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{className:"language-go",children:"func (Handle) UpdateID() string\n"})}),"\n",(0,o.jsx)(n.p,{children:"Returns the update ID"}),"\n",(0,o.jsx)(n.p,{children:(0,o.jsx)(n.a,{href:"#generated-code-reference",children:"top"})}),"\n",(0,o.jsx)(n.hr,{}),"\n",(0,o.jsx)(n.h4,{id:"workflowid-method",children:"WorkflowID method"}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{className:"language-go",children:"func (Handle) WorkflowID() string\n"})}),"\n",(0,o.jsx)(n.p,{children:"Returns the workflow ID"}),"\n",(0,o.jsx)(n.p,{children:(0,o.jsx)(n.a,{href:"#generated-code-reference",children:"top"})}),"\n",(0,o.jsx)(n.h3,{id:"workflowoptions-struct",children:"WorkflowOptions struct"}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{className:"language-go",children:"type Options struct {}\n"})}),"\n",(0,o.jsx)(n.p,{children:"Optional configuration for workfow methods"}),"\n",(0,o.jsx)(n.p,{children:(0,o.jsx)(n.strong,{children:"Example"})}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{className:"language-protobuf",children:"service Example {\n rpc Foo(google.protobuf.Empty) returns (google.protobuf.Empty) {\n option (temporal.v1.workflow) = {\n execution_timeout: { seconds: 60 }\n };\n }\n}\n"})}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{className:"language-go",children:"func example(ctx context.Context, example examplev1.ExampleClient) error {\n return example.Foo(ctx, examplev1.NewFooOptions().\n WithStartWorkflowOptions(client.StartWorkflowOptions{\n ExecutionTimeout: time.Seconds*30\n }),\n )\n}\n"})}),"\n",(0,o.jsx)(n.p,{children:(0,o.jsx)(n.a,{href:"#generated-code-reference",children:"top"})}),"\n",(0,o.jsx)(n.hr,{}),"\n",(0,o.jsx)(n.h4,{id:"newworkflowoptions-function",children:"NewWorkflowOptions function"}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{className:"language-go",children:"func NewOptions() *Options\n"})}),"\n",(0,o.jsx)(n.p,{children:"Returns a new workflow options value for the corresponding workflow"}),"\n",(0,o.jsx)(n.p,{children:(0,o.jsx)(n.a,{href:"#generated-code-reference",children:"top"})}),"\n",(0,o.jsx)(n.hr,{}),"\n",(0,o.jsx)(n.h4,{id:"withstartworkflowoptions-method",children:"WithStartWorkflowOptions method"}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{className:"language-go",children:"func (*Options) WithStartWorkflowOptions(client.StartWorkflowOptions) *Options\n"})}),"\n",(0,o.jsx)(n.p,{children:"Sets dynamic workflow options for an individual workflow execution"}),"\n",(0,o.jsx)(n.p,{children:(0,o.jsx)(n.a,{href:"#generated-code-reference",children:"top"})}),"\n",(0,o.jsx)(n.h3,{id:"workflowrun-interface",children:"WorkflowRun interface"}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{className:"language-go",children:"type Run interface {}\n"})}),"\n",(0,o.jsx)(n.p,{children:"Interface describing a workflow execution handle returned by asynchronous workflow methods"}),"\n",(0,o.jsx)(n.p,{children:(0,o.jsx)(n.a,{href:"#generated-code-reference",children:"top"})}),"\n",(0,o.jsx)(n.hr,{}),"\n",(0,o.jsx)(n.h4,{id:"cancel-method",children:"Cancel method"}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{className:"language-go",children:"type (Run) Cancel(context.Context) error\n"})}),"\n",(0,o.jsx)(n.p,{children:"Cancels the workflow execution"}),"\n",(0,o.jsx)(n.p,{children:(0,o.jsx)(n.a,{href:"#generated-code-reference",children:"top"})}),"\n",(0,o.jsx)(n.hr,{}),"\n",(0,o.jsx)(n.h4,{id:"get-method-1",children:"Get method"}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{className:"language-go",children:"type (Run) Get(context.Context) ([*Response], error)\n"})}),"\n",(0,o.jsx)(n.p,{children:"Returns the workflow result, blocking until workflow completes or errors"}),"\n",(0,o.jsx)(n.p,{children:(0,o.jsx)(n.a,{href:"#generated-code-reference",children:"top"})}),"\n",(0,o.jsx)(n.hr,{}),"\n",(0,o.jsx)(n.h4,{id:"id-method",children:"ID method"}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{className:"language-go",children:"type (Run) ID() string\n"})}),"\n",(0,o.jsx)(n.p,{children:"Returns the workflow ID"}),"\n",(0,o.jsx)(n.p,{children:(0,o.jsx)(n.a,{href:"#generated-code-reference",children:"top"})}),"\n",(0,o.jsx)(n.hr,{}),"\n",(0,o.jsx)(n.h4,{id:"query-method-1",children:"Query method"}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{className:"language-go",children:"type (Run) (context.Context, [*Request]) ([*Response], error)\n"})}),"\n",(0,o.jsx)(n.p,{children:"Executes the corresponding query against the workflow execution using the configured default options"}),"\n",(0,o.jsx)(n.p,{children:(0,o.jsx)(n.a,{href:"#generated-code-reference",children:"top"})}),"\n",(0,o.jsx)(n.hr,{}),"\n",(0,o.jsx)(n.h4,{id:"run-method",children:"Run method"}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{className:"language-go",children:"type (Run) Run() client.WorkflowRun\n"})}),"\n",(0,o.jsxs)(n.p,{children:["Returns the inner ",(0,o.jsx)(n.a,{href:"https://pkg.go.dev/go.temporal.io/sdk/client#WorkflowRun",children:"client.WorkflowRun"})]}),"\n",(0,o.jsx)(n.p,{children:(0,o.jsx)(n.a,{href:"#generated-code-reference",children:"top"})}),"\n",(0,o.jsx)(n.hr,{}),"\n",(0,o.jsx)(n.h4,{id:"runid-method-1",children:"RunID method"}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{className:"language-go",children:"type (Run) RunID() string\n"})}),"\n",(0,o.jsx)(n.p,{children:"Returns the workflow execution ID"}),"\n",(0,o.jsx)(n.p,{children:(0,o.jsx)(n.a,{href:"#generated-code-reference",children:"top"})}),"\n",(0,o.jsx)(n.hr,{}),"\n",(0,o.jsx)(n.h4,{id:"signal-method-1",children:"Signal method"}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{className:"language-go",children:"type (Run) (context.Context, [*Request]) error\n"})}),"\n",(0,o.jsx)(n.p,{children:"Executes the corresponding signal against the workflow execution using the configured default options"}),"\n",(0,o.jsx)(n.p,{children:(0,o.jsx)(n.a,{href:"#generated-code-reference",children:"top"})}),"\n",(0,o.jsx)(n.hr,{}),"\n",(0,o.jsx)(n.h4,{id:"terminate-method",children:"Terminate method"}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{className:"language-go",children:"type (Run) Terminate(\n ctx context.Context,\n reason string,\n details ...any,\n) error\n"})}),"\n",(0,o.jsx)(n.p,{children:"Terminates the workflow execution"}),"\n",(0,o.jsx)(n.p,{children:(0,o.jsx)(n.a,{href:"#generated-code-reference",children:"top"})}),"\n",(0,o.jsx)(n.hr,{}),"\n",(0,o.jsx)(n.h4,{id:"update-method-1",children:"Update method"}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{className:"language-go",children:"type (Run) (\n context.Context, \n [*Request],\n ...*Options,\n) ([*Response], error)\n"})}),"\n",(0,o.jsx)(n.p,{children:"Executes the corresponding update against the workflow execution using the configured default options, blocking until the update completes or errors"}),"\n",(0,o.jsx)(n.p,{children:(0,o.jsx)(n.a,{href:"#generated-code-reference",children:"top"})}),"\n",(0,o.jsx)(n.hr,{}),"\n",(0,o.jsx)(n.h4,{id:"update-method-asynchronous-1",children:"Update method (asynchronous)"}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{className:"language-go",children:"type (Run) (\n context.Context, \n [*Request],\n ...*Options,\n) (Handle, error)\n"})}),"\n",(0,o.jsxs)(n.p,{children:["Executes the corresponding query against the workflow execution using the configured default options, returning an ",(0,o.jsx)(n.a,{href:"#updatehandle-interface",children:"UpdateHandle"})," for the update execution"]}),"\n",(0,o.jsx)(n.p,{children:(0,o.jsx)(n.a,{href:"#generated-code-reference",children:"top"})}),"\n",(0,o.jsx)(n.h2,{id:"worker",children:"Worker"}),"\n",(0,o.jsx)(n.h3,{id:"activities-interface",children:"Activities interface"}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{className:"language-go",children:"type Activities interface {}\n"})}),"\n",(0,o.jsx)(n.p,{children:"Interface used to describe the required Activities struct implementation"}),"\n",(0,o.jsx)(n.p,{children:(0,o.jsx)(n.strong,{children:"Example"})}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{className:"language-protobuf",children:"service Example {\n rpc Foo(google.protobuf.Empty) returns (google.protobuf.Empty) {\n option (temporal.v1.activity) = {};\n }\n\n rpc Bar(BarRequest) returns (google.protobuf.Empty) {\n option (temporal.v1.activity) = {};\n }\n\n rpc Baz(google.protobuf.Empty) returns (BazResponse) {\n option (temporal.v1.activity) = {};\n }\n\n rpc Qux(QuxRequest) returns (QuxResponse) {\n option (temporal.v1.activity) = {};\n }\n}\n"})}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{className:"language-go",children:"type ExampleActivities interface {\n Foo(context.Context) error\n Bar(context.Context, *BarRequest) error\n Baz(context.Context) (*BazResponse, error)\n Qux(context.Context, *QuxRequest) (*QuxResponse, error)\n}\n"})}),"\n",(0,o.jsx)(n.p,{children:(0,o.jsx)(n.a,{href:"#generated-code-reference",children:"top"})}),"\n",(0,o.jsx)(n.h3,{id:"registeractivities-function",children:"RegisterActivities function"}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{className:"language-go",children:"func RegisterActivities(worker.ActivityRegistry, Activities)\n"})}),"\n",(0,o.jsx)(n.p,{children:"Registers all service activities with the provided registry"}),"\n",(0,o.jsx)(n.p,{children:(0,o.jsx)(n.a,{href:"#generated-code-reference",children:"top"})}),"\n",(0,o.jsx)(n.h3,{id:"registeractivity-function",children:"RegisterActivity function"}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{className:"language-go",children:"func RegisterActivity(\n worker.ActivityRegistry, \n func(context.Context, [*Request]) ([*Response], error),\n)\n"})}),"\n",(0,o.jsx)(n.p,{children:"Registers the activity with the provided registry"}),"\n",(0,o.jsx)(n.p,{children:(0,o.jsx)(n.a,{href:"#generated-code-reference",children:"top"})}),"\n",(0,o.jsx)(n.h3,{id:"activity-function",children:"Activity function"}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{className:"language-go",children:"func (\n workflow.Context, \n [*Request],\n ...*ActivityOptions,\n) ([*Response], error)\n"})}),"\n",(0,o.jsx)(n.p,{children:"Executes the corresponding activity, blocking until activity completes or errors"}),"\n",(0,o.jsx)(n.p,{children:(0,o.jsx)(n.strong,{children:"Example"})}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{className:"language-protobuf",children:"service Example {\n rpc Foo(google.protobuf.Empty) returns (google.protobuf.Empty) {\n option (temporal.v1.workflow) = {};\n }\n\n rpc Bar(BarRequest) returns (BarResponse) {\n option (temporal.v1.activity) = {};\n }\n}\n"})}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{className:"language-go",children:'type (\n Activities struct {}\n\n FooWorkflow struct {\n *examplev1.FooInput\n }\n)\n\nfunc (a *Activities) Bar(ctx context.Context, req *BarRequest) (*BarResponse, error) {\n return nil, nil\n}\n\nfunc (w *FooWorkflow) Execute(ctx workflow.Context) error {\n bar, err := examplev1.Bar(ctx, &examplev1.BarRequest{})\n workflow.GetLogger(ctx).Info("executed bar activity", "result", bar)\n return err\n}\n'})}),"\n",(0,o.jsx)(n.p,{children:(0,o.jsx)(n.a,{href:"#generated-code-reference",children:"top"})}),"\n",(0,o.jsx)(n.h3,{id:"activityasync-function",children:"ActivityAsync function"}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{className:"language-go",children:"func Async(\n workflow.Context, \n [*Request],\n ... *ActivityOptions,\n) (Future, error)\n"})}),"\n",(0,o.jsxs)(n.p,{children:["Executes the corresponding activity, returning an ",(0,o.jsx)(n.a,{href:"#activityfuture-interface",children:"ActivityFuture"})," for the activity execution"]}),"\n",(0,o.jsx)(n.p,{children:(0,o.jsx)(n.a,{href:"#generated-code-reference",children:"top"})}),"\n",(0,o.jsx)(n.p,{children:(0,o.jsx)(n.strong,{children:"Example"})}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{className:"language-protobuf",children:"service Example {\n rpc Foo(google.protobuf.Empty) returns (google.protobuf.Empty) {\n option (temporal.v1.workflow) = {};\n }\n\n rpc Bar(BarRequest) returns (BarResponse) {\n option (temporal.v1.activity) = {};\n }\n}\n"})}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{className:"language-go",children:'type (\n Activities struct {}\n\n FooWorkflow struct {\n *examplev1.FooInput\n }\n)\n\nfunc (a *Activities) Bar(ctx context.Context, req *BarRequest) (*BarResponse, error) {\n return nil, nil\n}\n\nfunc (w *FooWorkflow) Execute(ctx workflow.Context) error {\n f, err := examplev1.BarAsync(ctx, &examplev1.BarRequest{})\n if err != nil {\n return fmt.Errorf("error starting bar activity: %w", err)\n }\n bar, err := f.Get(ctx)\n workflow.GetLogger(ctx).Info("executed bar activity", "result", bar)\n return err\n}\n'})}),"\n",(0,o.jsx)(n.p,{children:(0,o.jsx)(n.a,{href:"#generated-code-reference",children:"top"})}),"\n",(0,o.jsx)(n.h3,{id:"activitylocal-function",children:"ActivityLocal function"}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{className:"language-go",children:"func Local(\n workflow.Context, \n [*Request],\n ... *ActivityLocalOptions,\n) ([*Response], error)\n"})}),"\n",(0,o.jsxs)(n.p,{children:["Executes the corresponding activity as a ",(0,o.jsx)(n.a,{href:"https://docs.temporal.io/activities#local-activity",children:"local activity"}),", blocking until local activity completes or errors"]}),"\n",(0,o.jsx)(n.p,{children:(0,o.jsx)(n.a,{href:"#generated-code-reference",children:"top"})}),"\n",(0,o.jsx)(n.h3,{id:"activitylocalasync-function",children:"ActivityLocalAsync function"}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{className:"language-go",children:"func LocalAsync(\n workflow.Context, \n [*Request],\n ... *ActivityLocalOptions,\n) (Future, error)\n"})}),"\n",(0,o.jsxs)(n.p,{children:["Executes the corresponding activity as a ",(0,o.jsx)(n.a,{href:"https://docs.temporal.io/activities#local-activity",children:"local activity"}),", returning an ",(0,o.jsx)(n.a,{href:"#activityfuture-interface",children:"ActivityFuture"})," for the local activity execution"]}),"\n",(0,o.jsx)(n.p,{children:(0,o.jsx)(n.a,{href:"#generated-code-reference",children:"top"})}),"\n",(0,o.jsx)(n.h3,{id:"activityfuture-struct",children:"ActivityFuture struct"}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{className:"language-go",children:"type Future struct {\n Future workflow.Future\n}\n"})}),"\n",(0,o.jsx)(n.p,{children:"Struct providing an interface execution handle returned by asynchronous activity methods"}),"\n",(0,o.jsx)(n.p,{children:(0,o.jsx)(n.a,{href:"#generated-code-reference",children:"top"})}),"\n",(0,o.jsx)(n.hr,{}),"\n",(0,o.jsx)(n.h4,{id:"get-method-2",children:"Get method"}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{className:"language-go",children:"func (*Future) Get(context.Context) ([*Response], error)\n"})}),"\n",(0,o.jsx)(n.p,{children:"Returns the activity result, blocking until activity completes or errors"}),"\n",(0,o.jsx)(n.p,{children:(0,o.jsx)(n.a,{href:"#generated-code-reference",children:"top"})}),"\n",(0,o.jsx)(n.hr,{}),"\n",(0,o.jsx)(n.h4,{id:"select-method",children:"Select method"}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{className:"language-go",children:"func (*Future) Select(workflow.Selector, func(Future)) workflow.Selector\n"})}),"\n",(0,o.jsx)(n.p,{children:"Registers the activity execution callback with the given selector"}),"\n",(0,o.jsx)(n.p,{children:(0,o.jsx)(n.a,{href:"#generated-code-reference",children:"top"})}),"\n",(0,o.jsx)(n.h3,{id:"activityoptions-struct",children:"ActivityOptions struct"}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{className:"language-go",children:"type ActivityOptions struct {}\n"})}),"\n",(0,o.jsx)(n.p,{children:"Optional configuration for activity methods"}),"\n",(0,o.jsx)(n.p,{children:(0,o.jsx)(n.a,{href:"#generated-code-reference",children:"top"})}),"\n",(0,o.jsx)(n.hr,{}),"\n",(0,o.jsx)(n.h4,{id:"newactivityoptions-function",children:"NewActivityOptions function"}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{className:"language-go",children:"func NewActivityOptions() *ActivityOptions\n"})}),"\n",(0,o.jsx)(n.p,{children:"Returns a new activity options value"}),"\n",(0,o.jsx)(n.p,{children:(0,o.jsx)(n.a,{href:"#generated-code-reference",children:"top"})}),"\n",(0,o.jsx)(n.hr,{}),"\n",(0,o.jsx)(n.h4,{id:"withactivityoptions-method",children:"WithActivityOptions method"}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{className:"language-go",children:"func (*ActivityOptions) WithActivityOptions(workflow.ActivityOptions) *ActivityOptions\n"})}),"\n",(0,o.jsx)(n.p,{children:"Sets dynamic activity options for an individual activity execution"}),"\n",(0,o.jsx)(n.p,{children:(0,o.jsx)(n.strong,{children:"Example"})}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{className:"language-protobuf",children:"service Example {\n rpc Foo(google.protobuf.Empty) returns (google.protobuf.Empty) {\n option (temporal.v1.workflow) = {};\n }\n\n rpc Bar(BarRequest) returns (BarResponse) {\n option (temporal.v1.activity) = {};\n }\n}\n"})}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{className:"language-go",children:'type (\n Activities struct {}\n\n FooWorkflow struct {\n *examplev1.FooInput\n }\n)\n\nfunc (a *Activities) Bar(ctx context.Context, req *BarRequest) (*BarResponse, error) {\n return nil, nil\n}\n\nfunc (w *FooWorkflow) Execute(ctx workflow.Context) error {\n opts := workflow.GetActivityOptions(ctx)\n opts.StartToCloseTimeout = time.Second*30\n bar, err := examplev1.Bar(\n ctx, \n &examplev1.BarRequest{}, \n examplev1.NewBarActivityOptions().\n WithActivityOptions(opts),\n )\n workflow.GetLogger(ctx).Info("executed bar activity", "result", bar)\n return err\n}\n'})}),"\n",(0,o.jsx)(n.p,{children:(0,o.jsx)(n.a,{href:"#generated-code-reference",children:"top"})}),"\n",(0,o.jsx)(n.h3,{id:"localactivityoptions-struct",children:"LocalActivityOptions struct"}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{className:"language-go",children:"type LocalActivityOptions struct {}\n"})}),"\n",(0,o.jsx)(n.p,{children:"Optional configuration for local activity methods"}),"\n",(0,o.jsx)(n.p,{children:(0,o.jsx)(n.a,{href:"#generated-code-reference",children:"top"})}),"\n",(0,o.jsx)(n.hr,{}),"\n",(0,o.jsx)(n.h4,{id:"local-method",children:"Local method"}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{className:"language-go",children:"func (*LocalActivityOptions) Local(\n func(context.Context, [*Request]) ([*Response], error)\n) *LocalActivityOptions\n"})}),"\n",(0,o.jsx)(n.p,{children:"Sets the activity definition to use for the local execution"}),"\n",(0,o.jsx)(n.p,{children:(0,o.jsx)(n.strong,{children:"Example"})}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{className:"language-protobuf",children:"service Example {\n rpc Foo(google.protobuf.Empty) returns (google.protobuf.Empty) {\n option (temporal.v1.workflow) = {};\n }\n\n rpc Bar(BarRequest) returns (BarResponse) {\n option (temporal.v1.activity) = {};\n }\n}\n"})}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{className:"language-go",children:'type (\n FooWorkflow struct {\n *examplev1.FooInput\n }\n)\n\nfunc (w *FooWorkflow) Execute(ctx workflow.Context) error {\n bar, err := examplev1.BarLocal(\n ctx, \n &examplev1.BarRequest{}, \n examplev1.NewBarActivityOptions().\n Local(func(ctx context.Context, req *BarRequest) (*BarResponse, error) {\n return nil, nil\n }),\n )\n workflow.GetLogger(ctx).Info("executed local bar activity", "result", bar)\n return err\n}\n'})}),"\n",(0,o.jsx)(n.p,{children:(0,o.jsx)(n.a,{href:"#generated-code-reference",children:"top"})}),"\n",(0,o.jsx)(n.hr,{}),"\n",(0,o.jsx)(n.h4,{id:"newlocalactivityoptions-function",children:"NewLocalActivityOptions function"}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{className:"language-go",children:"func NewLocalActivityOptions() *LocalActivityOptions\n"})}),"\n",(0,o.jsx)(n.p,{children:"Returns a new activity local options value"}),"\n",(0,o.jsx)(n.p,{children:(0,o.jsx)(n.a,{href:"#generated-code-reference",children:"top"})}),"\n",(0,o.jsx)(n.hr,{}),"\n",(0,o.jsx)(n.h4,{id:"withlocalactivityoptions-method",children:"WithLocalActivityOptions method"}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{className:"language-go",children:"func (*LocalActivityOptions) WithLocalActivityOptions(workflow.LocalActivityOptions) *LocalActivityOptions\n"})}),"\n",(0,o.jsx)(n.p,{children:"Sets dynamic activity options for an individual local activity execution"}),"\n",(0,o.jsx)(n.p,{children:(0,o.jsx)(n.strong,{children:"Example"})}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{className:"language-protobuf",children:"service Example {\n rpc Foo(google.protobuf.Empty) returns (google.protobuf.Empty) {\n option (temporal.v1.workflow) = {};\n }\n\n rpc Bar(BarRequest) returns (BarResponse) {\n option (temporal.v1.activity) = {};\n }\n}\n"})}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{className:"language-go",children:'type (\n Activities struct {}\n\n FooWorkflow struct {\n *examplev1.FooInput\n }\n)\n\nfunc (a *Activities) Bar(ctx context.Context, req *BarRequest) (*BarResponse, error) {\n return nil, nil\n}\n\nfunc (w *FooWorkflow) Execute(ctx workflow.Context) error {\n opts := workflow.GetLocalActivityOptions(ctx)\n opts.StartToCloseTimeout = time.Second*30\n bar, err := examplev1.BarLocal(\n ctx, \n &examplev1.BarRequest{}, \n examplev1.NewBarActivityOptions().\n WithLocalActivityOptions(opts),\n )\n workflow.GetLogger(ctx).Info("executed local bar activity", "result", bar)\n return err\n}\n'})}),"\n",(0,o.jsx)(n.p,{children:(0,o.jsx)(n.a,{href:"#generated-code-reference",children:"top"})}),"\n",(0,o.jsx)(n.h3,{id:"signal-struct",children:"Signal struct"}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{className:"language-go",children:"type Signal struct {\n Channel workflow.ReceiveChannel\n}\n"})}),"\n",(0,o.jsx)(n.p,{children:"Struct providing types and methods to simplify interacting with the corresponding signal from a workflow definition"}),"\n",(0,o.jsx)(n.p,{children:(0,o.jsx)(n.strong,{children:"Example"})}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{className:"language-protobuf",children:"service Example {\n rpc Foo(google.protobuf.Empty) returns (google.protobuf.Empty) {\n option (temporal.v1.workflow) = {\n signal: { ref: 'Bar' }\n };\n }\n\n rpc Bar(BarRequest) returns (google.protobuf.Empty) {\n option (temporal.v1.signal) = {};\n }\n}\n"})}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{className:"language-go",children:'type (\n Workflows struct{}\n\n FooWorkflow struct {\n *examplev1.FooInput\n }\n)\n\nfunc (wfs *Workflows) Foo(ctx workflow.Context, input *examplev1.FooInput) (examplev1.FooWorkflow, error) {\n return &FooWorkflow{input}, nil\n}\n\nfunc (w *FooWorkflow) Execute(ctx workflow.Context) error {\n workflow.NewSelector(ctx).\n AddReceive(w.Bar.Channel, func(workflow.ReceiveChannel, bool) {\n bar := w.Bar.ReceiveAsync()\n workflow.GetLogger(ctx).Info("received bar signal", "signal", bar)\n }).\n Select(ctx)\n return nil\n}\n'})}),"\n",(0,o.jsx)(n.p,{children:(0,o.jsx)(n.a,{href:"#generated-code-reference",children:"top"})}),"\n",(0,o.jsx)(n.hr,{}),"\n",(0,o.jsx)(n.h4,{id:"receive-method",children:"Receive method"}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{className:"language-go",children:"func (*Signal) Receive(workflow.Context) ([*Request], bool)\n"})}),"\n",(0,o.jsx)(n.p,{children:"Returns the next signal request and boolean indicating whether the channel is closed, blocking until the signal is received."}),"\n",(0,o.jsx)(n.p,{children:(0,o.jsx)(n.strong,{children:"Example"})}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{className:"language-protobuf",children:"service Example {\n rpc Foo(google.protobuf.Empty) returns (google.protobuf.Empty) {\n option (temporal.v1.workflow) = {\n signal: { ref: 'Bar' }\n };\n }\n\n rpc Bar(BarRequest) returns (google.protobuf.Empty) {\n option (temporal.v1.signal) = {};\n }\n}\n"})}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{className:"language-go",children:'type (\n Workflows struct{}\n\n FooWorkflow struct {\n *examplev1.FooInput\n }\n)\n\nfunc (wfs *Workflows) Foo(ctx workflow.Context, input *examplev1.FooInput) (examplev1.FooWorkflow, error) {\n return &FooWorkflow{input}, nil\n}\n\nfunc (w *FooWorkflow) Execute(ctx workflow.Context) error {\n bar, _ := w.Bar.Receive(ctx)\n workflow.GetLogger(ctx).Info("received bar signal", "signal", bar)\n return nil\n}\n'})}),"\n",(0,o.jsx)(n.p,{children:(0,o.jsx)(n.a,{href:"#generated-code-reference",children:"top"})}),"\n",(0,o.jsx)(n.hr,{}),"\n",(0,o.jsx)(n.h4,{id:"receiveasync-method",children:"ReceiveAsync method"}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{className:"language-go",children:"func (*Signal) ReceiveAsync() (*Request | bool)\n"})}),"\n",(0,o.jsx)(n.p,{children:"Returns the next signal request if available (bool if signal has no request payload), or nil otherwise."}),"\n",(0,o.jsx)(n.p,{children:(0,o.jsx)(n.strong,{children:"Example"})}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{className:"language-protobuf",children:"service Example {\n rpc Foo(google.protobuf.Empty) returns (google.protobuf.Empty) {\n option (temporal.v1.workflow) = {\n signal: { ref: 'Bar', start: true }\n };\n }\n\n rpc Bar(BarRequest) returns (google.protobuf.Empty) {\n option (temporal.v1.signal) = {};\n }\n}\n"})}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{className:"language-go",children:'type (\n Workflows struct{}\n\n FooWorkflow struct {\n *examplev1.FooInput\n }\n)\n\nfunc (wfs *Workflows) Foo(ctx workflow.Context, input *examplev1.FooInput) (examplev1.FooWorkflow, error) {\n return &FooWorkflow{input}, nil\n}\n\nfunc (w *FooWorkflow) Execute(ctx workflow.Context) error {\n bar := w.Bar.ReceiveAsync()\n if bar != nil {\n workflow.GetLogger(ctx).Info("workflow started with bar signal", "signal", bar)\n }\n return nil\n}\n'})}),"\n",(0,o.jsx)(n.p,{children:(0,o.jsx)(n.a,{href:"#generated-code-reference",children:"top"})}),"\n",(0,o.jsx)(n.hr,{}),"\n",(0,o.jsx)(n.h4,{id:"select-method-1",children:"Select method"}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{className:"language-go",children:"func (*Signal) Select(\n workflow.Selector,\n func([*Request]),\n) workflow.Selector\n"})}),"\n",(0,o.jsx)(n.p,{children:"Registers the provided signal callback with the provided selector"}),"\n",(0,o.jsx)(n.p,{children:(0,o.jsx)(n.a,{href:"#generated-code-reference",children:"top"})}),"\n",(0,o.jsx)(n.h3,{id:"signalexternal-function",children:"SignalExternal function"}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{className:"language-go",children:"func External(\n ctx workflow.Context, \n workflowID string,\n runID string,\n signal [*Request],\n) error\n"})}),"\n",(0,o.jsx)(n.p,{children:"Sends the corresponding signal to an existing workflow execution."}),"\n",(0,o.jsx)(n.p,{children:(0,o.jsx)(n.strong,{children:"Example"})}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{className:"language-protobuf",children:"service Example {\n rpc Foo(google.protobuf.Empty) returns (google.protobuf.Empty) {\n option (temporal.v1.workflow) = {};\n }\n\n rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty) {\n option (temporal.v1.workflow) = {\n signal: { ref: 'Baz' }\n };\n }\n\n rpc Baz(BazRequest) returns (google.protobuf.Empty) {\n option (temporal.v1.signal) = {};\n }\n}\n"})}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{className:"language-go",children:'type (\n FooWorkflow struct {\n *examplev1.FooInput\n }\n\n BarWorkflow struct {\n *examplev1.BarInput\n }\n)\n\nfunc (w *FooWorkflow) Execute(ctx workflow.Context) error {\n return examplev1.BazExternal(ctx, "barID", "", &examplev1.BazRequest{})\n}\n\nfunc (w *FooWorkflow) Execute(ctx workflow.Context) error {\n baz, _ := w.Baz.Receive(ctx)\n workflow.GetLogger(ctx).Info("received baz signal", "signal", baz)\n return nil\n}\n'})}),"\n",(0,o.jsx)(n.p,{children:(0,o.jsx)(n.a,{href:"#generated-code-reference",children:"top"})}),"\n",(0,o.jsx)(n.h3,{id:"signalexternalasync-function",children:"SignalExternalAsync function"}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{className:"language-go",children:"func ExternalAsync(\n ctx workflow.Context, \n workflowID string,\n runID string,\n signal [*Request],\n) workflow.Future\n"})}),"\n",(0,o.jsx)(n.p,{children:"Sends the corresponding signal to an existing workflow execution, returning a workflow future."}),"\n",(0,o.jsx)(n.p,{children:(0,o.jsx)(n.a,{href:"#generated-code-reference",children:"top"})}),"\n",(0,o.jsx)(n.h3,{id:"workflows-interface",children:"Workflows interface"}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{className:"language-go",children:"type Workflows interface {}\n"})}),"\n",(0,o.jsx)(n.p,{children:"Interface used to describe the required Workflows struct implementation"}),"\n",(0,o.jsx)(n.p,{children:(0,o.jsx)(n.strong,{children:"Example"})}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{className:"language-protobuf",children:"service Example {\n rpc Foo(google.protobuf.Empty) returns (google.protobuf.Empty) {\n option (temporal.v1.workflow) = {};\n }\n}\n"})}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{className:"language-go",children:"type ExampleWorkflows interface {\n Foo(context.Context, *examplev1.FooInput) (examplev1.FooWorkflow, error)\n}\n"})}),"\n",(0,o.jsx)(n.p,{children:(0,o.jsx)(n.a,{href:"#generated-code-reference",children:"top"})}),"\n",(0,o.jsx)(n.h3,{id:"registerworkflows-function",children:"RegisterWorkflows function"}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{className:"language-go",children:"func RegisterWorkflows(worker.WorkflowRegistry, examplev1.Workflows)\n"})}),"\n",(0,o.jsx)(n.p,{children:"Registers all service workflows with the provided registry"}),"\n",(0,o.jsx)(n.p,{children:(0,o.jsx)(n.a,{href:"#generated-code-reference",children:"top"})}),"\n",(0,o.jsx)(n.h3,{id:"registerworkflow-function",children:"RegisterWorkflow function"}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{className:"language-go",children:"func RegisterWorkflow(\n worker.WorkflowRegistry,\n func(workflow.Context, *examplev1.Input) (examplev1.Workflow, error)\n)\n"})}),"\n",(0,o.jsx)(n.p,{children:"Registers the workflow with the provided registry"}),"\n",(0,o.jsx)(n.p,{children:(0,o.jsx)(n.a,{href:"#generated-code-reference",children:"top"})}),"\n",(0,o.jsx)(n.h3,{id:"workflow-interface",children:"Workflow interface"}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{className:"language-go",children:"type Workflow {\n Execute(workflow.Context) ([*Response], error)\n ([*Request]) (*Response, error)\n ([*Request]) ([*Response], error)\n Validate([*Request]) error\n}\n"})}),"\n",(0,o.jsx)(n.p,{children:"Interface used to describe a required Workflow struct implementation"}),"\n",(0,o.jsx)(n.p,{children:(0,o.jsx)(n.strong,{children:"Example"})}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{className:"language-protobuf",children:"service Example {\n rpc Foo(FooRequest) returns (FooResponse) {\n option (temporal.v1.workflow) = {\n query: { ref: 'QueryFoo' }\n update: { ref: 'UpdateFoo' }\n };\n }\n\n rpc QueryFoo(QueryFooRequest) returns (QueryFooResponse) {\n option (temporal.v1.query) = {};\n }\n\n rpc UpdateFoo(UpdateFooRequest) returns (UpdateFooResponse) {\n option (temporal.v1.update) = {\n validate: true\n };\n }\n}\n"})}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{className:"language-go",children:"type FooWorkflow struct {\n *examplev1.FooInput\n}\n\nfunc (w *FooWorkflow) Execute(ctx workflow.Context) (*examplev1.FooResponse, error) {\n return &examplev1.FooResponse{}, nil\n}\n\nfunc (w *FooWorkflow) QueryFoo(req *examplev1.QueryFooRequest) (*examplev1.QueryFooResponse, error) {\n return &examplev1.QueryFooResponse{}, nil\n}\n\nfunc (w *FooWorkflow) UpdateFoo(ctx workflow.Context, req *examplev1.UpdateFooRequest) (*examplev1.UpdateFooResponse, error) {\n return &examplev1.UpdateFooResponse{}, nil\n}\n\nfunc (w *FooWorkflow) UpdateFoo(ctx workflow.Context, req *examplev1.UpdateFooRequest) error {\n return nil\n}\n"})}),"\n",(0,o.jsx)(n.p,{children:(0,o.jsx)(n.a,{href:"#generated-code-reference",children:"top"})}),"\n",(0,o.jsx)(n.h3,{id:"workflowchild-function",children:"WorkflowChild function"}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{className:"language-go",children:"func Child(\n workflow.Context,\n [*Request], \n ...*ChildOptions,\n) ([*Response], error)\n"})}),"\n",(0,o.jsx)(n.p,{children:"Executes the corresponding child workflow, blocking until child workflow completes or errors"}),"\n",(0,o.jsx)(n.p,{children:(0,o.jsx)(n.strong,{children:"Example"})}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{className:"language-protobuf",children:"service Example {\n rpc Foo(google.protobuf.Empty) returns (google.protobuf.Empty) {\n option (temporal.v1.workflow) = {};\n }\n\n rpc Bar(BarRequest) returns (BarResponse) {\n option (temporal.v1.workflow) = {};\n }\n}\n"})}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{className:"language-go",children:'type (\n FooWorkflow struct {\n *examplev1.FooInput\n }\n\n BarWorkflow struct {\n *examplev1.BarInput\n }\n)\n\nfunc (w *FooWorkflow) Execute(ctx workflow.Context) error {\n bar, err := examplev1.BarChild(ctx, &examplev1.BarRequest{})\n workflow.GetLogger(ctx).Info("executed bar child workflow", "response", bar)\n return err\n}\n\nfunc (w *BarWorkflow) Execute(ctx workflow.Context) (*examplev1.BarResponse, error) {\n return &examplev1.BarResponse{}, nil\n}\n'})}),"\n",(0,o.jsx)(n.p,{children:(0,o.jsx)(n.a,{href:"#generated-code-reference",children:"top"})}),"\n",(0,o.jsx)(n.h3,{id:"workflowchildasync-function",children:"WorkflowChildAsync function"}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{className:"language-go",children:"func Child(\n workflow.Context,\n [*Request], \n ...*ChildOptions,\n) ([*ChildRun], error)\n"})}),"\n",(0,o.jsxs)(n.p,{children:["Executes the corresponding child workflow, returning a ",(0,o.jsx)(n.a,{href:"#workflowchildrun-struct",children:"WorkflowChildRun"})," for the child workflow execution"]}),"\n",(0,o.jsx)(n.p,{children:(0,o.jsx)(n.a,{href:"#generated-code-reference",children:"top"})}),"\n",(0,o.jsx)(n.h3,{id:"workflowchildoptions-struct",children:"WorkflowChildOptions struct"}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{className:"language-go",children:"type ChildOptions struct {}\n"})}),"\n",(0,o.jsx)(n.p,{children:"Optional configuration for child workfow functions"}),"\n",(0,o.jsx)(n.p,{children:(0,o.jsx)(n.a,{href:"#generated-code-reference",children:"top"})}),"\n",(0,o.jsx)(n.hr,{}),"\n",(0,o.jsx)(n.h4,{id:"newworkflowchildoptions-function",children:"NewWorkflowChildOptions function"}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{className:"language-go",children:"func NewChildOptions() *ChildOptions\n"})}),"\n",(0,o.jsx)(n.p,{children:"Returns a new workflow child options value for the corresponding workflow"}),"\n",(0,o.jsx)(n.p,{children:(0,o.jsx)(n.a,{href:"#generated-code-reference",children:"top"})}),"\n",(0,o.jsx)(n.hr,{}),"\n",(0,o.jsx)(n.h4,{id:"withchildworkflowoptions-method",children:"WithChildWorkflowOptions method"}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{className:"language-go",children:"func (*Options) WithChildWorkflowOptions(workflow.ChildWorkflowOptions) *ChildOptions\n"})}),"\n",(0,o.jsx)(n.p,{children:"Sets dynamic workflow options for an individual workflow execution"}),"\n",(0,o.jsx)(n.p,{children:(0,o.jsx)(n.a,{href:"#generated-code-reference",children:"top"})}),"\n",(0,o.jsx)(n.h3,{id:"workflowinput-struct",children:"WorkflowInput struct"}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{className:"language-go",children:"type Input struct {\n [Req *Request]\n [ *Signal]\n}\n"})}),"\n",(0,o.jsx)(n.p,{children:"Struct that contains references to workflow inputs and signals"}),"\n",(0,o.jsx)(n.p,{children:(0,o.jsx)(n.strong,{children:"Example"})}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{className:"language-protobuf",children:"service Example {\n rpc Foo(FooRequest) returns (google.protobuf.Empty) {\n option (temporal.v1.workflow) = {\n signal: { ref: 'Bar' }\n signal: { ref: 'Baz' }\n };\n }\n\n rpc Bar(BarRequest) returns (google.protobuf.Empty) {\n option (temporal.v1.workflow) = {};\n }\n\n rpc Baz(BazRequest) returns (google.protobuf.Empty) {\n option (temporal.v1.workflow) = {};\n }\n}\n"})}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{className:"language-go",children:'type (\n Workflows struct {}\n\n FooWorkflow struct {\n *examplev1.FooInput\n log log.Logger\n }\n)\n\nfunc (w *Workflows) Foo(ctx workflow.Context, input *examplev1.FooInput) (examplev1.FooWorkflow, error) {\n return &FooWorkflow{input, workflow.GetLogger(ctx)}, nil\n}\n\nfunc (w *FooWorkflow) Execute(ctx workflow.Context) error {\n w.log.Info("starting foo workflow", "request", w.Req)\n for bar, baz := 0, 0; bar + baz < 2; {\n sel := workflow.NewSelector(ctx)\n if bar == 0 {\n w.Bar.Select(ctx, func(signal *examplev1.BarRequest) {\n w.log.Info("received bar signal", "signal", signal)\n bar++\n })\n }\n if baz == 0 {\n w.Baz.Select(ctx, func(signal *examplev1.BazRequest) {\n w.log.Info("received baz signal", "signal", signal)\n baz++\n })\n }\n sel.Select(ctx)\n }\n return nil\n}\n'})}),"\n",(0,o.jsx)(n.p,{children:(0,o.jsx)(n.a,{href:"#generated-code-reference",children:"top"})}),"\n",(0,o.jsx)(n.h3,{id:"workflowchildrun-struct",children:"WorkflowChildRun struct"}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{className:"language-go",children:"type ChildRun struct {\n Future workflow.ChildWorkflowFuture\n}\n"})}),"\n",(0,o.jsx)(n.p,{children:"Struct providing a child workflow execution handle returned by asynchronous child workflow methods"}),"\n",(0,o.jsx)(n.p,{children:(0,o.jsx)(n.a,{href:"#generated-code-reference",children:"top"})}),"\n",(0,o.jsx)(n.hr,{}),"\n",(0,o.jsx)(n.h4,{id:"get-method-3",children:"Get method"}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{className:"language-go",children:"func (*ChildRun) Get(workflow.Context) ([*Response], error)\n"})}),"\n",(0,o.jsx)(n.p,{children:"Returns the child workflow result, blocking until child workflow completes or errors"}),"\n",(0,o.jsx)(n.p,{children:(0,o.jsx)(n.a,{href:"#generated-code-reference",children:"top"})}),"\n",(0,o.jsx)(n.hr,{}),"\n",(0,o.jsx)(n.h4,{id:"select-method-2",children:"Select method"}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{className:"language-go",children:"func (*ChildRun) Select(\n workflow.Selector,\n func(*ChildRun)\n) workflow.Selector\n"})}),"\n",(0,o.jsx)(n.p,{children:"Registers the child workflow execution and a callback with the provided selector"}),"\n",(0,o.jsx)(n.p,{children:(0,o.jsx)(n.a,{href:"#generated-code-reference",children:"top"})}),"\n",(0,o.jsx)(n.hr,{}),"\n",(0,o.jsx)(n.h4,{id:"selectstart-method",children:"SelectStart method"}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{className:"language-go",children:"func (*ChildRun) Select(\n workflow.Selector,\n func(*ChildRun)\n) workflow.Selector\n"})}),"\n",(0,o.jsx)(n.p,{children:"Registers the start of the child workflow execution and a callback with the provided selector"}),"\n",(0,o.jsx)(n.p,{children:(0,o.jsx)(n.a,{href:"#generated-code-reference",children:"top"})}),"\n",(0,o.jsx)(n.hr,{}),"\n",(0,o.jsx)(n.h4,{id:"signal-method-2",children:"Signal method"}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{className:"language-go",children:"func (*ChildRun) (workflow.Context, [*Request]) error\n"})}),"\n",(0,o.jsx)(n.p,{children:"Sends the corresponding signal to the child workflow execution"}),"\n",(0,o.jsx)(n.p,{children:(0,o.jsx)(n.a,{href:"#generated-code-reference",children:"top"})}),"\n",(0,o.jsx)(n.hr,{}),"\n",(0,o.jsx)(n.h4,{id:"signalasync-method",children:"SignalAsync method"}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{className:"language-go",children:"func (*ChildRun) (workflow.Context, [*Request]) workflow.Future\n"})}),"\n",(0,o.jsx)(n.p,{children:"Sends the corresponding signal to the child workflow execution"}),"\n",(0,o.jsx)(n.p,{children:(0,o.jsx)(n.a,{href:"#generated-code-reference",children:"top"})}),"\n",(0,o.jsx)(n.hr,{}),"\n",(0,o.jsx)(n.h4,{id:"waitstart-method",children:"WaitStart method"}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{className:"language-go",children:"func (*ChildRun) WaitStart(workflow.Context) (*workflow.Execution, error)\n"})}),"\n",(0,o.jsx)(n.p,{children:"Blocks until the child workflow execution has started"}),"\n",(0,o.jsx)(n.p,{children:(0,o.jsx)(n.a,{href:"#generated-code-reference",children:"top"})})]})}function p(e={}){const{wrapper:n}={...(0,t.R)(),...e.components};return n?(0,o.jsx)(n,{...e,children:(0,o.jsx)(d,{...e})}):d(e)}},8453:(e,n,r)=>{r.d(n,{R:()=>i,x:()=>c});var o=r(6540);const t={},l=o.createContext(t);function i(e){const n=o.useContext(l);return o.useMemo((function(){return"function"==typeof e?e(n):{...n,...e}}),[n,e])}function c(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(t):e.components||t:i(e.components),o.createElement(l.Provider,{value:n},e.children)}}}]); \ No newline at end of file diff --git a/assets/js/7f7ed216.9f6466d0.js b/assets/js/7f7ed216.9f6466d0.js deleted file mode 100644 index df352b37..00000000 --- a/assets/js/7f7ed216.9f6466d0.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunkdocs=self.webpackChunkdocs||[]).push([[1039],{194:(e,t,n)=>{n.r(t),n.d(t,{assets:()=>i,contentTitle:()=>l,default:()=>c,frontMatter:()=>o,metadata:()=>s,toc:()=>u});var a=n(4848),r=n(8453);n(1470),n(9365);const o={},l="Update",s={id:"configuration/update",title:"Update",description:"Updates are defined as Protobuf RPCs annotated with the temporal.v1.update method option. They're mapped to workflows using the update workflow option. See the Updates guide for more usage details.",source:"@site/docs/configuration/update.mdx",sourceDirName:"configuration",slug:"/configuration/update",permalink:"/docs/configuration/update",draft:!1,unlisted:!1,editUrl:"https://github.com/facebook/docusaurus/tree/main/packages/create-docusaurus/templates/shared/docs/configuration/update.mdx",tags:[],version:"current",frontMatter:{},sidebar:"docs",previous:{title:"Signal",permalink:"/docs/configuration/signal"},next:{title:"Workflows",permalink:"/docs/guides/workflows"}},i={},u=[{value:"Options",id:"options",level:2},{value:"id",id:"id",level:3},{value:"name",id:"name",level:3},{value:"validate",id:"validate",level:3},{value:"xns",id:"xns",level:3},{value:"wait_policy",id:"wait_policy",level:3}];function d(e){const t={a:"a",admonition:"admonition",code:"code",h1:"h1",h2:"h2",h3:"h3",p:"p",pre:"pre",...(0,r.R)(),...e.components};return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(t.h1,{id:"update",children:"Update"}),"\n",(0,a.jsxs)(t.p,{children:[(0,a.jsx)(t.a,{href:"https://docs.temporal.io/workflows#update",children:"Updates"})," are defined as Protobuf RPCs annotated with the ",(0,a.jsx)(t.a,{href:"https://buf.build/cludden/protoc-gen-go-temporal/docs/main:temporal.v1#temporal.v1.UpdateOptions",children:"temporal.v1.update"})," method option. They're mapped to workflows using the ",(0,a.jsx)(t.a,{href:"/docs/configuration/workflow#update",children:"update workflow option"}),". See the ",(0,a.jsx)(t.a,{href:"/docs/guides/queries",children:"Updates guide"})," for more usage details."]}),"\n",(0,a.jsx)(t.admonition,{type:"warning",children:(0,a.jsxs)(t.p,{children:["Updates are considered experimental. They can be enabled using the ",(0,a.jsx)(t.a,{href:"/docs/configuration/plugin#options",children:"workflow-update-enabled"})," plugin option. They are disabled by default."]})}),"\n",(0,a.jsx)(t.admonition,{type:"info",children:(0,a.jsxs)(t.p,{children:["Update definitions can omit an input and/or out parameter by specifying the native ",(0,a.jsx)(t.code,{children:"google.protobuf.Empty"})," message type in its place. This requires an additional ",(0,a.jsx)(t.code,{children:"google/protobuf/empty.proto"})," protobuf import."]})}),"\n",(0,a.jsx)(t.pre,{children:(0,a.jsx)(t.code,{className:"language-protobuf",metastring:'title="example.proto"',children:'syntax="proto3";\n\npackage example.v1;\n\nimport "temporal/v1/temporal.proto";\n\nservice Example {\n // Hello returns a friendly greeting\n rpc Hello(HelloInput) returns (HelloOutput) {\n option (temporal.v1.workflow) = {\n update: { ref: \'UpdateHello\' }\n };\n }\n\n // UpdateHello updates an existing Hello workflow\n rpc UpdateHello(UpdateHelloInput) returns (UpdateHelloOutput) {\n option (temporal.v1.update) = {};\n }\n}\n'})}),"\n",(0,a.jsx)(t.h2,{id:"options",children:"Options"}),"\n",(0,a.jsx)(t.h3,{id:"id",children:"id"}),"\n",(0,a.jsx)(t.p,{children:(0,a.jsx)(t.code,{children:"string"})}),"\n",(0,a.jsxs)(t.p,{children:["Specifies the default Update ID as a ",(0,a.jsx)(t.a,{href:"/docs/guides/bloblang",children:"Bloblang expression"}),"."]}),"\n",(0,a.jsx)(t.pre,{children:(0,a.jsx)(t.code,{className:"language-protobuf",children:"service Example {\n rpc UpdateHello(UpdateHelloInput) returns (UpdateHelloOutput) {\n option (temporal.v1.update) = {\n id: 'update-hello/${! newName }'\n };\n }\n}\n\nmessage UpdateHelloInput {\n string new_name = 1;\n}\n"})}),"\n",(0,a.jsx)(t.h3,{id:"name",children:"name"}),"\n",(0,a.jsx)(t.p,{children:(0,a.jsx)(t.code,{children:"string"})}),"\n",(0,a.jsxs)(t.p,{children:["Fully qualified Update type name. Defaults to protobuf method full name (e.g. ",(0,a.jsx)(t.code,{children:"example.v1.Example.UpdateHello"}),")"]}),"\n",(0,a.jsx)(t.pre,{children:(0,a.jsx)(t.code,{className:"language-protobuf",children:'service Example {\n rpc UpdateHello(UpdateHelloInput) returns (UpdateHelloOutput) {\n option (temporal.v1.update) = {\n name: "UpdateHello"\n };\n }\n}\n'})}),"\n",(0,a.jsx)(t.h3,{id:"validate",children:"validate"}),"\n",(0,a.jsx)(t.p,{children:(0,a.jsx)(t.code,{children:"bool"})}),"\n",(0,a.jsxs)(t.p,{children:["Enables update ",(0,a.jsx)(t.a,{href:"https://docs.temporal.io/workflows#update",children:"validation"}),"."]}),"\n",(0,a.jsx)(t.pre,{children:(0,a.jsx)(t.code,{className:"language-protobuf",children:"service Example {\n rpc UpdateHello(UpdateHelloInput) returns (UpdateHelloOutput) {\n option (temporal.v1.update) = {\n validate: true\n };\n }\n}\n"})}),"\n",(0,a.jsx)(t.h3,{id:"xns",children:"xns"}),"\n",(0,a.jsx)(t.p,{children:(0,a.jsx)(t.a,{href:"https://buf.build/cludden/protoc-gen-go-temporal/docs/main:temporal.v1#temporal.v1.XNSActivityOptions",children:"temporal.v1.XNSActivityOptions"})}),"\n",(0,a.jsxs)(t.p,{children:["Used to configure ",(0,a.jsx)(t.a,{href:"/docs/guides/xns",children:"cross-namespace"})," activity options."]}),"\n",(0,a.jsx)(t.admonition,{type:"note",children:(0,a.jsxs)(t.p,{children:["This requires the ",(0,a.jsx)(t.a,{href:"/docs/configuration/plugin",children:"enable-xns"})," plugin option to be enabled."]})}),"\n",(0,a.jsx)(t.pre,{children:(0,a.jsx)(t.code,{className:"language-protobuf",children:"service Example {\n rpc GetHelloStatus(GetHelloStatusInput) returns (GetHelloStatusOutput) {\n option (temporal.v1.update) = {\n xns: {\n heartbeat_timeout: { seconds: 30 }\n heartbeat_interval: { seconds: 10 }\n start_to_close_timeout: { seconds: 300 }\n }\n };\n }\n}\n"})}),"\n",(0,a.jsx)(t.h3,{id:"wait_policy",children:"wait_policy"}),"\n",(0,a.jsx)(t.p,{children:(0,a.jsx)(t.a,{href:"https://buf.build/cludden/protoc-gen-go-temporal/docs/main:temporal.v1#temporal.v1.WaitPolicy",children:"temporal.v1.WaitPolicy"})}),"\n",(0,a.jsx)(t.p,{children:"Used to indicate to the server how long the client wishes to wait for a return value from an UpdateWorkflow RPC."}),"\n",(0,a.jsx)(t.pre,{children:(0,a.jsx)(t.code,{className:"language-protobuf",children:"service Example {\n rpc UpdateHello(UpdateHelloInput) returns (UpdateHelloOutput) {\n option (temporal.v1.update) = {\n wait_policy: WAIT_POLICY_COMPLETED\n };\n }\n}\n"})})]})}function c(e={}){const{wrapper:t}={...(0,r.R)(),...e.components};return t?(0,a.jsx)(t,{...e,children:(0,a.jsx)(d,{...e})}):d(e)}},9365:(e,t,n)=>{n.d(t,{A:()=>l});n(6540);var a=n(4164);const r={tabItem:"tabItem_Ymn6"};var o=n(4848);function l(e){let{children:t,hidden:n,className:l}=e;return(0,o.jsx)("div",{role:"tabpanel",className:(0,a.A)(r.tabItem,l),hidden:n,children:t})}},1470:(e,t,n)=>{n.d(t,{A:()=>y});var a=n(6540),r=n(4164),o=n(3104),l=n(6347),s=n(205),i=n(7485),u=n(1682),d=n(9466);function c(e){return a.Children.toArray(e).filter((e=>"\n"!==e)).map((e=>{if(!e||(0,a.isValidElement)(e)&&function(e){const{props:t}=e;return!!t&&"object"==typeof t&&"value"in t}(e))return e;throw new Error(`Docusaurus error: Bad child <${"string"==typeof e.type?e.type:e.type.name}>: all children of the component should be , and every should have a unique "value" prop.`)}))?.filter(Boolean)??[]}function p(e){const{values:t,children:n}=e;return(0,a.useMemo)((()=>{const e=t??function(e){return c(e).map((e=>{let{props:{value:t,label:n,attributes:a,default:r}}=e;return{value:t,label:n,attributes:a,default:r}}))}(n);return function(e){const t=(0,u.X)(e,((e,t)=>e.value===t.value));if(t.length>0)throw new Error(`Docusaurus error: Duplicate values "${t.map((e=>e.value)).join(", ")}" found in . Every value needs to be unique.`)}(e),e}),[t,n])}function h(e){let{value:t,tabValues:n}=e;return n.some((e=>e.value===t))}function m(e){let{queryString:t=!1,groupId:n}=e;const r=(0,l.W6)(),o=function(e){let{queryString:t=!1,groupId:n}=e;if("string"==typeof t)return t;if(!1===t)return null;if(!0===t&&!n)throw new Error('Docusaurus error: The component groupId prop is required if queryString=true, because this value is used as the search param name. You can also provide an explicit value such as queryString="my-search-param".');return n??null}({queryString:t,groupId:n});return[(0,i.aZ)(o),(0,a.useCallback)((e=>{if(!o)return;const t=new URLSearchParams(r.location.search);t.set(o,e),r.replace({...r.location,search:t.toString()})}),[o,r])]}function f(e){const{defaultValue:t,queryString:n=!1,groupId:r}=e,o=p(e),[l,i]=(0,a.useState)((()=>function(e){let{defaultValue:t,tabValues:n}=e;if(0===n.length)throw new Error("Docusaurus error: the component requires at least one children component");if(t){if(!h({value:t,tabValues:n}))throw new Error(`Docusaurus error: The has a defaultValue "${t}" but none of its children has the corresponding value. Available values are: ${n.map((e=>e.value)).join(", ")}. If you intend to show no default tab, use defaultValue={null} instead.`);return t}const a=n.find((e=>e.default))??n[0];if(!a)throw new Error("Unexpected error: 0 tabValues");return a.value}({defaultValue:t,tabValues:o}))),[u,c]=m({queryString:n,groupId:r}),[f,b]=function(e){let{groupId:t}=e;const n=function(e){return e?`docusaurus.tab.${e}`:null}(t),[r,o]=(0,d.Dv)(n);return[r,(0,a.useCallback)((e=>{n&&o.set(e)}),[n,o])]}({groupId:r}),g=(()=>{const e=u??f;return h({value:e,tabValues:o})?e:null})();(0,s.A)((()=>{g&&i(g)}),[g]);return{selectedValue:l,selectValue:(0,a.useCallback)((e=>{if(!h({value:e,tabValues:o}))throw new Error(`Can't select invalid tab value=${e}`);i(e),c(e),b(e)}),[c,b,o]),tabValues:o}}var b=n(2303);const g={tabList:"tabList__CuJ",tabItem:"tabItem_LNqP"};var v=n(4848);function x(e){let{className:t,block:n,selectedValue:a,selectValue:l,tabValues:s}=e;const i=[],{blockElementScrollPositionUntilNextRender:u}=(0,o.a_)(),d=e=>{const t=e.currentTarget,n=i.indexOf(t),r=s[n].value;r!==a&&(u(t),l(r))},c=e=>{let t=null;switch(e.key){case"Enter":d(e);break;case"ArrowRight":{const n=i.indexOf(e.currentTarget)+1;t=i[n]??i[0];break}case"ArrowLeft":{const n=i.indexOf(e.currentTarget)-1;t=i[n]??i[i.length-1];break}}t?.focus()};return(0,v.jsx)("ul",{role:"tablist","aria-orientation":"horizontal",className:(0,r.A)("tabs",{"tabs--block":n},t),children:s.map((e=>{let{value:t,label:n,attributes:o}=e;return(0,v.jsx)("li",{role:"tab",tabIndex:a===t?0:-1,"aria-selected":a===t,ref:e=>i.push(e),onKeyDown:c,onClick:d,...o,className:(0,r.A)("tabs__item",g.tabItem,o?.className,{"tabs__item--active":a===t}),children:n??t},t)}))})}function j(e){let{lazy:t,children:n,selectedValue:r}=e;const o=(Array.isArray(n)?n:[n]).filter(Boolean);if(t){const e=o.find((e=>e.props.value===r));return e?(0,a.cloneElement)(e,{className:"margin-top--md"}):null}return(0,v.jsx)("div",{className:"margin-top--md",children:o.map(((e,t)=>(0,a.cloneElement)(e,{key:t,hidden:e.props.value!==r})))})}function w(e){const t=f(e);return(0,v.jsxs)("div",{className:(0,r.A)("tabs-container",g.tabList),children:[(0,v.jsx)(x,{...e,...t}),(0,v.jsx)(j,{...e,...t})]})}function y(e){const t=(0,b.A)();return(0,v.jsx)(w,{...e,children:c(e.children)},String(t))}},8453:(e,t,n)=>{n.d(t,{R:()=>l,x:()=>s});var a=n(6540);const r={},o=a.createContext(r);function l(e){const t=a.useContext(o);return a.useMemo((function(){return"function"==typeof e?e(t):{...t,...e}}),[t,e])}function s(e){let t;return t=e.disableParentContext?"function"==typeof e.components?e.components(r):e.components||r:l(e.components),a.createElement(o.Provider,{value:t},e.children)}}}]); \ No newline at end of file diff --git a/assets/js/7f7ed216.d2bedb9b.js b/assets/js/7f7ed216.d2bedb9b.js new file mode 100644 index 00000000..74d9164e --- /dev/null +++ b/assets/js/7f7ed216.d2bedb9b.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunkdocs=self.webpackChunkdocs||[]).push([[1039],{194:(e,t,n)=>{n.r(t),n.d(t,{assets:()=>i,contentTitle:()=>l,default:()=>c,frontMatter:()=>r,metadata:()=>s,toc:()=>u});var a=n(4848),o=n(8453);n(1470),n(9365);const r={},l="Update",s={id:"configuration/update",title:"Update",description:"Updates are defined as Protobuf RPCs annotated with the temporal.v1.update method option. They're mapped to workflows using the update workflow option. See the Updates guide for more usage details.",source:"@site/docs/configuration/update.mdx",sourceDirName:"configuration",slug:"/configuration/update",permalink:"/protoc-gen-go-temporal/docs/configuration/update",draft:!1,unlisted:!1,editUrl:"https://github.com/facebook/docusaurus/tree/main/packages/create-docusaurus/templates/shared/docs/configuration/update.mdx",tags:[],version:"current",frontMatter:{},sidebar:"docs",previous:{title:"Signal",permalink:"/protoc-gen-go-temporal/docs/configuration/signal"},next:{title:"Workflows",permalink:"/protoc-gen-go-temporal/docs/guides/workflows"}},i={},u=[{value:"Options",id:"options",level:2},{value:"id",id:"id",level:3},{value:"name",id:"name",level:3},{value:"validate",id:"validate",level:3},{value:"xns",id:"xns",level:3},{value:"wait_policy",id:"wait_policy",level:3}];function d(e){const t={a:"a",admonition:"admonition",code:"code",h1:"h1",h2:"h2",h3:"h3",p:"p",pre:"pre",...(0,o.R)(),...e.components};return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(t.h1,{id:"update",children:"Update"}),"\n",(0,a.jsxs)(t.p,{children:[(0,a.jsx)(t.a,{href:"https://docs.temporal.io/workflows#update",children:"Updates"})," are defined as Protobuf RPCs annotated with the ",(0,a.jsx)(t.a,{href:"https://buf.build/cludden/protoc-gen-go-temporal/docs/main:temporal.v1#temporal.v1.UpdateOptions",children:"temporal.v1.update"})," method option. They're mapped to workflows using the ",(0,a.jsx)(t.a,{href:"/docs/configuration/workflow#update",children:"update workflow option"}),". See the ",(0,a.jsx)(t.a,{href:"/docs/guides/queries",children:"Updates guide"})," for more usage details."]}),"\n",(0,a.jsx)(t.admonition,{type:"warning",children:(0,a.jsxs)(t.p,{children:["Updates are considered experimental. They can be enabled using the ",(0,a.jsx)(t.a,{href:"/docs/configuration/plugin#options",children:"workflow-update-enabled"})," plugin option. They are disabled by default."]})}),"\n",(0,a.jsx)(t.admonition,{type:"info",children:(0,a.jsxs)(t.p,{children:["Update definitions can omit an input and/or out parameter by specifying the native ",(0,a.jsx)(t.code,{children:"google.protobuf.Empty"})," message type in its place. This requires an additional ",(0,a.jsx)(t.code,{children:"google/protobuf/empty.proto"})," protobuf import."]})}),"\n",(0,a.jsx)(t.pre,{children:(0,a.jsx)(t.code,{className:"language-protobuf",metastring:'title="example.proto"',children:'syntax="proto3";\n\npackage example.v1;\n\nimport "temporal/v1/temporal.proto";\n\nservice Example {\n // Hello returns a friendly greeting\n rpc Hello(HelloInput) returns (HelloOutput) {\n option (temporal.v1.workflow) = {\n update: { ref: \'UpdateHello\' }\n };\n }\n\n // UpdateHello updates an existing Hello workflow\n rpc UpdateHello(UpdateHelloInput) returns (UpdateHelloOutput) {\n option (temporal.v1.update) = {};\n }\n}\n'})}),"\n",(0,a.jsx)(t.h2,{id:"options",children:"Options"}),"\n",(0,a.jsx)(t.h3,{id:"id",children:"id"}),"\n",(0,a.jsx)(t.p,{children:(0,a.jsx)(t.code,{children:"string"})}),"\n",(0,a.jsxs)(t.p,{children:["Specifies the default Update ID as a ",(0,a.jsx)(t.a,{href:"/docs/guides/bloblang",children:"Bloblang expression"}),"."]}),"\n",(0,a.jsx)(t.pre,{children:(0,a.jsx)(t.code,{className:"language-protobuf",children:"service Example {\n rpc UpdateHello(UpdateHelloInput) returns (UpdateHelloOutput) {\n option (temporal.v1.update) = {\n id: 'update-hello/${! newName }'\n };\n }\n}\n\nmessage UpdateHelloInput {\n string new_name = 1;\n}\n"})}),"\n",(0,a.jsx)(t.h3,{id:"name",children:"name"}),"\n",(0,a.jsx)(t.p,{children:(0,a.jsx)(t.code,{children:"string"})}),"\n",(0,a.jsxs)(t.p,{children:["Fully qualified Update type name. Defaults to protobuf method full name (e.g. ",(0,a.jsx)(t.code,{children:"example.v1.Example.UpdateHello"}),")"]}),"\n",(0,a.jsx)(t.pre,{children:(0,a.jsx)(t.code,{className:"language-protobuf",children:'service Example {\n rpc UpdateHello(UpdateHelloInput) returns (UpdateHelloOutput) {\n option (temporal.v1.update) = {\n name: "UpdateHello"\n };\n }\n}\n'})}),"\n",(0,a.jsx)(t.h3,{id:"validate",children:"validate"}),"\n",(0,a.jsx)(t.p,{children:(0,a.jsx)(t.code,{children:"bool"})}),"\n",(0,a.jsxs)(t.p,{children:["Enables update ",(0,a.jsx)(t.a,{href:"https://docs.temporal.io/workflows#update",children:"validation"}),"."]}),"\n",(0,a.jsx)(t.pre,{children:(0,a.jsx)(t.code,{className:"language-protobuf",children:"service Example {\n rpc UpdateHello(UpdateHelloInput) returns (UpdateHelloOutput) {\n option (temporal.v1.update) = {\n validate: true\n };\n }\n}\n"})}),"\n",(0,a.jsx)(t.h3,{id:"xns",children:"xns"}),"\n",(0,a.jsx)(t.p,{children:(0,a.jsx)(t.a,{href:"https://buf.build/cludden/protoc-gen-go-temporal/docs/main:temporal.v1#temporal.v1.XNSActivityOptions",children:"temporal.v1.XNSActivityOptions"})}),"\n",(0,a.jsxs)(t.p,{children:["Used to configure ",(0,a.jsx)(t.a,{href:"/docs/guides/xns",children:"cross-namespace"})," activity options."]}),"\n",(0,a.jsx)(t.admonition,{type:"note",children:(0,a.jsxs)(t.p,{children:["This requires the ",(0,a.jsx)(t.a,{href:"/docs/configuration/plugin",children:"enable-xns"})," plugin option to be enabled."]})}),"\n",(0,a.jsx)(t.pre,{children:(0,a.jsx)(t.code,{className:"language-protobuf",children:"service Example {\n rpc GetHelloStatus(GetHelloStatusInput) returns (GetHelloStatusOutput) {\n option (temporal.v1.update) = {\n xns: {\n heartbeat_timeout: { seconds: 30 }\n heartbeat_interval: { seconds: 10 }\n start_to_close_timeout: { seconds: 300 }\n }\n };\n }\n}\n"})}),"\n",(0,a.jsx)(t.h3,{id:"wait_policy",children:"wait_policy"}),"\n",(0,a.jsx)(t.p,{children:(0,a.jsx)(t.a,{href:"https://buf.build/cludden/protoc-gen-go-temporal/docs/main:temporal.v1#temporal.v1.WaitPolicy",children:"temporal.v1.WaitPolicy"})}),"\n",(0,a.jsx)(t.p,{children:"Used to indicate to the server how long the client wishes to wait for a return value from an UpdateWorkflow RPC."}),"\n",(0,a.jsx)(t.pre,{children:(0,a.jsx)(t.code,{className:"language-protobuf",children:"service Example {\n rpc UpdateHello(UpdateHelloInput) returns (UpdateHelloOutput) {\n option (temporal.v1.update) = {\n wait_policy: WAIT_POLICY_COMPLETED\n };\n }\n}\n"})})]})}function c(e={}){const{wrapper:t}={...(0,o.R)(),...e.components};return t?(0,a.jsx)(t,{...e,children:(0,a.jsx)(d,{...e})}):d(e)}},9365:(e,t,n)=>{n.d(t,{A:()=>l});n(6540);var a=n(4164);const o={tabItem:"tabItem_Ymn6"};var r=n(4848);function l(e){let{children:t,hidden:n,className:l}=e;return(0,r.jsx)("div",{role:"tabpanel",className:(0,a.A)(o.tabItem,l),hidden:n,children:t})}},1470:(e,t,n)=>{n.d(t,{A:()=>y});var a=n(6540),o=n(4164),r=n(3104),l=n(6347),s=n(205),i=n(7485),u=n(1682),d=n(9466);function c(e){return a.Children.toArray(e).filter((e=>"\n"!==e)).map((e=>{if(!e||(0,a.isValidElement)(e)&&function(e){const{props:t}=e;return!!t&&"object"==typeof t&&"value"in t}(e))return e;throw new Error(`Docusaurus error: Bad child <${"string"==typeof e.type?e.type:e.type.name}>: all children of the component should be , and every should have a unique "value" prop.`)}))?.filter(Boolean)??[]}function p(e){const{values:t,children:n}=e;return(0,a.useMemo)((()=>{const e=t??function(e){return c(e).map((e=>{let{props:{value:t,label:n,attributes:a,default:o}}=e;return{value:t,label:n,attributes:a,default:o}}))}(n);return function(e){const t=(0,u.X)(e,((e,t)=>e.value===t.value));if(t.length>0)throw new Error(`Docusaurus error: Duplicate values "${t.map((e=>e.value)).join(", ")}" found in . Every value needs to be unique.`)}(e),e}),[t,n])}function h(e){let{value:t,tabValues:n}=e;return n.some((e=>e.value===t))}function m(e){let{queryString:t=!1,groupId:n}=e;const o=(0,l.W6)(),r=function(e){let{queryString:t=!1,groupId:n}=e;if("string"==typeof t)return t;if(!1===t)return null;if(!0===t&&!n)throw new Error('Docusaurus error: The component groupId prop is required if queryString=true, because this value is used as the search param name. You can also provide an explicit value such as queryString="my-search-param".');return n??null}({queryString:t,groupId:n});return[(0,i.aZ)(r),(0,a.useCallback)((e=>{if(!r)return;const t=new URLSearchParams(o.location.search);t.set(r,e),o.replace({...o.location,search:t.toString()})}),[r,o])]}function f(e){const{defaultValue:t,queryString:n=!1,groupId:o}=e,r=p(e),[l,i]=(0,a.useState)((()=>function(e){let{defaultValue:t,tabValues:n}=e;if(0===n.length)throw new Error("Docusaurus error: the component requires at least one children component");if(t){if(!h({value:t,tabValues:n}))throw new Error(`Docusaurus error: The has a defaultValue "${t}" but none of its children has the corresponding value. Available values are: ${n.map((e=>e.value)).join(", ")}. If you intend to show no default tab, use defaultValue={null} instead.`);return t}const a=n.find((e=>e.default))??n[0];if(!a)throw new Error("Unexpected error: 0 tabValues");return a.value}({defaultValue:t,tabValues:r}))),[u,c]=m({queryString:n,groupId:o}),[f,g]=function(e){let{groupId:t}=e;const n=function(e){return e?`docusaurus.tab.${e}`:null}(t),[o,r]=(0,d.Dv)(n);return[o,(0,a.useCallback)((e=>{n&&r.set(e)}),[n,r])]}({groupId:o}),b=(()=>{const e=u??f;return h({value:e,tabValues:r})?e:null})();(0,s.A)((()=>{b&&i(b)}),[b]);return{selectedValue:l,selectValue:(0,a.useCallback)((e=>{if(!h({value:e,tabValues:r}))throw new Error(`Can't select invalid tab value=${e}`);i(e),c(e),g(e)}),[c,g,r]),tabValues:r}}var g=n(2303);const b={tabList:"tabList__CuJ",tabItem:"tabItem_LNqP"};var v=n(4848);function x(e){let{className:t,block:n,selectedValue:a,selectValue:l,tabValues:s}=e;const i=[],{blockElementScrollPositionUntilNextRender:u}=(0,r.a_)(),d=e=>{const t=e.currentTarget,n=i.indexOf(t),o=s[n].value;o!==a&&(u(t),l(o))},c=e=>{let t=null;switch(e.key){case"Enter":d(e);break;case"ArrowRight":{const n=i.indexOf(e.currentTarget)+1;t=i[n]??i[0];break}case"ArrowLeft":{const n=i.indexOf(e.currentTarget)-1;t=i[n]??i[i.length-1];break}}t?.focus()};return(0,v.jsx)("ul",{role:"tablist","aria-orientation":"horizontal",className:(0,o.A)("tabs",{"tabs--block":n},t),children:s.map((e=>{let{value:t,label:n,attributes:r}=e;return(0,v.jsx)("li",{role:"tab",tabIndex:a===t?0:-1,"aria-selected":a===t,ref:e=>i.push(e),onKeyDown:c,onClick:d,...r,className:(0,o.A)("tabs__item",b.tabItem,r?.className,{"tabs__item--active":a===t}),children:n??t},t)}))})}function j(e){let{lazy:t,children:n,selectedValue:o}=e;const r=(Array.isArray(n)?n:[n]).filter(Boolean);if(t){const e=r.find((e=>e.props.value===o));return e?(0,a.cloneElement)(e,{className:"margin-top--md"}):null}return(0,v.jsx)("div",{className:"margin-top--md",children:r.map(((e,t)=>(0,a.cloneElement)(e,{key:t,hidden:e.props.value!==o})))})}function w(e){const t=f(e);return(0,v.jsxs)("div",{className:(0,o.A)("tabs-container",b.tabList),children:[(0,v.jsx)(x,{...e,...t}),(0,v.jsx)(j,{...e,...t})]})}function y(e){const t=(0,g.A)();return(0,v.jsx)(w,{...e,children:c(e.children)},String(t))}},8453:(e,t,n)=>{n.d(t,{R:()=>l,x:()=>s});var a=n(6540);const o={},r=a.createContext(o);function l(e){const t=a.useContext(r);return a.useMemo((function(){return"function"==typeof e?e(t):{...t,...e}}),[t,e])}function s(e){let t;return t=e.disableParentContext?"function"==typeof e.components?e.components(o):e.components||o:l(e.components),a.createElement(r.Provider,{value:t},e.children)}}}]); \ No newline at end of file diff --git a/assets/js/814f3328.5dfaceaf.js b/assets/js/814f3328.5dfaceaf.js deleted file mode 100644 index 6e1fb507..00000000 --- a/assets/js/814f3328.5dfaceaf.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunkdocs=self.webpackChunkdocs||[]).push([[7472],{5513:l=>{l.exports=JSON.parse('{"title":"Recent posts","items":[{"title":"Welcome","permalink":"/blog/welcome","unlisted":false},{"title":"MDX Blog Post","permalink":"/blog/mdx-blog-post","unlisted":false},{"title":"Long Blog Post","permalink":"/blog/long-blog-post","unlisted":false},{"title":"First Blog Post","permalink":"/blog/first-blog-post","unlisted":false}]}')}}]); \ No newline at end of file diff --git a/assets/js/814f3328.e35e6f1b.js b/assets/js/814f3328.e35e6f1b.js new file mode 100644 index 00000000..675956f4 --- /dev/null +++ b/assets/js/814f3328.e35e6f1b.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunkdocs=self.webpackChunkdocs||[]).push([[7472],{5513:o=>{o.exports=JSON.parse('{"title":"Recent posts","items":[{"title":"Welcome","permalink":"/protoc-gen-go-temporal/blog/welcome","unlisted":false},{"title":"MDX Blog Post","permalink":"/protoc-gen-go-temporal/blog/mdx-blog-post","unlisted":false},{"title":"Long Blog Post","permalink":"/protoc-gen-go-temporal/blog/long-blog-post","unlisted":false},{"title":"First Blog Post","permalink":"/protoc-gen-go-temporal/blog/first-blog-post","unlisted":false}]}')}}]); \ No newline at end of file diff --git a/assets/js/8717b14a.03076b3f.js b/assets/js/8717b14a.03076b3f.js new file mode 100644 index 00000000..0687de14 --- /dev/null +++ b/assets/js/8717b14a.03076b3f.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunkdocs=self.webpackChunkdocs||[]).push([[3694],{1615:(o,t,e)=>{e.r(t),e.d(t,{assets:()=>i,contentTitle:()=>r,default:()=>u,frontMatter:()=>l,metadata:()=>a,toc:()=>c});var s=e(4848),n=e(8453);const l={slug:"long-blog-post",title:"Long Blog Post",authors:"endi",tags:["hello","docusaurus"]},r=void 0,a={permalink:"/protoc-gen-go-temporal/blog/long-blog-post",editUrl:"https://github.com/facebook/docusaurus/tree/main/packages/create-docusaurus/templates/shared/blog/2019-05-29-long-blog-post.md",source:"@site/blog/2019-05-29-long-blog-post.md",title:"Long Blog Post",description:"This is the summary of a very long blog post,",date:"2019-05-29T00:00:00.000Z",formattedDate:"May 29, 2019",tags:[{label:"hello",permalink:"/protoc-gen-go-temporal/blog/tags/hello"},{label:"docusaurus",permalink:"/protoc-gen-go-temporal/blog/tags/docusaurus"}],readingTime:2.05,hasTruncateMarker:!0,authors:[{name:"Endilie Yacop Sucipto",title:"Maintainer of Docusaurus",url:"https://github.com/endiliey",imageURL:"https://github.com/endiliey.png",key:"endi"}],frontMatter:{slug:"long-blog-post",title:"Long Blog Post",authors:"endi",tags:["hello","docusaurus"]},unlisted:!1,prevItem:{title:"MDX Blog Post",permalink:"/protoc-gen-go-temporal/blog/mdx-blog-post"},nextItem:{title:"First Blog Post",permalink:"/protoc-gen-go-temporal/blog/first-blog-post"}},i={authorsImageUrls:[void 0]},c=[];function g(o){const t={code:"code",p:"p",...(0,n.R)(),...o.components};return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(t.p,{children:"This is the summary of a very long blog post,"}),"\n",(0,s.jsxs)(t.p,{children:["Use a ",(0,s.jsx)(t.code,{children:"\x3c!--"})," ",(0,s.jsx)(t.code,{children:"truncate"})," ",(0,s.jsx)(t.code,{children:"--\x3e"})," comment to limit blog post size in the list view."]})]})}function u(o={}){const{wrapper:t}={...(0,n.R)(),...o.components};return t?(0,s.jsx)(t,{...o,children:(0,s.jsx)(g,{...o})}):g(o)}},8453:(o,t,e)=>{e.d(t,{R:()=>r,x:()=>a});var s=e(6540);const n={},l=s.createContext(n);function r(o){const t=s.useContext(l);return s.useMemo((function(){return"function"==typeof o?o(t):{...t,...o}}),[t,o])}function a(o){let t;return t=o.disableParentContext?"function"==typeof o.components?o.components(n):o.components||n:r(o.components),s.createElement(l.Provider,{value:t},o.children)}}}]); \ No newline at end of file diff --git a/assets/js/8717b14a.3c7a3dd9.js b/assets/js/8717b14a.3c7a3dd9.js deleted file mode 100644 index de1ff49a..00000000 --- a/assets/js/8717b14a.3c7a3dd9.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunkdocs=self.webpackChunkdocs||[]).push([[3694],{1615:(t,e,o)=>{o.r(e),o.d(e,{assets:()=>i,contentTitle:()=>r,default:()=>g,frontMatter:()=>l,metadata:()=>a,toc:()=>c});var s=o(4848),n=o(8453);const l={slug:"long-blog-post",title:"Long Blog Post",authors:"endi",tags:["hello","docusaurus"]},r=void 0,a={permalink:"/blog/long-blog-post",editUrl:"https://github.com/facebook/docusaurus/tree/main/packages/create-docusaurus/templates/shared/blog/2019-05-29-long-blog-post.md",source:"@site/blog/2019-05-29-long-blog-post.md",title:"Long Blog Post",description:"This is the summary of a very long blog post,",date:"2019-05-29T00:00:00.000Z",formattedDate:"May 29, 2019",tags:[{label:"hello",permalink:"/blog/tags/hello"},{label:"docusaurus",permalink:"/blog/tags/docusaurus"}],readingTime:2.05,hasTruncateMarker:!0,authors:[{name:"Endilie Yacop Sucipto",title:"Maintainer of Docusaurus",url:"https://github.com/endiliey",imageURL:"https://github.com/endiliey.png",key:"endi"}],frontMatter:{slug:"long-blog-post",title:"Long Blog Post",authors:"endi",tags:["hello","docusaurus"]},unlisted:!1,prevItem:{title:"MDX Blog Post",permalink:"/blog/mdx-blog-post"},nextItem:{title:"First Blog Post",permalink:"/blog/first-blog-post"}},i={authorsImageUrls:[void 0]},c=[];function u(t){const e={code:"code",p:"p",...(0,n.R)(),...t.components};return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(e.p,{children:"This is the summary of a very long blog post,"}),"\n",(0,s.jsxs)(e.p,{children:["Use a ",(0,s.jsx)(e.code,{children:"\x3c!--"})," ",(0,s.jsx)(e.code,{children:"truncate"})," ",(0,s.jsx)(e.code,{children:"--\x3e"})," comment to limit blog post size in the list view."]})]})}function g(t={}){const{wrapper:e}={...(0,n.R)(),...t.components};return e?(0,s.jsx)(e,{...t,children:(0,s.jsx)(u,{...t})}):u(t)}},8453:(t,e,o)=>{o.d(e,{R:()=>r,x:()=>a});var s=o(6540);const n={},l=s.createContext(n);function r(t){const e=s.useContext(l);return s.useMemo((function(){return"function"==typeof t?t(e):{...e,...t}}),[e,t])}function a(t){let e;return e=t.disableParentContext?"function"==typeof t.components?t.components(n):t.components||n:r(t.components),s.createElement(l.Provider,{value:e},t.children)}}}]); \ No newline at end of file diff --git a/assets/js/89450fc0.b7fd6d88.js b/assets/js/89450fc0.b7fd6d88.js new file mode 100644 index 00000000..60a8f728 --- /dev/null +++ b/assets/js/89450fc0.b7fd6d88.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunkdocs=self.webpackChunkdocs||[]).push([[6208],{807:e=>{e.exports=JSON.parse('{"blogPosts":[{"id":"welcome","metadata":{"permalink":"/protoc-gen-go-temporal/blog/welcome","editUrl":"https://github.com/facebook/docusaurus/tree/main/packages/create-docusaurus/templates/shared/blog/2021-08-26-welcome/index.md","source":"@site/blog/2021-08-26-welcome/index.md","title":"Welcome","description":"Docusaurus blogging features are powered by the blog plugin.","date":"2021-08-26T00:00:00.000Z","formattedDate":"August 26, 2021","tags":[{"label":"facebook","permalink":"/protoc-gen-go-temporal/blog/tags/facebook"},{"label":"hello","permalink":"/protoc-gen-go-temporal/blog/tags/hello"},{"label":"docusaurus","permalink":"/protoc-gen-go-temporal/blog/tags/docusaurus"}],"readingTime":0.405,"hasTruncateMarker":false,"authors":[{"name":"S\xe9bastien Lorber","title":"Docusaurus maintainer","url":"https://sebastienlorber.com","imageURL":"https://github.com/slorber.png","key":"slorber"},{"name":"Yangshun Tay","title":"Front End Engineer @ Facebook","url":"https://github.com/yangshun","imageURL":"https://github.com/yangshun.png","key":"yangshun"}],"frontMatter":{"slug":"welcome","title":"Welcome","authors":["slorber","yangshun"],"tags":["facebook","hello","docusaurus"]},"unlisted":false,"nextItem":{"title":"MDX Blog Post","permalink":"/protoc-gen-go-temporal/blog/mdx-blog-post"}},"content":"[Docusaurus blogging features](https://docusaurus.io/docs/blog) are powered by the [blog plugin](https://docusaurus.io/docs/api/plugins/@docusaurus/plugin-content-blog).\\n\\nSimply add Markdown files (or folders) to the `blog` directory.\\n\\nRegular blog authors can be added to `authors.yml`.\\n\\nThe blog post date can be extracted from filenames, such as:\\n\\n- `2019-05-30-welcome.md`\\n- `2019-05-30-welcome/index.md`\\n\\nA blog post folder can be convenient to co-locate blog post images:\\n\\n![Docusaurus Plushie](./docusaurus-plushie-banner.jpeg)\\n\\nThe blog supports tags as well!\\n\\n**And if you don\'t want a blog**: just delete this directory, and use `blog: false` in your Docusaurus config."},{"id":"mdx-blog-post","metadata":{"permalink":"/protoc-gen-go-temporal/blog/mdx-blog-post","editUrl":"https://github.com/facebook/docusaurus/tree/main/packages/create-docusaurus/templates/shared/blog/2021-08-01-mdx-blog-post.mdx","source":"@site/blog/2021-08-01-mdx-blog-post.mdx","title":"MDX Blog Post","description":"Blog posts support Docusaurus Markdown features, such as MDX.","date":"2021-08-01T00:00:00.000Z","formattedDate":"August 1, 2021","tags":[{"label":"docusaurus","permalink":"/protoc-gen-go-temporal/blog/tags/docusaurus"}],"readingTime":0.175,"hasTruncateMarker":false,"authors":[{"name":"S\xe9bastien Lorber","title":"Docusaurus maintainer","url":"https://sebastienlorber.com","imageURL":"https://github.com/slorber.png","key":"slorber"}],"frontMatter":{"slug":"mdx-blog-post","title":"MDX Blog Post","authors":["slorber"],"tags":["docusaurus"]},"unlisted":false,"prevItem":{"title":"Welcome","permalink":"/protoc-gen-go-temporal/blog/welcome"},"nextItem":{"title":"Long Blog Post","permalink":"/protoc-gen-go-temporal/blog/long-blog-post"}},"content":"Blog posts support [Docusaurus Markdown features](https://docusaurus.io/docs/markdown-features), such as [MDX](https://mdxjs.com/).\\n\\n:::tip\\n\\nUse the power of React to create interactive blog posts.\\n\\n```js\\n\\n```\\n\\n\\n\\n:::"},{"id":"long-blog-post","metadata":{"permalink":"/protoc-gen-go-temporal/blog/long-blog-post","editUrl":"https://github.com/facebook/docusaurus/tree/main/packages/create-docusaurus/templates/shared/blog/2019-05-29-long-blog-post.md","source":"@site/blog/2019-05-29-long-blog-post.md","title":"Long Blog Post","description":"This is the summary of a very long blog post,","date":"2019-05-29T00:00:00.000Z","formattedDate":"May 29, 2019","tags":[{"label":"hello","permalink":"/protoc-gen-go-temporal/blog/tags/hello"},{"label":"docusaurus","permalink":"/protoc-gen-go-temporal/blog/tags/docusaurus"}],"readingTime":2.05,"hasTruncateMarker":true,"authors":[{"name":"Endilie Yacop Sucipto","title":"Maintainer of Docusaurus","url":"https://github.com/endiliey","imageURL":"https://github.com/endiliey.png","key":"endi"}],"frontMatter":{"slug":"long-blog-post","title":"Long Blog Post","authors":"endi","tags":["hello","docusaurus"]},"unlisted":false,"prevItem":{"title":"MDX Blog Post","permalink":"/protoc-gen-go-temporal/blog/mdx-blog-post"},"nextItem":{"title":"First Blog Post","permalink":"/protoc-gen-go-temporal/blog/first-blog-post"}},"content":"This is the summary of a very long blog post,\\n\\nUse a `\x3c!--` `truncate` `--\x3e` comment to limit blog post size in the list view.\\n\\n\x3c!--truncate--\x3e\\n\\nLorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque elementum dignissim ultricies. Fusce rhoncus ipsum tempor eros aliquam consequat. Lorem ipsum dolor sit amet\\n\\nLorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque elementum dignissim ultricies. Fusce rhoncus ipsum tempor eros aliquam consequat. Lorem ipsum dolor sit amet\\n\\nLorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque elementum dignissim ultricies. Fusce rhoncus ipsum tempor eros aliquam consequat. Lorem ipsum dolor sit amet\\n\\nLorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque elementum dignissim ultricies. Fusce rhoncus ipsum tempor eros aliquam consequat. Lorem ipsum dolor sit amet\\n\\nLorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque elementum dignissim ultricies. Fusce rhoncus ipsum tempor eros aliquam consequat. Lorem ipsum dolor sit amet\\n\\nLorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque elementum dignissim ultricies. Fusce rhoncus ipsum tempor eros aliquam consequat. Lorem ipsum dolor sit amet\\n\\nLorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque elementum dignissim ultricies. Fusce rhoncus ipsum tempor eros aliquam consequat. Lorem ipsum dolor sit amet\\n\\nLorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque elementum dignissim ultricies. Fusce rhoncus ipsum tempor eros aliquam consequat. Lorem ipsum dolor sit amet\\n\\nLorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque elementum dignissim ultricies. Fusce rhoncus ipsum tempor eros aliquam consequat. Lorem ipsum dolor sit amet\\n\\nLorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque elementum dignissim ultricies. Fusce rhoncus ipsum tempor eros aliquam consequat. Lorem ipsum dolor sit amet\\n\\nLorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque elementum dignissim ultricies. Fusce rhoncus ipsum tempor eros aliquam consequat. Lorem ipsum dolor sit amet\\n\\nLorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque elementum dignissim ultricies. Fusce rhoncus ipsum tempor eros aliquam consequat. Lorem ipsum dolor sit amet\\n\\nLorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque elementum dignissim ultricies. Fusce rhoncus ipsum tempor eros aliquam consequat. Lorem ipsum dolor sit amet\\n\\nLorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque elementum dignissim ultricies. Fusce rhoncus ipsum tempor eros aliquam consequat. Lorem ipsum dolor sit amet\\n\\nLorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque elementum dignissim ultricies. Fusce rhoncus ipsum tempor eros aliquam consequat. Lorem ipsum dolor sit amet\\n\\nLorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque elementum dignissim ultricies. Fusce rhoncus ipsum tempor eros aliquam consequat. Lorem ipsum dolor sit amet"},{"id":"first-blog-post","metadata":{"permalink":"/protoc-gen-go-temporal/blog/first-blog-post","editUrl":"https://github.com/facebook/docusaurus/tree/main/packages/create-docusaurus/templates/shared/blog/2019-05-28-first-blog-post.md","source":"@site/blog/2019-05-28-first-blog-post.md","title":"First Blog Post","description":"Lorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque elementum dignissim ultricies. Fusce rhoncus ipsum tempor eros aliquam consequat. Lorem ipsum dolor sit amet","date":"2019-05-28T00:00:00.000Z","formattedDate":"May 28, 2019","tags":[{"label":"hola","permalink":"/protoc-gen-go-temporal/blog/tags/hola"},{"label":"docusaurus","permalink":"/protoc-gen-go-temporal/blog/tags/docusaurus"}],"readingTime":0.12,"hasTruncateMarker":false,"authors":[{"name":"Gao Wei","title":"Docusaurus Core Team","url":"https://github.com/wgao19","image_url":"https://github.com/wgao19.png","imageURL":"https://github.com/wgao19.png"}],"frontMatter":{"slug":"first-blog-post","title":"First Blog Post","authors":{"name":"Gao Wei","title":"Docusaurus Core Team","url":"https://github.com/wgao19","image_url":"https://github.com/wgao19.png","imageURL":"https://github.com/wgao19.png"},"tags":["hola","docusaurus"]},"unlisted":false,"prevItem":{"title":"Long Blog Post","permalink":"/protoc-gen-go-temporal/blog/long-blog-post"}},"content":"Lorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque elementum dignissim ultricies. Fusce rhoncus ipsum tempor eros aliquam consequat. Lorem ipsum dolor sit amet"}]}')}}]); \ No newline at end of file diff --git a/assets/js/925b3f96.15b77012.js b/assets/js/925b3f96.15b77012.js deleted file mode 100644 index b0c915ca..00000000 --- a/assets/js/925b3f96.15b77012.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunkdocs=self.webpackChunkdocs||[]).push([[8609],{5026:(t,e,o)=>{o.r(e),o.d(e,{assets:()=>n,contentTitle:()=>u,default:()=>m,frontMatter:()=>r,metadata:()=>i,toc:()=>l});var s=o(4848),a=o(8453);const r={slug:"first-blog-post",title:"First Blog Post",authors:{name:"Gao Wei",title:"Docusaurus Core Team",url:"https://github.com/wgao19",image_url:"https://github.com/wgao19.png"},tags:["hola","docusaurus"]},u=void 0,i={permalink:"/blog/first-blog-post",editUrl:"https://github.com/facebook/docusaurus/tree/main/packages/create-docusaurus/templates/shared/blog/2019-05-28-first-blog-post.md",source:"@site/blog/2019-05-28-first-blog-post.md",title:"First Blog Post",description:"Lorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque elementum dignissim ultricies. Fusce rhoncus ipsum tempor eros aliquam consequat. Lorem ipsum dolor sit amet",date:"2019-05-28T00:00:00.000Z",formattedDate:"May 28, 2019",tags:[{label:"hola",permalink:"/blog/tags/hola"},{label:"docusaurus",permalink:"/blog/tags/docusaurus"}],readingTime:.12,hasTruncateMarker:!1,authors:[{name:"Gao Wei",title:"Docusaurus Core Team",url:"https://github.com/wgao19",image_url:"https://github.com/wgao19.png",imageURL:"https://github.com/wgao19.png"}],frontMatter:{slug:"first-blog-post",title:"First Blog Post",authors:{name:"Gao Wei",title:"Docusaurus Core Team",url:"https://github.com/wgao19",image_url:"https://github.com/wgao19.png",imageURL:"https://github.com/wgao19.png"},tags:["hola","docusaurus"]},unlisted:!1,prevItem:{title:"Long Blog Post",permalink:"/blog/long-blog-post"}},n={authorsImageUrls:[void 0]},l=[];function c(t){const e={p:"p",...(0,a.R)(),...t.components};return(0,s.jsx)(e.p,{children:"Lorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque elementum dignissim ultricies. Fusce rhoncus ipsum tempor eros aliquam consequat. Lorem ipsum dolor sit amet"})}function m(t={}){const{wrapper:e}={...(0,a.R)(),...t.components};return e?(0,s.jsx)(e,{...t,children:(0,s.jsx)(c,{...t})}):c(t)}},8453:(t,e,o)=>{o.d(e,{R:()=>u,x:()=>i});var s=o(6540);const a={},r=s.createContext(a);function u(t){const e=s.useContext(r);return s.useMemo((function(){return"function"==typeof t?t(e):{...e,...t}}),[e,t])}function i(t){let e;return e=t.disableParentContext?"function"==typeof t.components?t.components(a):t.components||a:u(t.components),s.createElement(r.Provider,{value:e},t.children)}}}]); \ No newline at end of file diff --git a/assets/js/925b3f96.90b7bac1.js b/assets/js/925b3f96.90b7bac1.js new file mode 100644 index 00000000..2ead0047 --- /dev/null +++ b/assets/js/925b3f96.90b7bac1.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunkdocs=self.webpackChunkdocs||[]).push([[8609],{5026:(t,o,e)=>{e.r(o),e.d(o,{assets:()=>n,contentTitle:()=>u,default:()=>m,frontMatter:()=>a,metadata:()=>i,toc:()=>l});var s=e(4848),r=e(8453);const a={slug:"first-blog-post",title:"First Blog Post",authors:{name:"Gao Wei",title:"Docusaurus Core Team",url:"https://github.com/wgao19",image_url:"https://github.com/wgao19.png"},tags:["hola","docusaurus"]},u=void 0,i={permalink:"/protoc-gen-go-temporal/blog/first-blog-post",editUrl:"https://github.com/facebook/docusaurus/tree/main/packages/create-docusaurus/templates/shared/blog/2019-05-28-first-blog-post.md",source:"@site/blog/2019-05-28-first-blog-post.md",title:"First Blog Post",description:"Lorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque elementum dignissim ultricies. Fusce rhoncus ipsum tempor eros aliquam consequat. Lorem ipsum dolor sit amet",date:"2019-05-28T00:00:00.000Z",formattedDate:"May 28, 2019",tags:[{label:"hola",permalink:"/protoc-gen-go-temporal/blog/tags/hola"},{label:"docusaurus",permalink:"/protoc-gen-go-temporal/blog/tags/docusaurus"}],readingTime:.12,hasTruncateMarker:!1,authors:[{name:"Gao Wei",title:"Docusaurus Core Team",url:"https://github.com/wgao19",image_url:"https://github.com/wgao19.png",imageURL:"https://github.com/wgao19.png"}],frontMatter:{slug:"first-blog-post",title:"First Blog Post",authors:{name:"Gao Wei",title:"Docusaurus Core Team",url:"https://github.com/wgao19",image_url:"https://github.com/wgao19.png",imageURL:"https://github.com/wgao19.png"},tags:["hola","docusaurus"]},unlisted:!1,prevItem:{title:"Long Blog Post",permalink:"/protoc-gen-go-temporal/blog/long-blog-post"}},n={authorsImageUrls:[void 0]},l=[];function c(t){const o={p:"p",...(0,r.R)(),...t.components};return(0,s.jsx)(o.p,{children:"Lorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque elementum dignissim ultricies. Fusce rhoncus ipsum tempor eros aliquam consequat. Lorem ipsum dolor sit amet"})}function m(t={}){const{wrapper:o}={...(0,r.R)(),...t.components};return o?(0,s.jsx)(o,{...t,children:(0,s.jsx)(c,{...t})}):c(t)}},8453:(t,o,e)=>{e.d(o,{R:()=>u,x:()=>i});var s=e(6540);const r={},a=s.createContext(r);function u(t){const o=s.useContext(a);return s.useMemo((function(){return"function"==typeof t?t(o):{...o,...t}}),[o,t])}function i(t){let o;return o=t.disableParentContext?"function"==typeof t.components?t.components(r):t.components||r:u(t.components),s.createElement(a.Provider,{value:o},t.children)}}}]); \ No newline at end of file diff --git a/assets/js/935f2afb.3097c3c5.js b/assets/js/935f2afb.3097c3c5.js new file mode 100644 index 00000000..c0be731a --- /dev/null +++ b/assets/js/935f2afb.3097c3c5.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunkdocs=self.webpackChunkdocs||[]).push([[8581],{5610:e=>{e.exports=JSON.parse('{"pluginId":"default","version":"current","label":"Next","banner":null,"badge":false,"noIndex":false,"className":"docs-version-current","isLast":true,"docsSidebars":{"docs":[{"type":"link","label":"About","href":"/protoc-gen-go-temporal/docs/about","docId":"about","unlisted":false},{"type":"link","label":"Installing","href":"/protoc-gen-go-temporal/docs/install","docId":"install","unlisted":false},{"type":"link","label":"Getting Started","href":"/protoc-gen-go-temporal/docs/getting-started","docId":"getting-started","unlisted":false},{"type":"category","label":"Configuration","items":[{"type":"link","label":"Plugin","href":"/protoc-gen-go-temporal/docs/configuration/plugin","docId":"configuration/plugin","unlisted":false},{"type":"link","label":"Service","href":"/protoc-gen-go-temporal/docs/configuration/service","docId":"configuration/service","unlisted":false},{"type":"link","label":"Workflow","href":"/protoc-gen-go-temporal/docs/configuration/workflow","docId":"configuration/workflow","unlisted":false},{"type":"link","label":"Activities","href":"/protoc-gen-go-temporal/docs/configuration/activity","docId":"configuration/activity","unlisted":false},{"type":"link","label":"Query","href":"/protoc-gen-go-temporal/docs/configuration/query","docId":"configuration/query","unlisted":false},{"type":"link","label":"Signal","href":"/protoc-gen-go-temporal/docs/configuration/signal","docId":"configuration/signal","unlisted":false},{"type":"link","label":"Update","href":"/protoc-gen-go-temporal/docs/configuration/update","docId":"configuration/update","unlisted":false}],"collapsed":true,"collapsible":true},{"type":"category","label":"Guides","items":[{"type":"link","label":"Workflows","href":"/protoc-gen-go-temporal/docs/guides/workflows","docId":"guides/workflows","unlisted":false},{"type":"link","label":"Activities","href":"/protoc-gen-go-temporal/docs/guides/activities","docId":"guides/activities","unlisted":false},{"type":"link","label":"Queries","href":"/protoc-gen-go-temporal/docs/guides/queries","docId":"guides/queries","unlisted":false},{"type":"link","label":"Signals","href":"/protoc-gen-go-temporal/docs/guides/signals","docId":"guides/signals","unlisted":false},{"type":"link","label":"Testing","href":"/protoc-gen-go-temporal/docs/guides/testing","docId":"guides/testing","unlisted":false},{"type":"link","label":"Updates","href":"/protoc-gen-go-temporal/docs/guides/updates","docId":"guides/updates","unlisted":false},{"type":"link","label":"Clients","href":"/protoc-gen-go-temporal/docs/guides/clients","docId":"guides/clients","unlisted":false},{"type":"link","label":"CLI","href":"/protoc-gen-go-temporal/docs/guides/cli","docId":"guides/cli","unlisted":false},{"type":"link","label":"Child Workflows","href":"/protoc-gen-go-temporal/docs/guides/child-workflows","docId":"guides/child-workflows","unlisted":false},{"type":"link","label":"Cross-Namespace (XNS)","href":"/protoc-gen-go-temporal/docs/guides/xns","docId":"guides/xns","unlisted":false},{"type":"link","label":"Bloblang Expressions","href":"/protoc-gen-go-temporal/docs/guides/bloblang","docId":"guides/bloblang","unlisted":false},{"type":"link","label":"Codec Server","href":"/protoc-gen-go-temporal/docs/guides/codec-server","docId":"guides/codec-server","unlisted":false},{"type":"link","label":"Documentation","href":"/protoc-gen-go-temporal/docs/guides/documentation","docId":"guides/documentation","unlisted":false}],"collapsed":true,"collapsible":true}],"examples":[{"type":"link","label":"Hello World","href":"/protoc-gen-go-temporal/docs/examples/helloworld","docId":"examples/helloworld","unlisted":false},{"type":"link","label":"Codec Server","href":"/protoc-gen-go-temporal/docs/examples/codecserver","docId":"examples/codecserver","unlisted":false},{"type":"link","label":"Search Attributes","href":"/protoc-gen-go-temporal/docs/examples/searchattributes","docId":"examples/searchattributes","unlisted":false},{"type":"link","label":"Updatable Timer","href":"/protoc-gen-go-temporal/docs/examples/updatabletimer","docId":"examples/updatabletimer","unlisted":false}]},"docs":{"about":{"id":"about","title":"About","description":"A protoc plugin for generating typed Temporal clients and workers in Go from protobuf schemas. This plugin allows:","sidebar":"docs"},"configuration/activity":{"id":"configuration/activity","title":"Activity","description":"Activities are defined as Protobuf RPCs annotated with the temporal.v1.activity method option. See the Activities guide for more usage details.","sidebar":"docs"},"configuration/plugin":{"id":"configuration/plugin","title":"Plugin","description":"Plugin options are used to globally configure this plugin\'s behavior at runtime.","sidebar":"docs"},"configuration/query":{"id":"configuration/query","title":"Query","description":"Queries are defined as Protobuf RPCs annotated with the temporal.v1.query method option. They\'re mapped to workflows using the query workflow option. See the Queries guide for more usage details.","sidebar":"docs"},"configuration/service":{"id":"configuration/service","title":"Service","description":"Service options apply to all Temporal resources defined within an individual protobuf service.","sidebar":"docs"},"configuration/signal":{"id":"configuration/signal","title":"Signal","description":"Signals are defined as Protobuf RPCs annotated with the temporal.v1.signal method option. They\'re mapped to workflows using the signal workflow option. See the Signals guide for more usage details.","sidebar":"docs"},"configuration/update":{"id":"configuration/update","title":"Update","description":"Updates are defined as Protobuf RPCs annotated with the temporal.v1.update method option. They\'re mapped to workflows using the update workflow option. See the Updates guide for more usage details.","sidebar":"docs"},"configuration/workflow":{"id":"configuration/workflow","title":"Workflow","description":"Workflows are defined as Protobuf RPCs annotated with the temporal.v1.workflow method option. See the Workflows guide for more usage details.","sidebar":"docs"},"examples/codecserver":{"id":"examples/codecserver","title":"Codec Server","description":"A simple example inspired by temporalio/samples-go/codecserver","sidebar":"examples"},"examples/helloworld":{"id":"examples/helloworld","title":"Hello World","description":"A simple example inspired by temporalio/samples-go/helloworld","sidebar":"examples"},"examples/searchattributes":{"id":"examples/searchattributes","title":"Search Attributes","description":"A simple example inspired by temporalio/samples-go/searchattributes","sidebar":"examples"},"examples/updatabletimer":{"id":"examples/updatabletimer","title":"Updatable Timer","description":"A simple example inspired by temporalio/samples-go/updatabletimer","sidebar":"examples"},"getting-started":{"id":"getting-started","title":"Getting Started","description":"Setup","sidebar":"docs"},"guides/activities":{"id":"guides/activities","title":"Activities","description":"Implementation","sidebar":"docs"},"guides/bloblang":{"id":"guides/bloblang","title":"Bloblang","description":"Default workflow IDs, update IDs, and search attributes can be defined using Bloblang expressions via the ${!} interpolation syntax. The expression is evaluated against the protojson serialized input, allowing it to leverage fields from the input parameter, as well as Bloblang\'s native functions and methods.","sidebar":"docs"},"guides/child-workflows":{"id":"guides/child-workflows","title":"Child Workflows","description":"Coming Soon...","sidebar":"docs"},"guides/cli":{"id":"guides/cli","title":"CLI","description":"Coming Soon...","sidebar":"docs"},"guides/clients":{"id":"guides/clients","title":"Clients","description":"Coming Soon...","sidebar":"docs"},"guides/codec-server":{"id":"guides/codec-server","title":"Codec Server","description":"Data Converter","sidebar":"docs"},"guides/documentation":{"id":"guides/documentation","title":"Documentation","description":"Coming Soon...","sidebar":"docs"},"guides/queries":{"id":"guides/queries","title":"Queries","description":"Implementation","sidebar":"docs"},"guides/signals":{"id":"guides/signals","title":"Signals","description":"Coming Soon...","sidebar":"docs"},"guides/testing":{"id":"guides/testing","title":"Testing","description":"Coming Soon...","sidebar":"docs"},"guides/updates":{"id":"guides/updates","title":"Updates","description":"Coming Soon...","sidebar":"docs"},"guides/workflows":{"id":"guides/workflows","title":"Workflows","description":"Implementation","sidebar":"docs"},"guides/xns":{"id":"guides/xns","title":"Cross Namespace (xns)","description":"Coming Soon...","sidebar":"docs"},"install":{"id":"install","title":"Install","description":"This installation method omits detailed version metadata in generated file headers.","sidebar":"docs"},"reference":{"id":"reference","title":"Reference","description":"This page provides an overview of the Go code generated by protoc-gen-go_temporal."}}}')}}]); \ No newline at end of file diff --git a/assets/js/935f2afb.9c1d7074.js b/assets/js/935f2afb.9c1d7074.js deleted file mode 100644 index f9428126..00000000 --- a/assets/js/935f2afb.9c1d7074.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunkdocs=self.webpackChunkdocs||[]).push([[8581],{5610:e=>{e.exports=JSON.parse('{"pluginId":"default","version":"current","label":"Next","banner":null,"badge":false,"noIndex":false,"className":"docs-version-current","isLast":true,"docsSidebars":{"docs":[{"type":"link","label":"About","href":"/docs/about","docId":"about","unlisted":false},{"type":"link","label":"Installing","href":"/docs/install","docId":"install","unlisted":false},{"type":"link","label":"Getting Started","href":"/docs/getting-started","docId":"getting-started","unlisted":false},{"type":"category","label":"Configuration","items":[{"type":"link","label":"Plugin","href":"/docs/configuration/plugin","docId":"configuration/plugin","unlisted":false},{"type":"link","label":"Service","href":"/docs/configuration/service","docId":"configuration/service","unlisted":false},{"type":"link","label":"Workflow","href":"/docs/configuration/workflow","docId":"configuration/workflow","unlisted":false},{"type":"link","label":"Activities","href":"/docs/configuration/activity","docId":"configuration/activity","unlisted":false},{"type":"link","label":"Query","href":"/docs/configuration/query","docId":"configuration/query","unlisted":false},{"type":"link","label":"Signal","href":"/docs/configuration/signal","docId":"configuration/signal","unlisted":false},{"type":"link","label":"Update","href":"/docs/configuration/update","docId":"configuration/update","unlisted":false}],"collapsed":true,"collapsible":true},{"type":"category","label":"Guides","items":[{"type":"link","label":"Workflows","href":"/docs/guides/workflows","docId":"guides/workflows","unlisted":false},{"type":"link","label":"Activities","href":"/docs/guides/activities","docId":"guides/activities","unlisted":false},{"type":"link","label":"Queries","href":"/docs/guides/queries","docId":"guides/queries","unlisted":false},{"type":"link","label":"Signals","href":"/docs/guides/signals","docId":"guides/signals","unlisted":false},{"type":"link","label":"Testing","href":"/docs/guides/testing","docId":"guides/testing","unlisted":false},{"type":"link","label":"Updates","href":"/docs/guides/updates","docId":"guides/updates","unlisted":false},{"type":"link","label":"Clients","href":"/docs/guides/clients","docId":"guides/clients","unlisted":false},{"type":"link","label":"CLI","href":"/docs/guides/cli","docId":"guides/cli","unlisted":false},{"type":"link","label":"Child Workflows","href":"/docs/guides/child-workflows","docId":"guides/child-workflows","unlisted":false},{"type":"link","label":"Cross-Namespace (XNS)","href":"/docs/guides/xns","docId":"guides/xns","unlisted":false},{"type":"link","label":"Bloblang Expressions","href":"/docs/guides/bloblang","docId":"guides/bloblang","unlisted":false},{"type":"link","label":"Codec Server","href":"/docs/guides/codec-server","docId":"guides/codec-server","unlisted":false},{"type":"link","label":"Documentation","href":"/docs/guides/documentation","docId":"guides/documentation","unlisted":false}],"collapsed":true,"collapsible":true}],"examples":[{"type":"link","label":"Hello World","href":"/docs/examples/helloworld","docId":"examples/helloworld","unlisted":false},{"type":"link","label":"Codec Server","href":"/docs/examples/codecserver","docId":"examples/codecserver","unlisted":false},{"type":"link","label":"Search Attributes","href":"/docs/examples/searchattributes","docId":"examples/searchattributes","unlisted":false},{"type":"link","label":"Updatable Timer","href":"/docs/examples/updatabletimer","docId":"examples/updatabletimer","unlisted":false}]},"docs":{"about":{"id":"about","title":"About","description":"A protoc plugin for generating typed Temporal clients and workers in Go from protobuf schemas. This plugin allows:","sidebar":"docs"},"configuration/activity":{"id":"configuration/activity","title":"Activity","description":"Activities are defined as Protobuf RPCs annotated with the temporal.v1.activity method option. See the Activities guide for more usage details.","sidebar":"docs"},"configuration/plugin":{"id":"configuration/plugin","title":"Plugin","description":"Plugin options are used to globally configure this plugin\'s behavior at runtime.","sidebar":"docs"},"configuration/query":{"id":"configuration/query","title":"Query","description":"Queries are defined as Protobuf RPCs annotated with the temporal.v1.query method option. They\'re mapped to workflows using the query workflow option. See the Queries guide for more usage details.","sidebar":"docs"},"configuration/service":{"id":"configuration/service","title":"Service","description":"Service options apply to all Temporal resources defined within an individual protobuf service.","sidebar":"docs"},"configuration/signal":{"id":"configuration/signal","title":"Signal","description":"Signals are defined as Protobuf RPCs annotated with the temporal.v1.signal method option. They\'re mapped to workflows using the signal workflow option. See the Signals guide for more usage details.","sidebar":"docs"},"configuration/update":{"id":"configuration/update","title":"Update","description":"Updates are defined as Protobuf RPCs annotated with the temporal.v1.update method option. They\'re mapped to workflows using the update workflow option. See the Updates guide for more usage details.","sidebar":"docs"},"configuration/workflow":{"id":"configuration/workflow","title":"Workflow","description":"Workflows are defined as Protobuf RPCs annotated with the temporal.v1.workflow method option. See the Workflows guide for more usage details.","sidebar":"docs"},"examples/codecserver":{"id":"examples/codecserver","title":"Codec Server","description":"A simple example inspired by temporalio/samples-go/codecserver","sidebar":"examples"},"examples/helloworld":{"id":"examples/helloworld","title":"Hello World","description":"A simple example inspired by temporalio/samples-go/helloworld","sidebar":"examples"},"examples/searchattributes":{"id":"examples/searchattributes","title":"Search Attributes","description":"A simple example inspired by temporalio/samples-go/searchattributes","sidebar":"examples"},"examples/updatabletimer":{"id":"examples/updatabletimer","title":"Updatable Timer","description":"A simple example inspired by temporalio/samples-go/updatabletimer","sidebar":"examples"},"getting-started":{"id":"getting-started","title":"Getting Started","description":"Setup","sidebar":"docs"},"guides/activities":{"id":"guides/activities","title":"Activities","description":"Implementation","sidebar":"docs"},"guides/bloblang":{"id":"guides/bloblang","title":"Bloblang","description":"Default workflow IDs, update IDs, and search attributes can be defined using Bloblang expressions via the ${!} interpolation syntax. The expression is evaluated against the protojson serialized input, allowing it to leverage fields from the input parameter, as well as Bloblang\'s native functions and methods.","sidebar":"docs"},"guides/child-workflows":{"id":"guides/child-workflows","title":"Child Workflows","description":"Coming Soon...","sidebar":"docs"},"guides/cli":{"id":"guides/cli","title":"CLI","description":"Coming Soon...","sidebar":"docs"},"guides/clients":{"id":"guides/clients","title":"Clients","description":"Coming Soon...","sidebar":"docs"},"guides/codec-server":{"id":"guides/codec-server","title":"Codec Server","description":"Data Converter","sidebar":"docs"},"guides/documentation":{"id":"guides/documentation","title":"Documentation","description":"Coming Soon...","sidebar":"docs"},"guides/queries":{"id":"guides/queries","title":"Queries","description":"Implementation","sidebar":"docs"},"guides/signals":{"id":"guides/signals","title":"Signals","description":"Coming Soon...","sidebar":"docs"},"guides/testing":{"id":"guides/testing","title":"Testing","description":"Coming Soon...","sidebar":"docs"},"guides/updates":{"id":"guides/updates","title":"Updates","description":"Coming Soon...","sidebar":"docs"},"guides/workflows":{"id":"guides/workflows","title":"Workflows","description":"Implementation","sidebar":"docs"},"guides/xns":{"id":"guides/xns","title":"Cross Namespace (xns)","description":"Coming Soon...","sidebar":"docs"},"install":{"id":"install","title":"Install","description":"This installation method omits detailed version metadata in generated file headers.","sidebar":"docs"},"reference":{"id":"reference","title":"Reference","description":"This page provides an overview of the Go code generated by protoc-gen-go_temporal."}}}')}}]); \ No newline at end of file diff --git a/assets/js/93fb8980.4cf42dce.js b/assets/js/93fb8980.4cf42dce.js new file mode 100644 index 00000000..ebfac5bf --- /dev/null +++ b/assets/js/93fb8980.4cf42dce.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunkdocs=self.webpackChunkdocs||[]).push([[1482],{2958:(e,t,o)=>{o.r(t),o.d(t,{assets:()=>s,contentTitle:()=>a,default:()=>d,frontMatter:()=>i,metadata:()=>l,toc:()=>c});var r=o(4848),n=o(8453);o(1470),o(9365);const i={},a="Activity",l={id:"configuration/activity",title:"Activity",description:"Activities are defined as Protobuf RPCs annotated with the temporal.v1.activity method option. See the Activities guide for more usage details.",source:"@site/docs/configuration/activity.mdx",sourceDirName:"configuration",slug:"/configuration/activity",permalink:"/protoc-gen-go-temporal/docs/configuration/activity",draft:!1,unlisted:!1,editUrl:"https://github.com/facebook/docusaurus/tree/main/packages/create-docusaurus/templates/shared/docs/configuration/activity.mdx",tags:[],version:"current",frontMatter:{},sidebar:"docs",previous:{title:"Workflow",permalink:"/protoc-gen-go-temporal/docs/configuration/workflow"},next:{title:"Query",permalink:"/protoc-gen-go-temporal/docs/configuration/query"}},s={},c=[{value:"Options",id:"options",level:2},{value:"heartbeat_timeout",id:"heartbeat_timeout",level:3},{value:"name",id:"name",level:3},{value:"retry_policy",id:"retry_policy",level:3},{value:"schedule_to_close_timeout",id:"schedule_to_close_timeout",level:3},{value:"schedule_to_start_timeout",id:"schedule_to_start_timeout",level:3},{value:"start_to_close_timeout",id:"start_to_close_timeout",level:3},{value:"task_queue",id:"task_queue",level:3}];function u(e){const t={a:"a",admonition:"admonition",code:"code",h1:"h1",h2:"h2",h3:"h3",p:"p",pre:"pre",...(0,n.R)(),...e.components};return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(t.h1,{id:"activity",children:"Activity"}),"\n",(0,r.jsxs)(t.p,{children:[(0,r.jsx)(t.a,{href:"https://docs.temporal.io/activities",children:"Activities"})," are defined as Protobuf RPCs annotated with the ",(0,r.jsx)(t.code,{children:"temporal.v1.activity"})," method option. See the ",(0,r.jsx)(t.a,{href:"/docs/guides/activities",children:"Activities guide"})," for more usage details."]}),"\n",(0,r.jsx)(t.admonition,{type:"info",children:(0,r.jsxs)(t.p,{children:["Activity definitions can omit an input and/or out parameter by specifying the native ",(0,r.jsx)(t.code,{children:"google.protobuf.Empty"})," message type in its place. This requires an additional ",(0,r.jsx)(t.code,{children:"google/protobuf/empty.proto"})," protobuf import."]})}),"\n",(0,r.jsx)(t.pre,{children:(0,r.jsx)(t.code,{className:"language-protobuf",metastring:'title="example.proto"',children:'syntax="proto3";\n\npackage example.v1;\n\nimport "temporal/v1/temporal.proto";\n\nservice Example {\n // Hello returns a friendly greeting\n rpc Hello(HelloInput) returns (HelloOutput) {\n option (temporal.v1.activity) = {\n start_to_close_timeout: { seconds: 60 }\n };\n }\n}\n'})}),"\n",(0,r.jsx)(t.h2,{id:"options",children:"Options"}),"\n",(0,r.jsx)(t.h3,{id:"heartbeat_timeout",children:"heartbeat_timeout"}),"\n",(0,r.jsx)(t.p,{children:(0,r.jsx)(t.a,{href:"https://protobuf.dev/reference/protobuf/google.protobuf/#duration",children:"google.protobuf.Duration"})}),"\n",(0,r.jsxs)(t.p,{children:["The maximum time allowed between ",(0,r.jsx)(t.a,{href:"https://docs.temporal.io/activities#activity-heartbeat",children:"Activity Heartbeats"}),". See ",(0,r.jsx)(t.a,{href:"https://docs.temporal.io/activities#heartbeat-timeout",children:"docs"})," for more details."]}),"\n",(0,r.jsx)(t.pre,{children:(0,r.jsx)(t.code,{className:"language-protobuf",children:"service Example {\n rpc Hello(HelloInput) returns (HelloOutput) {\n option (temporal.v1.activity) = {\n heartbeat_timeout: { seconds: 300 } // 5m\n };\n }\n}\n"})}),"\n",(0,r.jsx)(t.h3,{id:"name",children:"name"}),"\n",(0,r.jsx)(t.p,{children:(0,r.jsx)(t.code,{children:"string"})}),"\n",(0,r.jsxs)(t.p,{children:["Fully qualified ",(0,r.jsx)(t.a,{href:"https://docs.temporal.io/activities#activity-type",children:"Activity type name"}),". Defaults to protobuf method full name (e.g. ",(0,r.jsx)(t.code,{children:"example.v1.Example.Hello"}),")"]}),"\n",(0,r.jsx)(t.pre,{children:(0,r.jsx)(t.code,{className:"language-protobuf",children:'service Example {\n rpc Hello(HelloInput) returns (HelloOutput) {\n option (temporal.v1.activity) = {\n name: "Hello"\n };\n }\n}\n'})}),"\n",(0,r.jsx)(t.h3,{id:"retry_policy",children:"retry_policy"}),"\n",(0,r.jsx)(t.p,{children:(0,r.jsx)(t.a,{href:"https://buf.build/cludden/protoc-gen-go-temporal/docs/main:temporal.v1#temporal.v1.RetryPolicy",children:"temporal.v1.RetryPolicy"})}),"\n",(0,r.jsxs)(t.p,{children:["Optional ",(0,r.jsx)(t.a,{href:"https://docs.temporal.io/retry-policies",children:"retry policy"})," for activity."]}),"\n",(0,r.jsx)(t.pre,{children:(0,r.jsx)(t.code,{className:"language-protobuf",children:'service Example {\n rpc Hello(HelloInput) returns (HelloOutput) {\n option (temporal.v1.activity) = {\n retry_policy: {\n max_attempts: 10\n initial_interval: { seconds: 5 }\n max_interval: { seconds: 60 }\n backoff_coefficient: 2.0\n non_retryable_error_types: ["SomeError", "SomeOtherError"]\n }\n };\n }\n}\n'})}),"\n",(0,r.jsx)(t.h3,{id:"schedule_to_close_timeout",children:"schedule_to_close_timeout"}),"\n",(0,r.jsx)(t.p,{children:(0,r.jsx)(t.a,{href:"https://protobuf.dev/reference/protobuf/google.protobuf/#duration",children:"google.protobuf.Duration"})}),"\n",(0,r.jsxs)(t.p,{children:["The maximum time allowed for the overall ",(0,r.jsx)(t.a,{href:"https://docs.temporal.io/activities#activity-execution",children:"Activity Execution"}),". At least one of ",(0,r.jsx)(t.a,{href:"#schedule_to_close_timeout",children:"schedule_to_close_timeout"}),", ",(0,r.jsx)(t.a,{href:"#schedule_to_start_timeout",children:"schedule_to_start_timeout"}),", or ",(0,r.jsx)(t.a,{href:"#start_to_close_timeout",children:"start_to_close_timeout"})," is required. See ",(0,r.jsx)(t.a,{href:"https://docs.temporal.io/activities#schedule-to-close-timeout",children:"docs"})," for more details."]}),"\n",(0,r.jsx)(t.pre,{children:(0,r.jsx)(t.code,{className:"language-protobuf",children:"service Example {\n rpc Hello(HelloInput) returns (HelloOutput) {\n option (temporal.v1.activity) = {\n schedule_to_close_timeout: { seconds: 10 }\n };\n }\n}\n"})}),"\n",(0,r.jsx)(t.h3,{id:"schedule_to_start_timeout",children:"schedule_to_start_timeout"}),"\n",(0,r.jsx)(t.p,{children:(0,r.jsx)(t.a,{href:"https://protobuf.dev/reference/protobuf/google.protobuf/#duration",children:"google.protobuf.Duration"})}),"\n",(0,r.jsxs)(t.p,{children:["The maximum time allowed from when an ",(0,r.jsx)(t.a,{href:"https://docs.temporal.io/workers#activity-task",children:"Activity Task"})," is scheduled to when a Worker starts the Activity Task. At least one of ",(0,r.jsx)(t.a,{href:"#schedule_to_close_timeout",children:"schedule_to_close_timeout"}),", ",(0,r.jsx)(t.a,{href:"#schedule_to_start_timeout",children:"schedule_to_start_timeout"}),", or ",(0,r.jsx)(t.a,{href:"#start_to_close_timeout",children:"start_to_close_timeout"})," is required. See ",(0,r.jsx)(t.a,{href:"https://docs.temporal.io/activities#schedule-to-start-timeout",children:"docs"})," for more details."]}),"\n",(0,r.jsx)(t.pre,{children:(0,r.jsx)(t.code,{className:"language-protobuf",children:"service Example {\n rpc Hello(HelloInput) returns (HelloOutput) {\n option (temporal.v1.activity) = {\n schedule_to_start_timeout: { seconds: 10 }\n };\n }\n}\n"})}),"\n",(0,r.jsx)(t.h3,{id:"start_to_close_timeout",children:"start_to_close_timeout"}),"\n",(0,r.jsx)(t.p,{children:(0,r.jsx)(t.a,{href:"https://protobuf.dev/reference/protobuf/google.protobuf/#duration",children:"google.protobuf.Duration"})}),"\n",(0,r.jsxs)(t.p,{children:["The maximum time allowed for a single ",(0,r.jsx)(t.a,{href:"https://docs.temporal.io/workers#activity-task-execution",children:"Activity Task Execution"}),". At least one of ",(0,r.jsx)(t.a,{href:"#schedule_to_close_timeout",children:"schedule_to_close_timeout"}),", ",(0,r.jsx)(t.a,{href:"#schedule_to_start_timeout",children:"schedule_to_start_timeout"}),", or ",(0,r.jsx)(t.a,{href:"#start_to_close_timeout",children:"start_to_close_timeout"})," is required. See ",(0,r.jsx)(t.a,{href:"https://docs.temporal.io/activities#start-to-close-timeout",children:"docs"})," for more details."]}),"\n",(0,r.jsx)(t.pre,{children:(0,r.jsx)(t.code,{className:"language-protobuf",children:"service Example {\n rpc Hello(HelloInput) returns (HelloOutput) {\n option (temporal.v1.activity) = {\n start_to_close_timeout: { seconds: 10 }\n };\n }\n}\n"})}),"\n",(0,r.jsx)(t.h3,{id:"task_queue",children:"task_queue"}),"\n",(0,r.jsx)(t.p,{children:(0,r.jsx)(t.code,{children:"string"})}),"\n",(0,r.jsxs)(t.p,{children:["Overrides the default task queue for a particular activity type. Defaults to Service's ",(0,r.jsx)(t.code,{children:"task_queue"})," if specified."]}),"\n",(0,r.jsx)(t.pre,{children:(0,r.jsx)(t.code,{className:"language-protobuf",children:'service Example {\n rpc Hello(HelloInput) returns (HelloOutput) {\n option (temporal.v1.activity) = {\n task_queue: "example-v2"\n };\n }\n}\n'})})]})}function d(e={}){const{wrapper:t}={...(0,n.R)(),...e.components};return t?(0,r.jsx)(t,{...e,children:(0,r.jsx)(u,{...e})}):u(e)}},9365:(e,t,o)=>{o.d(t,{A:()=>a});o(6540);var r=o(4164);const n={tabItem:"tabItem_Ymn6"};var i=o(4848);function a(e){let{children:t,hidden:o,className:a}=e;return(0,i.jsx)("div",{role:"tabpanel",className:(0,r.A)(n.tabItem,a),hidden:o,children:t})}},1470:(e,t,o)=>{o.d(t,{A:()=>j});var r=o(6540),n=o(4164),i=o(3104),a=o(6347),l=o(205),s=o(7485),c=o(1682),u=o(9466);function d(e){return r.Children.toArray(e).filter((e=>"\n"!==e)).map((e=>{if(!e||(0,r.isValidElement)(e)&&function(e){const{props:t}=e;return!!t&&"object"==typeof t&&"value"in t}(e))return e;throw new Error(`Docusaurus error: Bad child <${"string"==typeof e.type?e.type:e.type.name}>: all children of the component should be , and every should have a unique "value" prop.`)}))?.filter(Boolean)??[]}function p(e){const{values:t,children:o}=e;return(0,r.useMemo)((()=>{const e=t??function(e){return d(e).map((e=>{let{props:{value:t,label:o,attributes:r,default:n}}=e;return{value:t,label:o,attributes:r,default:n}}))}(o);return function(e){const t=(0,c.X)(e,((e,t)=>e.value===t.value));if(t.length>0)throw new Error(`Docusaurus error: Duplicate values "${t.map((e=>e.value)).join(", ")}" found in . Every value needs to be unique.`)}(e),e}),[t,o])}function h(e){let{value:t,tabValues:o}=e;return o.some((e=>e.value===t))}function m(e){let{queryString:t=!1,groupId:o}=e;const n=(0,a.W6)(),i=function(e){let{queryString:t=!1,groupId:o}=e;if("string"==typeof t)return t;if(!1===t)return null;if(!0===t&&!o)throw new Error('Docusaurus error: The component groupId prop is required if queryString=true, because this value is used as the search param name. You can also provide an explicit value such as queryString="my-search-param".');return o??null}({queryString:t,groupId:o});return[(0,s.aZ)(i),(0,r.useCallback)((e=>{if(!i)return;const t=new URLSearchParams(n.location.search);t.set(i,e),n.replace({...n.location,search:t.toString()})}),[i,n])]}function f(e){const{defaultValue:t,queryString:o=!1,groupId:n}=e,i=p(e),[a,s]=(0,r.useState)((()=>function(e){let{defaultValue:t,tabValues:o}=e;if(0===o.length)throw new Error("Docusaurus error: the component requires at least one children component");if(t){if(!h({value:t,tabValues:o}))throw new Error(`Docusaurus error: The has a defaultValue "${t}" but none of its children has the corresponding value. Available values are: ${o.map((e=>e.value)).join(", ")}. If you intend to show no default tab, use defaultValue={null} instead.`);return t}const r=o.find((e=>e.default))??o[0];if(!r)throw new Error("Unexpected error: 0 tabValues");return r.value}({defaultValue:t,tabValues:i}))),[c,d]=m({queryString:o,groupId:n}),[f,v]=function(e){let{groupId:t}=e;const o=function(e){return e?`docusaurus.tab.${e}`:null}(t),[n,i]=(0,u.Dv)(o);return[n,(0,r.useCallback)((e=>{o&&i.set(e)}),[o,i])]}({groupId:n}),_=(()=>{const e=c??f;return h({value:e,tabValues:i})?e:null})();(0,l.A)((()=>{_&&s(_)}),[_]);return{selectedValue:a,selectValue:(0,r.useCallback)((e=>{if(!h({value:e,tabValues:i}))throw new Error(`Can't select invalid tab value=${e}`);s(e),d(e),v(e)}),[d,v,i]),tabValues:i}}var v=o(2303);const _={tabList:"tabList__CuJ",tabItem:"tabItem_LNqP"};var x=o(4848);function b(e){let{className:t,block:o,selectedValue:r,selectValue:a,tabValues:l}=e;const s=[],{blockElementScrollPositionUntilNextRender:c}=(0,i.a_)(),u=e=>{const t=e.currentTarget,o=s.indexOf(t),n=l[o].value;n!==r&&(c(t),a(n))},d=e=>{let t=null;switch(e.key){case"Enter":u(e);break;case"ArrowRight":{const o=s.indexOf(e.currentTarget)+1;t=s[o]??s[0];break}case"ArrowLeft":{const o=s.indexOf(e.currentTarget)-1;t=s[o]??s[s.length-1];break}}t?.focus()};return(0,x.jsx)("ul",{role:"tablist","aria-orientation":"horizontal",className:(0,n.A)("tabs",{"tabs--block":o},t),children:l.map((e=>{let{value:t,label:o,attributes:i}=e;return(0,x.jsx)("li",{role:"tab",tabIndex:r===t?0:-1,"aria-selected":r===t,ref:e=>s.push(e),onKeyDown:d,onClick:u,...i,className:(0,n.A)("tabs__item",_.tabItem,i?.className,{"tabs__item--active":r===t}),children:o??t},t)}))})}function g(e){let{lazy:t,children:o,selectedValue:n}=e;const i=(Array.isArray(o)?o:[o]).filter(Boolean);if(t){const e=i.find((e=>e.props.value===n));return e?(0,r.cloneElement)(e,{className:"margin-top--md"}):null}return(0,x.jsx)("div",{className:"margin-top--md",children:i.map(((e,t)=>(0,r.cloneElement)(e,{key:t,hidden:e.props.value!==n})))})}function y(e){const t=f(e);return(0,x.jsxs)("div",{className:(0,n.A)("tabs-container",_.tabList),children:[(0,x.jsx)(b,{...e,...t}),(0,x.jsx)(g,{...e,...t})]})}function j(e){const t=(0,v.A)();return(0,x.jsx)(y,{...e,children:d(e.children)},String(t))}},8453:(e,t,o)=>{o.d(t,{R:()=>a,x:()=>l});var r=o(6540);const n={},i=r.createContext(n);function a(e){const t=r.useContext(i);return r.useMemo((function(){return"function"==typeof e?e(t):{...t,...e}}),[t,e])}function l(e){let t;return t=e.disableParentContext?"function"==typeof e.components?e.components(n):e.components||n:a(e.components),r.createElement(i.Provider,{value:t},e.children)}}}]); \ No newline at end of file diff --git a/assets/js/93fb8980.bb4ee59f.js b/assets/js/93fb8980.bb4ee59f.js deleted file mode 100644 index d9034737..00000000 --- a/assets/js/93fb8980.bb4ee59f.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunkdocs=self.webpackChunkdocs||[]).push([[1482],{2958:(e,t,o)=>{o.r(t),o.d(t,{assets:()=>l,contentTitle:()=>a,default:()=>d,frontMatter:()=>i,metadata:()=>s,toc:()=>c});var r=o(4848),n=o(8453);o(1470),o(9365);const i={},a="Activity",s={id:"configuration/activity",title:"Activity",description:"Activities are defined as Protobuf RPCs annotated with the temporal.v1.activity method option. See the Activities guide for more usage details.",source:"@site/docs/configuration/activity.mdx",sourceDirName:"configuration",slug:"/configuration/activity",permalink:"/docs/configuration/activity",draft:!1,unlisted:!1,editUrl:"https://github.com/facebook/docusaurus/tree/main/packages/create-docusaurus/templates/shared/docs/configuration/activity.mdx",tags:[],version:"current",frontMatter:{},sidebar:"docs",previous:{title:"Workflow",permalink:"/docs/configuration/workflow"},next:{title:"Query",permalink:"/docs/configuration/query"}},l={},c=[{value:"Options",id:"options",level:2},{value:"heartbeat_timeout",id:"heartbeat_timeout",level:3},{value:"name",id:"name",level:3},{value:"retry_policy",id:"retry_policy",level:3},{value:"schedule_to_close_timeout",id:"schedule_to_close_timeout",level:3},{value:"schedule_to_start_timeout",id:"schedule_to_start_timeout",level:3},{value:"start_to_close_timeout",id:"start_to_close_timeout",level:3},{value:"task_queue",id:"task_queue",level:3}];function u(e){const t={a:"a",admonition:"admonition",code:"code",h1:"h1",h2:"h2",h3:"h3",p:"p",pre:"pre",...(0,n.R)(),...e.components};return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(t.h1,{id:"activity",children:"Activity"}),"\n",(0,r.jsxs)(t.p,{children:[(0,r.jsx)(t.a,{href:"https://docs.temporal.io/activities",children:"Activities"})," are defined as Protobuf RPCs annotated with the ",(0,r.jsx)(t.code,{children:"temporal.v1.activity"})," method option. See the ",(0,r.jsx)(t.a,{href:"/docs/guides/activities",children:"Activities guide"})," for more usage details."]}),"\n",(0,r.jsx)(t.admonition,{type:"info",children:(0,r.jsxs)(t.p,{children:["Activity definitions can omit an input and/or out parameter by specifying the native ",(0,r.jsx)(t.code,{children:"google.protobuf.Empty"})," message type in its place. This requires an additional ",(0,r.jsx)(t.code,{children:"google/protobuf/empty.proto"})," protobuf import."]})}),"\n",(0,r.jsx)(t.pre,{children:(0,r.jsx)(t.code,{className:"language-protobuf",metastring:'title="example.proto"',children:'syntax="proto3";\n\npackage example.v1;\n\nimport "temporal/v1/temporal.proto";\n\nservice Example {\n // Hello returns a friendly greeting\n rpc Hello(HelloInput) returns (HelloOutput) {\n option (temporal.v1.activity) = {\n start_to_close_timeout: { seconds: 60 }\n };\n }\n}\n'})}),"\n",(0,r.jsx)(t.h2,{id:"options",children:"Options"}),"\n",(0,r.jsx)(t.h3,{id:"heartbeat_timeout",children:"heartbeat_timeout"}),"\n",(0,r.jsx)(t.p,{children:(0,r.jsx)(t.a,{href:"https://protobuf.dev/reference/protobuf/google.protobuf/#duration",children:"google.protobuf.Duration"})}),"\n",(0,r.jsxs)(t.p,{children:["The maximum time allowed between ",(0,r.jsx)(t.a,{href:"https://docs.temporal.io/activities#activity-heartbeat",children:"Activity Heartbeats"}),". See ",(0,r.jsx)(t.a,{href:"https://docs.temporal.io/activities#heartbeat-timeout",children:"docs"})," for more details."]}),"\n",(0,r.jsx)(t.pre,{children:(0,r.jsx)(t.code,{className:"language-protobuf",children:"service Example {\n rpc Hello(HelloInput) returns (HelloOutput) {\n option (temporal.v1.activity) = {\n heartbeat_timeout: { seconds: 300 } // 5m\n };\n }\n}\n"})}),"\n",(0,r.jsx)(t.h3,{id:"name",children:"name"}),"\n",(0,r.jsx)(t.p,{children:(0,r.jsx)(t.code,{children:"string"})}),"\n",(0,r.jsxs)(t.p,{children:["Fully qualified ",(0,r.jsx)(t.a,{href:"https://docs.temporal.io/activities#activity-type",children:"Activity type name"}),". Defaults to protobuf method full name (e.g. ",(0,r.jsx)(t.code,{children:"example.v1.Example.Hello"}),")"]}),"\n",(0,r.jsx)(t.pre,{children:(0,r.jsx)(t.code,{className:"language-protobuf",children:'service Example {\n rpc Hello(HelloInput) returns (HelloOutput) {\n option (temporal.v1.activity) = {\n name: "Hello"\n };\n }\n}\n'})}),"\n",(0,r.jsx)(t.h3,{id:"retry_policy",children:"retry_policy"}),"\n",(0,r.jsx)(t.p,{children:(0,r.jsx)(t.a,{href:"https://buf.build/cludden/protoc-gen-go-temporal/docs/main:temporal.v1#temporal.v1.RetryPolicy",children:"temporal.v1.RetryPolicy"})}),"\n",(0,r.jsxs)(t.p,{children:["Optional ",(0,r.jsx)(t.a,{href:"https://docs.temporal.io/retry-policies",children:"retry policy"})," for activity."]}),"\n",(0,r.jsx)(t.pre,{children:(0,r.jsx)(t.code,{className:"language-protobuf",children:'service Example {\n rpc Hello(HelloInput) returns (HelloOutput) {\n option (temporal.v1.activity) = {\n retry_policy: {\n max_attempts: 10\n initial_interval: { seconds: 5 }\n max_interval: { seconds: 60 }\n backoff_coefficient: 2.0\n non_retryable_error_types: ["SomeError", "SomeOtherError"]\n }\n };\n }\n}\n'})}),"\n",(0,r.jsx)(t.h3,{id:"schedule_to_close_timeout",children:"schedule_to_close_timeout"}),"\n",(0,r.jsx)(t.p,{children:(0,r.jsx)(t.a,{href:"https://protobuf.dev/reference/protobuf/google.protobuf/#duration",children:"google.protobuf.Duration"})}),"\n",(0,r.jsxs)(t.p,{children:["The maximum time allowed for the overall ",(0,r.jsx)(t.a,{href:"https://docs.temporal.io/activities#activity-execution",children:"Activity Execution"}),". At least one of ",(0,r.jsx)(t.a,{href:"#schedule_to_close_timeout",children:"schedule_to_close_timeout"}),", ",(0,r.jsx)(t.a,{href:"#schedule_to_start_timeout",children:"schedule_to_start_timeout"}),", or ",(0,r.jsx)(t.a,{href:"#start_to_close_timeout",children:"start_to_close_timeout"})," is required. See ",(0,r.jsx)(t.a,{href:"https://docs.temporal.io/activities#schedule-to-close-timeout",children:"docs"})," for more details."]}),"\n",(0,r.jsx)(t.pre,{children:(0,r.jsx)(t.code,{className:"language-protobuf",children:"service Example {\n rpc Hello(HelloInput) returns (HelloOutput) {\n option (temporal.v1.activity) = {\n schedule_to_close_timeout: { seconds: 10 }\n };\n }\n}\n"})}),"\n",(0,r.jsx)(t.h3,{id:"schedule_to_start_timeout",children:"schedule_to_start_timeout"}),"\n",(0,r.jsx)(t.p,{children:(0,r.jsx)(t.a,{href:"https://protobuf.dev/reference/protobuf/google.protobuf/#duration",children:"google.protobuf.Duration"})}),"\n",(0,r.jsxs)(t.p,{children:["The maximum time allowed from when an ",(0,r.jsx)(t.a,{href:"https://docs.temporal.io/workers#activity-task",children:"Activity Task"})," is scheduled to when a Worker starts the Activity Task. At least one of ",(0,r.jsx)(t.a,{href:"#schedule_to_close_timeout",children:"schedule_to_close_timeout"}),", ",(0,r.jsx)(t.a,{href:"#schedule_to_start_timeout",children:"schedule_to_start_timeout"}),", or ",(0,r.jsx)(t.a,{href:"#start_to_close_timeout",children:"start_to_close_timeout"})," is required. See ",(0,r.jsx)(t.a,{href:"https://docs.temporal.io/activities#schedule-to-start-timeout",children:"docs"})," for more details."]}),"\n",(0,r.jsx)(t.pre,{children:(0,r.jsx)(t.code,{className:"language-protobuf",children:"service Example {\n rpc Hello(HelloInput) returns (HelloOutput) {\n option (temporal.v1.activity) = {\n schedule_to_start_timeout: { seconds: 10 }\n };\n }\n}\n"})}),"\n",(0,r.jsx)(t.h3,{id:"start_to_close_timeout",children:"start_to_close_timeout"}),"\n",(0,r.jsx)(t.p,{children:(0,r.jsx)(t.a,{href:"https://protobuf.dev/reference/protobuf/google.protobuf/#duration",children:"google.protobuf.Duration"})}),"\n",(0,r.jsxs)(t.p,{children:["The maximum time allowed for a single ",(0,r.jsx)(t.a,{href:"https://docs.temporal.io/workers#activity-task-execution",children:"Activity Task Execution"}),". At least one of ",(0,r.jsx)(t.a,{href:"#schedule_to_close_timeout",children:"schedule_to_close_timeout"}),", ",(0,r.jsx)(t.a,{href:"#schedule_to_start_timeout",children:"schedule_to_start_timeout"}),", or ",(0,r.jsx)(t.a,{href:"#start_to_close_timeout",children:"start_to_close_timeout"})," is required. See ",(0,r.jsx)(t.a,{href:"https://docs.temporal.io/activities#start-to-close-timeout",children:"docs"})," for more details."]}),"\n",(0,r.jsx)(t.pre,{children:(0,r.jsx)(t.code,{className:"language-protobuf",children:"service Example {\n rpc Hello(HelloInput) returns (HelloOutput) {\n option (temporal.v1.activity) = {\n start_to_close_timeout: { seconds: 10 }\n };\n }\n}\n"})}),"\n",(0,r.jsx)(t.h3,{id:"task_queue",children:"task_queue"}),"\n",(0,r.jsx)(t.p,{children:(0,r.jsx)(t.code,{children:"string"})}),"\n",(0,r.jsxs)(t.p,{children:["Overrides the default task queue for a particular activity type. Defaults to Service's ",(0,r.jsx)(t.code,{children:"task_queue"})," if specified."]}),"\n",(0,r.jsx)(t.pre,{children:(0,r.jsx)(t.code,{className:"language-protobuf",children:'service Example {\n rpc Hello(HelloInput) returns (HelloOutput) {\n option (temporal.v1.activity) = {\n task_queue: "example-v2"\n };\n }\n}\n'})})]})}function d(e={}){const{wrapper:t}={...(0,n.R)(),...e.components};return t?(0,r.jsx)(t,{...e,children:(0,r.jsx)(u,{...e})}):u(e)}},9365:(e,t,o)=>{o.d(t,{A:()=>a});o(6540);var r=o(4164);const n={tabItem:"tabItem_Ymn6"};var i=o(4848);function a(e){let{children:t,hidden:o,className:a}=e;return(0,i.jsx)("div",{role:"tabpanel",className:(0,r.A)(n.tabItem,a),hidden:o,children:t})}},1470:(e,t,o)=>{o.d(t,{A:()=>j});var r=o(6540),n=o(4164),i=o(3104),a=o(6347),s=o(205),l=o(7485),c=o(1682),u=o(9466);function d(e){return r.Children.toArray(e).filter((e=>"\n"!==e)).map((e=>{if(!e||(0,r.isValidElement)(e)&&function(e){const{props:t}=e;return!!t&&"object"==typeof t&&"value"in t}(e))return e;throw new Error(`Docusaurus error: Bad child <${"string"==typeof e.type?e.type:e.type.name}>: all children of the component should be , and every should have a unique "value" prop.`)}))?.filter(Boolean)??[]}function p(e){const{values:t,children:o}=e;return(0,r.useMemo)((()=>{const e=t??function(e){return d(e).map((e=>{let{props:{value:t,label:o,attributes:r,default:n}}=e;return{value:t,label:o,attributes:r,default:n}}))}(o);return function(e){const t=(0,c.X)(e,((e,t)=>e.value===t.value));if(t.length>0)throw new Error(`Docusaurus error: Duplicate values "${t.map((e=>e.value)).join(", ")}" found in . Every value needs to be unique.`)}(e),e}),[t,o])}function h(e){let{value:t,tabValues:o}=e;return o.some((e=>e.value===t))}function m(e){let{queryString:t=!1,groupId:o}=e;const n=(0,a.W6)(),i=function(e){let{queryString:t=!1,groupId:o}=e;if("string"==typeof t)return t;if(!1===t)return null;if(!0===t&&!o)throw new Error('Docusaurus error: The component groupId prop is required if queryString=true, because this value is used as the search param name. You can also provide an explicit value such as queryString="my-search-param".');return o??null}({queryString:t,groupId:o});return[(0,l.aZ)(i),(0,r.useCallback)((e=>{if(!i)return;const t=new URLSearchParams(n.location.search);t.set(i,e),n.replace({...n.location,search:t.toString()})}),[i,n])]}function f(e){const{defaultValue:t,queryString:o=!1,groupId:n}=e,i=p(e),[a,l]=(0,r.useState)((()=>function(e){let{defaultValue:t,tabValues:o}=e;if(0===o.length)throw new Error("Docusaurus error: the component requires at least one children component");if(t){if(!h({value:t,tabValues:o}))throw new Error(`Docusaurus error: The has a defaultValue "${t}" but none of its children has the corresponding value. Available values are: ${o.map((e=>e.value)).join(", ")}. If you intend to show no default tab, use defaultValue={null} instead.`);return t}const r=o.find((e=>e.default))??o[0];if(!r)throw new Error("Unexpected error: 0 tabValues");return r.value}({defaultValue:t,tabValues:i}))),[c,d]=m({queryString:o,groupId:n}),[f,v]=function(e){let{groupId:t}=e;const o=function(e){return e?`docusaurus.tab.${e}`:null}(t),[n,i]=(0,u.Dv)(o);return[n,(0,r.useCallback)((e=>{o&&i.set(e)}),[o,i])]}({groupId:n}),_=(()=>{const e=c??f;return h({value:e,tabValues:i})?e:null})();(0,s.A)((()=>{_&&l(_)}),[_]);return{selectedValue:a,selectValue:(0,r.useCallback)((e=>{if(!h({value:e,tabValues:i}))throw new Error(`Can't select invalid tab value=${e}`);l(e),d(e),v(e)}),[d,v,i]),tabValues:i}}var v=o(2303);const _={tabList:"tabList__CuJ",tabItem:"tabItem_LNqP"};var x=o(4848);function b(e){let{className:t,block:o,selectedValue:r,selectValue:a,tabValues:s}=e;const l=[],{blockElementScrollPositionUntilNextRender:c}=(0,i.a_)(),u=e=>{const t=e.currentTarget,o=l.indexOf(t),n=s[o].value;n!==r&&(c(t),a(n))},d=e=>{let t=null;switch(e.key){case"Enter":u(e);break;case"ArrowRight":{const o=l.indexOf(e.currentTarget)+1;t=l[o]??l[0];break}case"ArrowLeft":{const o=l.indexOf(e.currentTarget)-1;t=l[o]??l[l.length-1];break}}t?.focus()};return(0,x.jsx)("ul",{role:"tablist","aria-orientation":"horizontal",className:(0,n.A)("tabs",{"tabs--block":o},t),children:s.map((e=>{let{value:t,label:o,attributes:i}=e;return(0,x.jsx)("li",{role:"tab",tabIndex:r===t?0:-1,"aria-selected":r===t,ref:e=>l.push(e),onKeyDown:d,onClick:u,...i,className:(0,n.A)("tabs__item",_.tabItem,i?.className,{"tabs__item--active":r===t}),children:o??t},t)}))})}function g(e){let{lazy:t,children:o,selectedValue:n}=e;const i=(Array.isArray(o)?o:[o]).filter(Boolean);if(t){const e=i.find((e=>e.props.value===n));return e?(0,r.cloneElement)(e,{className:"margin-top--md"}):null}return(0,x.jsx)("div",{className:"margin-top--md",children:i.map(((e,t)=>(0,r.cloneElement)(e,{key:t,hidden:e.props.value!==n})))})}function y(e){const t=f(e);return(0,x.jsxs)("div",{className:(0,n.A)("tabs-container",_.tabList),children:[(0,x.jsx)(b,{...e,...t}),(0,x.jsx)(g,{...e,...t})]})}function j(e){const t=(0,v.A)();return(0,x.jsx)(y,{...e,children:d(e.children)},String(t))}},8453:(e,t,o)=>{o.d(t,{R:()=>a,x:()=>s});var r=o(6540);const n={},i=r.createContext(n);function a(e){const t=r.useContext(i);return r.useMemo((function(){return"function"==typeof e?e(t):{...t,...e}}),[t,e])}function s(e){let t;return t=e.disableParentContext?"function"==typeof e.components?e.components(n):e.components||n:a(e.components),r.createElement(i.Provider,{value:t},e.children)}}}]); \ No newline at end of file diff --git a/assets/js/94350439.0fd8f775.js b/assets/js/94350439.0fd8f775.js deleted file mode 100644 index 7682d494..00000000 --- a/assets/js/94350439.0fd8f775.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunkdocs=self.webpackChunkdocs||[]).push([[9080],{6377:(e,n,t)=>{t.r(n),t.d(n,{assets:()=>l,contentTitle:()=>s,default:()=>d,frontMatter:()=>a,metadata:()=>i,toc:()=>u});var r=t(4848),o=t(8453);t(1470),t(9365);const a={},s="Signal",i={id:"configuration/signal",title:"Signal",description:"Signals are defined as Protobuf RPCs annotated with the temporal.v1.signal method option. They're mapped to workflows using the signal workflow option. See the Signals guide for more usage details.",source:"@site/docs/configuration/signal.mdx",sourceDirName:"configuration",slug:"/configuration/signal",permalink:"/docs/configuration/signal",draft:!1,unlisted:!1,editUrl:"https://github.com/facebook/docusaurus/tree/main/packages/create-docusaurus/templates/shared/docs/configuration/signal.mdx",tags:[],version:"current",frontMatter:{},sidebar:"docs",previous:{title:"Query",permalink:"/docs/configuration/query"},next:{title:"Update",permalink:"/docs/configuration/update"}},l={},u=[{value:"Options",id:"options",level:2},{value:"name",id:"name",level:3},{value:"xns",id:"xns",level:3}];function c(e){const n={a:"a",admonition:"admonition",code:"code",h1:"h1",h2:"h2",h3:"h3",p:"p",pre:"pre",...(0,o.R)(),...e.components};return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(n.h1,{id:"signal",children:"Signal"}),"\n",(0,r.jsxs)(n.p,{children:[(0,r.jsx)(n.a,{href:"https://docs.temporal.io/workflows#signal",children:"Signals"})," are defined as Protobuf RPCs annotated with the ",(0,r.jsx)(n.code,{children:"temporal.v1.signal"})," method option. They're mapped to workflows using the ",(0,r.jsx)(n.a,{href:"/docs/configuration/workflow#signal",children:"signal workflow option"}),". See the ",(0,r.jsx)(n.a,{href:"/docs/guides/signals",children:"Signals guide"})," for more usage details."]}),"\n",(0,r.jsx)(n.admonition,{type:"warning",children:(0,r.jsxs)(n.p,{children:["Signals definitions must use ",(0,r.jsx)(n.code,{children:"google.protobuf.Empty"})," as their return value. This requires an additional ",(0,r.jsx)(n.code,{children:"google/protobuf/empty.proto"})," protobuf import."]})}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-protobuf",metastring:'title="example.proto"',children:'syntax="proto3";\n\npackage example.v1;\n\nimport "google/protobuf/empty.proto";\nimport "temporal/v1/temporal.proto";\n\nservice Example {\n // Hello returns a friendly greeting\n rpc Hello(HelloInput) returns (HelloOutput) {\n option (temporal.v1.workflow) = {\n signal: { ref: \'Ping\' }\n };\n }\n\n // Ping sends a signal to an existing workflow\n rpc Ping(PingInput) returns (google.protobuf.Empty) {\n option (temporal.v1.signal) = {};\n }\n}\n'})}),"\n",(0,r.jsx)(n.h2,{id:"options",children:"Options"}),"\n",(0,r.jsx)(n.h3,{id:"name",children:"name"}),"\n",(0,r.jsx)(n.p,{children:(0,r.jsx)(n.code,{children:"string"})}),"\n",(0,r.jsxs)(n.p,{children:["Fully qualified ",(0,r.jsx)(n.a,{href:"https://docs.temporal.io/workflows#signal",children:"Signal type name"}),". Defaults to protobuf method full name (e.g. ",(0,r.jsx)(n.code,{children:"example.v1.Example.Ping"}),")"]}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-protobuf",children:'service Example {\n rpc Ping(PingInput) returns (google.protobuf.Empty) {\n option (temporal.v1.signal) = {\n name: "Ping"\n };\n }\n}\n'})}),"\n",(0,r.jsx)(n.h3,{id:"xns",children:"xns"}),"\n",(0,r.jsx)(n.p,{children:(0,r.jsx)(n.a,{href:"https://buf.build/cludden/protoc-gen-go-temporal/docs/main:temporal.v1#temporal.v1.XNSActivityOptions",children:"temporal.v1.XNSActivityOptions"})}),"\n",(0,r.jsxs)(n.p,{children:["Used to configure ",(0,r.jsx)(n.a,{href:"/docs/guides/xns",children:"cross-namespace"})," activity options."]}),"\n",(0,r.jsx)(n.admonition,{type:"note",children:(0,r.jsxs)(n.p,{children:["This requires the ",(0,r.jsx)(n.a,{href:"/docs/configuration/plugin",children:"enable-xns"})," plugin option to be enabled."]})}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-protobuf",children:"service Example {\n rpc Ping(PingInput) returns (google.protobuf.Empty) {\n option (temporal.v1.signal) = {\n xns: {\n heartbeat_timeout: { seconds: 30 }\n heartbeat_interval: { seconds: 10 }\n start_to_close_timeout: { seconds: 300 }\n }\n };\n }\n}\n"})})]})}function d(e={}){const{wrapper:n}={...(0,o.R)(),...e.components};return n?(0,r.jsx)(n,{...e,children:(0,r.jsx)(c,{...e})}):c(e)}},9365:(e,n,t)=>{t.d(n,{A:()=>s});t(6540);var r=t(4164);const o={tabItem:"tabItem_Ymn6"};var a=t(4848);function s(e){let{children:n,hidden:t,className:s}=e;return(0,a.jsx)("div",{role:"tabpanel",className:(0,r.A)(o.tabItem,s),hidden:t,children:n})}},1470:(e,n,t)=>{t.d(n,{A:()=>w});var r=t(6540),o=t(4164),a=t(3104),s=t(6347),i=t(205),l=t(7485),u=t(1682),c=t(9466);function d(e){return r.Children.toArray(e).filter((e=>"\n"!==e)).map((e=>{if(!e||(0,r.isValidElement)(e)&&function(e){const{props:n}=e;return!!n&&"object"==typeof n&&"value"in n}(e))return e;throw new Error(`Docusaurus error: Bad child <${"string"==typeof e.type?e.type:e.type.name}>: all children of the component should be , and every should have a unique "value" prop.`)}))?.filter(Boolean)??[]}function p(e){const{values:n,children:t}=e;return(0,r.useMemo)((()=>{const e=n??function(e){return d(e).map((e=>{let{props:{value:n,label:t,attributes:r,default:o}}=e;return{value:n,label:t,attributes:r,default:o}}))}(t);return function(e){const n=(0,u.X)(e,((e,n)=>e.value===n.value));if(n.length>0)throw new Error(`Docusaurus error: Duplicate values "${n.map((e=>e.value)).join(", ")}" found in . Every value needs to be unique.`)}(e),e}),[n,t])}function h(e){let{value:n,tabValues:t}=e;return t.some((e=>e.value===n))}function f(e){let{queryString:n=!1,groupId:t}=e;const o=(0,s.W6)(),a=function(e){let{queryString:n=!1,groupId:t}=e;if("string"==typeof n)return n;if(!1===n)return null;if(!0===n&&!t)throw new Error('Docusaurus error: The component groupId prop is required if queryString=true, because this value is used as the search param name. You can also provide an explicit value such as queryString="my-search-param".');return t??null}({queryString:n,groupId:t});return[(0,l.aZ)(a),(0,r.useCallback)((e=>{if(!a)return;const n=new URLSearchParams(o.location.search);n.set(a,e),o.replace({...o.location,search:n.toString()})}),[a,o])]}function m(e){const{defaultValue:n,queryString:t=!1,groupId:o}=e,a=p(e),[s,l]=(0,r.useState)((()=>function(e){let{defaultValue:n,tabValues:t}=e;if(0===t.length)throw new Error("Docusaurus error: the component requires at least one children component");if(n){if(!h({value:n,tabValues:t}))throw new Error(`Docusaurus error: The has a defaultValue "${n}" but none of its children has the corresponding value. Available values are: ${t.map((e=>e.value)).join(", ")}. If you intend to show no default tab, use defaultValue={null} instead.`);return n}const r=t.find((e=>e.default))??t[0];if(!r)throw new Error("Unexpected error: 0 tabValues");return r.value}({defaultValue:n,tabValues:a}))),[u,d]=f({queryString:t,groupId:o}),[m,g]=function(e){let{groupId:n}=e;const t=function(e){return e?`docusaurus.tab.${e}`:null}(n),[o,a]=(0,c.Dv)(t);return[o,(0,r.useCallback)((e=>{t&&a.set(e)}),[t,a])]}({groupId:o}),b=(()=>{const e=u??m;return h({value:e,tabValues:a})?e:null})();(0,i.A)((()=>{b&&l(b)}),[b]);return{selectedValue:s,selectValue:(0,r.useCallback)((e=>{if(!h({value:e,tabValues:a}))throw new Error(`Can't select invalid tab value=${e}`);l(e),d(e),g(e)}),[d,g,a]),tabValues:a}}var g=t(2303);const b={tabList:"tabList__CuJ",tabItem:"tabItem_LNqP"};var v=t(4848);function x(e){let{className:n,block:t,selectedValue:r,selectValue:s,tabValues:i}=e;const l=[],{blockElementScrollPositionUntilNextRender:u}=(0,a.a_)(),c=e=>{const n=e.currentTarget,t=l.indexOf(n),o=i[t].value;o!==r&&(u(n),s(o))},d=e=>{let n=null;switch(e.key){case"Enter":c(e);break;case"ArrowRight":{const t=l.indexOf(e.currentTarget)+1;n=l[t]??l[0];break}case"ArrowLeft":{const t=l.indexOf(e.currentTarget)-1;n=l[t]??l[l.length-1];break}}n?.focus()};return(0,v.jsx)("ul",{role:"tablist","aria-orientation":"horizontal",className:(0,o.A)("tabs",{"tabs--block":t},n),children:i.map((e=>{let{value:n,label:t,attributes:a}=e;return(0,v.jsx)("li",{role:"tab",tabIndex:r===n?0:-1,"aria-selected":r===n,ref:e=>l.push(e),onKeyDown:d,onClick:c,...a,className:(0,o.A)("tabs__item",b.tabItem,a?.className,{"tabs__item--active":r===n}),children:t??n},n)}))})}function j(e){let{lazy:n,children:t,selectedValue:o}=e;const a=(Array.isArray(t)?t:[t]).filter(Boolean);if(n){const e=a.find((e=>e.props.value===o));return e?(0,r.cloneElement)(e,{className:"margin-top--md"}):null}return(0,v.jsx)("div",{className:"margin-top--md",children:a.map(((e,n)=>(0,r.cloneElement)(e,{key:n,hidden:e.props.value!==o})))})}function y(e){const n=m(e);return(0,v.jsxs)("div",{className:(0,o.A)("tabs-container",b.tabList),children:[(0,v.jsx)(x,{...e,...n}),(0,v.jsx)(j,{...e,...n})]})}function w(e){const n=(0,g.A)();return(0,v.jsx)(y,{...e,children:d(e.children)},String(n))}},8453:(e,n,t)=>{t.d(n,{R:()=>s,x:()=>i});var r=t(6540);const o={},a=r.createContext(o);function s(e){const n=r.useContext(a);return r.useMemo((function(){return"function"==typeof e?e(n):{...n,...e}}),[n,e])}function i(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(o):e.components||o:s(e.components),r.createElement(a.Provider,{value:n},e.children)}}}]); \ No newline at end of file diff --git a/assets/js/94350439.292adea4.js b/assets/js/94350439.292adea4.js new file mode 100644 index 00000000..ca81bfe7 --- /dev/null +++ b/assets/js/94350439.292adea4.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunkdocs=self.webpackChunkdocs||[]).push([[9080],{6377:(e,n,t)=>{t.r(n),t.d(n,{assets:()=>i,contentTitle:()=>s,default:()=>d,frontMatter:()=>a,metadata:()=>l,toc:()=>u});var r=t(4848),o=t(8453);t(1470),t(9365);const a={},s="Signal",l={id:"configuration/signal",title:"Signal",description:"Signals are defined as Protobuf RPCs annotated with the temporal.v1.signal method option. They're mapped to workflows using the signal workflow option. See the Signals guide for more usage details.",source:"@site/docs/configuration/signal.mdx",sourceDirName:"configuration",slug:"/configuration/signal",permalink:"/protoc-gen-go-temporal/docs/configuration/signal",draft:!1,unlisted:!1,editUrl:"https://github.com/facebook/docusaurus/tree/main/packages/create-docusaurus/templates/shared/docs/configuration/signal.mdx",tags:[],version:"current",frontMatter:{},sidebar:"docs",previous:{title:"Query",permalink:"/protoc-gen-go-temporal/docs/configuration/query"},next:{title:"Update",permalink:"/protoc-gen-go-temporal/docs/configuration/update"}},i={},u=[{value:"Options",id:"options",level:2},{value:"name",id:"name",level:3},{value:"xns",id:"xns",level:3}];function c(e){const n={a:"a",admonition:"admonition",code:"code",h1:"h1",h2:"h2",h3:"h3",p:"p",pre:"pre",...(0,o.R)(),...e.components};return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(n.h1,{id:"signal",children:"Signal"}),"\n",(0,r.jsxs)(n.p,{children:[(0,r.jsx)(n.a,{href:"https://docs.temporal.io/workflows#signal",children:"Signals"})," are defined as Protobuf RPCs annotated with the ",(0,r.jsx)(n.code,{children:"temporal.v1.signal"})," method option. They're mapped to workflows using the ",(0,r.jsx)(n.a,{href:"/docs/configuration/workflow#signal",children:"signal workflow option"}),". See the ",(0,r.jsx)(n.a,{href:"/docs/guides/signals",children:"Signals guide"})," for more usage details."]}),"\n",(0,r.jsx)(n.admonition,{type:"warning",children:(0,r.jsxs)(n.p,{children:["Signals definitions must use ",(0,r.jsx)(n.code,{children:"google.protobuf.Empty"})," as their return value. This requires an additional ",(0,r.jsx)(n.code,{children:"google/protobuf/empty.proto"})," protobuf import."]})}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-protobuf",metastring:'title="example.proto"',children:'syntax="proto3";\n\npackage example.v1;\n\nimport "google/protobuf/empty.proto";\nimport "temporal/v1/temporal.proto";\n\nservice Example {\n // Hello returns a friendly greeting\n rpc Hello(HelloInput) returns (HelloOutput) {\n option (temporal.v1.workflow) = {\n signal: { ref: \'Ping\' }\n };\n }\n\n // Ping sends a signal to an existing workflow\n rpc Ping(PingInput) returns (google.protobuf.Empty) {\n option (temporal.v1.signal) = {};\n }\n}\n'})}),"\n",(0,r.jsx)(n.h2,{id:"options",children:"Options"}),"\n",(0,r.jsx)(n.h3,{id:"name",children:"name"}),"\n",(0,r.jsx)(n.p,{children:(0,r.jsx)(n.code,{children:"string"})}),"\n",(0,r.jsxs)(n.p,{children:["Fully qualified ",(0,r.jsx)(n.a,{href:"https://docs.temporal.io/workflows#signal",children:"Signal type name"}),". Defaults to protobuf method full name (e.g. ",(0,r.jsx)(n.code,{children:"example.v1.Example.Ping"}),")"]}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-protobuf",children:'service Example {\n rpc Ping(PingInput) returns (google.protobuf.Empty) {\n option (temporal.v1.signal) = {\n name: "Ping"\n };\n }\n}\n'})}),"\n",(0,r.jsx)(n.h3,{id:"xns",children:"xns"}),"\n",(0,r.jsx)(n.p,{children:(0,r.jsx)(n.a,{href:"https://buf.build/cludden/protoc-gen-go-temporal/docs/main:temporal.v1#temporal.v1.XNSActivityOptions",children:"temporal.v1.XNSActivityOptions"})}),"\n",(0,r.jsxs)(n.p,{children:["Used to configure ",(0,r.jsx)(n.a,{href:"/docs/guides/xns",children:"cross-namespace"})," activity options."]}),"\n",(0,r.jsx)(n.admonition,{type:"note",children:(0,r.jsxs)(n.p,{children:["This requires the ",(0,r.jsx)(n.a,{href:"/docs/configuration/plugin",children:"enable-xns"})," plugin option to be enabled."]})}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-protobuf",children:"service Example {\n rpc Ping(PingInput) returns (google.protobuf.Empty) {\n option (temporal.v1.signal) = {\n xns: {\n heartbeat_timeout: { seconds: 30 }\n heartbeat_interval: { seconds: 10 }\n start_to_close_timeout: { seconds: 300 }\n }\n };\n }\n}\n"})})]})}function d(e={}){const{wrapper:n}={...(0,o.R)(),...e.components};return n?(0,r.jsx)(n,{...e,children:(0,r.jsx)(c,{...e})}):c(e)}},9365:(e,n,t)=>{t.d(n,{A:()=>s});t(6540);var r=t(4164);const o={tabItem:"tabItem_Ymn6"};var a=t(4848);function s(e){let{children:n,hidden:t,className:s}=e;return(0,a.jsx)("div",{role:"tabpanel",className:(0,r.A)(o.tabItem,s),hidden:t,children:n})}},1470:(e,n,t)=>{t.d(n,{A:()=>w});var r=t(6540),o=t(4164),a=t(3104),s=t(6347),l=t(205),i=t(7485),u=t(1682),c=t(9466);function d(e){return r.Children.toArray(e).filter((e=>"\n"!==e)).map((e=>{if(!e||(0,r.isValidElement)(e)&&function(e){const{props:n}=e;return!!n&&"object"==typeof n&&"value"in n}(e))return e;throw new Error(`Docusaurus error: Bad child <${"string"==typeof e.type?e.type:e.type.name}>: all children of the component should be , and every should have a unique "value" prop.`)}))?.filter(Boolean)??[]}function p(e){const{values:n,children:t}=e;return(0,r.useMemo)((()=>{const e=n??function(e){return d(e).map((e=>{let{props:{value:n,label:t,attributes:r,default:o}}=e;return{value:n,label:t,attributes:r,default:o}}))}(t);return function(e){const n=(0,u.X)(e,((e,n)=>e.value===n.value));if(n.length>0)throw new Error(`Docusaurus error: Duplicate values "${n.map((e=>e.value)).join(", ")}" found in . Every value needs to be unique.`)}(e),e}),[n,t])}function h(e){let{value:n,tabValues:t}=e;return t.some((e=>e.value===n))}function g(e){let{queryString:n=!1,groupId:t}=e;const o=(0,s.W6)(),a=function(e){let{queryString:n=!1,groupId:t}=e;if("string"==typeof n)return n;if(!1===n)return null;if(!0===n&&!t)throw new Error('Docusaurus error: The component groupId prop is required if queryString=true, because this value is used as the search param name. You can also provide an explicit value such as queryString="my-search-param".');return t??null}({queryString:n,groupId:t});return[(0,i.aZ)(a),(0,r.useCallback)((e=>{if(!a)return;const n=new URLSearchParams(o.location.search);n.set(a,e),o.replace({...o.location,search:n.toString()})}),[a,o])]}function m(e){const{defaultValue:n,queryString:t=!1,groupId:o}=e,a=p(e),[s,i]=(0,r.useState)((()=>function(e){let{defaultValue:n,tabValues:t}=e;if(0===t.length)throw new Error("Docusaurus error: the component requires at least one children component");if(n){if(!h({value:n,tabValues:t}))throw new Error(`Docusaurus error: The has a defaultValue "${n}" but none of its children has the corresponding value. Available values are: ${t.map((e=>e.value)).join(", ")}. If you intend to show no default tab, use defaultValue={null} instead.`);return n}const r=t.find((e=>e.default))??t[0];if(!r)throw new Error("Unexpected error: 0 tabValues");return r.value}({defaultValue:n,tabValues:a}))),[u,d]=g({queryString:t,groupId:o}),[m,f]=function(e){let{groupId:n}=e;const t=function(e){return e?`docusaurus.tab.${e}`:null}(n),[o,a]=(0,c.Dv)(t);return[o,(0,r.useCallback)((e=>{t&&a.set(e)}),[t,a])]}({groupId:o}),b=(()=>{const e=u??m;return h({value:e,tabValues:a})?e:null})();(0,l.A)((()=>{b&&i(b)}),[b]);return{selectedValue:s,selectValue:(0,r.useCallback)((e=>{if(!h({value:e,tabValues:a}))throw new Error(`Can't select invalid tab value=${e}`);i(e),d(e),f(e)}),[d,f,a]),tabValues:a}}var f=t(2303);const b={tabList:"tabList__CuJ",tabItem:"tabItem_LNqP"};var v=t(4848);function x(e){let{className:n,block:t,selectedValue:r,selectValue:s,tabValues:l}=e;const i=[],{blockElementScrollPositionUntilNextRender:u}=(0,a.a_)(),c=e=>{const n=e.currentTarget,t=i.indexOf(n),o=l[t].value;o!==r&&(u(n),s(o))},d=e=>{let n=null;switch(e.key){case"Enter":c(e);break;case"ArrowRight":{const t=i.indexOf(e.currentTarget)+1;n=i[t]??i[0];break}case"ArrowLeft":{const t=i.indexOf(e.currentTarget)-1;n=i[t]??i[i.length-1];break}}n?.focus()};return(0,v.jsx)("ul",{role:"tablist","aria-orientation":"horizontal",className:(0,o.A)("tabs",{"tabs--block":t},n),children:l.map((e=>{let{value:n,label:t,attributes:a}=e;return(0,v.jsx)("li",{role:"tab",tabIndex:r===n?0:-1,"aria-selected":r===n,ref:e=>i.push(e),onKeyDown:d,onClick:c,...a,className:(0,o.A)("tabs__item",b.tabItem,a?.className,{"tabs__item--active":r===n}),children:t??n},n)}))})}function j(e){let{lazy:n,children:t,selectedValue:o}=e;const a=(Array.isArray(t)?t:[t]).filter(Boolean);if(n){const e=a.find((e=>e.props.value===o));return e?(0,r.cloneElement)(e,{className:"margin-top--md"}):null}return(0,v.jsx)("div",{className:"margin-top--md",children:a.map(((e,n)=>(0,r.cloneElement)(e,{key:n,hidden:e.props.value!==o})))})}function y(e){const n=m(e);return(0,v.jsxs)("div",{className:(0,o.A)("tabs-container",b.tabList),children:[(0,v.jsx)(x,{...e,...n}),(0,v.jsx)(j,{...e,...n})]})}function w(e){const n=(0,f.A)();return(0,v.jsx)(y,{...e,children:d(e.children)},String(n))}},8453:(e,n,t)=>{t.d(n,{R:()=>s,x:()=>l});var r=t(6540);const o={},a=r.createContext(o);function s(e){const n=r.useContext(a);return r.useMemo((function(){return"function"==typeof e?e(n):{...n,...e}}),[n,e])}function l(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(o):e.components||o:s(e.components),r.createElement(a.Provider,{value:n},e.children)}}}]); \ No newline at end of file diff --git a/assets/js/956a4e1f.924daeed.js b/assets/js/956a4e1f.924daeed.js new file mode 100644 index 00000000..de68ae7b --- /dev/null +++ b/assets/js/956a4e1f.924daeed.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunkdocs=self.webpackChunkdocs||[]).push([[5570],{7252:(e,n,l)=>{l.r(n),l.d(n,{assets:()=>u,contentTitle:()=>c,default:()=>h,frontMatter:()=>s,metadata:()=>i,toc:()=>d});var t=l(4848),a=l(8453),r=l(1470),o=l(9365);const s={},c="Plugin",i={id:"configuration/plugin",title:"Plugin",description:"Plugin options are used to globally configure this plugin's behavior at runtime.",source:"@site/docs/configuration/plugin.mdx",sourceDirName:"configuration",slug:"/configuration/plugin",permalink:"/protoc-gen-go-temporal/docs/configuration/plugin",draft:!1,unlisted:!1,editUrl:"https://github.com/facebook/docusaurus/tree/main/packages/create-docusaurus/templates/shared/docs/configuration/plugin.mdx",tags:[],version:"current",frontMatter:{},sidebar:"docs",previous:{title:"Getting Started",permalink:"/protoc-gen-go-temporal/docs/getting-started"},next:{title:"Service",permalink:"/protoc-gen-go-temporal/docs/configuration/service"}},u={},d=[{value:"Options",id:"options",level:2},{value:"cli-categories",id:"cli-categories",level:3},{value:"cli-enabled",id:"cli-enabled",level:3},{value:"disable-workflow-input-rename",id:"disable-workflow-input-rename",level:3},{value:"docs-out",id:"docs-out",level:3},{value:"docs-template",id:"docs-template",level:3},{value:"enable-codec",id:"enable-codec",level:3},{value:"enable-patch-support",id:"enable-patch-support",level:3},{value:"enable-xns",id:"enable-xns",level:3},{value:"workflow-update-enabled",id:"workflow-update-enabled",level:3}];function p(e){const n={a:"a",admonition:"admonition",code:"code",h1:"h1",h2:"h2",h3:"h3",p:"p",pre:"pre",...(0,a.R)(),...e.components};return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(n.h1,{id:"plugin",children:"Plugin"}),"\n",(0,t.jsx)(n.p,{children:"Plugin options are used to globally configure this plugin's behavior at runtime."}),"\n",(0,t.jsxs)(r.A,{children:[(0,t.jsx)(o.A,{value:"buf",label:"Buf",children:(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-yaml",metastring:'title="buf.gen.yaml"',children:"plugins:\n - plugin: go_temporal\n out: gen\n opt: =,=\n strategy: all\n"})})}),(0,t.jsx)(o.A,{value:"protoc",label:"Protoc",children:(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-shell",children:"--go_temporal_opt==,=\n"})})})]}),"\n",(0,t.jsx)(n.h2,{id:"options",children:"Options"}),"\n",(0,t.jsx)(n.h3,{id:"cli-categories",children:"cli-categories"}),"\n",(0,t.jsx)(n.p,{children:(0,t.jsx)(n.code,{children:"bool"})}),"\n",(0,t.jsxs)(n.p,{children:["Enables ",(0,t.jsx)(n.a,{href:"https://cli.urfave.org/v2/examples/subcommands-categories/",children:"cli categories"})," for grouping workflow, query, signal, and update commands."]}),"\n",(0,t.jsx)(n.admonition,{type:"info",children:(0,t.jsxs)(n.p,{children:["Requires the ",(0,t.jsx)(n.a,{href:"#cli-enabled",children:"cli-categories"})," plugin option to be enabled."]})}),"\n",(0,t.jsxs)(r.A,{children:[(0,t.jsx)(o.A,{value:"cli-categories-buf",label:"Buf",children:(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-yaml",metastring:'title="buf.gen.yaml"',children:"plugins:\n - plugin: go_temporal\n out: gen\n opt: cli-enabled=true,cli-categories=true\n strategy: all\n"})})}),(0,t.jsx)(o.A,{value:"cli-categories-protoc",label:"Protoc",children:(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-sh",children:"protoc --go_temporal_opt=cli-enabled=true,cli-categories=true\n"})})})]}),"\n",(0,t.jsx)(n.h3,{id:"cli-enabled",children:"cli-enabled"}),"\n",(0,t.jsx)(n.p,{children:(0,t.jsx)(n.code,{children:"bool"})}),"\n",(0,t.jsxs)(n.p,{children:["Enables ",(0,t.jsx)(n.a,{href:"/docs/guides/cli",children:"cli generation"}),"."]}),"\n",(0,t.jsxs)(r.A,{children:[(0,t.jsx)(o.A,{value:"cli-enabled-buf",label:"Buf",children:(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-yaml",metastring:'title="buf.gen.yaml"',children:"plugins:\n - plugin: go_temporal\n out: gen\n opt: cli-enabled=true\n strategy: all\n"})})}),(0,t.jsx)(o.A,{value:"cli-enabled-protoc",label:"Protoc",children:(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-sh",children:"protoc --go_temporal_opt=cli-enabled=true\n"})})})]}),"\n",(0,t.jsx)(n.h3,{id:"disable-workflow-input-rename",children:"disable-workflow-input-rename"}),"\n",(0,t.jsx)(n.p,{children:(0,t.jsx)(n.code,{children:"bool"})}),"\n",(0,t.jsxs)(n.p,{children:["Prior to ",(0,t.jsx)(n.a,{href:"https://github.com/cludden/protoc-gen-go-temporal/releases/tag/v1.3.0",children:"v1.3.0"}),", the generated workflow input struct used the ",(0,t.jsx)(n.code,{children:"Input"})," naming convention. This caused conflicts with workflow definitions that used input messages with the same naming convetion. In ",(0,t.jsx)(n.code,{children:"v1.3.0"}),", the naming convention for the generated workflow input struct was changed to ",(0,t.jsx)(n.code,{children:"WorkflowInput"}),". In order to continue to support schemas using the old convention, this option was added to enable the old naming convention."]}),"\n",(0,t.jsxs)(r.A,{children:[(0,t.jsx)(o.A,{value:"disable-workflow-input-rename-buf",label:"Buf",children:(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-yaml",metastring:'title="buf.gen.yaml"',children:"plugins:\n - plugin: go_temporal\n out: gen\n opt: disable-workflow-input-rename=true\n strategy: all\n"})})}),(0,t.jsx)(o.A,{value:"disable-workflow-input-rename-protoc",label:"Protoc",children:(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-sh",children:"protoc --go_temporal_opt=disable-workflow-input-rename=true\n"})})})]}),"\n",(0,t.jsx)(n.h3,{id:"docs-out",children:"docs-out"}),"\n",(0,t.jsx)(n.p,{children:(0,t.jsx)(n.code,{children:"string"})}),"\n",(0,t.jsxs)(n.p,{children:["Enables ",(0,t.jsx)(n.a,{href:"/docs/guides/documentation",children:"doc generation"})," by specifying the output path."]}),"\n",(0,t.jsxs)(r.A,{children:[(0,t.jsx)(o.A,{value:"docs-out-buf",label:"Buf",children:(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-yaml",metastring:'title="buf.gen.yaml"',children:"plugins:\n - plugin: go_temporal\n out: gen\n opt: docs-out=./proto/README.md\n strategy: all\n"})})}),(0,t.jsx)(o.A,{value:"docs-out-protoc",label:"Protoc",children:(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-sh",children:"protoc --go_temporal_opt=docs-out=./proto/README.md\n"})})})]}),"\n",(0,t.jsx)(n.h3,{id:"docs-template",children:"docs-template"}),"\n",(0,t.jsx)(n.p,{children:(0,t.jsx)(n.code,{children:"string"})}),"\n",(0,t.jsxs)(n.p,{children:["Specifies the path to a custom template to use for generated documentation. See the ",(0,t.jsx)(n.a,{href:"/docs/guides/documentation",children:"guide"})," for more details."]}),"\n",(0,t.jsx)(n.admonition,{type:"info",children:(0,t.jsxs)(n.p,{children:["Requires the ",(0,t.jsx)(n.a,{href:"#docs-out",children:"docs-out"})," plugin option to be defined."]})}),"\n",(0,t.jsxs)(r.A,{children:[(0,t.jsx)(o.A,{value:"docs-template-buf",label:"Buf",children:(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-yaml",metastring:'title="buf.gen.yaml"',children:"plugins:\n - plugin: go_temporal\n out: gen\n opt: docs-out=./proto/README.md,docs-template=./docs/custom.tpl\n strategy: all\n"})})}),(0,t.jsx)(o.A,{value:"docs-template-protoc",label:"Protoc",children:(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-sh",children:"protoc --go_temporal_opt=docs-out=./proto/README.md,docs-template=./docs/custom.tpl\n"})})})]}),"\n",(0,t.jsx)(n.h3,{id:"enable-codec",children:"enable-codec"}),"\n",(0,t.jsx)(n.p,{children:(0,t.jsx)(n.code,{children:"bool"})}),"\n",(0,t.jsxs)(n.p,{children:["Enables ",(0,t.jsx)(n.a,{href:"/docs/guides/codec-server",children:"codec server generation"})]}),"\n",(0,t.jsxs)(r.A,{children:[(0,t.jsx)(o.A,{value:"enable-codec-buf",label:"Buf",children:(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-yaml",metastring:'title="buf.gen.yaml"',children:"plugins:\n - plugin: go_temporal\n out: gen\n opt: enable-codec=true\n strategy: all\n"})})}),(0,t.jsx)(o.A,{value:"enable-codec-protoc",label:"Protoc",children:(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-sh",children:"protoc --go_temporal_opt=enable-codec=true\n"})})})]}),"\n",(0,t.jsx)(n.h3,{id:"enable-patch-support",children:"enable-patch-support"}),"\n",(0,t.jsx)(n.p,{children:(0,t.jsx)(n.code,{children:"bool"})}),"\n",(0,t.jsxs)(n.p,{children:["Enables support for ",(0,t.jsx)(n.a,{href:"https://github.com/alta/protopatch",children:"protoc-gen-go-patch"})]}),"\n",(0,t.jsxs)(r.A,{children:[(0,t.jsx)(o.A,{value:"enable-patch-support-buf",label:"Buf",children:(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-yaml",metastring:'title="buf.gen.yaml"',children:"plugins:\n - plugin: go_temporal\n out: gen\n opt: enable-patch-support=true\n strategy: all\n"})})}),(0,t.jsx)(o.A,{value:"enable-patch-support-protoc",label:"Protoc",children:(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-sh",children:"protoc --go_temporal_opt=enable-patch-support=true\n"})})})]}),"\n",(0,t.jsx)(n.h3,{id:"enable-xns",children:"enable-xns"}),"\n",(0,t.jsx)(n.p,{children:(0,t.jsx)(n.code,{children:"bool"})}),"\n",(0,t.jsxs)(n.p,{children:["Enables ",(0,t.jsx)(n.a,{href:"/docs/guides/xns",children:"xns generation"})]}),"\n",(0,t.jsxs)(r.A,{children:[(0,t.jsx)(o.A,{value:"enable-xns-buf",label:"Buf",children:(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-yaml",metastring:'title="buf.gen.yaml"',children:"plugins:\n - plugin: go_temporal\n out: gen\n opt: enable-xns=true\n strategy: all\n"})})}),(0,t.jsx)(o.A,{value:"enable-xns-protoc",label:"Protoc",children:(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-sh",children:"protoc --go_temporal_opt=enable-xns=true\n"})})})]}),"\n",(0,t.jsx)(n.h3,{id:"workflow-update-enabled",children:"workflow-update-enabled"}),"\n",(0,t.jsx)(n.p,{children:(0,t.jsx)(n.code,{children:"bool"})}),"\n",(0,t.jsxs)(n.p,{children:["Enables ",(0,t.jsx)(n.a,{href:"/docs/guides/updates",children:"update support"})]}),"\n",(0,t.jsxs)(r.A,{children:[(0,t.jsx)(o.A,{value:"workflow-update-enabled-buf",label:"Buf",children:(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-yaml",metastring:'title="buf.gen.yaml"',children:"plugins:\n - plugin: go_temporal\n out: gen\n opt: workflow-update-enabled=true\n strategy: all\n"})})}),(0,t.jsx)(o.A,{value:"workflow-update-enabled-protoc",label:"Protoc",children:(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-sh",children:"protoc --go_temporal_opt=workflow-update-enabled=true\n"})})})]})]})}function h(e={}){const{wrapper:n}={...(0,a.R)(),...e.components};return n?(0,t.jsx)(n,{...e,children:(0,t.jsx)(p,{...e})}):p(e)}},9365:(e,n,l)=>{l.d(n,{A:()=>o});l(6540);var t=l(4164);const a={tabItem:"tabItem_Ymn6"};var r=l(4848);function o(e){let{children:n,hidden:l,className:o}=e;return(0,r.jsx)("div",{role:"tabpanel",className:(0,t.A)(a.tabItem,o),hidden:l,children:n})}},1470:(e,n,l)=>{l.d(n,{A:()=>y});var t=l(6540),a=l(4164),r=l(3104),o=l(6347),s=l(205),c=l(7485),i=l(1682),u=l(9466);function d(e){return t.Children.toArray(e).filter((e=>"\n"!==e)).map((e=>{if(!e||(0,t.isValidElement)(e)&&function(e){const{props:n}=e;return!!n&&"object"==typeof n&&"value"in n}(e))return e;throw new Error(`Docusaurus error: Bad child <${"string"==typeof e.type?e.type:e.type.name}>: all children of the component should be , and every should have a unique "value" prop.`)}))?.filter(Boolean)??[]}function p(e){const{values:n,children:l}=e;return(0,t.useMemo)((()=>{const e=n??function(e){return d(e).map((e=>{let{props:{value:n,label:l,attributes:t,default:a}}=e;return{value:n,label:l,attributes:t,default:a}}))}(l);return function(e){const n=(0,i.X)(e,((e,n)=>e.value===n.value));if(n.length>0)throw new Error(`Docusaurus error: Duplicate values "${n.map((e=>e.value)).join(", ")}" found in . Every value needs to be unique.`)}(e),e}),[n,l])}function h(e){let{value:n,tabValues:l}=e;return l.some((e=>e.value===n))}function g(e){let{queryString:n=!1,groupId:l}=e;const a=(0,o.W6)(),r=function(e){let{queryString:n=!1,groupId:l}=e;if("string"==typeof n)return n;if(!1===n)return null;if(!0===n&&!l)throw new Error('Docusaurus error: The component groupId prop is required if queryString=true, because this value is used as the search param name. You can also provide an explicit value such as queryString="my-search-param".');return l??null}({queryString:n,groupId:l});return[(0,c.aZ)(r),(0,t.useCallback)((e=>{if(!r)return;const n=new URLSearchParams(a.location.search);n.set(r,e),a.replace({...a.location,search:n.toString()})}),[r,a])]}function m(e){const{defaultValue:n,queryString:l=!1,groupId:a}=e,r=p(e),[o,c]=(0,t.useState)((()=>function(e){let{defaultValue:n,tabValues:l}=e;if(0===l.length)throw new Error("Docusaurus error: the component requires at least one children component");if(n){if(!h({value:n,tabValues:l}))throw new Error(`Docusaurus error: The has a defaultValue "${n}" but none of its children has the corresponding value. Available values are: ${l.map((e=>e.value)).join(", ")}. If you intend to show no default tab, use defaultValue={null} instead.`);return n}const t=l.find((e=>e.default))??l[0];if(!t)throw new Error("Unexpected error: 0 tabValues");return t.value}({defaultValue:n,tabValues:r}))),[i,d]=g({queryString:l,groupId:a}),[m,b]=function(e){let{groupId:n}=e;const l=function(e){return e?`docusaurus.tab.${e}`:null}(n),[a,r]=(0,u.Dv)(l);return[a,(0,t.useCallback)((e=>{l&&r.set(e)}),[l,r])]}({groupId:a}),f=(()=>{const e=i??m;return h({value:e,tabValues:r})?e:null})();(0,s.A)((()=>{f&&c(f)}),[f]);return{selectedValue:o,selectValue:(0,t.useCallback)((e=>{if(!h({value:e,tabValues:r}))throw new Error(`Can't select invalid tab value=${e}`);c(e),d(e),b(e)}),[d,b,r]),tabValues:r}}var b=l(2303);const f={tabList:"tabList__CuJ",tabItem:"tabItem_LNqP"};var x=l(4848);function j(e){let{className:n,block:l,selectedValue:t,selectValue:o,tabValues:s}=e;const c=[],{blockElementScrollPositionUntilNextRender:i}=(0,r.a_)(),u=e=>{const n=e.currentTarget,l=c.indexOf(n),a=s[l].value;a!==t&&(i(n),o(a))},d=e=>{let n=null;switch(e.key){case"Enter":u(e);break;case"ArrowRight":{const l=c.indexOf(e.currentTarget)+1;n=c[l]??c[0];break}case"ArrowLeft":{const l=c.indexOf(e.currentTarget)-1;n=c[l]??c[c.length-1];break}}n?.focus()};return(0,x.jsx)("ul",{role:"tablist","aria-orientation":"horizontal",className:(0,a.A)("tabs",{"tabs--block":l},n),children:s.map((e=>{let{value:n,label:l,attributes:r}=e;return(0,x.jsx)("li",{role:"tab",tabIndex:t===n?0:-1,"aria-selected":t===n,ref:e=>c.push(e),onKeyDown:d,onClick:u,...r,className:(0,a.A)("tabs__item",f.tabItem,r?.className,{"tabs__item--active":t===n}),children:l??n},n)}))})}function v(e){let{lazy:n,children:l,selectedValue:a}=e;const r=(Array.isArray(l)?l:[l]).filter(Boolean);if(n){const e=r.find((e=>e.props.value===a));return e?(0,t.cloneElement)(e,{className:"margin-top--md"}):null}return(0,x.jsx)("div",{className:"margin-top--md",children:r.map(((e,n)=>(0,t.cloneElement)(e,{key:n,hidden:e.props.value!==a})))})}function w(e){const n=m(e);return(0,x.jsxs)("div",{className:(0,a.A)("tabs-container",f.tabList),children:[(0,x.jsx)(j,{...e,...n}),(0,x.jsx)(v,{...e,...n})]})}function y(e){const n=(0,b.A)();return(0,x.jsx)(w,{...e,children:d(e.children)},String(n))}},8453:(e,n,l)=>{l.d(n,{R:()=>o,x:()=>s});var t=l(6540);const a={},r=t.createContext(a);function o(e){const n=t.useContext(r);return t.useMemo((function(){return"function"==typeof e?e(n):{...n,...e}}),[n,e])}function s(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(a):e.components||a:o(e.components),t.createElement(r.Provider,{value:n},e.children)}}}]); \ No newline at end of file diff --git a/assets/js/956a4e1f.f7a55fd6.js b/assets/js/956a4e1f.f7a55fd6.js deleted file mode 100644 index 1ed25dac..00000000 --- a/assets/js/956a4e1f.f7a55fd6.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunkdocs=self.webpackChunkdocs||[]).push([[5570],{7252:(e,n,l)=>{l.r(n),l.d(n,{assets:()=>u,contentTitle:()=>i,default:()=>h,frontMatter:()=>s,metadata:()=>c,toc:()=>d});var t=l(4848),a=l(8453),r=l(1470),o=l(9365);const s={},i="Plugin",c={id:"configuration/plugin",title:"Plugin",description:"Plugin options are used to globally configure this plugin's behavior at runtime.",source:"@site/docs/configuration/plugin.mdx",sourceDirName:"configuration",slug:"/configuration/plugin",permalink:"/docs/configuration/plugin",draft:!1,unlisted:!1,editUrl:"https://github.com/facebook/docusaurus/tree/main/packages/create-docusaurus/templates/shared/docs/configuration/plugin.mdx",tags:[],version:"current",frontMatter:{},sidebar:"docs",previous:{title:"Getting Started",permalink:"/docs/getting-started"},next:{title:"Service",permalink:"/docs/configuration/service"}},u={},d=[{value:"Options",id:"options",level:2},{value:"cli-categories",id:"cli-categories",level:3},{value:"cli-enabled",id:"cli-enabled",level:3},{value:"disable-workflow-input-rename",id:"disable-workflow-input-rename",level:3},{value:"docs-out",id:"docs-out",level:3},{value:"docs-template",id:"docs-template",level:3},{value:"enable-codec",id:"enable-codec",level:3},{value:"enable-patch-support",id:"enable-patch-support",level:3},{value:"enable-xns",id:"enable-xns",level:3},{value:"workflow-update-enabled",id:"workflow-update-enabled",level:3}];function p(e){const n={a:"a",admonition:"admonition",code:"code",h1:"h1",h2:"h2",h3:"h3",p:"p",pre:"pre",...(0,a.R)(),...e.components};return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(n.h1,{id:"plugin",children:"Plugin"}),"\n",(0,t.jsx)(n.p,{children:"Plugin options are used to globally configure this plugin's behavior at runtime."}),"\n",(0,t.jsxs)(r.A,{children:[(0,t.jsx)(o.A,{value:"buf",label:"Buf",children:(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-yaml",metastring:'title="buf.gen.yaml"',children:"plugins:\n - plugin: go_temporal\n out: gen\n opt: =,=\n strategy: all\n"})})}),(0,t.jsx)(o.A,{value:"protoc",label:"Protoc",children:(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-shell",children:"--go_temporal_opt==,=\n"})})})]}),"\n",(0,t.jsx)(n.h2,{id:"options",children:"Options"}),"\n",(0,t.jsx)(n.h3,{id:"cli-categories",children:"cli-categories"}),"\n",(0,t.jsx)(n.p,{children:(0,t.jsx)(n.code,{children:"bool"})}),"\n",(0,t.jsxs)(n.p,{children:["Enables ",(0,t.jsx)(n.a,{href:"https://cli.urfave.org/v2/examples/subcommands-categories/",children:"cli categories"})," for grouping workflow, query, signal, and update commands."]}),"\n",(0,t.jsx)(n.admonition,{type:"info",children:(0,t.jsxs)(n.p,{children:["Requires the ",(0,t.jsx)(n.a,{href:"#cli-enabled",children:"cli-categories"})," plugin option to be enabled."]})}),"\n",(0,t.jsxs)(r.A,{children:[(0,t.jsx)(o.A,{value:"cli-categories-buf",label:"Buf",children:(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-yaml",metastring:'title="buf.gen.yaml"',children:"plugins:\n - plugin: go_temporal\n out: gen\n opt: cli-enabled=true,cli-categories=true\n strategy: all\n"})})}),(0,t.jsx)(o.A,{value:"cli-categories-protoc",label:"Protoc",children:(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-sh",children:"protoc --go_temporal_opt=cli-enabled=true,cli-categories=true\n"})})})]}),"\n",(0,t.jsx)(n.h3,{id:"cli-enabled",children:"cli-enabled"}),"\n",(0,t.jsx)(n.p,{children:(0,t.jsx)(n.code,{children:"bool"})}),"\n",(0,t.jsxs)(n.p,{children:["Enables ",(0,t.jsx)(n.a,{href:"/docs/guides/cli",children:"cli generation"}),"."]}),"\n",(0,t.jsxs)(r.A,{children:[(0,t.jsx)(o.A,{value:"cli-enabled-buf",label:"Buf",children:(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-yaml",metastring:'title="buf.gen.yaml"',children:"plugins:\n - plugin: go_temporal\n out: gen\n opt: cli-enabled=true\n strategy: all\n"})})}),(0,t.jsx)(o.A,{value:"cli-enabled-protoc",label:"Protoc",children:(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-sh",children:"protoc --go_temporal_opt=cli-enabled=true\n"})})})]}),"\n",(0,t.jsx)(n.h3,{id:"disable-workflow-input-rename",children:"disable-workflow-input-rename"}),"\n",(0,t.jsx)(n.p,{children:(0,t.jsx)(n.code,{children:"bool"})}),"\n",(0,t.jsxs)(n.p,{children:["Prior to ",(0,t.jsx)(n.a,{href:"https://github.com/cludden/protoc-gen-go-temporal/releases/tag/v1.3.0",children:"v1.3.0"}),", the generated workflow input struct used the ",(0,t.jsx)(n.code,{children:"Input"})," naming convention. This caused conflicts with workflow definitions that used input messages with the same naming convetion. In ",(0,t.jsx)(n.code,{children:"v1.3.0"}),", the naming convention for the generated workflow input struct was changed to ",(0,t.jsx)(n.code,{children:"WorkflowInput"}),". In order to continue to support schemas using the old convention, this option was added to enable the old naming convention."]}),"\n",(0,t.jsxs)(r.A,{children:[(0,t.jsx)(o.A,{value:"disable-workflow-input-rename-buf",label:"Buf",children:(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-yaml",metastring:'title="buf.gen.yaml"',children:"plugins:\n - plugin: go_temporal\n out: gen\n opt: disable-workflow-input-rename=true\n strategy: all\n"})})}),(0,t.jsx)(o.A,{value:"disable-workflow-input-rename-protoc",label:"Protoc",children:(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-sh",children:"protoc --go_temporal_opt=disable-workflow-input-rename=true\n"})})})]}),"\n",(0,t.jsx)(n.h3,{id:"docs-out",children:"docs-out"}),"\n",(0,t.jsx)(n.p,{children:(0,t.jsx)(n.code,{children:"string"})}),"\n",(0,t.jsxs)(n.p,{children:["Enables ",(0,t.jsx)(n.a,{href:"/docs/guides/documentation",children:"doc generation"})," by specifying the output path."]}),"\n",(0,t.jsxs)(r.A,{children:[(0,t.jsx)(o.A,{value:"docs-out-buf",label:"Buf",children:(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-yaml",metastring:'title="buf.gen.yaml"',children:"plugins:\n - plugin: go_temporal\n out: gen\n opt: docs-out=./proto/README.md\n strategy: all\n"})})}),(0,t.jsx)(o.A,{value:"docs-out-protoc",label:"Protoc",children:(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-sh",children:"protoc --go_temporal_opt=docs-out=./proto/README.md\n"})})})]}),"\n",(0,t.jsx)(n.h3,{id:"docs-template",children:"docs-template"}),"\n",(0,t.jsx)(n.p,{children:(0,t.jsx)(n.code,{children:"string"})}),"\n",(0,t.jsxs)(n.p,{children:["Specifies the path to a custom template to use for generated documentation. See the ",(0,t.jsx)(n.a,{href:"/docs/guides/documentation",children:"guide"})," for more details."]}),"\n",(0,t.jsx)(n.admonition,{type:"info",children:(0,t.jsxs)(n.p,{children:["Requires the ",(0,t.jsx)(n.a,{href:"#docs-out",children:"docs-out"})," plugin option to be defined."]})}),"\n",(0,t.jsxs)(r.A,{children:[(0,t.jsx)(o.A,{value:"docs-template-buf",label:"Buf",children:(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-yaml",metastring:'title="buf.gen.yaml"',children:"plugins:\n - plugin: go_temporal\n out: gen\n opt: docs-out=./proto/README.md,docs-template=./docs/custom.tpl\n strategy: all\n"})})}),(0,t.jsx)(o.A,{value:"docs-template-protoc",label:"Protoc",children:(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-sh",children:"protoc --go_temporal_opt=docs-out=./proto/README.md,docs-template=./docs/custom.tpl\n"})})})]}),"\n",(0,t.jsx)(n.h3,{id:"enable-codec",children:"enable-codec"}),"\n",(0,t.jsx)(n.p,{children:(0,t.jsx)(n.code,{children:"bool"})}),"\n",(0,t.jsxs)(n.p,{children:["Enables ",(0,t.jsx)(n.a,{href:"/docs/guides/codec-server",children:"codec server generation"})]}),"\n",(0,t.jsxs)(r.A,{children:[(0,t.jsx)(o.A,{value:"enable-codec-buf",label:"Buf",children:(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-yaml",metastring:'title="buf.gen.yaml"',children:"plugins:\n - plugin: go_temporal\n out: gen\n opt: enable-codec=true\n strategy: all\n"})})}),(0,t.jsx)(o.A,{value:"enable-codec-protoc",label:"Protoc",children:(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-sh",children:"protoc --go_temporal_opt=enable-codec=true\n"})})})]}),"\n",(0,t.jsx)(n.h3,{id:"enable-patch-support",children:"enable-patch-support"}),"\n",(0,t.jsx)(n.p,{children:(0,t.jsx)(n.code,{children:"bool"})}),"\n",(0,t.jsxs)(n.p,{children:["Enables support for ",(0,t.jsx)(n.a,{href:"https://github.com/alta/protopatch",children:"protoc-gen-go-patch"})]}),"\n",(0,t.jsxs)(r.A,{children:[(0,t.jsx)(o.A,{value:"enable-patch-support-buf",label:"Buf",children:(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-yaml",metastring:'title="buf.gen.yaml"',children:"plugins:\n - plugin: go_temporal\n out: gen\n opt: enable-patch-support=true\n strategy: all\n"})})}),(0,t.jsx)(o.A,{value:"enable-patch-support-protoc",label:"Protoc",children:(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-sh",children:"protoc --go_temporal_opt=enable-patch-support=true\n"})})})]}),"\n",(0,t.jsx)(n.h3,{id:"enable-xns",children:"enable-xns"}),"\n",(0,t.jsx)(n.p,{children:(0,t.jsx)(n.code,{children:"bool"})}),"\n",(0,t.jsxs)(n.p,{children:["Enables ",(0,t.jsx)(n.a,{href:"/docs/guides/xns",children:"xns generation"})]}),"\n",(0,t.jsxs)(r.A,{children:[(0,t.jsx)(o.A,{value:"enable-xns-buf",label:"Buf",children:(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-yaml",metastring:'title="buf.gen.yaml"',children:"plugins:\n - plugin: go_temporal\n out: gen\n opt: enable-xns=true\n strategy: all\n"})})}),(0,t.jsx)(o.A,{value:"enable-xns-protoc",label:"Protoc",children:(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-sh",children:"protoc --go_temporal_opt=enable-xns=true\n"})})})]}),"\n",(0,t.jsx)(n.h3,{id:"workflow-update-enabled",children:"workflow-update-enabled"}),"\n",(0,t.jsx)(n.p,{children:(0,t.jsx)(n.code,{children:"bool"})}),"\n",(0,t.jsxs)(n.p,{children:["Enables ",(0,t.jsx)(n.a,{href:"/docs/guides/updates",children:"update support"})]}),"\n",(0,t.jsxs)(r.A,{children:[(0,t.jsx)(o.A,{value:"workflow-update-enabled-buf",label:"Buf",children:(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-yaml",metastring:'title="buf.gen.yaml"',children:"plugins:\n - plugin: go_temporal\n out: gen\n opt: workflow-update-enabled=true\n strategy: all\n"})})}),(0,t.jsx)(o.A,{value:"workflow-update-enabled-protoc",label:"Protoc",children:(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-sh",children:"protoc --go_temporal_opt=workflow-update-enabled=true\n"})})})]})]})}function h(e={}){const{wrapper:n}={...(0,a.R)(),...e.components};return n?(0,t.jsx)(n,{...e,children:(0,t.jsx)(p,{...e})}):p(e)}},9365:(e,n,l)=>{l.d(n,{A:()=>o});l(6540);var t=l(4164);const a={tabItem:"tabItem_Ymn6"};var r=l(4848);function o(e){let{children:n,hidden:l,className:o}=e;return(0,r.jsx)("div",{role:"tabpanel",className:(0,t.A)(a.tabItem,o),hidden:l,children:n})}},1470:(e,n,l)=>{l.d(n,{A:()=>y});var t=l(6540),a=l(4164),r=l(3104),o=l(6347),s=l(205),i=l(7485),c=l(1682),u=l(9466);function d(e){return t.Children.toArray(e).filter((e=>"\n"!==e)).map((e=>{if(!e||(0,t.isValidElement)(e)&&function(e){const{props:n}=e;return!!n&&"object"==typeof n&&"value"in n}(e))return e;throw new Error(`Docusaurus error: Bad child <${"string"==typeof e.type?e.type:e.type.name}>: all children of the component should be , and every should have a unique "value" prop.`)}))?.filter(Boolean)??[]}function p(e){const{values:n,children:l}=e;return(0,t.useMemo)((()=>{const e=n??function(e){return d(e).map((e=>{let{props:{value:n,label:l,attributes:t,default:a}}=e;return{value:n,label:l,attributes:t,default:a}}))}(l);return function(e){const n=(0,c.X)(e,((e,n)=>e.value===n.value));if(n.length>0)throw new Error(`Docusaurus error: Duplicate values "${n.map((e=>e.value)).join(", ")}" found in . Every value needs to be unique.`)}(e),e}),[n,l])}function h(e){let{value:n,tabValues:l}=e;return l.some((e=>e.value===n))}function g(e){let{queryString:n=!1,groupId:l}=e;const a=(0,o.W6)(),r=function(e){let{queryString:n=!1,groupId:l}=e;if("string"==typeof n)return n;if(!1===n)return null;if(!0===n&&!l)throw new Error('Docusaurus error: The component groupId prop is required if queryString=true, because this value is used as the search param name. You can also provide an explicit value such as queryString="my-search-param".');return l??null}({queryString:n,groupId:l});return[(0,i.aZ)(r),(0,t.useCallback)((e=>{if(!r)return;const n=new URLSearchParams(a.location.search);n.set(r,e),a.replace({...a.location,search:n.toString()})}),[r,a])]}function m(e){const{defaultValue:n,queryString:l=!1,groupId:a}=e,r=p(e),[o,i]=(0,t.useState)((()=>function(e){let{defaultValue:n,tabValues:l}=e;if(0===l.length)throw new Error("Docusaurus error: the component requires at least one children component");if(n){if(!h({value:n,tabValues:l}))throw new Error(`Docusaurus error: The has a defaultValue "${n}" but none of its children has the corresponding value. Available values are: ${l.map((e=>e.value)).join(", ")}. If you intend to show no default tab, use defaultValue={null} instead.`);return n}const t=l.find((e=>e.default))??l[0];if(!t)throw new Error("Unexpected error: 0 tabValues");return t.value}({defaultValue:n,tabValues:r}))),[c,d]=g({queryString:l,groupId:a}),[m,b]=function(e){let{groupId:n}=e;const l=function(e){return e?`docusaurus.tab.${e}`:null}(n),[a,r]=(0,u.Dv)(l);return[a,(0,t.useCallback)((e=>{l&&r.set(e)}),[l,r])]}({groupId:a}),f=(()=>{const e=c??m;return h({value:e,tabValues:r})?e:null})();(0,s.A)((()=>{f&&i(f)}),[f]);return{selectedValue:o,selectValue:(0,t.useCallback)((e=>{if(!h({value:e,tabValues:r}))throw new Error(`Can't select invalid tab value=${e}`);i(e),d(e),b(e)}),[d,b,r]),tabValues:r}}var b=l(2303);const f={tabList:"tabList__CuJ",tabItem:"tabItem_LNqP"};var x=l(4848);function j(e){let{className:n,block:l,selectedValue:t,selectValue:o,tabValues:s}=e;const i=[],{blockElementScrollPositionUntilNextRender:c}=(0,r.a_)(),u=e=>{const n=e.currentTarget,l=i.indexOf(n),a=s[l].value;a!==t&&(c(n),o(a))},d=e=>{let n=null;switch(e.key){case"Enter":u(e);break;case"ArrowRight":{const l=i.indexOf(e.currentTarget)+1;n=i[l]??i[0];break}case"ArrowLeft":{const l=i.indexOf(e.currentTarget)-1;n=i[l]??i[i.length-1];break}}n?.focus()};return(0,x.jsx)("ul",{role:"tablist","aria-orientation":"horizontal",className:(0,a.A)("tabs",{"tabs--block":l},n),children:s.map((e=>{let{value:n,label:l,attributes:r}=e;return(0,x.jsx)("li",{role:"tab",tabIndex:t===n?0:-1,"aria-selected":t===n,ref:e=>i.push(e),onKeyDown:d,onClick:u,...r,className:(0,a.A)("tabs__item",f.tabItem,r?.className,{"tabs__item--active":t===n}),children:l??n},n)}))})}function v(e){let{lazy:n,children:l,selectedValue:a}=e;const r=(Array.isArray(l)?l:[l]).filter(Boolean);if(n){const e=r.find((e=>e.props.value===a));return e?(0,t.cloneElement)(e,{className:"margin-top--md"}):null}return(0,x.jsx)("div",{className:"margin-top--md",children:r.map(((e,n)=>(0,t.cloneElement)(e,{key:n,hidden:e.props.value!==a})))})}function w(e){const n=m(e);return(0,x.jsxs)("div",{className:(0,a.A)("tabs-container",f.tabList),children:[(0,x.jsx)(j,{...e,...n}),(0,x.jsx)(v,{...e,...n})]})}function y(e){const n=(0,b.A)();return(0,x.jsx)(w,{...e,children:d(e.children)},String(n))}},8453:(e,n,l)=>{l.d(n,{R:()=>o,x:()=>s});var t=l(6540);const a={},r=t.createContext(a);function o(e){const n=t.useContext(r);return t.useMemo((function(){return"function"==typeof e?e(n):{...n,...e}}),[n,e])}function s(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(a):e.components||a:o(e.components),t.createElement(r.Provider,{value:n},e.children)}}}]); \ No newline at end of file diff --git a/assets/js/98260113.8e322bca.js b/assets/js/98260113.8e322bca.js deleted file mode 100644 index 06d4ec20..00000000 --- a/assets/js/98260113.8e322bca.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunkdocs=self.webpackChunkdocs||[]).push([[9441],{8439:(e,t,n)=>{n.r(t),n.d(t,{assets:()=>c,contentTitle:()=>s,default:()=>d,frontMatter:()=>l,metadata:()=>u,toc:()=>p});var r=n(4848),o=n(8453),a=n(1470),i=n(9365);const l={},s="Activities",u={id:"guides/activities",title:"Activities",description:"Implementation",source:"@site/docs/guides/activities.mdx",sourceDirName:"guides",slug:"/guides/activities",permalink:"/docs/guides/activities",draft:!1,unlisted:!1,editUrl:"https://github.com/facebook/docusaurus/tree/main/packages/create-docusaurus/templates/shared/docs/guides/activities.mdx",tags:[],version:"current",frontMatter:{},sidebar:"docs",previous:{title:"Workflows",permalink:"/docs/guides/workflows"},next:{title:"Queries",permalink:"/docs/guides/queries"}},c={},p=[{value:"Implementation",id:"implementation",level:2},{value:"Parameters",id:"parameters",level:3},{value:"Registration",id:"registration",level:2}];function m(e){const t={a:"a",code:"code",h1:"h1",h2:"h2",h3:"h3",p:"p",pre:"pre",...(0,o.R)(),...e.components};return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(t.h1,{id:"activities",children:"Activities"}),"\n",(0,r.jsx)(t.h2,{id:"implementation",children:"Implementation"}),"\n",(0,r.jsxs)(t.p,{children:["Activities are implemented as methods on a Go ",(0,r.jsx)(t.code,{children:"struct"})," that satisfies the generated ",(0,r.jsx)(t.code,{children:"Activities"})," interface type generated by this plugin"]}),"\n",(0,r.jsxs)(a.A,{children:[(0,r.jsx)(i.A,{value:"implementation-go",label:"Go",children:(0,r.jsx)(t.pre,{children:(0,r.jsx)(t.code,{className:"language-go",metastring:'title="main.go"',children:'package main\n\nimport (\n "context"\n\n examplev1 "path/to/gen/example/v1"\n "go.temporal.io/sdk/activity"\n)\n\ntype Activities struct {}\n\nfunc (a *Activities) Execute(ctx context.Context, input *examplev1.HelloInput) (*examplev1.HelloOutput, error) {\n activity.GetLogger(ctx).Info("executing hello activity", "input", input)\n return &examplev1.HelloOutput{}, nil\n}\n\n// type assertion for illustrative purposes\nvar _ examplev1.ExampleActivities = (*Activities)(nil)\n'})})}),(0,r.jsx)(i.A,{value:"implementation-schema",label:"Schema",children:(0,r.jsx)(t.pre,{children:(0,r.jsx)(t.code,{className:"language-protobuf",metastring:'title="example.proto"',children:'syntax="proto3";\n\npackage example.v1;\n\nimport "temporal/v1/temporal.proto";\n\nservice Example {\n // Hello returns a friendly greeting\n rpc Hello(HelloInput) returns (HelloOutput) {\n option (temporal.v1.activity) = {\n start_to_close_timeout: { seconds: 60 }\n };\n }\n}\n'})})})]}),"\n",(0,r.jsx)(t.h3,{id:"parameters",children:"Parameters"}),"\n",(0,r.jsx)(t.p,{children:"The signature of an activity method varies based on whether or not the activity definition specifies a non-empty input and/or output message type."}),"\n",(0,r.jsxs)(a.A,{children:[(0,r.jsxs)(i.A,{value:"parameters-both",label:"Input & Output Parameters",children:[(0,r.jsx)(t.p,{children:"Most activities should specify both an input and output message type, even if the type is empty. This to support the addition of fields to either the input or output (or both) in the future without needing to introduce a breaking change."}),(0,r.jsx)(t.pre,{children:(0,r.jsx)(t.code,{className:"language-protobuf",metastring:'title="example.proto"',children:'syntax="proto3";\n\npackage example.v1;\n\nimport "temporal/v1/temporal.proto";\n\nservice Example {\n // Hello returns a friendly greeting\n rpc Hello(HelloInput) returns (HelloOutput) {\n option (temporal.v1.activity) = {\n start_to_close_timeout: { seconds: 60 }\n };\n }\n}\n'})}),(0,r.jsx)(t.pre,{children:(0,r.jsx)(t.code,{className:"language-go",metastring:'title="main.go"',children:'package main\n\nimport (\n "context"\n\n examplev1 "path/to/gen/example/v1"\n)\n\ntype Activities struct {}\n\nfunc (a *Activities) Hello(ctx context.Context, input *examplev1.HelloInput) (*examplev1.HelloOutput, error) {\n return &examplev1.HelloOutput{}, nil\n}\n'})})]}),(0,r.jsxs)(i.A,{value:"parameters-input",label:"No Output Parameter",children:[(0,r.jsxs)(t.p,{children:["An Activity output can be omitted using the native ",(0,r.jsx)(t.a,{href:"https://protobuf.dev/reference/protobuf/google.protobuf/#empty",children:"google.protobuf.Empty"})," type. This modifies the signature of the Activity method to have a single return value of type ",(0,r.jsx)(t.code,{children:"error"}),". Note that this also requires an additional ",(0,r.jsx)(t.code,{children:"google/protobuf/empty.proto"})," protobuf import statement."]}),(0,r.jsx)(t.pre,{children:(0,r.jsx)(t.code,{className:"language-protobuf",metastring:'title="example.proto"',children:'syntax="proto3";\n\npackage example.v1;\n\nimport "google/protobuf/empty.proto";\nimport "temporal/v1/temporal.proto";\n\nservice Example {\n // Hello returns a friendly greeting\n rpc Hello(HelloInput) returns (google.protobuf.Empty) {\n option (temporal.v1.activity) = {\n start_to_close_timeout: { seconds: 60 }\n };\n }\n}\n'})}),(0,r.jsx)(t.pre,{children:(0,r.jsx)(t.code,{className:"language-go",metastring:'title="main.go"',children:'package main\n\nimport (\n "context"\n\n examplev1 "path/to/gen/example/v1"\n)\n\ntype Activities struct {}\n\nfunc (a *Activities) Hello(ctx context.Context, input *examplev1.HelloInput) error {\n return nil\n}\n'})})]}),(0,r.jsxs)(i.A,{value:"parameters-output",label:"No Input Parameter",children:[(0,r.jsxs)(t.p,{children:["An Activity input can be omitted using the native ",(0,r.jsx)(t.a,{href:"https://protobuf.dev/reference/protobuf/google.protobuf/#empty",children:"google.protobuf.Empty"})," type. This modifies the signature of the Activity method to have a single input argument of type ",(0,r.jsx)(t.code,{children:"context.Context"}),". Note that this also requires an additional ",(0,r.jsx)(t.code,{children:"google/protobuf/empty.proto"})," protobuf import statement."]}),(0,r.jsx)(t.pre,{children:(0,r.jsx)(t.code,{className:"language-protobuf",metastring:'title="example.proto"',children:'syntax="proto3";\n\npackage example.v1;\n\nimport "google/protobuf/empty.proto";\nimport "temporal/v1/temporal.proto";\n\nservice Example {\n // Hello returns a friendly greeting\n rpc Hello(google.protobuf.Empty) returns (HelloOutput) {\n option (temporal.v1.activity) = {\n start_to_close_timeout: { seconds: 60 }\n };\n }\n}\n'})}),(0,r.jsx)(t.pre,{children:(0,r.jsx)(t.code,{className:"language-go",metastring:'title="main.go"',children:'package main\n\nimport (\n "context"\n\n examplev1 "path/to/gen/example/v1"\n)\n\ntype Activities struct {}\n\nfunc (a *Activities) Hello(ctx context.Context) (*examplev1.HelloOutput, error) {\n return &examplev1.HelloOutput{}, nil\n}\n'})})]}),(0,r.jsxs)(i.A,{value:"parameters-none",label:"No Parameters",children:[(0,r.jsxs)(t.p,{children:["An Activity can omit both input and output parameters using the native ",(0,r.jsx)(t.a,{href:"https://protobuf.dev/reference/protobuf/google.protobuf/#empty",children:"google.protobuf.Empty"})," type. This modifies the signature of the Activity method to accept a single argument of type ",(0,r.jsx)(t.code,{children:"context.Context"})," and return a single value of type ",(0,r.jsx)(t.code,{children:"error"}),". Note that this also requires an additional ",(0,r.jsx)(t.code,{children:"google/protobuf/empty.proto"})," protobuf import statement."]}),(0,r.jsx)(t.pre,{children:(0,r.jsx)(t.code,{className:"language-protobuf",metastring:'title="example.proto"',children:'syntax="proto3";\n\npackage example.v1;\n\nimport "google/protobuf/empty.proto";\nimport "temporal/v1/temporal.proto";\n\nservice Example {\n // Hello returns a friendly greeting\n rpc Hello(google.protobuf.Empty) returns (google.protobuf.Empty) {\n option (temporal.v1.activity) = {\n start_to_close_timeout: { seconds: 60 }\n };\n }\n}\n'})}),(0,r.jsx)(t.pre,{children:(0,r.jsx)(t.code,{className:"language-go",metastring:'title="main.go"',children:'package main\n\nimport (\n "context"\n\n examplev1 "path/to/gen/example/v1"\n)\n\ntype Activities struct {}\n\nfunc (a *Activities) Hello(ctx context.Context) error {\n return nil\n}\n'})})]})]}),"\n",(0,r.jsx)(t.h2,{id:"registration",children:"Registration"}),"\n",(0,r.jsx)(t.p,{children:"This plugin generates helpers for registering your activities with a Temporal worker."}),"\n",(0,r.jsxs)(a.A,{children:[(0,r.jsx)(i.A,{value:"registration-go",label:"Go",children:(0,r.jsx)(t.pre,{children:(0,r.jsx)(t.code,{className:"language-go",metastring:'title="main.go"',children:'package main\n\nimport (\n "context"\n\n examplev1 "path/to/gen/example/v1"\n "go.temporal.io/sdk/client"\n "go.temporal.io/sdk/worker"\n)\n\ntype Activities struct {}\n\nfunc (a *Activities) Hello(ctx context.Context, input *examplev1.HelloInput) (*examplev1.HelloOutput, error) {\n return &examplev1.HelloOutput{}, nil\n}\n\nfunc main() {\n // initialize temporal client and worker\n c, err := client.Dial(client.Options{})\n if err != nil {\n log.Fatalf("error initializing client: %v", err)\n }\n w := worker.New(c, examplev1.ExampleTaskQueue, worker.Options{})\n\n // Register all example.v1.Example activities with the worker\n examplev1.RegisterExampleActivities(w, &Activities{})\n w.Run(worker.InterruptCh())\n}\n'})})}),(0,r.jsx)(i.A,{value:"registration-schema",label:"Schema",children:(0,r.jsx)(t.pre,{children:(0,r.jsx)(t.code,{className:"language-protobuf",metastring:'title="example.proto"',children:'syntax="proto3";\n\npackage example.v1;\n\nimport "temporal/v1/temporal.proto";\n\nservice Example {\n option (temporal.v1.service) = {\n task_queue: "example-v1"\n };\n\n // Hello returns a friendly greeting\n rpc Hello(HelloInput) returns (HelloOutput) {\n option (temporal.v1.activity) = {\n start_to_close_timeout: { seconds: 60 }\n };\n }\n}\n'})})})]})]})}function d(e={}){const{wrapper:t}={...(0,o.R)(),...e.components};return t?(0,r.jsx)(t,{...e,children:(0,r.jsx)(m,{...e})}):m(e)}},9365:(e,t,n)=>{n.d(t,{A:()=>i});n(6540);var r=n(4164);const o={tabItem:"tabItem_Ymn6"};var a=n(4848);function i(e){let{children:t,hidden:n,className:i}=e;return(0,a.jsx)("div",{role:"tabpanel",className:(0,r.A)(o.tabItem,i),hidden:n,children:t})}},1470:(e,t,n)=>{n.d(t,{A:()=>A});var r=n(6540),o=n(4164),a=n(3104),i=n(6347),l=n(205),s=n(7485),u=n(1682),c=n(9466);function p(e){return r.Children.toArray(e).filter((e=>"\n"!==e)).map((e=>{if(!e||(0,r.isValidElement)(e)&&function(e){const{props:t}=e;return!!t&&"object"==typeof t&&"value"in t}(e))return e;throw new Error(`Docusaurus error: Bad child <${"string"==typeof e.type?e.type:e.type.name}>: all children of the component should be , and every should have a unique "value" prop.`)}))?.filter(Boolean)??[]}function m(e){const{values:t,children:n}=e;return(0,r.useMemo)((()=>{const e=t??function(e){return p(e).map((e=>{let{props:{value:t,label:n,attributes:r,default:o}}=e;return{value:t,label:n,attributes:r,default:o}}))}(n);return function(e){const t=(0,u.X)(e,((e,t)=>e.value===t.value));if(t.length>0)throw new Error(`Docusaurus error: Duplicate values "${t.map((e=>e.value)).join(", ")}" found in . Every value needs to be unique.`)}(e),e}),[t,n])}function d(e){let{value:t,tabValues:n}=e;return n.some((e=>e.value===t))}function h(e){let{queryString:t=!1,groupId:n}=e;const o=(0,i.W6)(),a=function(e){let{queryString:t=!1,groupId:n}=e;if("string"==typeof t)return t;if(!1===t)return null;if(!0===t&&!n)throw new Error('Docusaurus error: The component groupId prop is required if queryString=true, because this value is used as the search param name. You can also provide an explicit value such as queryString="my-search-param".');return n??null}({queryString:t,groupId:n});return[(0,s.aZ)(a),(0,r.useCallback)((e=>{if(!a)return;const t=new URLSearchParams(o.location.search);t.set(a,e),o.replace({...o.location,search:t.toString()})}),[a,o])]}function g(e){const{defaultValue:t,queryString:n=!1,groupId:o}=e,a=m(e),[i,s]=(0,r.useState)((()=>function(e){let{defaultValue:t,tabValues:n}=e;if(0===n.length)throw new Error("Docusaurus error: the component requires at least one children component");if(t){if(!d({value:t,tabValues:n}))throw new Error(`Docusaurus error: The has a defaultValue "${t}" but none of its children has the corresponding value. Available values are: ${n.map((e=>e.value)).join(", ")}. If you intend to show no default tab, use defaultValue={null} instead.`);return t}const r=n.find((e=>e.default))??n[0];if(!r)throw new Error("Unexpected error: 0 tabValues");return r.value}({defaultValue:t,tabValues:a}))),[u,p]=h({queryString:n,groupId:o}),[g,v]=function(e){let{groupId:t}=e;const n=function(e){return e?`docusaurus.tab.${e}`:null}(t),[o,a]=(0,c.Dv)(n);return[o,(0,r.useCallback)((e=>{n&&a.set(e)}),[n,a])]}({groupId:o}),x=(()=>{const e=u??g;return d({value:e,tabValues:a})?e:null})();(0,l.A)((()=>{x&&s(x)}),[x]);return{selectedValue:i,selectValue:(0,r.useCallback)((e=>{if(!d({value:e,tabValues:a}))throw new Error(`Can't select invalid tab value=${e}`);s(e),p(e),v(e)}),[p,v,a]),tabValues:a}}var v=n(2303);const x={tabList:"tabList__CuJ",tabItem:"tabItem_LNqP"};var f=n(4848);function b(e){let{className:t,block:n,selectedValue:r,selectValue:i,tabValues:l}=e;const s=[],{blockElementScrollPositionUntilNextRender:u}=(0,a.a_)(),c=e=>{const t=e.currentTarget,n=s.indexOf(t),o=l[n].value;o!==r&&(u(t),i(o))},p=e=>{let t=null;switch(e.key){case"Enter":c(e);break;case"ArrowRight":{const n=s.indexOf(e.currentTarget)+1;t=s[n]??s[0];break}case"ArrowLeft":{const n=s.indexOf(e.currentTarget)-1;t=s[n]??s[s.length-1];break}}t?.focus()};return(0,f.jsx)("ul",{role:"tablist","aria-orientation":"horizontal",className:(0,o.A)("tabs",{"tabs--block":n},t),children:l.map((e=>{let{value:t,label:n,attributes:a}=e;return(0,f.jsx)("li",{role:"tab",tabIndex:r===t?0:-1,"aria-selected":r===t,ref:e=>s.push(e),onKeyDown:p,onClick:c,...a,className:(0,o.A)("tabs__item",x.tabItem,a?.className,{"tabs__item--active":r===t}),children:n??t},t)}))})}function y(e){let{lazy:t,children:n,selectedValue:o}=e;const a=(Array.isArray(n)?n:[n]).filter(Boolean);if(t){const e=a.find((e=>e.props.value===o));return e?(0,r.cloneElement)(e,{className:"margin-top--md"}):null}return(0,f.jsx)("div",{className:"margin-top--md",children:a.map(((e,t)=>(0,r.cloneElement)(e,{key:t,hidden:e.props.value!==o})))})}function j(e){const t=g(e);return(0,f.jsxs)("div",{className:(0,o.A)("tabs-container",x.tabList),children:[(0,f.jsx)(b,{...e,...t}),(0,f.jsx)(y,{...e,...t})]})}function A(e){const t=(0,v.A)();return(0,f.jsx)(j,{...e,children:p(e.children)},String(t))}},8453:(e,t,n)=>{n.d(t,{R:()=>i,x:()=>l});var r=n(6540);const o={},a=r.createContext(o);function i(e){const t=r.useContext(a);return r.useMemo((function(){return"function"==typeof e?e(t):{...t,...e}}),[t,e])}function l(e){let t;return t=e.disableParentContext?"function"==typeof e.components?e.components(o):e.components||o:i(e.components),r.createElement(a.Provider,{value:t},e.children)}}}]); \ No newline at end of file diff --git a/assets/js/98260113.dfa2acb6.js b/assets/js/98260113.dfa2acb6.js new file mode 100644 index 00000000..513769ce --- /dev/null +++ b/assets/js/98260113.dfa2acb6.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunkdocs=self.webpackChunkdocs||[]).push([[9441],{8439:(e,t,n)=>{n.r(t),n.d(t,{assets:()=>c,contentTitle:()=>s,default:()=>d,frontMatter:()=>l,metadata:()=>u,toc:()=>p});var r=n(4848),o=n(8453),a=n(1470),i=n(9365);const l={},s="Activities",u={id:"guides/activities",title:"Activities",description:"Implementation",source:"@site/docs/guides/activities.mdx",sourceDirName:"guides",slug:"/guides/activities",permalink:"/protoc-gen-go-temporal/docs/guides/activities",draft:!1,unlisted:!1,editUrl:"https://github.com/facebook/docusaurus/tree/main/packages/create-docusaurus/templates/shared/docs/guides/activities.mdx",tags:[],version:"current",frontMatter:{},sidebar:"docs",previous:{title:"Workflows",permalink:"/protoc-gen-go-temporal/docs/guides/workflows"},next:{title:"Queries",permalink:"/protoc-gen-go-temporal/docs/guides/queries"}},c={},p=[{value:"Implementation",id:"implementation",level:2},{value:"Parameters",id:"parameters",level:3},{value:"Registration",id:"registration",level:2}];function m(e){const t={a:"a",code:"code",h1:"h1",h2:"h2",h3:"h3",p:"p",pre:"pre",...(0,o.R)(),...e.components};return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(t.h1,{id:"activities",children:"Activities"}),"\n",(0,r.jsx)(t.h2,{id:"implementation",children:"Implementation"}),"\n",(0,r.jsxs)(t.p,{children:["Activities are implemented as methods on a Go ",(0,r.jsx)(t.code,{children:"struct"})," that satisfies the generated ",(0,r.jsx)(t.code,{children:"Activities"})," interface type generated by this plugin"]}),"\n",(0,r.jsxs)(a.A,{children:[(0,r.jsx)(i.A,{value:"implementation-go",label:"Go",children:(0,r.jsx)(t.pre,{children:(0,r.jsx)(t.code,{className:"language-go",metastring:'title="main.go"',children:'package main\n\nimport (\n "context"\n\n examplev1 "path/to/gen/example/v1"\n "go.temporal.io/sdk/activity"\n)\n\ntype Activities struct {}\n\nfunc (a *Activities) Execute(ctx context.Context, input *examplev1.HelloInput) (*examplev1.HelloOutput, error) {\n activity.GetLogger(ctx).Info("executing hello activity", "input", input)\n return &examplev1.HelloOutput{}, nil\n}\n\n// type assertion for illustrative purposes\nvar _ examplev1.ExampleActivities = (*Activities)(nil)\n'})})}),(0,r.jsx)(i.A,{value:"implementation-schema",label:"Schema",children:(0,r.jsx)(t.pre,{children:(0,r.jsx)(t.code,{className:"language-protobuf",metastring:'title="example.proto"',children:'syntax="proto3";\n\npackage example.v1;\n\nimport "temporal/v1/temporal.proto";\n\nservice Example {\n // Hello returns a friendly greeting\n rpc Hello(HelloInput) returns (HelloOutput) {\n option (temporal.v1.activity) = {\n start_to_close_timeout: { seconds: 60 }\n };\n }\n}\n'})})})]}),"\n",(0,r.jsx)(t.h3,{id:"parameters",children:"Parameters"}),"\n",(0,r.jsx)(t.p,{children:"The signature of an activity method varies based on whether or not the activity definition specifies a non-empty input and/or output message type."}),"\n",(0,r.jsxs)(a.A,{children:[(0,r.jsxs)(i.A,{value:"parameters-both",label:"Input & Output Parameters",children:[(0,r.jsx)(t.p,{children:"Most activities should specify both an input and output message type, even if the type is empty. This to support the addition of fields to either the input or output (or both) in the future without needing to introduce a breaking change."}),(0,r.jsx)(t.pre,{children:(0,r.jsx)(t.code,{className:"language-protobuf",metastring:'title="example.proto"',children:'syntax="proto3";\n\npackage example.v1;\n\nimport "temporal/v1/temporal.proto";\n\nservice Example {\n // Hello returns a friendly greeting\n rpc Hello(HelloInput) returns (HelloOutput) {\n option (temporal.v1.activity) = {\n start_to_close_timeout: { seconds: 60 }\n };\n }\n}\n'})}),(0,r.jsx)(t.pre,{children:(0,r.jsx)(t.code,{className:"language-go",metastring:'title="main.go"',children:'package main\n\nimport (\n "context"\n\n examplev1 "path/to/gen/example/v1"\n)\n\ntype Activities struct {}\n\nfunc (a *Activities) Hello(ctx context.Context, input *examplev1.HelloInput) (*examplev1.HelloOutput, error) {\n return &examplev1.HelloOutput{}, nil\n}\n'})})]}),(0,r.jsxs)(i.A,{value:"parameters-input",label:"No Output Parameter",children:[(0,r.jsxs)(t.p,{children:["An Activity output can be omitted using the native ",(0,r.jsx)(t.a,{href:"https://protobuf.dev/reference/protobuf/google.protobuf/#empty",children:"google.protobuf.Empty"})," type. This modifies the signature of the Activity method to have a single return value of type ",(0,r.jsx)(t.code,{children:"error"}),". Note that this also requires an additional ",(0,r.jsx)(t.code,{children:"google/protobuf/empty.proto"})," protobuf import statement."]}),(0,r.jsx)(t.pre,{children:(0,r.jsx)(t.code,{className:"language-protobuf",metastring:'title="example.proto"',children:'syntax="proto3";\n\npackage example.v1;\n\nimport "google/protobuf/empty.proto";\nimport "temporal/v1/temporal.proto";\n\nservice Example {\n // Hello returns a friendly greeting\n rpc Hello(HelloInput) returns (google.protobuf.Empty) {\n option (temporal.v1.activity) = {\n start_to_close_timeout: { seconds: 60 }\n };\n }\n}\n'})}),(0,r.jsx)(t.pre,{children:(0,r.jsx)(t.code,{className:"language-go",metastring:'title="main.go"',children:'package main\n\nimport (\n "context"\n\n examplev1 "path/to/gen/example/v1"\n)\n\ntype Activities struct {}\n\nfunc (a *Activities) Hello(ctx context.Context, input *examplev1.HelloInput) error {\n return nil\n}\n'})})]}),(0,r.jsxs)(i.A,{value:"parameters-output",label:"No Input Parameter",children:[(0,r.jsxs)(t.p,{children:["An Activity input can be omitted using the native ",(0,r.jsx)(t.a,{href:"https://protobuf.dev/reference/protobuf/google.protobuf/#empty",children:"google.protobuf.Empty"})," type. This modifies the signature of the Activity method to have a single input argument of type ",(0,r.jsx)(t.code,{children:"context.Context"}),". Note that this also requires an additional ",(0,r.jsx)(t.code,{children:"google/protobuf/empty.proto"})," protobuf import statement."]}),(0,r.jsx)(t.pre,{children:(0,r.jsx)(t.code,{className:"language-protobuf",metastring:'title="example.proto"',children:'syntax="proto3";\n\npackage example.v1;\n\nimport "google/protobuf/empty.proto";\nimport "temporal/v1/temporal.proto";\n\nservice Example {\n // Hello returns a friendly greeting\n rpc Hello(google.protobuf.Empty) returns (HelloOutput) {\n option (temporal.v1.activity) = {\n start_to_close_timeout: { seconds: 60 }\n };\n }\n}\n'})}),(0,r.jsx)(t.pre,{children:(0,r.jsx)(t.code,{className:"language-go",metastring:'title="main.go"',children:'package main\n\nimport (\n "context"\n\n examplev1 "path/to/gen/example/v1"\n)\n\ntype Activities struct {}\n\nfunc (a *Activities) Hello(ctx context.Context) (*examplev1.HelloOutput, error) {\n return &examplev1.HelloOutput{}, nil\n}\n'})})]}),(0,r.jsxs)(i.A,{value:"parameters-none",label:"No Parameters",children:[(0,r.jsxs)(t.p,{children:["An Activity can omit both input and output parameters using the native ",(0,r.jsx)(t.a,{href:"https://protobuf.dev/reference/protobuf/google.protobuf/#empty",children:"google.protobuf.Empty"})," type. This modifies the signature of the Activity method to accept a single argument of type ",(0,r.jsx)(t.code,{children:"context.Context"})," and return a single value of type ",(0,r.jsx)(t.code,{children:"error"}),". Note that this also requires an additional ",(0,r.jsx)(t.code,{children:"google/protobuf/empty.proto"})," protobuf import statement."]}),(0,r.jsx)(t.pre,{children:(0,r.jsx)(t.code,{className:"language-protobuf",metastring:'title="example.proto"',children:'syntax="proto3";\n\npackage example.v1;\n\nimport "google/protobuf/empty.proto";\nimport "temporal/v1/temporal.proto";\n\nservice Example {\n // Hello returns a friendly greeting\n rpc Hello(google.protobuf.Empty) returns (google.protobuf.Empty) {\n option (temporal.v1.activity) = {\n start_to_close_timeout: { seconds: 60 }\n };\n }\n}\n'})}),(0,r.jsx)(t.pre,{children:(0,r.jsx)(t.code,{className:"language-go",metastring:'title="main.go"',children:'package main\n\nimport (\n "context"\n\n examplev1 "path/to/gen/example/v1"\n)\n\ntype Activities struct {}\n\nfunc (a *Activities) Hello(ctx context.Context) error {\n return nil\n}\n'})})]})]}),"\n",(0,r.jsx)(t.h2,{id:"registration",children:"Registration"}),"\n",(0,r.jsx)(t.p,{children:"This plugin generates helpers for registering your activities with a Temporal worker."}),"\n",(0,r.jsxs)(a.A,{children:[(0,r.jsx)(i.A,{value:"registration-go",label:"Go",children:(0,r.jsx)(t.pre,{children:(0,r.jsx)(t.code,{className:"language-go",metastring:'title="main.go"',children:'package main\n\nimport (\n "context"\n\n examplev1 "path/to/gen/example/v1"\n "go.temporal.io/sdk/client"\n "go.temporal.io/sdk/worker"\n)\n\ntype Activities struct {}\n\nfunc (a *Activities) Hello(ctx context.Context, input *examplev1.HelloInput) (*examplev1.HelloOutput, error) {\n return &examplev1.HelloOutput{}, nil\n}\n\nfunc main() {\n // initialize temporal client and worker\n c, err := client.Dial(client.Options{})\n if err != nil {\n log.Fatalf("error initializing client: %v", err)\n }\n w := worker.New(c, examplev1.ExampleTaskQueue, worker.Options{})\n\n // Register all example.v1.Example activities with the worker\n examplev1.RegisterExampleActivities(w, &Activities{})\n w.Run(worker.InterruptCh())\n}\n'})})}),(0,r.jsx)(i.A,{value:"registration-schema",label:"Schema",children:(0,r.jsx)(t.pre,{children:(0,r.jsx)(t.code,{className:"language-protobuf",metastring:'title="example.proto"',children:'syntax="proto3";\n\npackage example.v1;\n\nimport "temporal/v1/temporal.proto";\n\nservice Example {\n option (temporal.v1.service) = {\n task_queue: "example-v1"\n };\n\n // Hello returns a friendly greeting\n rpc Hello(HelloInput) returns (HelloOutput) {\n option (temporal.v1.activity) = {\n start_to_close_timeout: { seconds: 60 }\n };\n }\n}\n'})})})]})]})}function d(e={}){const{wrapper:t}={...(0,o.R)(),...e.components};return t?(0,r.jsx)(t,{...e,children:(0,r.jsx)(m,{...e})}):m(e)}},9365:(e,t,n)=>{n.d(t,{A:()=>i});n(6540);var r=n(4164);const o={tabItem:"tabItem_Ymn6"};var a=n(4848);function i(e){let{children:t,hidden:n,className:i}=e;return(0,a.jsx)("div",{role:"tabpanel",className:(0,r.A)(o.tabItem,i),hidden:n,children:t})}},1470:(e,t,n)=>{n.d(t,{A:()=>A});var r=n(6540),o=n(4164),a=n(3104),i=n(6347),l=n(205),s=n(7485),u=n(1682),c=n(9466);function p(e){return r.Children.toArray(e).filter((e=>"\n"!==e)).map((e=>{if(!e||(0,r.isValidElement)(e)&&function(e){const{props:t}=e;return!!t&&"object"==typeof t&&"value"in t}(e))return e;throw new Error(`Docusaurus error: Bad child <${"string"==typeof e.type?e.type:e.type.name}>: all children of the component should be , and every should have a unique "value" prop.`)}))?.filter(Boolean)??[]}function m(e){const{values:t,children:n}=e;return(0,r.useMemo)((()=>{const e=t??function(e){return p(e).map((e=>{let{props:{value:t,label:n,attributes:r,default:o}}=e;return{value:t,label:n,attributes:r,default:o}}))}(n);return function(e){const t=(0,u.X)(e,((e,t)=>e.value===t.value));if(t.length>0)throw new Error(`Docusaurus error: Duplicate values "${t.map((e=>e.value)).join(", ")}" found in . Every value needs to be unique.`)}(e),e}),[t,n])}function d(e){let{value:t,tabValues:n}=e;return n.some((e=>e.value===t))}function g(e){let{queryString:t=!1,groupId:n}=e;const o=(0,i.W6)(),a=function(e){let{queryString:t=!1,groupId:n}=e;if("string"==typeof t)return t;if(!1===t)return null;if(!0===t&&!n)throw new Error('Docusaurus error: The component groupId prop is required if queryString=true, because this value is used as the search param name. You can also provide an explicit value such as queryString="my-search-param".');return n??null}({queryString:t,groupId:n});return[(0,s.aZ)(a),(0,r.useCallback)((e=>{if(!a)return;const t=new URLSearchParams(o.location.search);t.set(a,e),o.replace({...o.location,search:t.toString()})}),[a,o])]}function h(e){const{defaultValue:t,queryString:n=!1,groupId:o}=e,a=m(e),[i,s]=(0,r.useState)((()=>function(e){let{defaultValue:t,tabValues:n}=e;if(0===n.length)throw new Error("Docusaurus error: the component requires at least one children component");if(t){if(!d({value:t,tabValues:n}))throw new Error(`Docusaurus error: The has a defaultValue "${t}" but none of its children has the corresponding value. Available values are: ${n.map((e=>e.value)).join(", ")}. If you intend to show no default tab, use defaultValue={null} instead.`);return t}const r=n.find((e=>e.default))??n[0];if(!r)throw new Error("Unexpected error: 0 tabValues");return r.value}({defaultValue:t,tabValues:a}))),[u,p]=g({queryString:n,groupId:o}),[h,v]=function(e){let{groupId:t}=e;const n=function(e){return e?`docusaurus.tab.${e}`:null}(t),[o,a]=(0,c.Dv)(n);return[o,(0,r.useCallback)((e=>{n&&a.set(e)}),[n,a])]}({groupId:o}),x=(()=>{const e=u??h;return d({value:e,tabValues:a})?e:null})();(0,l.A)((()=>{x&&s(x)}),[x]);return{selectedValue:i,selectValue:(0,r.useCallback)((e=>{if(!d({value:e,tabValues:a}))throw new Error(`Can't select invalid tab value=${e}`);s(e),p(e),v(e)}),[p,v,a]),tabValues:a}}var v=n(2303);const x={tabList:"tabList__CuJ",tabItem:"tabItem_LNqP"};var f=n(4848);function b(e){let{className:t,block:n,selectedValue:r,selectValue:i,tabValues:l}=e;const s=[],{blockElementScrollPositionUntilNextRender:u}=(0,a.a_)(),c=e=>{const t=e.currentTarget,n=s.indexOf(t),o=l[n].value;o!==r&&(u(t),i(o))},p=e=>{let t=null;switch(e.key){case"Enter":c(e);break;case"ArrowRight":{const n=s.indexOf(e.currentTarget)+1;t=s[n]??s[0];break}case"ArrowLeft":{const n=s.indexOf(e.currentTarget)-1;t=s[n]??s[s.length-1];break}}t?.focus()};return(0,f.jsx)("ul",{role:"tablist","aria-orientation":"horizontal",className:(0,o.A)("tabs",{"tabs--block":n},t),children:l.map((e=>{let{value:t,label:n,attributes:a}=e;return(0,f.jsx)("li",{role:"tab",tabIndex:r===t?0:-1,"aria-selected":r===t,ref:e=>s.push(e),onKeyDown:p,onClick:c,...a,className:(0,o.A)("tabs__item",x.tabItem,a?.className,{"tabs__item--active":r===t}),children:n??t},t)}))})}function y(e){let{lazy:t,children:n,selectedValue:o}=e;const a=(Array.isArray(n)?n:[n]).filter(Boolean);if(t){const e=a.find((e=>e.props.value===o));return e?(0,r.cloneElement)(e,{className:"margin-top--md"}):null}return(0,f.jsx)("div",{className:"margin-top--md",children:a.map(((e,t)=>(0,r.cloneElement)(e,{key:t,hidden:e.props.value!==o})))})}function j(e){const t=h(e);return(0,f.jsxs)("div",{className:(0,o.A)("tabs-container",x.tabList),children:[(0,f.jsx)(b,{...e,...t}),(0,f.jsx)(y,{...e,...t})]})}function A(e){const t=(0,v.A)();return(0,f.jsx)(j,{...e,children:p(e.children)},String(t))}},8453:(e,t,n)=>{n.d(t,{R:()=>i,x:()=>l});var r=n(6540);const o={},a=r.createContext(o);function i(e){const t=r.useContext(a);return r.useMemo((function(){return"function"==typeof e?e(t):{...t,...e}}),[t,e])}function l(e){let t;return t=e.disableParentContext?"function"==typeof e.components?e.components(o):e.components||o:i(e.components),r.createElement(a.Provider,{value:t},e.children)}}}]); \ No newline at end of file diff --git a/assets/js/a7023ddc.c0adbbf8.js b/assets/js/a7023ddc.c0adbbf8.js deleted file mode 100644 index 6313babb..00000000 --- a/assets/js/a7023ddc.c0adbbf8.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunkdocs=self.webpackChunkdocs||[]).push([[9267],{8289:l=>{l.exports=JSON.parse('[{"label":"facebook","permalink":"/blog/tags/facebook","count":1},{"label":"hello","permalink":"/blog/tags/hello","count":2},{"label":"docusaurus","permalink":"/blog/tags/docusaurus","count":4},{"label":"hola","permalink":"/blog/tags/hola","count":1}]')}}]); \ No newline at end of file diff --git a/assets/js/a80da1cf.e39cd5b6.js b/assets/js/a80da1cf.e39cd5b6.js deleted file mode 100644 index 582277c1..00000000 --- a/assets/js/a80da1cf.e39cd5b6.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunkdocs=self.webpackChunkdocs||[]).push([[497],{1550:s=>{s.exports=JSON.parse('{"label":"docusaurus","permalink":"/blog/tags/docusaurus","allTagsPath":"/blog/tags","count":4,"unlisted":false}')}}]); \ No newline at end of file diff --git a/assets/js/aba4fb3d.7b37fae6.js b/assets/js/aba4fb3d.7b37fae6.js new file mode 100644 index 00000000..83acfe0e --- /dev/null +++ b/assets/js/aba4fb3d.7b37fae6.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunkdocs=self.webpackChunkdocs||[]).push([[6652],{2836:e=>{e.exports=JSON.parse('{"label":"hello","permalink":"/protoc-gen-go-temporal/blog/tags/hello","allTagsPath":"/protoc-gen-go-temporal/blog/tags","count":2,"unlisted":false}')}}]); \ No newline at end of file diff --git a/assets/js/b2b675dd.e198e674.js b/assets/js/b2b675dd.e198e674.js deleted file mode 100644 index df09c165..00000000 --- a/assets/js/b2b675dd.e198e674.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunkdocs=self.webpackChunkdocs||[]).push([[1991],{9775:e=>{e.exports=JSON.parse('{"permalink":"/blog","page":1,"postsPerPage":10,"totalPages":1,"totalCount":4,"blogDescription":"Blog","blogTitle":"Blog"}')}}]); \ No newline at end of file diff --git a/assets/js/b2f554cd.c3fd38f0.js b/assets/js/b2f554cd.c3fd38f0.js deleted file mode 100644 index 5594448b..00000000 --- a/assets/js/b2f554cd.c3fd38f0.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunkdocs=self.webpackChunkdocs||[]).push([[5894],{6042:e=>{e.exports=JSON.parse('{"blogPosts":[{"id":"welcome","metadata":{"permalink":"/blog/welcome","editUrl":"https://github.com/facebook/docusaurus/tree/main/packages/create-docusaurus/templates/shared/blog/2021-08-26-welcome/index.md","source":"@site/blog/2021-08-26-welcome/index.md","title":"Welcome","description":"Docusaurus blogging features are powered by the blog plugin.","date":"2021-08-26T00:00:00.000Z","formattedDate":"August 26, 2021","tags":[{"label":"facebook","permalink":"/blog/tags/facebook"},{"label":"hello","permalink":"/blog/tags/hello"},{"label":"docusaurus","permalink":"/blog/tags/docusaurus"}],"readingTime":0.405,"hasTruncateMarker":false,"authors":[{"name":"S\xe9bastien Lorber","title":"Docusaurus maintainer","url":"https://sebastienlorber.com","imageURL":"https://github.com/slorber.png","key":"slorber"},{"name":"Yangshun Tay","title":"Front End Engineer @ Facebook","url":"https://github.com/yangshun","imageURL":"https://github.com/yangshun.png","key":"yangshun"}],"frontMatter":{"slug":"welcome","title":"Welcome","authors":["slorber","yangshun"],"tags":["facebook","hello","docusaurus"]},"unlisted":false,"nextItem":{"title":"MDX Blog Post","permalink":"/blog/mdx-blog-post"}},"content":"[Docusaurus blogging features](https://docusaurus.io/docs/blog) are powered by the [blog plugin](https://docusaurus.io/docs/api/plugins/@docusaurus/plugin-content-blog).\\n\\nSimply add Markdown files (or folders) to the `blog` directory.\\n\\nRegular blog authors can be added to `authors.yml`.\\n\\nThe blog post date can be extracted from filenames, such as:\\n\\n- `2019-05-30-welcome.md`\\n- `2019-05-30-welcome/index.md`\\n\\nA blog post folder can be convenient to co-locate blog post images:\\n\\n![Docusaurus Plushie](./docusaurus-plushie-banner.jpeg)\\n\\nThe blog supports tags as well!\\n\\n**And if you don\'t want a blog**: just delete this directory, and use `blog: false` in your Docusaurus config."},{"id":"mdx-blog-post","metadata":{"permalink":"/blog/mdx-blog-post","editUrl":"https://github.com/facebook/docusaurus/tree/main/packages/create-docusaurus/templates/shared/blog/2021-08-01-mdx-blog-post.mdx","source":"@site/blog/2021-08-01-mdx-blog-post.mdx","title":"MDX Blog Post","description":"Blog posts support Docusaurus Markdown features, such as MDX.","date":"2021-08-01T00:00:00.000Z","formattedDate":"August 1, 2021","tags":[{"label":"docusaurus","permalink":"/blog/tags/docusaurus"}],"readingTime":0.175,"hasTruncateMarker":false,"authors":[{"name":"S\xe9bastien Lorber","title":"Docusaurus maintainer","url":"https://sebastienlorber.com","imageURL":"https://github.com/slorber.png","key":"slorber"}],"frontMatter":{"slug":"mdx-blog-post","title":"MDX Blog Post","authors":["slorber"],"tags":["docusaurus"]},"unlisted":false,"prevItem":{"title":"Welcome","permalink":"/blog/welcome"},"nextItem":{"title":"Long Blog Post","permalink":"/blog/long-blog-post"}},"content":"Blog posts support [Docusaurus Markdown features](https://docusaurus.io/docs/markdown-features), such as [MDX](https://mdxjs.com/).\\n\\n:::tip\\n\\nUse the power of React to create interactive blog posts.\\n\\n```js\\n\\n```\\n\\n\\n\\n:::"},{"id":"long-blog-post","metadata":{"permalink":"/blog/long-blog-post","editUrl":"https://github.com/facebook/docusaurus/tree/main/packages/create-docusaurus/templates/shared/blog/2019-05-29-long-blog-post.md","source":"@site/blog/2019-05-29-long-blog-post.md","title":"Long Blog Post","description":"This is the summary of a very long blog post,","date":"2019-05-29T00:00:00.000Z","formattedDate":"May 29, 2019","tags":[{"label":"hello","permalink":"/blog/tags/hello"},{"label":"docusaurus","permalink":"/blog/tags/docusaurus"}],"readingTime":2.05,"hasTruncateMarker":true,"authors":[{"name":"Endilie Yacop Sucipto","title":"Maintainer of Docusaurus","url":"https://github.com/endiliey","imageURL":"https://github.com/endiliey.png","key":"endi"}],"frontMatter":{"slug":"long-blog-post","title":"Long Blog Post","authors":"endi","tags":["hello","docusaurus"]},"unlisted":false,"prevItem":{"title":"MDX Blog Post","permalink":"/blog/mdx-blog-post"},"nextItem":{"title":"First Blog Post","permalink":"/blog/first-blog-post"}},"content":"This is the summary of a very long blog post,\\n\\nUse a `\x3c!--` `truncate` `--\x3e` comment to limit blog post size in the list view.\\n\\n\x3c!--truncate--\x3e\\n\\nLorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque elementum dignissim ultricies. Fusce rhoncus ipsum tempor eros aliquam consequat. Lorem ipsum dolor sit amet\\n\\nLorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque elementum dignissim ultricies. Fusce rhoncus ipsum tempor eros aliquam consequat. Lorem ipsum dolor sit amet\\n\\nLorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque elementum dignissim ultricies. Fusce rhoncus ipsum tempor eros aliquam consequat. Lorem ipsum dolor sit amet\\n\\nLorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque elementum dignissim ultricies. Fusce rhoncus ipsum tempor eros aliquam consequat. Lorem ipsum dolor sit amet\\n\\nLorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque elementum dignissim ultricies. Fusce rhoncus ipsum tempor eros aliquam consequat. Lorem ipsum dolor sit amet\\n\\nLorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque elementum dignissim ultricies. Fusce rhoncus ipsum tempor eros aliquam consequat. Lorem ipsum dolor sit amet\\n\\nLorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque elementum dignissim ultricies. Fusce rhoncus ipsum tempor eros aliquam consequat. Lorem ipsum dolor sit amet\\n\\nLorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque elementum dignissim ultricies. Fusce rhoncus ipsum tempor eros aliquam consequat. Lorem ipsum dolor sit amet\\n\\nLorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque elementum dignissim ultricies. Fusce rhoncus ipsum tempor eros aliquam consequat. Lorem ipsum dolor sit amet\\n\\nLorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque elementum dignissim ultricies. Fusce rhoncus ipsum tempor eros aliquam consequat. Lorem ipsum dolor sit amet\\n\\nLorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque elementum dignissim ultricies. Fusce rhoncus ipsum tempor eros aliquam consequat. Lorem ipsum dolor sit amet\\n\\nLorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque elementum dignissim ultricies. Fusce rhoncus ipsum tempor eros aliquam consequat. Lorem ipsum dolor sit amet\\n\\nLorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque elementum dignissim ultricies. Fusce rhoncus ipsum tempor eros aliquam consequat. Lorem ipsum dolor sit amet\\n\\nLorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque elementum dignissim ultricies. Fusce rhoncus ipsum tempor eros aliquam consequat. Lorem ipsum dolor sit amet\\n\\nLorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque elementum dignissim ultricies. Fusce rhoncus ipsum tempor eros aliquam consequat. Lorem ipsum dolor sit amet\\n\\nLorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque elementum dignissim ultricies. Fusce rhoncus ipsum tempor eros aliquam consequat. Lorem ipsum dolor sit amet"},{"id":"first-blog-post","metadata":{"permalink":"/blog/first-blog-post","editUrl":"https://github.com/facebook/docusaurus/tree/main/packages/create-docusaurus/templates/shared/blog/2019-05-28-first-blog-post.md","source":"@site/blog/2019-05-28-first-blog-post.md","title":"First Blog Post","description":"Lorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque elementum dignissim ultricies. Fusce rhoncus ipsum tempor eros aliquam consequat. Lorem ipsum dolor sit amet","date":"2019-05-28T00:00:00.000Z","formattedDate":"May 28, 2019","tags":[{"label":"hola","permalink":"/blog/tags/hola"},{"label":"docusaurus","permalink":"/blog/tags/docusaurus"}],"readingTime":0.12,"hasTruncateMarker":false,"authors":[{"name":"Gao Wei","title":"Docusaurus Core Team","url":"https://github.com/wgao19","image_url":"https://github.com/wgao19.png","imageURL":"https://github.com/wgao19.png"}],"frontMatter":{"slug":"first-blog-post","title":"First Blog Post","authors":{"name":"Gao Wei","title":"Docusaurus Core Team","url":"https://github.com/wgao19","image_url":"https://github.com/wgao19.png","imageURL":"https://github.com/wgao19.png"},"tags":["hola","docusaurus"]},"unlisted":false,"prevItem":{"title":"Long Blog Post","permalink":"/blog/long-blog-post"}},"content":"Lorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque elementum dignissim ultricies. Fusce rhoncus ipsum tempor eros aliquam consequat. Lorem ipsum dolor sit amet"}]}')}}]); \ No newline at end of file diff --git a/assets/js/b419606a.f3f375f3.js b/assets/js/b419606a.f3f375f3.js new file mode 100644 index 00000000..d322a275 --- /dev/null +++ b/assets/js/b419606a.f3f375f3.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunkdocs=self.webpackChunkdocs||[]).push([[6366],{2914:s=>{s.exports=JSON.parse('{"label":"docusaurus","permalink":"/protoc-gen-go-temporal/blog/tags/docusaurus","allTagsPath":"/protoc-gen-go-temporal/blog/tags","count":4,"unlisted":false}')}}]); \ No newline at end of file diff --git a/assets/js/b9958750.1a70b6ce.js b/assets/js/b9958750.1a70b6ce.js deleted file mode 100644 index 34894e6a..00000000 --- a/assets/js/b9958750.1a70b6ce.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunkdocs=self.webpackChunkdocs||[]).push([[7414],{9208:(e,t,n)=>{n.r(t),n.d(t,{assets:()=>l,contentTitle:()=>u,default:()=>d,frontMatter:()=>o,metadata:()=>s,toc:()=>i});var r=n(4848),a=n(8453);n(1470),n(9365);const o={},u="Documentation",s={id:"guides/documentation",title:"Documentation",description:"Coming Soon...",source:"@site/docs/guides/documentation.mdx",sourceDirName:"guides",slug:"/guides/documentation",permalink:"/docs/guides/documentation",draft:!1,unlisted:!1,editUrl:"https://github.com/facebook/docusaurus/tree/main/packages/create-docusaurus/templates/shared/docs/guides/documentation.mdx",tags:[],version:"current",frontMatter:{},sidebar:"docs",previous:{title:"Codec Server",permalink:"/docs/guides/codec-server"}},l={},i=[];function c(e){const t={h1:"h1",p:"p",strong:"strong",...(0,a.R)(),...e.components};return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(t.h1,{id:"documentation",children:"Documentation"}),"\n",(0,r.jsx)(t.p,{children:(0,r.jsx)(t.strong,{children:"Coming Soon..."})})]})}function d(e={}){const{wrapper:t}={...(0,a.R)(),...e.components};return t?(0,r.jsx)(t,{...e,children:(0,r.jsx)(c,{...e})}):c(e)}},9365:(e,t,n)=>{n.d(t,{A:()=>u});n(6540);var r=n(4164);const a={tabItem:"tabItem_Ymn6"};var o=n(4848);function u(e){let{children:t,hidden:n,className:u}=e;return(0,o.jsx)("div",{role:"tabpanel",className:(0,r.A)(a.tabItem,u),hidden:n,children:t})}},1470:(e,t,n)=>{n.d(t,{A:()=>k});var r=n(6540),a=n(4164),o=n(3104),u=n(6347),s=n(205),l=n(7485),i=n(1682),c=n(9466);function d(e){return r.Children.toArray(e).filter((e=>"\n"!==e)).map((e=>{if(!e||(0,r.isValidElement)(e)&&function(e){const{props:t}=e;return!!t&&"object"==typeof t&&"value"in t}(e))return e;throw new Error(`Docusaurus error: Bad child <${"string"==typeof e.type?e.type:e.type.name}>: all children of the component should be , and every should have a unique "value" prop.`)}))?.filter(Boolean)??[]}function m(e){const{values:t,children:n}=e;return(0,r.useMemo)((()=>{const e=t??function(e){return d(e).map((e=>{let{props:{value:t,label:n,attributes:r,default:a}}=e;return{value:t,label:n,attributes:r,default:a}}))}(n);return function(e){const t=(0,i.X)(e,((e,t)=>e.value===t.value));if(t.length>0)throw new Error(`Docusaurus error: Duplicate values "${t.map((e=>e.value)).join(", ")}" found in . Every value needs to be unique.`)}(e),e}),[t,n])}function f(e){let{value:t,tabValues:n}=e;return n.some((e=>e.value===t))}function p(e){let{queryString:t=!1,groupId:n}=e;const a=(0,u.W6)(),o=function(e){let{queryString:t=!1,groupId:n}=e;if("string"==typeof t)return t;if(!1===t)return null;if(!0===t&&!n)throw new Error('Docusaurus error: The component groupId prop is required if queryString=true, because this value is used as the search param name. You can also provide an explicit value such as queryString="my-search-param".');return n??null}({queryString:t,groupId:n});return[(0,l.aZ)(o),(0,r.useCallback)((e=>{if(!o)return;const t=new URLSearchParams(a.location.search);t.set(o,e),a.replace({...a.location,search:t.toString()})}),[o,a])]}function b(e){const{defaultValue:t,queryString:n=!1,groupId:a}=e,o=m(e),[u,l]=(0,r.useState)((()=>function(e){let{defaultValue:t,tabValues:n}=e;if(0===n.length)throw new Error("Docusaurus error: the component requires at least one children component");if(t){if(!f({value:t,tabValues:n}))throw new Error(`Docusaurus error: The has a defaultValue "${t}" but none of its children has the corresponding value. Available values are: ${n.map((e=>e.value)).join(", ")}. If you intend to show no default tab, use defaultValue={null} instead.`);return t}const r=n.find((e=>e.default))??n[0];if(!r)throw new Error("Unexpected error: 0 tabValues");return r.value}({defaultValue:t,tabValues:o}))),[i,d]=p({queryString:n,groupId:a}),[b,h]=function(e){let{groupId:t}=e;const n=function(e){return e?`docusaurus.tab.${e}`:null}(t),[a,o]=(0,c.Dv)(n);return[a,(0,r.useCallback)((e=>{n&&o.set(e)}),[n,o])]}({groupId:a}),v=(()=>{const e=i??b;return f({value:e,tabValues:o})?e:null})();(0,s.A)((()=>{v&&l(v)}),[v]);return{selectedValue:u,selectValue:(0,r.useCallback)((e=>{if(!f({value:e,tabValues:o}))throw new Error(`Can't select invalid tab value=${e}`);l(e),d(e),h(e)}),[d,h,o]),tabValues:o}}var h=n(2303);const v={tabList:"tabList__CuJ",tabItem:"tabItem_LNqP"};var g=n(4848);function x(e){let{className:t,block:n,selectedValue:r,selectValue:u,tabValues:s}=e;const l=[],{blockElementScrollPositionUntilNextRender:i}=(0,o.a_)(),c=e=>{const t=e.currentTarget,n=l.indexOf(t),a=s[n].value;a!==r&&(i(t),u(a))},d=e=>{let t=null;switch(e.key){case"Enter":c(e);break;case"ArrowRight":{const n=l.indexOf(e.currentTarget)+1;t=l[n]??l[0];break}case"ArrowLeft":{const n=l.indexOf(e.currentTarget)-1;t=l[n]??l[l.length-1];break}}t?.focus()};return(0,g.jsx)("ul",{role:"tablist","aria-orientation":"horizontal",className:(0,a.A)("tabs",{"tabs--block":n},t),children:s.map((e=>{let{value:t,label:n,attributes:o}=e;return(0,g.jsx)("li",{role:"tab",tabIndex:r===t?0:-1,"aria-selected":r===t,ref:e=>l.push(e),onKeyDown:d,onClick:c,...o,className:(0,a.A)("tabs__item",v.tabItem,o?.className,{"tabs__item--active":r===t}),children:n??t},t)}))})}function y(e){let{lazy:t,children:n,selectedValue:a}=e;const o=(Array.isArray(n)?n:[n]).filter(Boolean);if(t){const e=o.find((e=>e.props.value===a));return e?(0,r.cloneElement)(e,{className:"margin-top--md"}):null}return(0,g.jsx)("div",{className:"margin-top--md",children:o.map(((e,t)=>(0,r.cloneElement)(e,{key:t,hidden:e.props.value!==a})))})}function w(e){const t=b(e);return(0,g.jsxs)("div",{className:(0,a.A)("tabs-container",v.tabList),children:[(0,g.jsx)(x,{...e,...t}),(0,g.jsx)(y,{...e,...t})]})}function k(e){const t=(0,h.A)();return(0,g.jsx)(w,{...e,children:d(e.children)},String(t))}},8453:(e,t,n)=>{n.d(t,{R:()=>u,x:()=>s});var r=n(6540);const a={},o=r.createContext(a);function u(e){const t=r.useContext(o);return r.useMemo((function(){return"function"==typeof e?e(t):{...t,...e}}),[t,e])}function s(e){let t;return t=e.disableParentContext?"function"==typeof e.components?e.components(a):e.components||a:u(e.components),r.createElement(o.Provider,{value:t},e.children)}}}]); \ No newline at end of file diff --git a/assets/js/b9958750.b47dc2fd.js b/assets/js/b9958750.b47dc2fd.js new file mode 100644 index 00000000..c1d542dd --- /dev/null +++ b/assets/js/b9958750.b47dc2fd.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunkdocs=self.webpackChunkdocs||[]).push([[7414],{9208:(e,t,n)=>{n.r(t),n.d(t,{assets:()=>l,contentTitle:()=>u,default:()=>d,frontMatter:()=>o,metadata:()=>s,toc:()=>c});var r=n(4848),a=n(8453);n(1470),n(9365);const o={},u="Documentation",s={id:"guides/documentation",title:"Documentation",description:"Coming Soon...",source:"@site/docs/guides/documentation.mdx",sourceDirName:"guides",slug:"/guides/documentation",permalink:"/protoc-gen-go-temporal/docs/guides/documentation",draft:!1,unlisted:!1,editUrl:"https://github.com/facebook/docusaurus/tree/main/packages/create-docusaurus/templates/shared/docs/guides/documentation.mdx",tags:[],version:"current",frontMatter:{},sidebar:"docs",previous:{title:"Codec Server",permalink:"/protoc-gen-go-temporal/docs/guides/codec-server"}},l={},c=[];function i(e){const t={h1:"h1",p:"p",strong:"strong",...(0,a.R)(),...e.components};return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(t.h1,{id:"documentation",children:"Documentation"}),"\n",(0,r.jsx)(t.p,{children:(0,r.jsx)(t.strong,{children:"Coming Soon..."})})]})}function d(e={}){const{wrapper:t}={...(0,a.R)(),...e.components};return t?(0,r.jsx)(t,{...e,children:(0,r.jsx)(i,{...e})}):i(e)}},9365:(e,t,n)=>{n.d(t,{A:()=>u});n(6540);var r=n(4164);const a={tabItem:"tabItem_Ymn6"};var o=n(4848);function u(e){let{children:t,hidden:n,className:u}=e;return(0,o.jsx)("div",{role:"tabpanel",className:(0,r.A)(a.tabItem,u),hidden:n,children:t})}},1470:(e,t,n)=>{n.d(t,{A:()=>k});var r=n(6540),a=n(4164),o=n(3104),u=n(6347),s=n(205),l=n(7485),c=n(1682),i=n(9466);function d(e){return r.Children.toArray(e).filter((e=>"\n"!==e)).map((e=>{if(!e||(0,r.isValidElement)(e)&&function(e){const{props:t}=e;return!!t&&"object"==typeof t&&"value"in t}(e))return e;throw new Error(`Docusaurus error: Bad child <${"string"==typeof e.type?e.type:e.type.name}>: all children of the component should be , and every should have a unique "value" prop.`)}))?.filter(Boolean)??[]}function m(e){const{values:t,children:n}=e;return(0,r.useMemo)((()=>{const e=t??function(e){return d(e).map((e=>{let{props:{value:t,label:n,attributes:r,default:a}}=e;return{value:t,label:n,attributes:r,default:a}}))}(n);return function(e){const t=(0,c.X)(e,((e,t)=>e.value===t.value));if(t.length>0)throw new Error(`Docusaurus error: Duplicate values "${t.map((e=>e.value)).join(", ")}" found in . Every value needs to be unique.`)}(e),e}),[t,n])}function p(e){let{value:t,tabValues:n}=e;return n.some((e=>e.value===t))}function f(e){let{queryString:t=!1,groupId:n}=e;const a=(0,u.W6)(),o=function(e){let{queryString:t=!1,groupId:n}=e;if("string"==typeof t)return t;if(!1===t)return null;if(!0===t&&!n)throw new Error('Docusaurus error: The component groupId prop is required if queryString=true, because this value is used as the search param name. You can also provide an explicit value such as queryString="my-search-param".');return n??null}({queryString:t,groupId:n});return[(0,l.aZ)(o),(0,r.useCallback)((e=>{if(!o)return;const t=new URLSearchParams(a.location.search);t.set(o,e),a.replace({...a.location,search:t.toString()})}),[o,a])]}function b(e){const{defaultValue:t,queryString:n=!1,groupId:a}=e,o=m(e),[u,l]=(0,r.useState)((()=>function(e){let{defaultValue:t,tabValues:n}=e;if(0===n.length)throw new Error("Docusaurus error: the component requires at least one children component");if(t){if(!p({value:t,tabValues:n}))throw new Error(`Docusaurus error: The has a defaultValue "${t}" but none of its children has the corresponding value. Available values are: ${n.map((e=>e.value)).join(", ")}. If you intend to show no default tab, use defaultValue={null} instead.`);return t}const r=n.find((e=>e.default))??n[0];if(!r)throw new Error("Unexpected error: 0 tabValues");return r.value}({defaultValue:t,tabValues:o}))),[c,d]=f({queryString:n,groupId:a}),[b,h]=function(e){let{groupId:t}=e;const n=function(e){return e?`docusaurus.tab.${e}`:null}(t),[a,o]=(0,i.Dv)(n);return[a,(0,r.useCallback)((e=>{n&&o.set(e)}),[n,o])]}({groupId:a}),g=(()=>{const e=c??b;return p({value:e,tabValues:o})?e:null})();(0,s.A)((()=>{g&&l(g)}),[g]);return{selectedValue:u,selectValue:(0,r.useCallback)((e=>{if(!p({value:e,tabValues:o}))throw new Error(`Can't select invalid tab value=${e}`);l(e),d(e),h(e)}),[d,h,o]),tabValues:o}}var h=n(2303);const g={tabList:"tabList__CuJ",tabItem:"tabItem_LNqP"};var v=n(4848);function x(e){let{className:t,block:n,selectedValue:r,selectValue:u,tabValues:s}=e;const l=[],{blockElementScrollPositionUntilNextRender:c}=(0,o.a_)(),i=e=>{const t=e.currentTarget,n=l.indexOf(t),a=s[n].value;a!==r&&(c(t),u(a))},d=e=>{let t=null;switch(e.key){case"Enter":i(e);break;case"ArrowRight":{const n=l.indexOf(e.currentTarget)+1;t=l[n]??l[0];break}case"ArrowLeft":{const n=l.indexOf(e.currentTarget)-1;t=l[n]??l[l.length-1];break}}t?.focus()};return(0,v.jsx)("ul",{role:"tablist","aria-orientation":"horizontal",className:(0,a.A)("tabs",{"tabs--block":n},t),children:s.map((e=>{let{value:t,label:n,attributes:o}=e;return(0,v.jsx)("li",{role:"tab",tabIndex:r===t?0:-1,"aria-selected":r===t,ref:e=>l.push(e),onKeyDown:d,onClick:i,...o,className:(0,a.A)("tabs__item",g.tabItem,o?.className,{"tabs__item--active":r===t}),children:n??t},t)}))})}function y(e){let{lazy:t,children:n,selectedValue:a}=e;const o=(Array.isArray(n)?n:[n]).filter(Boolean);if(t){const e=o.find((e=>e.props.value===a));return e?(0,r.cloneElement)(e,{className:"margin-top--md"}):null}return(0,v.jsx)("div",{className:"margin-top--md",children:o.map(((e,t)=>(0,r.cloneElement)(e,{key:t,hidden:e.props.value!==a})))})}function w(e){const t=b(e);return(0,v.jsxs)("div",{className:(0,a.A)("tabs-container",g.tabList),children:[(0,v.jsx)(x,{...e,...t}),(0,v.jsx)(y,{...e,...t})]})}function k(e){const t=(0,h.A)();return(0,v.jsx)(w,{...e,children:d(e.children)},String(t))}},8453:(e,t,n)=>{n.d(t,{R:()=>u,x:()=>s});var r=n(6540);const a={},o=r.createContext(a);function u(e){const t=r.useContext(o);return r.useMemo((function(){return"function"==typeof e?e(t):{...t,...e}}),[t,e])}function s(e){let t;return t=e.disableParentContext?"function"==typeof e.components?e.components(a):e.components||a:u(e.components),r.createElement(o.Provider,{value:t},e.children)}}}]); \ No newline at end of file diff --git a/assets/js/c726c94b.e696db08.js b/assets/js/c726c94b.e696db08.js new file mode 100644 index 00000000..8a727ce4 --- /dev/null +++ b/assets/js/c726c94b.e696db08.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunkdocs=self.webpackChunkdocs||[]).push([[9335],{5564:o=>{o.exports=JSON.parse('{"permalink":"/protoc-gen-go-temporal/blog","page":1,"postsPerPage":10,"totalPages":1,"totalCount":4,"blogDescription":"Blog","blogTitle":"Blog"}')}}]); \ No newline at end of file diff --git a/assets/js/cb7b72ef.b01787c3.js b/assets/js/cb7b72ef.b01787c3.js deleted file mode 100644 index 56c982e7..00000000 --- a/assets/js/cb7b72ef.b01787c3.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunkdocs=self.webpackChunkdocs||[]).push([[7125],{2780:(e,t,r)=>{r.r(t),r.d(t,{assets:()=>l,contentTitle:()=>u,default:()=>d,frontMatter:()=>s,metadata:()=>o,toc:()=>i});var n=r(4848),a=r(8453);r(1470),r(9365);const s={},u="Updates",o={id:"guides/updates",title:"Updates",description:"Coming Soon...",source:"@site/docs/guides/updates.mdx",sourceDirName:"guides",slug:"/guides/updates",permalink:"/docs/guides/updates",draft:!1,unlisted:!1,editUrl:"https://github.com/facebook/docusaurus/tree/main/packages/create-docusaurus/templates/shared/docs/guides/updates.mdx",tags:[],version:"current",frontMatter:{},sidebar:"docs",previous:{title:"Testing",permalink:"/docs/guides/testing"},next:{title:"Clients",permalink:"/docs/guides/clients"}},l={},i=[];function c(e){const t={h1:"h1",p:"p",strong:"strong",...(0,a.R)(),...e.components};return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(t.h1,{id:"updates",children:"Updates"}),"\n",(0,n.jsx)(t.p,{children:(0,n.jsx)(t.strong,{children:"Coming Soon..."})})]})}function d(e={}){const{wrapper:t}={...(0,a.R)(),...e.components};return t?(0,n.jsx)(t,{...e,children:(0,n.jsx)(c,{...e})}):c(e)}},9365:(e,t,r)=>{r.d(t,{A:()=>u});r(6540);var n=r(4164);const a={tabItem:"tabItem_Ymn6"};var s=r(4848);function u(e){let{children:t,hidden:r,className:u}=e;return(0,s.jsx)("div",{role:"tabpanel",className:(0,n.A)(a.tabItem,u),hidden:r,children:t})}},1470:(e,t,r)=>{r.d(t,{A:()=>k});var n=r(6540),a=r(4164),s=r(3104),u=r(6347),o=r(205),l=r(7485),i=r(1682),c=r(9466);function d(e){return n.Children.toArray(e).filter((e=>"\n"!==e)).map((e=>{if(!e||(0,n.isValidElement)(e)&&function(e){const{props:t}=e;return!!t&&"object"==typeof t&&"value"in t}(e))return e;throw new Error(`Docusaurus error: Bad child <${"string"==typeof e.type?e.type:e.type.name}>: all children of the component should be , and every should have a unique "value" prop.`)}))?.filter(Boolean)??[]}function p(e){const{values:t,children:r}=e;return(0,n.useMemo)((()=>{const e=t??function(e){return d(e).map((e=>{let{props:{value:t,label:r,attributes:n,default:a}}=e;return{value:t,label:r,attributes:n,default:a}}))}(r);return function(e){const t=(0,i.X)(e,((e,t)=>e.value===t.value));if(t.length>0)throw new Error(`Docusaurus error: Duplicate values "${t.map((e=>e.value)).join(", ")}" found in . Every value needs to be unique.`)}(e),e}),[t,r])}function f(e){let{value:t,tabValues:r}=e;return r.some((e=>e.value===t))}function m(e){let{queryString:t=!1,groupId:r}=e;const a=(0,u.W6)(),s=function(e){let{queryString:t=!1,groupId:r}=e;if("string"==typeof t)return t;if(!1===t)return null;if(!0===t&&!r)throw new Error('Docusaurus error: The component groupId prop is required if queryString=true, because this value is used as the search param name. You can also provide an explicit value such as queryString="my-search-param".');return r??null}({queryString:t,groupId:r});return[(0,l.aZ)(s),(0,n.useCallback)((e=>{if(!s)return;const t=new URLSearchParams(a.location.search);t.set(s,e),a.replace({...a.location,search:t.toString()})}),[s,a])]}function b(e){const{defaultValue:t,queryString:r=!1,groupId:a}=e,s=p(e),[u,l]=(0,n.useState)((()=>function(e){let{defaultValue:t,tabValues:r}=e;if(0===r.length)throw new Error("Docusaurus error: the component requires at least one children component");if(t){if(!f({value:t,tabValues:r}))throw new Error(`Docusaurus error: The has a defaultValue "${t}" but none of its children has the corresponding value. Available values are: ${r.map((e=>e.value)).join(", ")}. If you intend to show no default tab, use defaultValue={null} instead.`);return t}const n=r.find((e=>e.default))??r[0];if(!n)throw new Error("Unexpected error: 0 tabValues");return n.value}({defaultValue:t,tabValues:s}))),[i,d]=m({queryString:r,groupId:a}),[b,h]=function(e){let{groupId:t}=e;const r=function(e){return e?`docusaurus.tab.${e}`:null}(t),[a,s]=(0,c.Dv)(r);return[a,(0,n.useCallback)((e=>{r&&s.set(e)}),[r,s])]}({groupId:a}),g=(()=>{const e=i??b;return f({value:e,tabValues:s})?e:null})();(0,o.A)((()=>{g&&l(g)}),[g]);return{selectedValue:u,selectValue:(0,n.useCallback)((e=>{if(!f({value:e,tabValues:s}))throw new Error(`Can't select invalid tab value=${e}`);l(e),d(e),h(e)}),[d,h,s]),tabValues:s}}var h=r(2303);const g={tabList:"tabList__CuJ",tabItem:"tabItem_LNqP"};var v=r(4848);function x(e){let{className:t,block:r,selectedValue:n,selectValue:u,tabValues:o}=e;const l=[],{blockElementScrollPositionUntilNextRender:i}=(0,s.a_)(),c=e=>{const t=e.currentTarget,r=l.indexOf(t),a=o[r].value;a!==n&&(i(t),u(a))},d=e=>{let t=null;switch(e.key){case"Enter":c(e);break;case"ArrowRight":{const r=l.indexOf(e.currentTarget)+1;t=l[r]??l[0];break}case"ArrowLeft":{const r=l.indexOf(e.currentTarget)-1;t=l[r]??l[l.length-1];break}}t?.focus()};return(0,v.jsx)("ul",{role:"tablist","aria-orientation":"horizontal",className:(0,a.A)("tabs",{"tabs--block":r},t),children:o.map((e=>{let{value:t,label:r,attributes:s}=e;return(0,v.jsx)("li",{role:"tab",tabIndex:n===t?0:-1,"aria-selected":n===t,ref:e=>l.push(e),onKeyDown:d,onClick:c,...s,className:(0,a.A)("tabs__item",g.tabItem,s?.className,{"tabs__item--active":n===t}),children:r??t},t)}))})}function y(e){let{lazy:t,children:r,selectedValue:a}=e;const s=(Array.isArray(r)?r:[r]).filter(Boolean);if(t){const e=s.find((e=>e.props.value===a));return e?(0,n.cloneElement)(e,{className:"margin-top--md"}):null}return(0,v.jsx)("div",{className:"margin-top--md",children:s.map(((e,t)=>(0,n.cloneElement)(e,{key:t,hidden:e.props.value!==a})))})}function w(e){const t=b(e);return(0,v.jsxs)("div",{className:(0,a.A)("tabs-container",g.tabList),children:[(0,v.jsx)(x,{...e,...t}),(0,v.jsx)(y,{...e,...t})]})}function k(e){const t=(0,h.A)();return(0,v.jsx)(w,{...e,children:d(e.children)},String(t))}},8453:(e,t,r)=>{r.d(t,{R:()=>u,x:()=>o});var n=r(6540);const a={},s=n.createContext(a);function u(e){const t=n.useContext(s);return n.useMemo((function(){return"function"==typeof e?e(t):{...t,...e}}),[t,e])}function o(e){let t;return t=e.disableParentContext?"function"==typeof e.components?e.components(a):e.components||a:u(e.components),n.createElement(s.Provider,{value:t},e.children)}}}]); \ No newline at end of file diff --git a/assets/js/cb7b72ef.e063f60b.js b/assets/js/cb7b72ef.e063f60b.js new file mode 100644 index 00000000..4d9dc427 --- /dev/null +++ b/assets/js/cb7b72ef.e063f60b.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunkdocs=self.webpackChunkdocs||[]).push([[7125],{2780:(e,t,r)=>{r.r(t),r.d(t,{assets:()=>l,contentTitle:()=>o,default:()=>d,frontMatter:()=>s,metadata:()=>u,toc:()=>i});var n=r(4848),a=r(8453);r(1470),r(9365);const s={},o="Updates",u={id:"guides/updates",title:"Updates",description:"Coming Soon...",source:"@site/docs/guides/updates.mdx",sourceDirName:"guides",slug:"/guides/updates",permalink:"/protoc-gen-go-temporal/docs/guides/updates",draft:!1,unlisted:!1,editUrl:"https://github.com/facebook/docusaurus/tree/main/packages/create-docusaurus/templates/shared/docs/guides/updates.mdx",tags:[],version:"current",frontMatter:{},sidebar:"docs",previous:{title:"Testing",permalink:"/protoc-gen-go-temporal/docs/guides/testing"},next:{title:"Clients",permalink:"/protoc-gen-go-temporal/docs/guides/clients"}},l={},i=[];function c(e){const t={h1:"h1",p:"p",strong:"strong",...(0,a.R)(),...e.components};return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(t.h1,{id:"updates",children:"Updates"}),"\n",(0,n.jsx)(t.p,{children:(0,n.jsx)(t.strong,{children:"Coming Soon..."})})]})}function d(e={}){const{wrapper:t}={...(0,a.R)(),...e.components};return t?(0,n.jsx)(t,{...e,children:(0,n.jsx)(c,{...e})}):c(e)}},9365:(e,t,r)=>{r.d(t,{A:()=>o});r(6540);var n=r(4164);const a={tabItem:"tabItem_Ymn6"};var s=r(4848);function o(e){let{children:t,hidden:r,className:o}=e;return(0,s.jsx)("div",{role:"tabpanel",className:(0,n.A)(a.tabItem,o),hidden:r,children:t})}},1470:(e,t,r)=>{r.d(t,{A:()=>k});var n=r(6540),a=r(4164),s=r(3104),o=r(6347),u=r(205),l=r(7485),i=r(1682),c=r(9466);function d(e){return n.Children.toArray(e).filter((e=>"\n"!==e)).map((e=>{if(!e||(0,n.isValidElement)(e)&&function(e){const{props:t}=e;return!!t&&"object"==typeof t&&"value"in t}(e))return e;throw new Error(`Docusaurus error: Bad child <${"string"==typeof e.type?e.type:e.type.name}>: all children of the component should be , and every should have a unique "value" prop.`)}))?.filter(Boolean)??[]}function p(e){const{values:t,children:r}=e;return(0,n.useMemo)((()=>{const e=t??function(e){return d(e).map((e=>{let{props:{value:t,label:r,attributes:n,default:a}}=e;return{value:t,label:r,attributes:n,default:a}}))}(r);return function(e){const t=(0,i.X)(e,((e,t)=>e.value===t.value));if(t.length>0)throw new Error(`Docusaurus error: Duplicate values "${t.map((e=>e.value)).join(", ")}" found in . Every value needs to be unique.`)}(e),e}),[t,r])}function f(e){let{value:t,tabValues:r}=e;return r.some((e=>e.value===t))}function m(e){let{queryString:t=!1,groupId:r}=e;const a=(0,o.W6)(),s=function(e){let{queryString:t=!1,groupId:r}=e;if("string"==typeof t)return t;if(!1===t)return null;if(!0===t&&!r)throw new Error('Docusaurus error: The component groupId prop is required if queryString=true, because this value is used as the search param name. You can also provide an explicit value such as queryString="my-search-param".');return r??null}({queryString:t,groupId:r});return[(0,l.aZ)(s),(0,n.useCallback)((e=>{if(!s)return;const t=new URLSearchParams(a.location.search);t.set(s,e),a.replace({...a.location,search:t.toString()})}),[s,a])]}function b(e){const{defaultValue:t,queryString:r=!1,groupId:a}=e,s=p(e),[o,l]=(0,n.useState)((()=>function(e){let{defaultValue:t,tabValues:r}=e;if(0===r.length)throw new Error("Docusaurus error: the component requires at least one children component");if(t){if(!f({value:t,tabValues:r}))throw new Error(`Docusaurus error: The has a defaultValue "${t}" but none of its children has the corresponding value. Available values are: ${r.map((e=>e.value)).join(", ")}. If you intend to show no default tab, use defaultValue={null} instead.`);return t}const n=r.find((e=>e.default))??r[0];if(!n)throw new Error("Unexpected error: 0 tabValues");return n.value}({defaultValue:t,tabValues:s}))),[i,d]=m({queryString:r,groupId:a}),[b,h]=function(e){let{groupId:t}=e;const r=function(e){return e?`docusaurus.tab.${e}`:null}(t),[a,s]=(0,c.Dv)(r);return[a,(0,n.useCallback)((e=>{r&&s.set(e)}),[r,s])]}({groupId:a}),g=(()=>{const e=i??b;return f({value:e,tabValues:s})?e:null})();(0,u.A)((()=>{g&&l(g)}),[g]);return{selectedValue:o,selectValue:(0,n.useCallback)((e=>{if(!f({value:e,tabValues:s}))throw new Error(`Can't select invalid tab value=${e}`);l(e),d(e),h(e)}),[d,h,s]),tabValues:s}}var h=r(2303);const g={tabList:"tabList__CuJ",tabItem:"tabItem_LNqP"};var v=r(4848);function x(e){let{className:t,block:r,selectedValue:n,selectValue:o,tabValues:u}=e;const l=[],{blockElementScrollPositionUntilNextRender:i}=(0,s.a_)(),c=e=>{const t=e.currentTarget,r=l.indexOf(t),a=u[r].value;a!==n&&(i(t),o(a))},d=e=>{let t=null;switch(e.key){case"Enter":c(e);break;case"ArrowRight":{const r=l.indexOf(e.currentTarget)+1;t=l[r]??l[0];break}case"ArrowLeft":{const r=l.indexOf(e.currentTarget)-1;t=l[r]??l[l.length-1];break}}t?.focus()};return(0,v.jsx)("ul",{role:"tablist","aria-orientation":"horizontal",className:(0,a.A)("tabs",{"tabs--block":r},t),children:u.map((e=>{let{value:t,label:r,attributes:s}=e;return(0,v.jsx)("li",{role:"tab",tabIndex:n===t?0:-1,"aria-selected":n===t,ref:e=>l.push(e),onKeyDown:d,onClick:c,...s,className:(0,a.A)("tabs__item",g.tabItem,s?.className,{"tabs__item--active":n===t}),children:r??t},t)}))})}function y(e){let{lazy:t,children:r,selectedValue:a}=e;const s=(Array.isArray(r)?r:[r]).filter(Boolean);if(t){const e=s.find((e=>e.props.value===a));return e?(0,n.cloneElement)(e,{className:"margin-top--md"}):null}return(0,v.jsx)("div",{className:"margin-top--md",children:s.map(((e,t)=>(0,n.cloneElement)(e,{key:t,hidden:e.props.value!==a})))})}function w(e){const t=b(e);return(0,v.jsxs)("div",{className:(0,a.A)("tabs-container",g.tabList),children:[(0,v.jsx)(x,{...e,...t}),(0,v.jsx)(y,{...e,...t})]})}function k(e){const t=(0,h.A)();return(0,v.jsx)(w,{...e,children:d(e.children)},String(t))}},8453:(e,t,r)=>{r.d(t,{R:()=>o,x:()=>u});var n=r(6540);const a={},s=n.createContext(a);function o(e){const t=n.useContext(s);return n.useMemo((function(){return"function"==typeof e?e(t):{...t,...e}}),[t,e])}function u(e){let t;return t=e.disableParentContext?"function"==typeof e.components?e.components(a):e.components||a:o(e.components),n.createElement(s.Provider,{value:t},e.children)}}}]); \ No newline at end of file diff --git a/assets/js/d6629652.1ad2a2cb.js b/assets/js/d6629652.1ad2a2cb.js deleted file mode 100644 index a02bcf9b..00000000 --- a/assets/js/d6629652.1ad2a2cb.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunkdocs=self.webpackChunkdocs||[]).push([[6325],{1912:(e,n,o)=>{o.r(n),o.d(n,{assets:()=>c,contentTitle:()=>s,default:()=>d,frontMatter:()=>i,metadata:()=>p,toc:()=>u});var r=o(4848),t=o(8453),l=o(1470),a=o(9365);const i={},s="Workflows",p={id:"guides/workflows",title:"Workflows",description:"Implementation",source:"@site/docs/guides/workflows.mdx",sourceDirName:"guides",slug:"/guides/workflows",permalink:"/docs/guides/workflows",draft:!1,unlisted:!1,editUrl:"https://github.com/facebook/docusaurus/tree/main/packages/create-docusaurus/templates/shared/docs/guides/workflows.mdx",tags:[],version:"current",frontMatter:{},sidebar:"docs",previous:{title:"Update",permalink:"/docs/configuration/update"},next:{title:"Activities",permalink:"/docs/guides/activities"}},c={},u=[{value:"Implementation",id:"implementation",level:2},{value:"Parameters",id:"parameters",level:3},{value:"Registration",id:"registration",level:2},{value:"Composite",id:"composite",level:3},{value:"Individual",id:"individual",level:3},{value:"Invocation",id:"invocation",level:2},{value:"Client",id:"client",level:3},{value:"Command Line Interface",id:"command-line-interface",level:3},{value:"Child Workflows",id:"child-workflows",level:3},{value:"Cross-Namespace (XNS)",id:"cross-namespace-xns",level:3},{value:"Workflow Functions",id:"workflow-functions",level:3}];function m(e){const n={a:"a",admonition:"admonition",code:"code",h1:"h1",h2:"h2",h3:"h3",li:"li",p:"p",pre:"pre",ul:"ul",...(0,t.R)(),...e.components};return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(n.h1,{id:"workflows",children:"Workflows"}),"\n",(0,r.jsx)(n.h2,{id:"implementation",children:"Implementation"}),"\n",(0,r.jsxs)(n.p,{children:["A workflow is implemented as a Go ",(0,r.jsx)(n.code,{children:"struct"})," that:"]}),"\n",(0,r.jsxs)(n.ul,{children:["\n",(0,r.jsxs)(n.li,{children:["satisfies the generated ",(0,r.jsx)(n.code,{children:"Workflow"})," interface type generated by this plugin"]}),"\n",(0,r.jsxs)(n.li,{children:["embeds the generated ",(0,r.jsx)(n.code,{children:"WorkflowInput"})," struct that contains the workflow input and any registered signals"]}),"\n"]}),"\n",(0,r.jsxs)(l.A,{children:[(0,r.jsx)(a.A,{value:"implementation-workflow",label:"Go",children:(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-go",metastring:'title="example.go"',children:'package example\n\nimport (\n examplev1 "path/to/gen/example/v1"\n "go.temporal.io/sdk/workflow"\n)\n\ntype HelloWorkflow struct {\n *examplev1.HelloWorkflowInput\n}\n\nfunc (w *HelloWorkflow) Execute(ctx workflow.Context) (*examplev1.HelloOutput, error) {\n workflow.GetLogger(ctx).Info("executing hello workflow", "input", w.Req)\n return &examplev1.HelloOutput{}, nil\n}\n\n// type assertion for illustrative purposes\nvar _ examplev1.HelloWorkflow = (*HelloWorkflow)(nil)\n'})})}),(0,r.jsx)(a.A,{value:"implementation-schema",label:"Schema",children:(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-protobuf",metastring:'title="example.proto"',children:'syntax="proto3";\n\npackage example.v1;\n\nimport "temporal/v1/temporal.proto";\n\nservice Example {\n // Hello returns a friendly greeting\n rpc Hello(HelloInput) returns (HelloOutput) {\n option (temporal.v1.workflow) = {};\n }\n}\n'})})})]}),"\n",(0,r.jsx)(n.h3,{id:"parameters",children:"Parameters"}),"\n",(0,r.jsxs)(n.p,{children:["Every ",(0,r.jsx)(n.code,{children:"Workflow"})," interface includes an ",(0,r.jsx)(n.code,{children:"Execute"})," method that defines the workflow entrypoint. The signature of this method varies based on whether or not the workflow specifies a non-empty output message type."]}),"\n",(0,r.jsxs)(l.A,{children:[(0,r.jsxs)(a.A,{value:"parameters-both",label:"Input & Output Parameters",children:[(0,r.jsx)(n.admonition,{type:"tip",children:(0,r.jsx)(n.p,{children:"Most workflows should specify both an input and output message type, even if the type is empty. This to support the addition of fields to either the input or output (or both) in the future without needing to introduce a breaking change."})}),(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-protobuf",metastring:'title="example.proto"',children:'syntax="proto3";\n\npackage example.v1;\n\nimport "temporal/v1/temporal.proto";\n\nservice Example {\n rpc Hello(HelloInput) returns (HelloOutput) {\n option (temporal.v1.workflow) = {};\n }\n}\n'})}),(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-go",metastring:'title="main.go"',children:'package main\n\nimport (\n "fmt"\n\n examplev1 "path/to/gen/example/v1"\n)\n\ntype HelloWorkflow struct {\n *examplev1.HelloWorkflowInput\n}\n\nfunc (w *HelloWorkflow) Execute(ctx workflow.Context) (*examplev1.HelloOutput, error) {\n return &examplev1.HelloOutput{\n Result: fmt.Sprintf("Hello %s!", w.Req.GetName()),\n }, nil\n}\n'})})]}),(0,r.jsxs)(a.A,{value:"parameters-input",label:"No Output Parameter",children:[(0,r.jsxs)(n.p,{children:["A workflow output can be omitted using the native ",(0,r.jsx)(n.a,{href:"https://protobuf.dev/reference/protobuf/google.protobuf/#empty",children:"google.protobuf.Empty"})," type. This modifies the signature of the workflow's ",(0,r.jsx)(n.code,{children:"Execute"})," method to have a single return value of type ",(0,r.jsx)(n.code,{children:"error"}),". Note that this also requires an additional ",(0,r.jsx)(n.code,{children:"google/protobuf/empty.proto"})," protobuf import statement."]}),(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-protobuf",metastring:'title="example.proto"',children:'syntax="proto3";\n\npackage example.v1;\n\nimport "google/protobuf/empty.proto";\nimport "temporal/v1/temporal.proto";\n\nservice Example {\n rpc Hello(HelloInput) returns (google.protobuf.Empty) {\n option (temporal.v1.workflow) = {};\n }\n}\n'})}),(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-go",metastring:'title="main.go"',children:'package main\n\nimport (\n examplev1 "path/to/gen/example/v1"\n "go.temporal.io/sdk/workflow"\n)\n\ntype HelloWorkflow struct {\n *examplev1.HelloWorkflowInput\n}\n\nfunc (w *HelloWorkflow) Execute(ctx workflow.Context) error {\n workflow.GetLogger(ctx).Info("hello!", "name", w.Req.GetName())\n return nil\n}\n'})})]}),(0,r.jsxs)(a.A,{value:"parameters-output",label:"No Input Parameter",children:[(0,r.jsxs)(n.p,{children:["A workflow input can be omitted using the native ",(0,r.jsx)(n.a,{href:"https://protobuf.dev/reference/protobuf/google.protobuf/#empty",children:"google.protobuf.Empty"})," type. This does not modify the signature of the workflow's ",(0,r.jsx)(n.code,{children:"Execute"})," method, but does omit the ",(0,r.jsx)(n.code,{children:"Req"})," field from the workflow input structure. Note that this also requires an additional ",(0,r.jsx)(n.code,{children:"google/protobuf/empty.proto"})," protobuf import statement."]}),(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-protobuf",metastring:'title="example.proto"',children:'syntax="proto3";\n\npackage example.v1;\n\nimport "google/protobuf/empty.proto";\nimport "temporal/v1/temporal.proto";\n\nservice Example {\n // Hello returns a friendly greeting\n rpc Hello(google.protobuf.Empty) returns (HelloOutput) {\n option (temporal.v1.workflow) = {};\n }\n}\n'})}),(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-go",metastring:'title="main.go"',children:'package main\n\nimport (\n "fmt"\n\n examplev1 "path/to/gen/example/v1"\n)\n\ntype HelloWorkflow struct {\n *examplev1.HelloWorkflowInput\n}\n\nfunc (w *HelloWorkflow) Execute(ctx workflow.Context) (*examplev1.HelloOutput, error) {\n return &examplev1.HelloOutput{\n Result: fmt.Sprintf("Hello World!"),\n }, nil\n}\n'})})]})]}),"\n",(0,r.jsx)(n.h2,{id:"registration",children:"Registration"}),"\n",(0,r.jsx)(n.p,{children:"This plugin generates helpers for registering your workflows with a Temporal worker. These helpers rely on user-defined constructor functions. There are two flavors of registration helpers, composite and individual."}),"\n",(0,r.jsx)(n.h3,{id:"composite",children:"Composite"}),"\n",(0,r.jsx)(n.admonition,{type:"tip",children:(0,r.jsx)(n.p,{children:"The composite registration helper is the recommended approach for registrating workflows."})}),"\n",(0,r.jsxs)(n.p,{children:["Each protobuf service with Temporal workflow definitions generates a ",(0,r.jsx)(n.code,{children:"RegisterWorkflows"})," composite registration function that registers all service workflows defined on a given protobuf service. This function receives two inputs:"]}),"\n",(0,r.jsxs)(n.ul,{children:["\n",(0,r.jsxs)(n.li,{children:["a ",(0,r.jsx)(n.a,{href:"https://pkg.go.dev/go.temporal.io/sdk/worker#Registry",children:"worker.Registry"})," to register the Service workflows with"]}),"\n",(0,r.jsxs)(n.li,{children:["a struct value implementing the ",(0,r.jsx)(n.code,{children:"Workflows"})," interface generated by this plugin. The interface describes a struct with methods for each workflow that initialize a new workflow value for an individual execution."]}),"\n"]}),"\n",(0,r.jsxs)(l.A,{children:[(0,r.jsx)(a.A,{value:"go-registration-composite",label:"Go",children:(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-go",metastring:'title="main.go"',children:'package main\n\nimport (\n "log"\n\n examplev1 "path/to/gen/example/v1"\n "go.temporal.io/sdk/client"\n "go.temporal.io/sdk/worker"\n)\n\n// Workflows provides constructor methods for example.v1.Example workflows\ntype Workflows struct {}\n\n// FooWorkflow implements an example.v1.Example.Foo workflow\ntype FooWorkflow struct {\n *examplev1.FooWorkflowInput\n}\n\n// Foo initializes a new examplev1.Workflow value\nfunc (w *Workflows) Foo(ctx workflow.Context, input *examplev1.FooWorkflowInput) (examplev1.FooWorkflow, error) {\n return &FooWorld{input}, nil\n}\n\n// Execute defines the entrypoint to an example.v1.Example.Foo workflow\nfunc (w *FooWorkflow) Execute(ctx workflow.Context) (*examplev1.FooOutput, error) {\n return &examplev1.FooOutput{}, nil\n}\n\n// BarWorkflow implements an example.v1.Example.Bar workflow\ntype BarWorkflow struct {\n *examplev1.BarWorkflowInput\n}\n\n// Bar initializes a new examplev1.Workflow value\nfunc (w *Workflows) Bar(ctx workflow.Context, input *examplev1.BarWorkflowInput) (examplev1.BarWorkflow, error) {\n return &BarWorld{input}, nil\n}\n\n// Execute defines the entrypoint to an example.v1.Example.Bar workflow\nfunc (w *BarWorkflow) Execute(ctx workflow.Context) (*examplev1.BarOutput, error) {\n return &examplev1.BarOutput{}, nil\n}\n\nfunc main() {\n // initialize temporal client and worker\n c, err := client.Dial(client.Options{})\n if err != nil {\n log.Fatalf("error initializing client: %v", err)\n }\n w := worker.New(c, examplev1.ExampleTaskQueue, worker.Options{})\n\n // Register all example.v1.Example workflows with the worker\n examplev1.RegisterExampleWorkflows(w, &Workflows{})\n w.Run(worker.InterruptCh())\n}\n'})})}),(0,r.jsx)(a.A,{value:"schema-registration-composite",label:"Schema",children:(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-protobuf",metastring:'title="example.proto"',children:'syntax="proto3";\n\npackage example.v1;\n\nservice Example {\n option (temporal.v1.service) = {\n task_queue: "example-v1"\n }\n\n rpc Foo(FooInput) returns (FooOutput) {\n option (temporal.v1.workflow) = {};\n }\n\n rpc Bar(BarInput) returns (BarOutput) {\n option (temporal.v1.workflow) = {};\n }\n}\n'})})})]}),"\n",(0,r.jsx)(n.h3,{id:"individual",children:"Individual"}),"\n",(0,r.jsxs)(n.p,{children:["Each workflow definitions generates a ",(0,r.jsx)(n.code,{children:"RegisterWorkflow"})," individual registration function. This function receives two inputs:"]}),"\n",(0,r.jsxs)(n.ul,{children:["\n",(0,r.jsxs)(n.li,{children:["a ",(0,r.jsx)(n.a,{href:"https://pkg.go.dev/go.temporal.io/sdk/worker#Worker",children:"worker.Worker"})," to register the workflow with"]}),"\n",(0,r.jsx)(n.li,{children:"a constructor function that receives as input the workflow execution context and generated workflow input and initializes a new workflow value for an individual execution"}),"\n"]}),"\n",(0,r.jsxs)(l.A,{children:[(0,r.jsx)(a.A,{value:"go-registration-individual",label:"Go",children:(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-go",metastring:'title="main.go"',children:'package main\n\nimport (\n "log"\n\n examplev1 "path/to/gen/example/v1"\n "go.temporal.io/sdk/client"\n "go.temporal.io/sdk/worker"\n)\n\n// FooWorkflow implements an example.v1.Example.Foo workflow\ntype FooWorkflow struct {\n *examplev1.FooWorkflowInput\n}\n\n// NewFooWorkflow initializes a new examplev1.Workflow value\nfunc NewFooWorkflow(ctx workflow.Context, input *examplev1.FooWorkflowInput) (examplev1.FooWorkflow, error) {\n return &FooWorld{input}, nil\n}\n\n// Execute defines the entrypoint to an example.v1.Example.Foo workflow\nfunc (w *FooWorkflow) Execute(ctx workflow.Context) (*examplev1.FooOutput, error) {\n return &examplev1.FooOutput{}, nil\n}\n\n// BarWorkflow implements an example.v1.Example.Bar workflow\ntype BarWorkflow struct {\n *examplev1.BarWorkflowInput\n}\n\n// NewBarWorkflow initializes a new examplev1.Workflow value\nfunc NewBarWorkflow(ctx workflow.Context, input *examplev1.BarWorkflowInput) (examplev1.BarWorkflow, error) {\n return &BarWorld{input}, nil\n}\n\n// Execute defines the entrypoint to an example.v1.Example.Bar workflow\nfunc (w *BarWorkflow) Execute(ctx workflow.Context) (*examplev1.BarOutput, error) {\n return &examplev1.BarOutput{}, nil\n}\n\nfunc main() {\n // initialize temporal client and worker\n c, err := client.Dial(client.Options{})\n if err != nil {\n log.Fatalf("error initializing client: %v", err)\n }\n w := worker.New(c, examplev1.ExampleTaskQueue, worker.Options{})\n\n // Register all example.v1.Example workflows individually\n examplev1.RegisterFooWorkflow(w, NewFooWorkflow)\n examplev1.RegisterBarWorkflow(w, NewBarWorkflow)\n w.Run(worker.InterruptCh())\n}\n'})})}),(0,r.jsx)(a.A,{value:"schema-registration-individual",label:"Schema",children:(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-protobuf",metastring:'title="example.proto"',children:'syntax="proto3";\n\npackage example.v1;\n\nservice Example {\n option (temporal.v1.service) = {\n task_queue: "example-v1"\n }\n\n rpc Foo(FooInput) returns (FooOutput) {\n option (temporal.v1.workflow) = {};\n }\n\n rpc Bar(BarInput) returns (BarOutput) {\n option (temporal.v1.workflow) = {};\n }\n}\n'})})})]}),"\n",(0,r.jsx)(n.h2,{id:"invocation",children:"Invocation"}),"\n",(0,r.jsx)(n.p,{children:"This plugin supports several methods for executing protobuf workflows, each of which is outlined in more detail below."}),"\n",(0,r.jsx)(n.h3,{id:"client",children:"Client"}),"\n",(0,r.jsxs)(n.p,{children:["Consumers can utilize the generated Client to execute workflows from any Go application. See the ",(0,r.jsx)(n.a,{href:"/docs/guides/clients",children:"Clients guide"})," for more usage details."]}),"\n",(0,r.jsxs)(l.A,{children:[(0,r.jsx)(a.A,{value:"client-go",label:"Go",children:(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-go",metastring:'title="main.go"',children:'package main\n\nimport (\n "context"\n "log"\n\n examplev1 "path/to/gen/example/v1"\n "go.temporal.io/sdk/client"\n)\n\nfunc main() {\n // initialize temporal client\n c, err := client.Dial(client.Options{})\n if err != nil {\n log.Fatalf("error initializing client: %v", err)\n }\n\n // initialize temporal protobuf client\n client := examplev1.NewExampleClient(c)\n\n // execute an example.v1.Example.Hello workflow and block until completion or non-retryable error\n out, err := client.Hello(context.Background(), &examplev1.HelloInput{})\n if err != nil {\n log.Fatalf("error executing example.v1.Example.Hello workflow: %v", err)\n }\n}\n'})})}),(0,r.jsx)(a.A,{value:"client-schema",label:"Schema",children:(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-protobuf",metastring:'title="example.proto"',children:'syntax="proto3";\n\npackage example.v1;\n\nservice Example {\n option (temporal.v1.service) = {\n task_queue: "example-v1"\n }\n\n rpc Hello(HelloInput) returns (HelloOutput) {\n option (temporal.v1.workflow) = {};\n }\n}\n'})})})]}),"\n",(0,r.jsx)(n.h3,{id:"command-line-interface",children:"Command Line Interface"}),"\n",(0,r.jsxs)(n.p,{children:["Consumers can utilize the generated Command Line Interface as a standalone application for executing workflows. See the ",(0,r.jsx)(n.a,{href:"/docs/guides/cli",children:"CLI guide"})," for more usage details."]}),"\n",(0,r.jsxs)(l.A,{children:[(0,r.jsxs)(a.A,{value:"cli-shell",label:"Shell",children:[(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-sh",metastring:'title="example -h"',children:"NAME:\n example - an example temporal cli\n\nUSAGE:\n example [global options] command [command options] [arguments...]\n\nCOMMANDS:\n help, h Shows a list of commands or help for one command\n WORKFLOWS:\n hello Hello returns a friendly greeting\n"})}),(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-sh",metastring:'title="example hello -h"',children:'NAME:\n example hello - Hello returns a friendly greeting\n\nUSAGE:\n example hello [command options] [arguments...]\n\nCATEGORY:\n WORKFLOWS\n\nOPTIONS:\n --detach, -d run workflow in the background and print workflow and execution id (default: false)\n --help, -h show help\n --input-file value, -f value path to json-formatted input file\n --task-queue value, -t value task queue name (default: "example-v1") [$TEMPORAL_TASK_QUEUE_NAME, $TEMPORAL_TASK_QUEUE, $TASK_QUEUE_NAME, $TASK_QUEUE]\n\n INPUT\n\n --name value Name specifies the subject to greet\n'})}),(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-json",metastring:'title="example hello --name Temporal"',children:'{\n "result": "Hello Temporal!"\n}\n'})})]}),(0,r.jsx)(a.A,{value:"cli-go",label:"Go",children:(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-go",metastring:'title="main.go"',children:'package main\n\nimport (\n "log"\n "os"\n\n examplev1 "path/to/gen/example/v1"\n)\n\nfunc main() {\n app, err := examplev1.NewExampleCLI()\n if err != nil {\n log.Fatalf("error initializing cli: %v", err)\n }\n\n if err := app.Run(os.Args); err != nil {\n log.Fatal(err)\n }\n}\n'})})}),(0,r.jsx)(a.A,{value:"cli-schema",label:"Schema",children:(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-protobuf",metastring:'title="example.proto"',children:'syntax="proto3";\n\npackage example.v1;\n\nservice Example {\n option (temporal.v1.service) = {\n task_queue: "example-v1"\n }\n\n // Hello returns a friendly greeting\n rpc Hello(HelloInput) returns (HelloOutput) {\n option (temporal.v1.workflow) = {};\n }\n}\n\nmessage HelloInput {\n // Name specifies the subject to greet\n string name = 1;\n}\n\nmessage HelloOutput {\n string result = 1;\n}\n'})})})]}),"\n",(0,r.jsx)(n.h3,{id:"child-workflows",children:"Child Workflows"}),"\n",(0,r.jsxs)(n.p,{children:["Workflows can be executed as child workflows from other workflows in the same Temporal namespace. See the ",(0,r.jsx)(n.a,{href:"/docs/guides/child-workflows",children:"Child Workflows guide"})," for more usage details."]}),"\n",(0,r.jsxs)(l.A,{children:[(0,r.jsx)(a.A,{value:"child-go",label:"Go",children:(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-go",metastring:'title="example.go"',children:'package main\n\nimport (\n "fmt"\n\n examplev1 "path/to/gen/example/v1"\n "go.temporal.io/sdk/workflow"\n)\n\nfunc MyWorkflow(ctx workflow.Context) error {\n out, err := examplev1.HelloChild(ctx, &examplev1.HelloInput{})\n if err != nil {\n return fmt.Errorf("error executing example.v1.Example.Hello child workflow: %w", err)\n }\n return nil\n}\n'})})}),(0,r.jsx)(a.A,{value:"child-schema",label:"Schema",children:(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-protobuf",metastring:'title="example.proto"',children:'syntax="proto3";\n\npackage example.v1;\n\nservice Example {\n option (temporal.v1.service) = {\n task_queue: "example-v1"\n }\n\n rpc Hello(HelloInput) returns (HelloOutput) {\n option (temporal.v1.workflow) = {};\n }\n}\n'})})})]}),"\n",(0,r.jsx)(n.h3,{id:"cross-namespace-xns",children:"Cross-Namespace (XNS)"}),"\n",(0,r.jsxs)(n.p,{children:["Workflows can be executed from other workflows in a different Temporal namespace or even an entirely separate Temporal cluster (e.g. on-prem to cloud). See the ",(0,r.jsx)(n.a,{href:"/docs/guides/xns",children:"Cross-Namespace guide"})," for more usage details."]}),"\n",(0,r.jsxs)(l.A,{children:[(0,r.jsx)(a.A,{value:"xns-go",label:"Go",children:(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-go",metastring:'title="example.go"',children:'package example\n\nimport (\n "fmt"\n\n examplev1 "path/to/gen/example/v1"\n "path/to/gen/example/v1/examplev1xns"\n "go.temporal.io/sdk/workflow"\n)\n\nfunc MyWorkflow(ctx workflow.Context) error {\n out, err := examplev1xns.Hello(ctx, &examplev1.HelloInput{})\n if err != nil {\n return fmt.Errorf("error executing example.v1.Example.Hello xns workflow: %w", err)\n }\n return nil\n}\n'})})}),(0,r.jsx)(a.A,{value:"xns-schema",label:"Schema",children:(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-protobuf",metastring:'title="example.proto"',children:'syntax="proto3";\n\npackage example.v1;\n\nservice Example {\n option (temporal.v1.service) = {\n task_queue: "example-v1"\n }\n\n rpc Hello(HelloInput) returns (HelloOutput) {\n option (temporal.v1.workflow) = {};\n }\n}\n'})})})]}),"\n",(0,r.jsx)(n.h3,{id:"workflow-functions",children:"Workflow Functions"}),"\n",(0,r.jsx)(n.p,{children:"Workflow definitions can be executed inline with another workflow definition."}),"\n",(0,r.jsxs)(l.A,{children:[(0,r.jsx)(a.A,{value:"wffn-go",label:"Go",children:(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-go",metastring:'title="main.go"',children:'package main\n\nimport (\n examplev1 "path/to/gen/example/v1"\n "go.temporal.io/sdk/client"\n "go.temporal.io/sdk/worker"\n "go.temporal.io/sdk/workflow"\n)\n\ntype ExampleWorkflows struct {}\n\ntype HelloWorkflow struct {\n *examplev1.HelloWorkflowInput\n}\n\nfunc (w *ExampleWorkflows) Hello(ctx workflow.Context, input *examplev1.HelloInput) (examplev1.HelloWorkflow, error) {\n return &HelloWorkflow{input}, nil\n}\n\nfunc (w *HelloWorkflow) Execute(ctx workflow.Context) error {\n workflow.GetLogger(ctx).Info("hello!", "name", w.Req.GetName())\n return nil\n}\n\nfunc MyWorkflow(ctx workflow.Context) error {\n // this is equivalent to calling Execute inline\n out, err := examplev1.HelloFunction(ctx, &examplev1.HelloInput{})\n if err != nil {\n return fmt.Errorf("error executing example.v1.Example.Hello inline: %w", err)\n }\n return nil\n}\n\nfunc main() {\n // initialize temporal client and worker\n c, err := client.Dial(client.Options{})\n if err != nil {\n log.Fatalf("error initializing client: %v", err)\n }\n w := worker.New(c, examplev1.ExampleTaskQueue, worker.Options{})\n\n // Register all example.v1.Example workflows with the worker\n examplev1.RegisterExampleWorkflows(w, &Workflows{})\n w.RegisterWorkflow(MyWorkflow)\n w.Run(worker.InterruptCh())\n}\n'})})}),(0,r.jsx)(a.A,{value:"wffn-schema",label:"Schema",children:(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-protobuf",metastring:'title="example.proto"',children:'syntax="proto3";\n\npackage example.v1;\n\nservice Example {\n option (temporal.v1.service) = {\n task_queue: "example-v1"\n }\n\n rpc Hello(HelloInput) returns (HelloOutput) {\n option (temporal.v1.workflow) = {};\n }\n}\n'})})})]})]})}function d(e={}){const{wrapper:n}={...(0,t.R)(),...e.components};return n?(0,r.jsx)(n,{...e,children:(0,r.jsx)(m,{...e})}):m(e)}},9365:(e,n,o)=>{o.d(n,{A:()=>a});o(6540);var r=o(4164);const t={tabItem:"tabItem_Ymn6"};var l=o(4848);function a(e){let{children:n,hidden:o,className:a}=e;return(0,l.jsx)("div",{role:"tabpanel",className:(0,r.A)(t.tabItem,a),hidden:o,children:n})}},1470:(e,n,o)=>{o.d(n,{A:()=>b});var r=o(6540),t=o(4164),l=o(3104),a=o(6347),i=o(205),s=o(7485),p=o(1682),c=o(9466);function u(e){return r.Children.toArray(e).filter((e=>"\n"!==e)).map((e=>{if(!e||(0,r.isValidElement)(e)&&function(e){const{props:n}=e;return!!n&&"object"==typeof n&&"value"in n}(e))return e;throw new Error(`Docusaurus error: Bad child <${"string"==typeof e.type?e.type:e.type.name}>: all children of the component should be , and every should have a unique "value" prop.`)}))?.filter(Boolean)??[]}function m(e){const{values:n,children:o}=e;return(0,r.useMemo)((()=>{const e=n??function(e){return u(e).map((e=>{let{props:{value:n,label:o,attributes:r,default:t}}=e;return{value:n,label:o,attributes:r,default:t}}))}(o);return function(e){const n=(0,p.X)(e,((e,n)=>e.value===n.value));if(n.length>0)throw new Error(`Docusaurus error: Duplicate values "${n.map((e=>e.value)).join(", ")}" found in . Every value needs to be unique.`)}(e),e}),[n,o])}function d(e){let{value:n,tabValues:o}=e;return o.some((e=>e.value===n))}function f(e){let{queryString:n=!1,groupId:o}=e;const t=(0,a.W6)(),l=function(e){let{queryString:n=!1,groupId:o}=e;if("string"==typeof n)return n;if(!1===n)return null;if(!0===n&&!o)throw new Error('Docusaurus error: The component groupId prop is required if queryString=true, because this value is used as the search param name. You can also provide an explicit value such as queryString="my-search-param".');return o??null}({queryString:n,groupId:o});return[(0,s.aZ)(l),(0,r.useCallback)((e=>{if(!l)return;const n=new URLSearchParams(t.location.search);n.set(l,e),t.replace({...t.location,search:n.toString()})}),[l,t])]}function x(e){const{defaultValue:n,queryString:o=!1,groupId:t}=e,l=m(e),[a,s]=(0,r.useState)((()=>function(e){let{defaultValue:n,tabValues:o}=e;if(0===o.length)throw new Error("Docusaurus error: the component requires at least one children component");if(n){if(!d({value:n,tabValues:o}))throw new Error(`Docusaurus error: The has a defaultValue "${n}" but none of its children has the corresponding value. Available values are: ${o.map((e=>e.value)).join(", ")}. If you intend to show no default tab, use defaultValue={null} instead.`);return n}const r=o.find((e=>e.default))??o[0];if(!r)throw new Error("Unexpected error: 0 tabValues");return r.value}({defaultValue:n,tabValues:l}))),[p,u]=f({queryString:o,groupId:t}),[x,h]=function(e){let{groupId:n}=e;const o=function(e){return e?`docusaurus.tab.${e}`:null}(n),[t,l]=(0,c.Dv)(o);return[t,(0,r.useCallback)((e=>{o&&l.set(e)}),[o,l])]}({groupId:t}),w=(()=>{const e=p??x;return d({value:e,tabValues:l})?e:null})();(0,i.A)((()=>{w&&s(w)}),[w]);return{selectedValue:a,selectValue:(0,r.useCallback)((e=>{if(!d({value:e,tabValues:l}))throw new Error(`Can't select invalid tab value=${e}`);s(e),u(e),h(e)}),[u,h,l]),tabValues:l}}var h=o(2303);const w={tabList:"tabList__CuJ",tabItem:"tabItem_LNqP"};var g=o(4848);function v(e){let{className:n,block:o,selectedValue:r,selectValue:a,tabValues:i}=e;const s=[],{blockElementScrollPositionUntilNextRender:p}=(0,l.a_)(),c=e=>{const n=e.currentTarget,o=s.indexOf(n),t=i[o].value;t!==r&&(p(n),a(t))},u=e=>{let n=null;switch(e.key){case"Enter":c(e);break;case"ArrowRight":{const o=s.indexOf(e.currentTarget)+1;n=s[o]??s[0];break}case"ArrowLeft":{const o=s.indexOf(e.currentTarget)-1;n=s[o]??s[s.length-1];break}}n?.focus()};return(0,g.jsx)("ul",{role:"tablist","aria-orientation":"horizontal",className:(0,t.A)("tabs",{"tabs--block":o},n),children:i.map((e=>{let{value:n,label:o,attributes:l}=e;return(0,g.jsx)("li",{role:"tab",tabIndex:r===n?0:-1,"aria-selected":r===n,ref:e=>s.push(e),onKeyDown:u,onClick:c,...l,className:(0,t.A)("tabs__item",w.tabItem,l?.className,{"tabs__item--active":r===n}),children:o??n},n)}))})}function k(e){let{lazy:n,children:o,selectedValue:t}=e;const l=(Array.isArray(o)?o:[o]).filter(Boolean);if(n){const e=l.find((e=>e.props.value===t));return e?(0,r.cloneElement)(e,{className:"margin-top--md"}):null}return(0,g.jsx)("div",{className:"margin-top--md",children:l.map(((e,n)=>(0,r.cloneElement)(e,{key:n,hidden:e.props.value!==t})))})}function j(e){const n=x(e);return(0,g.jsxs)("div",{className:(0,t.A)("tabs-container",w.tabList),children:[(0,g.jsx)(v,{...e,...n}),(0,g.jsx)(k,{...e,...n})]})}function b(e){const n=(0,h.A)();return(0,g.jsx)(j,{...e,children:u(e.children)},String(n))}},8453:(e,n,o)=>{o.d(n,{R:()=>a,x:()=>i});var r=o(6540);const t={},l=r.createContext(t);function a(e){const n=r.useContext(l);return r.useMemo((function(){return"function"==typeof e?e(n):{...n,...e}}),[n,e])}function i(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(t):e.components||t:a(e.components),r.createElement(l.Provider,{value:n},e.children)}}}]); \ No newline at end of file diff --git a/assets/js/d6629652.d138c022.js b/assets/js/d6629652.d138c022.js new file mode 100644 index 00000000..1763e2b2 --- /dev/null +++ b/assets/js/d6629652.d138c022.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunkdocs=self.webpackChunkdocs||[]).push([[6325],{1912:(e,n,o)=>{o.r(n),o.d(n,{assets:()=>c,contentTitle:()=>s,default:()=>d,frontMatter:()=>i,metadata:()=>p,toc:()=>u});var r=o(4848),t=o(8453),l=o(1470),a=o(9365);const i={},s="Workflows",p={id:"guides/workflows",title:"Workflows",description:"Implementation",source:"@site/docs/guides/workflows.mdx",sourceDirName:"guides",slug:"/guides/workflows",permalink:"/protoc-gen-go-temporal/docs/guides/workflows",draft:!1,unlisted:!1,editUrl:"https://github.com/facebook/docusaurus/tree/main/packages/create-docusaurus/templates/shared/docs/guides/workflows.mdx",tags:[],version:"current",frontMatter:{},sidebar:"docs",previous:{title:"Update",permalink:"/protoc-gen-go-temporal/docs/configuration/update"},next:{title:"Activities",permalink:"/protoc-gen-go-temporal/docs/guides/activities"}},c={},u=[{value:"Implementation",id:"implementation",level:2},{value:"Parameters",id:"parameters",level:3},{value:"Registration",id:"registration",level:2},{value:"Composite",id:"composite",level:3},{value:"Individual",id:"individual",level:3},{value:"Invocation",id:"invocation",level:2},{value:"Client",id:"client",level:3},{value:"Command Line Interface",id:"command-line-interface",level:3},{value:"Child Workflows",id:"child-workflows",level:3},{value:"Cross-Namespace (XNS)",id:"cross-namespace-xns",level:3},{value:"Workflow Functions",id:"workflow-functions",level:3}];function m(e){const n={a:"a",admonition:"admonition",code:"code",h1:"h1",h2:"h2",h3:"h3",li:"li",p:"p",pre:"pre",ul:"ul",...(0,t.R)(),...e.components};return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(n.h1,{id:"workflows",children:"Workflows"}),"\n",(0,r.jsx)(n.h2,{id:"implementation",children:"Implementation"}),"\n",(0,r.jsxs)(n.p,{children:["A workflow is implemented as a Go ",(0,r.jsx)(n.code,{children:"struct"})," that:"]}),"\n",(0,r.jsxs)(n.ul,{children:["\n",(0,r.jsxs)(n.li,{children:["satisfies the generated ",(0,r.jsx)(n.code,{children:"Workflow"})," interface type generated by this plugin"]}),"\n",(0,r.jsxs)(n.li,{children:["embeds the generated ",(0,r.jsx)(n.code,{children:"WorkflowInput"})," struct that contains the workflow input and any registered signals"]}),"\n"]}),"\n",(0,r.jsxs)(l.A,{children:[(0,r.jsx)(a.A,{value:"implementation-workflow",label:"Go",children:(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-go",metastring:'title="example.go"',children:'package example\n\nimport (\n examplev1 "path/to/gen/example/v1"\n "go.temporal.io/sdk/workflow"\n)\n\ntype HelloWorkflow struct {\n *examplev1.HelloWorkflowInput\n}\n\nfunc (w *HelloWorkflow) Execute(ctx workflow.Context) (*examplev1.HelloOutput, error) {\n workflow.GetLogger(ctx).Info("executing hello workflow", "input", w.Req)\n return &examplev1.HelloOutput{}, nil\n}\n\n// type assertion for illustrative purposes\nvar _ examplev1.HelloWorkflow = (*HelloWorkflow)(nil)\n'})})}),(0,r.jsx)(a.A,{value:"implementation-schema",label:"Schema",children:(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-protobuf",metastring:'title="example.proto"',children:'syntax="proto3";\n\npackage example.v1;\n\nimport "temporal/v1/temporal.proto";\n\nservice Example {\n // Hello returns a friendly greeting\n rpc Hello(HelloInput) returns (HelloOutput) {\n option (temporal.v1.workflow) = {};\n }\n}\n'})})})]}),"\n",(0,r.jsx)(n.h3,{id:"parameters",children:"Parameters"}),"\n",(0,r.jsxs)(n.p,{children:["Every ",(0,r.jsx)(n.code,{children:"Workflow"})," interface includes an ",(0,r.jsx)(n.code,{children:"Execute"})," method that defines the workflow entrypoint. The signature of this method varies based on whether or not the workflow specifies a non-empty output message type."]}),"\n",(0,r.jsxs)(l.A,{children:[(0,r.jsxs)(a.A,{value:"parameters-both",label:"Input & Output Parameters",children:[(0,r.jsx)(n.admonition,{type:"tip",children:(0,r.jsx)(n.p,{children:"Most workflows should specify both an input and output message type, even if the type is empty. This to support the addition of fields to either the input or output (or both) in the future without needing to introduce a breaking change."})}),(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-protobuf",metastring:'title="example.proto"',children:'syntax="proto3";\n\npackage example.v1;\n\nimport "temporal/v1/temporal.proto";\n\nservice Example {\n rpc Hello(HelloInput) returns (HelloOutput) {\n option (temporal.v1.workflow) = {};\n }\n}\n'})}),(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-go",metastring:'title="main.go"',children:'package main\n\nimport (\n "fmt"\n\n examplev1 "path/to/gen/example/v1"\n)\n\ntype HelloWorkflow struct {\n *examplev1.HelloWorkflowInput\n}\n\nfunc (w *HelloWorkflow) Execute(ctx workflow.Context) (*examplev1.HelloOutput, error) {\n return &examplev1.HelloOutput{\n Result: fmt.Sprintf("Hello %s!", w.Req.GetName()),\n }, nil\n}\n'})})]}),(0,r.jsxs)(a.A,{value:"parameters-input",label:"No Output Parameter",children:[(0,r.jsxs)(n.p,{children:["A workflow output can be omitted using the native ",(0,r.jsx)(n.a,{href:"https://protobuf.dev/reference/protobuf/google.protobuf/#empty",children:"google.protobuf.Empty"})," type. This modifies the signature of the workflow's ",(0,r.jsx)(n.code,{children:"Execute"})," method to have a single return value of type ",(0,r.jsx)(n.code,{children:"error"}),". Note that this also requires an additional ",(0,r.jsx)(n.code,{children:"google/protobuf/empty.proto"})," protobuf import statement."]}),(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-protobuf",metastring:'title="example.proto"',children:'syntax="proto3";\n\npackage example.v1;\n\nimport "google/protobuf/empty.proto";\nimport "temporal/v1/temporal.proto";\n\nservice Example {\n rpc Hello(HelloInput) returns (google.protobuf.Empty) {\n option (temporal.v1.workflow) = {};\n }\n}\n'})}),(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-go",metastring:'title="main.go"',children:'package main\n\nimport (\n examplev1 "path/to/gen/example/v1"\n "go.temporal.io/sdk/workflow"\n)\n\ntype HelloWorkflow struct {\n *examplev1.HelloWorkflowInput\n}\n\nfunc (w *HelloWorkflow) Execute(ctx workflow.Context) error {\n workflow.GetLogger(ctx).Info("hello!", "name", w.Req.GetName())\n return nil\n}\n'})})]}),(0,r.jsxs)(a.A,{value:"parameters-output",label:"No Input Parameter",children:[(0,r.jsxs)(n.p,{children:["A workflow input can be omitted using the native ",(0,r.jsx)(n.a,{href:"https://protobuf.dev/reference/protobuf/google.protobuf/#empty",children:"google.protobuf.Empty"})," type. This does not modify the signature of the workflow's ",(0,r.jsx)(n.code,{children:"Execute"})," method, but does omit the ",(0,r.jsx)(n.code,{children:"Req"})," field from the workflow input structure. Note that this also requires an additional ",(0,r.jsx)(n.code,{children:"google/protobuf/empty.proto"})," protobuf import statement."]}),(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-protobuf",metastring:'title="example.proto"',children:'syntax="proto3";\n\npackage example.v1;\n\nimport "google/protobuf/empty.proto";\nimport "temporal/v1/temporal.proto";\n\nservice Example {\n // Hello returns a friendly greeting\n rpc Hello(google.protobuf.Empty) returns (HelloOutput) {\n option (temporal.v1.workflow) = {};\n }\n}\n'})}),(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-go",metastring:'title="main.go"',children:'package main\n\nimport (\n "fmt"\n\n examplev1 "path/to/gen/example/v1"\n)\n\ntype HelloWorkflow struct {\n *examplev1.HelloWorkflowInput\n}\n\nfunc (w *HelloWorkflow) Execute(ctx workflow.Context) (*examplev1.HelloOutput, error) {\n return &examplev1.HelloOutput{\n Result: fmt.Sprintf("Hello World!"),\n }, nil\n}\n'})})]})]}),"\n",(0,r.jsx)(n.h2,{id:"registration",children:"Registration"}),"\n",(0,r.jsx)(n.p,{children:"This plugin generates helpers for registering your workflows with a Temporal worker. These helpers rely on user-defined constructor functions. There are two flavors of registration helpers, composite and individual."}),"\n",(0,r.jsx)(n.h3,{id:"composite",children:"Composite"}),"\n",(0,r.jsx)(n.admonition,{type:"tip",children:(0,r.jsx)(n.p,{children:"The composite registration helper is the recommended approach for registrating workflows."})}),"\n",(0,r.jsxs)(n.p,{children:["Each protobuf service with Temporal workflow definitions generates a ",(0,r.jsx)(n.code,{children:"RegisterWorkflows"})," composite registration function that registers all service workflows defined on a given protobuf service. This function receives two inputs:"]}),"\n",(0,r.jsxs)(n.ul,{children:["\n",(0,r.jsxs)(n.li,{children:["a ",(0,r.jsx)(n.a,{href:"https://pkg.go.dev/go.temporal.io/sdk/worker#Registry",children:"worker.Registry"})," to register the Service workflows with"]}),"\n",(0,r.jsxs)(n.li,{children:["a struct value implementing the ",(0,r.jsx)(n.code,{children:"Workflows"})," interface generated by this plugin. The interface describes a struct with methods for each workflow that initialize a new workflow value for an individual execution."]}),"\n"]}),"\n",(0,r.jsxs)(l.A,{children:[(0,r.jsx)(a.A,{value:"go-registration-composite",label:"Go",children:(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-go",metastring:'title="main.go"',children:'package main\n\nimport (\n "log"\n\n examplev1 "path/to/gen/example/v1"\n "go.temporal.io/sdk/client"\n "go.temporal.io/sdk/worker"\n)\n\n// Workflows provides constructor methods for example.v1.Example workflows\ntype Workflows struct {}\n\n// FooWorkflow implements an example.v1.Example.Foo workflow\ntype FooWorkflow struct {\n *examplev1.FooWorkflowInput\n}\n\n// Foo initializes a new examplev1.Workflow value\nfunc (w *Workflows) Foo(ctx workflow.Context, input *examplev1.FooWorkflowInput) (examplev1.FooWorkflow, error) {\n return &FooWorld{input}, nil\n}\n\n// Execute defines the entrypoint to an example.v1.Example.Foo workflow\nfunc (w *FooWorkflow) Execute(ctx workflow.Context) (*examplev1.FooOutput, error) {\n return &examplev1.FooOutput{}, nil\n}\n\n// BarWorkflow implements an example.v1.Example.Bar workflow\ntype BarWorkflow struct {\n *examplev1.BarWorkflowInput\n}\n\n// Bar initializes a new examplev1.Workflow value\nfunc (w *Workflows) Bar(ctx workflow.Context, input *examplev1.BarWorkflowInput) (examplev1.BarWorkflow, error) {\n return &BarWorld{input}, nil\n}\n\n// Execute defines the entrypoint to an example.v1.Example.Bar workflow\nfunc (w *BarWorkflow) Execute(ctx workflow.Context) (*examplev1.BarOutput, error) {\n return &examplev1.BarOutput{}, nil\n}\n\nfunc main() {\n // initialize temporal client and worker\n c, err := client.Dial(client.Options{})\n if err != nil {\n log.Fatalf("error initializing client: %v", err)\n }\n w := worker.New(c, examplev1.ExampleTaskQueue, worker.Options{})\n\n // Register all example.v1.Example workflows with the worker\n examplev1.RegisterExampleWorkflows(w, &Workflows{})\n w.Run(worker.InterruptCh())\n}\n'})})}),(0,r.jsx)(a.A,{value:"schema-registration-composite",label:"Schema",children:(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-protobuf",metastring:'title="example.proto"',children:'syntax="proto3";\n\npackage example.v1;\n\nservice Example {\n option (temporal.v1.service) = {\n task_queue: "example-v1"\n }\n\n rpc Foo(FooInput) returns (FooOutput) {\n option (temporal.v1.workflow) = {};\n }\n\n rpc Bar(BarInput) returns (BarOutput) {\n option (temporal.v1.workflow) = {};\n }\n}\n'})})})]}),"\n",(0,r.jsx)(n.h3,{id:"individual",children:"Individual"}),"\n",(0,r.jsxs)(n.p,{children:["Each workflow definitions generates a ",(0,r.jsx)(n.code,{children:"RegisterWorkflow"})," individual registration function. This function receives two inputs:"]}),"\n",(0,r.jsxs)(n.ul,{children:["\n",(0,r.jsxs)(n.li,{children:["a ",(0,r.jsx)(n.a,{href:"https://pkg.go.dev/go.temporal.io/sdk/worker#Worker",children:"worker.Worker"})," to register the workflow with"]}),"\n",(0,r.jsx)(n.li,{children:"a constructor function that receives as input the workflow execution context and generated workflow input and initializes a new workflow value for an individual execution"}),"\n"]}),"\n",(0,r.jsxs)(l.A,{children:[(0,r.jsx)(a.A,{value:"go-registration-individual",label:"Go",children:(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-go",metastring:'title="main.go"',children:'package main\n\nimport (\n "log"\n\n examplev1 "path/to/gen/example/v1"\n "go.temporal.io/sdk/client"\n "go.temporal.io/sdk/worker"\n)\n\n// FooWorkflow implements an example.v1.Example.Foo workflow\ntype FooWorkflow struct {\n *examplev1.FooWorkflowInput\n}\n\n// NewFooWorkflow initializes a new examplev1.Workflow value\nfunc NewFooWorkflow(ctx workflow.Context, input *examplev1.FooWorkflowInput) (examplev1.FooWorkflow, error) {\n return &FooWorld{input}, nil\n}\n\n// Execute defines the entrypoint to an example.v1.Example.Foo workflow\nfunc (w *FooWorkflow) Execute(ctx workflow.Context) (*examplev1.FooOutput, error) {\n return &examplev1.FooOutput{}, nil\n}\n\n// BarWorkflow implements an example.v1.Example.Bar workflow\ntype BarWorkflow struct {\n *examplev1.BarWorkflowInput\n}\n\n// NewBarWorkflow initializes a new examplev1.Workflow value\nfunc NewBarWorkflow(ctx workflow.Context, input *examplev1.BarWorkflowInput) (examplev1.BarWorkflow, error) {\n return &BarWorld{input}, nil\n}\n\n// Execute defines the entrypoint to an example.v1.Example.Bar workflow\nfunc (w *BarWorkflow) Execute(ctx workflow.Context) (*examplev1.BarOutput, error) {\n return &examplev1.BarOutput{}, nil\n}\n\nfunc main() {\n // initialize temporal client and worker\n c, err := client.Dial(client.Options{})\n if err != nil {\n log.Fatalf("error initializing client: %v", err)\n }\n w := worker.New(c, examplev1.ExampleTaskQueue, worker.Options{})\n\n // Register all example.v1.Example workflows individually\n examplev1.RegisterFooWorkflow(w, NewFooWorkflow)\n examplev1.RegisterBarWorkflow(w, NewBarWorkflow)\n w.Run(worker.InterruptCh())\n}\n'})})}),(0,r.jsx)(a.A,{value:"schema-registration-individual",label:"Schema",children:(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-protobuf",metastring:'title="example.proto"',children:'syntax="proto3";\n\npackage example.v1;\n\nservice Example {\n option (temporal.v1.service) = {\n task_queue: "example-v1"\n }\n\n rpc Foo(FooInput) returns (FooOutput) {\n option (temporal.v1.workflow) = {};\n }\n\n rpc Bar(BarInput) returns (BarOutput) {\n option (temporal.v1.workflow) = {};\n }\n}\n'})})})]}),"\n",(0,r.jsx)(n.h2,{id:"invocation",children:"Invocation"}),"\n",(0,r.jsx)(n.p,{children:"This plugin supports several methods for executing protobuf workflows, each of which is outlined in more detail below."}),"\n",(0,r.jsx)(n.h3,{id:"client",children:"Client"}),"\n",(0,r.jsxs)(n.p,{children:["Consumers can utilize the generated Client to execute workflows from any Go application. See the ",(0,r.jsx)(n.a,{href:"/docs/guides/clients",children:"Clients guide"})," for more usage details."]}),"\n",(0,r.jsxs)(l.A,{children:[(0,r.jsx)(a.A,{value:"client-go",label:"Go",children:(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-go",metastring:'title="main.go"',children:'package main\n\nimport (\n "context"\n "log"\n\n examplev1 "path/to/gen/example/v1"\n "go.temporal.io/sdk/client"\n)\n\nfunc main() {\n // initialize temporal client\n c, err := client.Dial(client.Options{})\n if err != nil {\n log.Fatalf("error initializing client: %v", err)\n }\n\n // initialize temporal protobuf client\n client := examplev1.NewExampleClient(c)\n\n // execute an example.v1.Example.Hello workflow and block until completion or non-retryable error\n out, err := client.Hello(context.Background(), &examplev1.HelloInput{})\n if err != nil {\n log.Fatalf("error executing example.v1.Example.Hello workflow: %v", err)\n }\n}\n'})})}),(0,r.jsx)(a.A,{value:"client-schema",label:"Schema",children:(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-protobuf",metastring:'title="example.proto"',children:'syntax="proto3";\n\npackage example.v1;\n\nservice Example {\n option (temporal.v1.service) = {\n task_queue: "example-v1"\n }\n\n rpc Hello(HelloInput) returns (HelloOutput) {\n option (temporal.v1.workflow) = {};\n }\n}\n'})})})]}),"\n",(0,r.jsx)(n.h3,{id:"command-line-interface",children:"Command Line Interface"}),"\n",(0,r.jsxs)(n.p,{children:["Consumers can utilize the generated Command Line Interface as a standalone application for executing workflows. See the ",(0,r.jsx)(n.a,{href:"/docs/guides/cli",children:"CLI guide"})," for more usage details."]}),"\n",(0,r.jsxs)(l.A,{children:[(0,r.jsxs)(a.A,{value:"cli-shell",label:"Shell",children:[(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-sh",metastring:'title="example -h"',children:"NAME:\n example - an example temporal cli\n\nUSAGE:\n example [global options] command [command options] [arguments...]\n\nCOMMANDS:\n help, h Shows a list of commands or help for one command\n WORKFLOWS:\n hello Hello returns a friendly greeting\n"})}),(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-sh",metastring:'title="example hello -h"',children:'NAME:\n example hello - Hello returns a friendly greeting\n\nUSAGE:\n example hello [command options] [arguments...]\n\nCATEGORY:\n WORKFLOWS\n\nOPTIONS:\n --detach, -d run workflow in the background and print workflow and execution id (default: false)\n --help, -h show help\n --input-file value, -f value path to json-formatted input file\n --task-queue value, -t value task queue name (default: "example-v1") [$TEMPORAL_TASK_QUEUE_NAME, $TEMPORAL_TASK_QUEUE, $TASK_QUEUE_NAME, $TASK_QUEUE]\n\n INPUT\n\n --name value Name specifies the subject to greet\n'})}),(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-json",metastring:'title="example hello --name Temporal"',children:'{\n "result": "Hello Temporal!"\n}\n'})})]}),(0,r.jsx)(a.A,{value:"cli-go",label:"Go",children:(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-go",metastring:'title="main.go"',children:'package main\n\nimport (\n "log"\n "os"\n\n examplev1 "path/to/gen/example/v1"\n)\n\nfunc main() {\n app, err := examplev1.NewExampleCLI()\n if err != nil {\n log.Fatalf("error initializing cli: %v", err)\n }\n\n if err := app.Run(os.Args); err != nil {\n log.Fatal(err)\n }\n}\n'})})}),(0,r.jsx)(a.A,{value:"cli-schema",label:"Schema",children:(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-protobuf",metastring:'title="example.proto"',children:'syntax="proto3";\n\npackage example.v1;\n\nservice Example {\n option (temporal.v1.service) = {\n task_queue: "example-v1"\n }\n\n // Hello returns a friendly greeting\n rpc Hello(HelloInput) returns (HelloOutput) {\n option (temporal.v1.workflow) = {};\n }\n}\n\nmessage HelloInput {\n // Name specifies the subject to greet\n string name = 1;\n}\n\nmessage HelloOutput {\n string result = 1;\n}\n'})})})]}),"\n",(0,r.jsx)(n.h3,{id:"child-workflows",children:"Child Workflows"}),"\n",(0,r.jsxs)(n.p,{children:["Workflows can be executed as child workflows from other workflows in the same Temporal namespace. See the ",(0,r.jsx)(n.a,{href:"/docs/guides/child-workflows",children:"Child Workflows guide"})," for more usage details."]}),"\n",(0,r.jsxs)(l.A,{children:[(0,r.jsx)(a.A,{value:"child-go",label:"Go",children:(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-go",metastring:'title="example.go"',children:'package main\n\nimport (\n "fmt"\n\n examplev1 "path/to/gen/example/v1"\n "go.temporal.io/sdk/workflow"\n)\n\nfunc MyWorkflow(ctx workflow.Context) error {\n out, err := examplev1.HelloChild(ctx, &examplev1.HelloInput{})\n if err != nil {\n return fmt.Errorf("error executing example.v1.Example.Hello child workflow: %w", err)\n }\n return nil\n}\n'})})}),(0,r.jsx)(a.A,{value:"child-schema",label:"Schema",children:(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-protobuf",metastring:'title="example.proto"',children:'syntax="proto3";\n\npackage example.v1;\n\nservice Example {\n option (temporal.v1.service) = {\n task_queue: "example-v1"\n }\n\n rpc Hello(HelloInput) returns (HelloOutput) {\n option (temporal.v1.workflow) = {};\n }\n}\n'})})})]}),"\n",(0,r.jsx)(n.h3,{id:"cross-namespace-xns",children:"Cross-Namespace (XNS)"}),"\n",(0,r.jsxs)(n.p,{children:["Workflows can be executed from other workflows in a different Temporal namespace or even an entirely separate Temporal cluster (e.g. on-prem to cloud). See the ",(0,r.jsx)(n.a,{href:"/docs/guides/xns",children:"Cross-Namespace guide"})," for more usage details."]}),"\n",(0,r.jsxs)(l.A,{children:[(0,r.jsx)(a.A,{value:"xns-go",label:"Go",children:(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-go",metastring:'title="example.go"',children:'package example\n\nimport (\n "fmt"\n\n examplev1 "path/to/gen/example/v1"\n "path/to/gen/example/v1/examplev1xns"\n "go.temporal.io/sdk/workflow"\n)\n\nfunc MyWorkflow(ctx workflow.Context) error {\n out, err := examplev1xns.Hello(ctx, &examplev1.HelloInput{})\n if err != nil {\n return fmt.Errorf("error executing example.v1.Example.Hello xns workflow: %w", err)\n }\n return nil\n}\n'})})}),(0,r.jsx)(a.A,{value:"xns-schema",label:"Schema",children:(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-protobuf",metastring:'title="example.proto"',children:'syntax="proto3";\n\npackage example.v1;\n\nservice Example {\n option (temporal.v1.service) = {\n task_queue: "example-v1"\n }\n\n rpc Hello(HelloInput) returns (HelloOutput) {\n option (temporal.v1.workflow) = {};\n }\n}\n'})})})]}),"\n",(0,r.jsx)(n.h3,{id:"workflow-functions",children:"Workflow Functions"}),"\n",(0,r.jsx)(n.p,{children:"Workflow definitions can be executed inline with another workflow definition."}),"\n",(0,r.jsxs)(l.A,{children:[(0,r.jsx)(a.A,{value:"wffn-go",label:"Go",children:(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-go",metastring:'title="main.go"',children:'package main\n\nimport (\n examplev1 "path/to/gen/example/v1"\n "go.temporal.io/sdk/client"\n "go.temporal.io/sdk/worker"\n "go.temporal.io/sdk/workflow"\n)\n\ntype ExampleWorkflows struct {}\n\ntype HelloWorkflow struct {\n *examplev1.HelloWorkflowInput\n}\n\nfunc (w *ExampleWorkflows) Hello(ctx workflow.Context, input *examplev1.HelloInput) (examplev1.HelloWorkflow, error) {\n return &HelloWorkflow{input}, nil\n}\n\nfunc (w *HelloWorkflow) Execute(ctx workflow.Context) error {\n workflow.GetLogger(ctx).Info("hello!", "name", w.Req.GetName())\n return nil\n}\n\nfunc MyWorkflow(ctx workflow.Context) error {\n // this is equivalent to calling Execute inline\n out, err := examplev1.HelloFunction(ctx, &examplev1.HelloInput{})\n if err != nil {\n return fmt.Errorf("error executing example.v1.Example.Hello inline: %w", err)\n }\n return nil\n}\n\nfunc main() {\n // initialize temporal client and worker\n c, err := client.Dial(client.Options{})\n if err != nil {\n log.Fatalf("error initializing client: %v", err)\n }\n w := worker.New(c, examplev1.ExampleTaskQueue, worker.Options{})\n\n // Register all example.v1.Example workflows with the worker\n examplev1.RegisterExampleWorkflows(w, &Workflows{})\n w.RegisterWorkflow(MyWorkflow)\n w.Run(worker.InterruptCh())\n}\n'})})}),(0,r.jsx)(a.A,{value:"wffn-schema",label:"Schema",children:(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-protobuf",metastring:'title="example.proto"',children:'syntax="proto3";\n\npackage example.v1;\n\nservice Example {\n option (temporal.v1.service) = {\n task_queue: "example-v1"\n }\n\n rpc Hello(HelloInput) returns (HelloOutput) {\n option (temporal.v1.workflow) = {};\n }\n}\n'})})})]})]})}function d(e={}){const{wrapper:n}={...(0,t.R)(),...e.components};return n?(0,r.jsx)(n,{...e,children:(0,r.jsx)(m,{...e})}):m(e)}},9365:(e,n,o)=>{o.d(n,{A:()=>a});o(6540);var r=o(4164);const t={tabItem:"tabItem_Ymn6"};var l=o(4848);function a(e){let{children:n,hidden:o,className:a}=e;return(0,l.jsx)("div",{role:"tabpanel",className:(0,r.A)(t.tabItem,a),hidden:o,children:n})}},1470:(e,n,o)=>{o.d(n,{A:()=>b});var r=o(6540),t=o(4164),l=o(3104),a=o(6347),i=o(205),s=o(7485),p=o(1682),c=o(9466);function u(e){return r.Children.toArray(e).filter((e=>"\n"!==e)).map((e=>{if(!e||(0,r.isValidElement)(e)&&function(e){const{props:n}=e;return!!n&&"object"==typeof n&&"value"in n}(e))return e;throw new Error(`Docusaurus error: Bad child <${"string"==typeof e.type?e.type:e.type.name}>: all children of the component should be , and every should have a unique "value" prop.`)}))?.filter(Boolean)??[]}function m(e){const{values:n,children:o}=e;return(0,r.useMemo)((()=>{const e=n??function(e){return u(e).map((e=>{let{props:{value:n,label:o,attributes:r,default:t}}=e;return{value:n,label:o,attributes:r,default:t}}))}(o);return function(e){const n=(0,p.X)(e,((e,n)=>e.value===n.value));if(n.length>0)throw new Error(`Docusaurus error: Duplicate values "${n.map((e=>e.value)).join(", ")}" found in . Every value needs to be unique.`)}(e),e}),[n,o])}function d(e){let{value:n,tabValues:o}=e;return o.some((e=>e.value===n))}function f(e){let{queryString:n=!1,groupId:o}=e;const t=(0,a.W6)(),l=function(e){let{queryString:n=!1,groupId:o}=e;if("string"==typeof n)return n;if(!1===n)return null;if(!0===n&&!o)throw new Error('Docusaurus error: The component groupId prop is required if queryString=true, because this value is used as the search param name. You can also provide an explicit value such as queryString="my-search-param".');return o??null}({queryString:n,groupId:o});return[(0,s.aZ)(l),(0,r.useCallback)((e=>{if(!l)return;const n=new URLSearchParams(t.location.search);n.set(l,e),t.replace({...t.location,search:n.toString()})}),[l,t])]}function x(e){const{defaultValue:n,queryString:o=!1,groupId:t}=e,l=m(e),[a,s]=(0,r.useState)((()=>function(e){let{defaultValue:n,tabValues:o}=e;if(0===o.length)throw new Error("Docusaurus error: the component requires at least one children component");if(n){if(!d({value:n,tabValues:o}))throw new Error(`Docusaurus error: The has a defaultValue "${n}" but none of its children has the corresponding value. Available values are: ${o.map((e=>e.value)).join(", ")}. If you intend to show no default tab, use defaultValue={null} instead.`);return n}const r=o.find((e=>e.default))??o[0];if(!r)throw new Error("Unexpected error: 0 tabValues");return r.value}({defaultValue:n,tabValues:l}))),[p,u]=f({queryString:o,groupId:t}),[x,h]=function(e){let{groupId:n}=e;const o=function(e){return e?`docusaurus.tab.${e}`:null}(n),[t,l]=(0,c.Dv)(o);return[t,(0,r.useCallback)((e=>{o&&l.set(e)}),[o,l])]}({groupId:t}),w=(()=>{const e=p??x;return d({value:e,tabValues:l})?e:null})();(0,i.A)((()=>{w&&s(w)}),[w]);return{selectedValue:a,selectValue:(0,r.useCallback)((e=>{if(!d({value:e,tabValues:l}))throw new Error(`Can't select invalid tab value=${e}`);s(e),u(e),h(e)}),[u,h,l]),tabValues:l}}var h=o(2303);const w={tabList:"tabList__CuJ",tabItem:"tabItem_LNqP"};var g=o(4848);function v(e){let{className:n,block:o,selectedValue:r,selectValue:a,tabValues:i}=e;const s=[],{blockElementScrollPositionUntilNextRender:p}=(0,l.a_)(),c=e=>{const n=e.currentTarget,o=s.indexOf(n),t=i[o].value;t!==r&&(p(n),a(t))},u=e=>{let n=null;switch(e.key){case"Enter":c(e);break;case"ArrowRight":{const o=s.indexOf(e.currentTarget)+1;n=s[o]??s[0];break}case"ArrowLeft":{const o=s.indexOf(e.currentTarget)-1;n=s[o]??s[s.length-1];break}}n?.focus()};return(0,g.jsx)("ul",{role:"tablist","aria-orientation":"horizontal",className:(0,t.A)("tabs",{"tabs--block":o},n),children:i.map((e=>{let{value:n,label:o,attributes:l}=e;return(0,g.jsx)("li",{role:"tab",tabIndex:r===n?0:-1,"aria-selected":r===n,ref:e=>s.push(e),onKeyDown:u,onClick:c,...l,className:(0,t.A)("tabs__item",w.tabItem,l?.className,{"tabs__item--active":r===n}),children:o??n},n)}))})}function k(e){let{lazy:n,children:o,selectedValue:t}=e;const l=(Array.isArray(o)?o:[o]).filter(Boolean);if(n){const e=l.find((e=>e.props.value===t));return e?(0,r.cloneElement)(e,{className:"margin-top--md"}):null}return(0,g.jsx)("div",{className:"margin-top--md",children:l.map(((e,n)=>(0,r.cloneElement)(e,{key:n,hidden:e.props.value!==t})))})}function j(e){const n=x(e);return(0,g.jsxs)("div",{className:(0,t.A)("tabs-container",w.tabList),children:[(0,g.jsx)(v,{...e,...n}),(0,g.jsx)(k,{...e,...n})]})}function b(e){const n=(0,h.A)();return(0,g.jsx)(j,{...e,children:u(e.children)},String(n))}},8453:(e,n,o)=>{o.d(n,{R:()=>a,x:()=>i});var r=o(6540);const t={},l=r.createContext(t);function a(e){const n=r.useContext(l);return r.useMemo((function(){return"function"==typeof e?e(n):{...n,...e}}),[n,e])}function i(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(t):e.components||t:a(e.components),r.createElement(l.Provider,{value:n},e.children)}}}]); \ No newline at end of file diff --git a/assets/js/d9f32620.01da87c2.js b/assets/js/d9f32620.01da87c2.js new file mode 100644 index 00000000..e3b76039 --- /dev/null +++ b/assets/js/d9f32620.01da87c2.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunkdocs=self.webpackChunkdocs||[]).push([[5557],{7447:(e,o,s)=>{s.r(o),s.d(o,{assets:()=>c,contentTitle:()=>l,default:()=>d,frontMatter:()=>r,metadata:()=>a,toc:()=>u});var t=s(4848),n=s(8453);const r={slug:"welcome",title:"Welcome",authors:["slorber","yangshun"],tags:["facebook","hello","docusaurus"]},l=void 0,a={permalink:"/protoc-gen-go-temporal/blog/welcome",editUrl:"https://github.com/facebook/docusaurus/tree/main/packages/create-docusaurus/templates/shared/blog/2021-08-26-welcome/index.md",source:"@site/blog/2021-08-26-welcome/index.md",title:"Welcome",description:"Docusaurus blogging features are powered by the blog plugin.",date:"2021-08-26T00:00:00.000Z",formattedDate:"August 26, 2021",tags:[{label:"facebook",permalink:"/protoc-gen-go-temporal/blog/tags/facebook"},{label:"hello",permalink:"/protoc-gen-go-temporal/blog/tags/hello"},{label:"docusaurus",permalink:"/protoc-gen-go-temporal/blog/tags/docusaurus"}],readingTime:.405,hasTruncateMarker:!1,authors:[{name:"S\xe9bastien Lorber",title:"Docusaurus maintainer",url:"https://sebastienlorber.com",imageURL:"https://github.com/slorber.png",key:"slorber"},{name:"Yangshun Tay",title:"Front End Engineer @ Facebook",url:"https://github.com/yangshun",imageURL:"https://github.com/yangshun.png",key:"yangshun"}],frontMatter:{slug:"welcome",title:"Welcome",authors:["slorber","yangshun"],tags:["facebook","hello","docusaurus"]},unlisted:!1,nextItem:{title:"MDX Blog Post",permalink:"/protoc-gen-go-temporal/blog/mdx-blog-post"}},c={authorsImageUrls:[void 0,void 0]},u=[];function i(e){const o={a:"a",code:"code",img:"img",li:"li",p:"p",strong:"strong",ul:"ul",...(0,n.R)(),...e.components};return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)(o.p,{children:[(0,t.jsx)(o.a,{href:"https://docusaurus.io/docs/blog",children:"Docusaurus blogging features"})," are powered by the ",(0,t.jsx)(o.a,{href:"https://docusaurus.io/docs/api/plugins/@docusaurus/plugin-content-blog",children:"blog plugin"}),"."]}),"\n",(0,t.jsxs)(o.p,{children:["Simply add Markdown files (or folders) to the ",(0,t.jsx)(o.code,{children:"blog"})," directory."]}),"\n",(0,t.jsxs)(o.p,{children:["Regular blog authors can be added to ",(0,t.jsx)(o.code,{children:"authors.yml"}),"."]}),"\n",(0,t.jsx)(o.p,{children:"The blog post date can be extracted from filenames, such as:"}),"\n",(0,t.jsxs)(o.ul,{children:["\n",(0,t.jsx)(o.li,{children:(0,t.jsx)(o.code,{children:"2019-05-30-welcome.md"})}),"\n",(0,t.jsx)(o.li,{children:(0,t.jsx)(o.code,{children:"2019-05-30-welcome/index.md"})}),"\n"]}),"\n",(0,t.jsx)(o.p,{children:"A blog post folder can be convenient to co-locate blog post images:"}),"\n",(0,t.jsx)(o.p,{children:(0,t.jsx)(o.img,{alt:"Docusaurus Plushie",src:s(3449).A+"",width:"1500",height:"500"})}),"\n",(0,t.jsx)(o.p,{children:"The blog supports tags as well!"}),"\n",(0,t.jsxs)(o.p,{children:[(0,t.jsx)(o.strong,{children:"And if you don't want a blog"}),": just delete this directory, and use ",(0,t.jsx)(o.code,{children:"blog: false"})," in your Docusaurus config."]})]})}function d(e={}){const{wrapper:o}={...(0,n.R)(),...e.components};return o?(0,t.jsx)(o,{...e,children:(0,t.jsx)(i,{...e})}):i(e)}},3449:(e,o,s)=>{s.d(o,{A:()=>t});const t=s.p+"assets/images/docusaurus-plushie-banner-a60f7593abca1e3eef26a9afa244e4fb.jpeg"},8453:(e,o,s)=>{s.d(o,{R:()=>l,x:()=>a});var t=s(6540);const n={},r=t.createContext(n);function l(e){const o=t.useContext(r);return t.useMemo((function(){return"function"==typeof e?e(o):{...o,...e}}),[o,e])}function a(e){let o;return o=e.disableParentContext?"function"==typeof e.components?e.components(n):e.components||n:l(e.components),t.createElement(r.Provider,{value:o},e.children)}}}]); \ No newline at end of file diff --git a/assets/js/d9f32620.d52c6267.js b/assets/js/d9f32620.d52c6267.js deleted file mode 100644 index 4673b8aa..00000000 --- a/assets/js/d9f32620.d52c6267.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunkdocs=self.webpackChunkdocs||[]).push([[5557],{7447:(e,o,s)=>{s.r(o),s.d(o,{assets:()=>c,contentTitle:()=>l,default:()=>d,frontMatter:()=>r,metadata:()=>a,toc:()=>u});var t=s(4848),n=s(8453);const r={slug:"welcome",title:"Welcome",authors:["slorber","yangshun"],tags:["facebook","hello","docusaurus"]},l=void 0,a={permalink:"/blog/welcome",editUrl:"https://github.com/facebook/docusaurus/tree/main/packages/create-docusaurus/templates/shared/blog/2021-08-26-welcome/index.md",source:"@site/blog/2021-08-26-welcome/index.md",title:"Welcome",description:"Docusaurus blogging features are powered by the blog plugin.",date:"2021-08-26T00:00:00.000Z",formattedDate:"August 26, 2021",tags:[{label:"facebook",permalink:"/blog/tags/facebook"},{label:"hello",permalink:"/blog/tags/hello"},{label:"docusaurus",permalink:"/blog/tags/docusaurus"}],readingTime:.405,hasTruncateMarker:!1,authors:[{name:"S\xe9bastien Lorber",title:"Docusaurus maintainer",url:"https://sebastienlorber.com",imageURL:"https://github.com/slorber.png",key:"slorber"},{name:"Yangshun Tay",title:"Front End Engineer @ Facebook",url:"https://github.com/yangshun",imageURL:"https://github.com/yangshun.png",key:"yangshun"}],frontMatter:{slug:"welcome",title:"Welcome",authors:["slorber","yangshun"],tags:["facebook","hello","docusaurus"]},unlisted:!1,nextItem:{title:"MDX Blog Post",permalink:"/blog/mdx-blog-post"}},c={authorsImageUrls:[void 0,void 0]},u=[];function i(e){const o={a:"a",code:"code",img:"img",li:"li",p:"p",strong:"strong",ul:"ul",...(0,n.R)(),...e.components};return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)(o.p,{children:[(0,t.jsx)(o.a,{href:"https://docusaurus.io/docs/blog",children:"Docusaurus blogging features"})," are powered by the ",(0,t.jsx)(o.a,{href:"https://docusaurus.io/docs/api/plugins/@docusaurus/plugin-content-blog",children:"blog plugin"}),"."]}),"\n",(0,t.jsxs)(o.p,{children:["Simply add Markdown files (or folders) to the ",(0,t.jsx)(o.code,{children:"blog"})," directory."]}),"\n",(0,t.jsxs)(o.p,{children:["Regular blog authors can be added to ",(0,t.jsx)(o.code,{children:"authors.yml"}),"."]}),"\n",(0,t.jsx)(o.p,{children:"The blog post date can be extracted from filenames, such as:"}),"\n",(0,t.jsxs)(o.ul,{children:["\n",(0,t.jsx)(o.li,{children:(0,t.jsx)(o.code,{children:"2019-05-30-welcome.md"})}),"\n",(0,t.jsx)(o.li,{children:(0,t.jsx)(o.code,{children:"2019-05-30-welcome/index.md"})}),"\n"]}),"\n",(0,t.jsx)(o.p,{children:"A blog post folder can be convenient to co-locate blog post images:"}),"\n",(0,t.jsx)(o.p,{children:(0,t.jsx)(o.img,{alt:"Docusaurus Plushie",src:s(3449).A+"",width:"1500",height:"500"})}),"\n",(0,t.jsx)(o.p,{children:"The blog supports tags as well!"}),"\n",(0,t.jsxs)(o.p,{children:[(0,t.jsx)(o.strong,{children:"And if you don't want a blog"}),": just delete this directory, and use ",(0,t.jsx)(o.code,{children:"blog: false"})," in your Docusaurus config."]})]})}function d(e={}){const{wrapper:o}={...(0,n.R)(),...e.components};return o?(0,t.jsx)(o,{...e,children:(0,t.jsx)(i,{...e})}):i(e)}},3449:(e,o,s)=>{s.d(o,{A:()=>t});const t=s.p+"assets/images/docusaurus-plushie-banner-a60f7593abca1e3eef26a9afa244e4fb.jpeg"},8453:(e,o,s)=>{s.d(o,{R:()=>l,x:()=>a});var t=s(6540);const n={},r=t.createContext(n);function l(e){const o=t.useContext(r);return t.useMemo((function(){return"function"==typeof e?e(o):{...o,...e}}),[o,e])}function a(e){let o;return o=e.disableParentContext?"function"==typeof e.components?e.components(n):e.components||n:l(e.components),t.createElement(r.Provider,{value:o},e.children)}}}]); \ No newline at end of file diff --git a/assets/js/dcf58752.b56b3c9d.js b/assets/js/dcf58752.b56b3c9d.js new file mode 100644 index 00000000..01b9960f --- /dev/null +++ b/assets/js/dcf58752.b56b3c9d.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunkdocs=self.webpackChunkdocs||[]).push([[965],{5329:o=>{o.exports=JSON.parse('{"permalink":"/protoc-gen-go-temporal/blog/tags/hola","page":1,"postsPerPage":10,"totalPages":1,"totalCount":1,"blogDescription":"Blog","blogTitle":"Blog"}')}}]); \ No newline at end of file diff --git a/assets/js/dd7fddbf.0dd3d26c.js b/assets/js/dd7fddbf.0dd3d26c.js new file mode 100644 index 00000000..27cd56da --- /dev/null +++ b/assets/js/dd7fddbf.0dd3d26c.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunkdocs=self.webpackChunkdocs||[]).push([[4792],{7685:(e,t,n)=>{n.r(t),n.d(t,{assets:()=>l,contentTitle:()=>o,default:()=>d,frontMatter:()=>s,metadata:()=>u,toc:()=>i});var r=n(4848),a=n(8453);n(1470),n(9365);const s={},o="Signals",u={id:"guides/signals",title:"Signals",description:"Coming Soon...",source:"@site/docs/guides/signals.mdx",sourceDirName:"guides",slug:"/guides/signals",permalink:"/protoc-gen-go-temporal/docs/guides/signals",draft:!1,unlisted:!1,editUrl:"https://github.com/facebook/docusaurus/tree/main/packages/create-docusaurus/templates/shared/docs/guides/signals.mdx",tags:[],version:"current",frontMatter:{},sidebar:"docs",previous:{title:"Queries",permalink:"/protoc-gen-go-temporal/docs/guides/queries"},next:{title:"Testing",permalink:"/protoc-gen-go-temporal/docs/guides/testing"}},l={},i=[];function c(e){const t={h1:"h1",p:"p",strong:"strong",...(0,a.R)(),...e.components};return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(t.h1,{id:"signals",children:"Signals"}),"\n",(0,r.jsx)(t.p,{children:(0,r.jsx)(t.strong,{children:"Coming Soon..."})})]})}function d(e={}){const{wrapper:t}={...(0,a.R)(),...e.components};return t?(0,r.jsx)(t,{...e,children:(0,r.jsx)(c,{...e})}):c(e)}},9365:(e,t,n)=>{n.d(t,{A:()=>o});n(6540);var r=n(4164);const a={tabItem:"tabItem_Ymn6"};var s=n(4848);function o(e){let{children:t,hidden:n,className:o}=e;return(0,s.jsx)("div",{role:"tabpanel",className:(0,r.A)(a.tabItem,o),hidden:n,children:t})}},1470:(e,t,n)=>{n.d(t,{A:()=>k});var r=n(6540),a=n(4164),s=n(3104),o=n(6347),u=n(205),l=n(7485),i=n(1682),c=n(9466);function d(e){return r.Children.toArray(e).filter((e=>"\n"!==e)).map((e=>{if(!e||(0,r.isValidElement)(e)&&function(e){const{props:t}=e;return!!t&&"object"==typeof t&&"value"in t}(e))return e;throw new Error(`Docusaurus error: Bad child <${"string"==typeof e.type?e.type:e.type.name}>: all children of the component should be , and every should have a unique "value" prop.`)}))?.filter(Boolean)??[]}function p(e){const{values:t,children:n}=e;return(0,r.useMemo)((()=>{const e=t??function(e){return d(e).map((e=>{let{props:{value:t,label:n,attributes:r,default:a}}=e;return{value:t,label:n,attributes:r,default:a}}))}(n);return function(e){const t=(0,i.X)(e,((e,t)=>e.value===t.value));if(t.length>0)throw new Error(`Docusaurus error: Duplicate values "${t.map((e=>e.value)).join(", ")}" found in . Every value needs to be unique.`)}(e),e}),[t,n])}function f(e){let{value:t,tabValues:n}=e;return n.some((e=>e.value===t))}function m(e){let{queryString:t=!1,groupId:n}=e;const a=(0,o.W6)(),s=function(e){let{queryString:t=!1,groupId:n}=e;if("string"==typeof t)return t;if(!1===t)return null;if(!0===t&&!n)throw new Error('Docusaurus error: The component groupId prop is required if queryString=true, because this value is used as the search param name. You can also provide an explicit value such as queryString="my-search-param".');return n??null}({queryString:t,groupId:n});return[(0,l.aZ)(s),(0,r.useCallback)((e=>{if(!s)return;const t=new URLSearchParams(a.location.search);t.set(s,e),a.replace({...a.location,search:t.toString()})}),[s,a])]}function b(e){const{defaultValue:t,queryString:n=!1,groupId:a}=e,s=p(e),[o,l]=(0,r.useState)((()=>function(e){let{defaultValue:t,tabValues:n}=e;if(0===n.length)throw new Error("Docusaurus error: the component requires at least one children component");if(t){if(!f({value:t,tabValues:n}))throw new Error(`Docusaurus error: The has a defaultValue "${t}" but none of its children has the corresponding value. Available values are: ${n.map((e=>e.value)).join(", ")}. If you intend to show no default tab, use defaultValue={null} instead.`);return t}const r=n.find((e=>e.default))??n[0];if(!r)throw new Error("Unexpected error: 0 tabValues");return r.value}({defaultValue:t,tabValues:s}))),[i,d]=m({queryString:n,groupId:a}),[b,h]=function(e){let{groupId:t}=e;const n=function(e){return e?`docusaurus.tab.${e}`:null}(t),[a,s]=(0,c.Dv)(n);return[a,(0,r.useCallback)((e=>{n&&s.set(e)}),[n,s])]}({groupId:a}),g=(()=>{const e=i??b;return f({value:e,tabValues:s})?e:null})();(0,u.A)((()=>{g&&l(g)}),[g]);return{selectedValue:o,selectValue:(0,r.useCallback)((e=>{if(!f({value:e,tabValues:s}))throw new Error(`Can't select invalid tab value=${e}`);l(e),d(e),h(e)}),[d,h,s]),tabValues:s}}var h=n(2303);const g={tabList:"tabList__CuJ",tabItem:"tabItem_LNqP"};var v=n(4848);function x(e){let{className:t,block:n,selectedValue:r,selectValue:o,tabValues:u}=e;const l=[],{blockElementScrollPositionUntilNextRender:i}=(0,s.a_)(),c=e=>{const t=e.currentTarget,n=l.indexOf(t),a=u[n].value;a!==r&&(i(t),o(a))},d=e=>{let t=null;switch(e.key){case"Enter":c(e);break;case"ArrowRight":{const n=l.indexOf(e.currentTarget)+1;t=l[n]??l[0];break}case"ArrowLeft":{const n=l.indexOf(e.currentTarget)-1;t=l[n]??l[l.length-1];break}}t?.focus()};return(0,v.jsx)("ul",{role:"tablist","aria-orientation":"horizontal",className:(0,a.A)("tabs",{"tabs--block":n},t),children:u.map((e=>{let{value:t,label:n,attributes:s}=e;return(0,v.jsx)("li",{role:"tab",tabIndex:r===t?0:-1,"aria-selected":r===t,ref:e=>l.push(e),onKeyDown:d,onClick:c,...s,className:(0,a.A)("tabs__item",g.tabItem,s?.className,{"tabs__item--active":r===t}),children:n??t},t)}))})}function y(e){let{lazy:t,children:n,selectedValue:a}=e;const s=(Array.isArray(n)?n:[n]).filter(Boolean);if(t){const e=s.find((e=>e.props.value===a));return e?(0,r.cloneElement)(e,{className:"margin-top--md"}):null}return(0,v.jsx)("div",{className:"margin-top--md",children:s.map(((e,t)=>(0,r.cloneElement)(e,{key:t,hidden:e.props.value!==a})))})}function w(e){const t=b(e);return(0,v.jsxs)("div",{className:(0,a.A)("tabs-container",g.tabList),children:[(0,v.jsx)(x,{...e,...t}),(0,v.jsx)(y,{...e,...t})]})}function k(e){const t=(0,h.A)();return(0,v.jsx)(w,{...e,children:d(e.children)},String(t))}},8453:(e,t,n)=>{n.d(t,{R:()=>o,x:()=>u});var r=n(6540);const a={},s=r.createContext(a);function o(e){const t=r.useContext(s);return r.useMemo((function(){return"function"==typeof e?e(t):{...t,...e}}),[t,e])}function u(e){let t;return t=e.disableParentContext?"function"==typeof e.components?e.components(a):e.components||a:o(e.components),r.createElement(s.Provider,{value:t},e.children)}}}]); \ No newline at end of file diff --git a/assets/js/dd7fddbf.d1e9a7dc.js b/assets/js/dd7fddbf.d1e9a7dc.js deleted file mode 100644 index d52e2a81..00000000 --- a/assets/js/dd7fddbf.d1e9a7dc.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunkdocs=self.webpackChunkdocs||[]).push([[4792],{7685:(e,t,n)=>{n.r(t),n.d(t,{assets:()=>l,contentTitle:()=>u,default:()=>d,frontMatter:()=>s,metadata:()=>o,toc:()=>i});var r=n(4848),a=n(8453);n(1470),n(9365);const s={},u="Signals",o={id:"guides/signals",title:"Signals",description:"Coming Soon...",source:"@site/docs/guides/signals.mdx",sourceDirName:"guides",slug:"/guides/signals",permalink:"/docs/guides/signals",draft:!1,unlisted:!1,editUrl:"https://github.com/facebook/docusaurus/tree/main/packages/create-docusaurus/templates/shared/docs/guides/signals.mdx",tags:[],version:"current",frontMatter:{},sidebar:"docs",previous:{title:"Queries",permalink:"/docs/guides/queries"},next:{title:"Testing",permalink:"/docs/guides/testing"}},l={},i=[];function c(e){const t={h1:"h1",p:"p",strong:"strong",...(0,a.R)(),...e.components};return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(t.h1,{id:"signals",children:"Signals"}),"\n",(0,r.jsx)(t.p,{children:(0,r.jsx)(t.strong,{children:"Coming Soon..."})})]})}function d(e={}){const{wrapper:t}={...(0,a.R)(),...e.components};return t?(0,r.jsx)(t,{...e,children:(0,r.jsx)(c,{...e})}):c(e)}},9365:(e,t,n)=>{n.d(t,{A:()=>u});n(6540);var r=n(4164);const a={tabItem:"tabItem_Ymn6"};var s=n(4848);function u(e){let{children:t,hidden:n,className:u}=e;return(0,s.jsx)("div",{role:"tabpanel",className:(0,r.A)(a.tabItem,u),hidden:n,children:t})}},1470:(e,t,n)=>{n.d(t,{A:()=>k});var r=n(6540),a=n(4164),s=n(3104),u=n(6347),o=n(205),l=n(7485),i=n(1682),c=n(9466);function d(e){return r.Children.toArray(e).filter((e=>"\n"!==e)).map((e=>{if(!e||(0,r.isValidElement)(e)&&function(e){const{props:t}=e;return!!t&&"object"==typeof t&&"value"in t}(e))return e;throw new Error(`Docusaurus error: Bad child <${"string"==typeof e.type?e.type:e.type.name}>: all children of the component should be , and every should have a unique "value" prop.`)}))?.filter(Boolean)??[]}function f(e){const{values:t,children:n}=e;return(0,r.useMemo)((()=>{const e=t??function(e){return d(e).map((e=>{let{props:{value:t,label:n,attributes:r,default:a}}=e;return{value:t,label:n,attributes:r,default:a}}))}(n);return function(e){const t=(0,i.X)(e,((e,t)=>e.value===t.value));if(t.length>0)throw new Error(`Docusaurus error: Duplicate values "${t.map((e=>e.value)).join(", ")}" found in . Every value needs to be unique.`)}(e),e}),[t,n])}function p(e){let{value:t,tabValues:n}=e;return n.some((e=>e.value===t))}function m(e){let{queryString:t=!1,groupId:n}=e;const a=(0,u.W6)(),s=function(e){let{queryString:t=!1,groupId:n}=e;if("string"==typeof t)return t;if(!1===t)return null;if(!0===t&&!n)throw new Error('Docusaurus error: The component groupId prop is required if queryString=true, because this value is used as the search param name. You can also provide an explicit value such as queryString="my-search-param".');return n??null}({queryString:t,groupId:n});return[(0,l.aZ)(s),(0,r.useCallback)((e=>{if(!s)return;const t=new URLSearchParams(a.location.search);t.set(s,e),a.replace({...a.location,search:t.toString()})}),[s,a])]}function b(e){const{defaultValue:t,queryString:n=!1,groupId:a}=e,s=f(e),[u,l]=(0,r.useState)((()=>function(e){let{defaultValue:t,tabValues:n}=e;if(0===n.length)throw new Error("Docusaurus error: the component requires at least one children component");if(t){if(!p({value:t,tabValues:n}))throw new Error(`Docusaurus error: The has a defaultValue "${t}" but none of its children has the corresponding value. Available values are: ${n.map((e=>e.value)).join(", ")}. If you intend to show no default tab, use defaultValue={null} instead.`);return t}const r=n.find((e=>e.default))??n[0];if(!r)throw new Error("Unexpected error: 0 tabValues");return r.value}({defaultValue:t,tabValues:s}))),[i,d]=m({queryString:n,groupId:a}),[b,h]=function(e){let{groupId:t}=e;const n=function(e){return e?`docusaurus.tab.${e}`:null}(t),[a,s]=(0,c.Dv)(n);return[a,(0,r.useCallback)((e=>{n&&s.set(e)}),[n,s])]}({groupId:a}),g=(()=>{const e=i??b;return p({value:e,tabValues:s})?e:null})();(0,o.A)((()=>{g&&l(g)}),[g]);return{selectedValue:u,selectValue:(0,r.useCallback)((e=>{if(!p({value:e,tabValues:s}))throw new Error(`Can't select invalid tab value=${e}`);l(e),d(e),h(e)}),[d,h,s]),tabValues:s}}var h=n(2303);const g={tabList:"tabList__CuJ",tabItem:"tabItem_LNqP"};var v=n(4848);function x(e){let{className:t,block:n,selectedValue:r,selectValue:u,tabValues:o}=e;const l=[],{blockElementScrollPositionUntilNextRender:i}=(0,s.a_)(),c=e=>{const t=e.currentTarget,n=l.indexOf(t),a=o[n].value;a!==r&&(i(t),u(a))},d=e=>{let t=null;switch(e.key){case"Enter":c(e);break;case"ArrowRight":{const n=l.indexOf(e.currentTarget)+1;t=l[n]??l[0];break}case"ArrowLeft":{const n=l.indexOf(e.currentTarget)-1;t=l[n]??l[l.length-1];break}}t?.focus()};return(0,v.jsx)("ul",{role:"tablist","aria-orientation":"horizontal",className:(0,a.A)("tabs",{"tabs--block":n},t),children:o.map((e=>{let{value:t,label:n,attributes:s}=e;return(0,v.jsx)("li",{role:"tab",tabIndex:r===t?0:-1,"aria-selected":r===t,ref:e=>l.push(e),onKeyDown:d,onClick:c,...s,className:(0,a.A)("tabs__item",g.tabItem,s?.className,{"tabs__item--active":r===t}),children:n??t},t)}))})}function y(e){let{lazy:t,children:n,selectedValue:a}=e;const s=(Array.isArray(n)?n:[n]).filter(Boolean);if(t){const e=s.find((e=>e.props.value===a));return e?(0,r.cloneElement)(e,{className:"margin-top--md"}):null}return(0,v.jsx)("div",{className:"margin-top--md",children:s.map(((e,t)=>(0,r.cloneElement)(e,{key:t,hidden:e.props.value!==a})))})}function w(e){const t=b(e);return(0,v.jsxs)("div",{className:(0,a.A)("tabs-container",g.tabList),children:[(0,v.jsx)(x,{...e,...t}),(0,v.jsx)(y,{...e,...t})]})}function k(e){const t=(0,h.A)();return(0,v.jsx)(w,{...e,children:d(e.children)},String(t))}},8453:(e,t,n)=>{n.d(t,{R:()=>u,x:()=>o});var r=n(6540);const a={},s=r.createContext(a);function u(e){const t=r.useContext(s);return r.useMemo((function(){return"function"==typeof e?e(t):{...t,...e}}),[t,e])}function o(e){let t;return t=e.disableParentContext?"function"==typeof e.components?e.components(a):e.components||a:u(e.components),r.createElement(s.Provider,{value:t},e.children)}}}]); \ No newline at end of file diff --git a/assets/js/e16015ca.50f76e86.js b/assets/js/e16015ca.50f76e86.js deleted file mode 100644 index fcc176c7..00000000 --- a/assets/js/e16015ca.50f76e86.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunkdocs=self.webpackChunkdocs||[]).push([[1497],{9635:s=>{s.exports=JSON.parse('{"label":"hola","permalink":"/blog/tags/hola","allTagsPath":"/blog/tags","count":1,"unlisted":false}')}}]); \ No newline at end of file diff --git a/assets/js/e17b2e0e.2fadf9a2.js b/assets/js/e17b2e0e.2fadf9a2.js deleted file mode 100644 index 63980137..00000000 --- a/assets/js/e17b2e0e.2fadf9a2.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunkdocs=self.webpackChunkdocs||[]).push([[3456],{8050:(e,t,n)=>{n.r(t),n.d(t,{assets:()=>c,contentTitle:()=>i,default:()=>d,frontMatter:()=>s,metadata:()=>u,toc:()=>p});var l=n(4848),r=n(8453),a=n(1470),o=n(9365);const s={},i="Queries",u={id:"guides/queries",title:"Queries",description:"Implementation",source:"@site/docs/guides/queries.mdx",sourceDirName:"guides",slug:"/guides/queries",permalink:"/docs/guides/queries",draft:!1,unlisted:!1,editUrl:"https://github.com/facebook/docusaurus/tree/main/packages/create-docusaurus/templates/shared/docs/guides/queries.mdx",tags:[],version:"current",frontMatter:{},sidebar:"docs",previous:{title:"Activities",permalink:"/docs/guides/activities"},next:{title:"Signals",permalink:"/docs/guides/signals"}},c={},p=[{value:"Implementation",id:"implementation",level:2},{value:"Parameters",id:"parameters",level:3},{value:"Invocation",id:"invocation",level:2},{value:"Client",id:"client",level:3},{value:"Command Line Interface",id:"command-line-interface",level:3},{value:"Cross-Namespace (XNS)",id:"cross-namespace-xns",level:3}];function m(e){const t={a:"a",admonition:"admonition",code:"code",h1:"h1",h2:"h2",h3:"h3",p:"p",pre:"pre",...(0,r.R)(),...e.components};return(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(t.h1,{id:"queries",children:"Queries"}),"\n",(0,l.jsx)(t.h2,{id:"implementation",children:"Implementation"}),"\n",(0,l.jsx)(t.p,{children:"A query is implemented as a method on a workflow struct."}),"\n",(0,l.jsxs)(a.A,{children:[(0,l.jsx)(o.A,{value:"implementation-go",label:"Go",children:(0,l.jsx)(t.pre,{children:(0,l.jsx)(t.code,{className:"language-go",metastring:'title="example.go"',children:'package example\n\nimport (\n examplev1 "path/to/gen/example/v1"\n "go.temporal.io/sdk/workflow"\n)\n\ntype HelloWorkflow struct {\n *examplev1.HelloWorkflowInput\n}\n\nfunc (w *HelloWorkflow) Execute(ctx workflow.Context) (*examplev1.HelloOutput, error) {\n workflow.GetLogger(ctx).Info("executing hello workflow", "input", w.Req)\n return &examplev1.HelloOutput{}, nil\n}\n\nfunc (w *HelloWorkflow) GetHelloStatus(input *examplev1.GetHelloStatusInput) (*examplev1.GetHelloStatusOutput, error) {\n return &examplev1.GetHelloStatusOutput{\n Status: w.Req.GetStatus(),\n }, nil\n}\n'})})}),(0,l.jsx)(o.A,{value:"implementation-schema",label:"Schema",children:(0,l.jsx)(t.pre,{children:(0,l.jsx)(t.code,{className:"language-protobuf",metastring:'title="example.proto"',children:'syntax="proto3";\n\npackage example.v1;\n\nimport "temporal/v1/temporal.proto";\n\nservice Example {\n // Hello returns a friendly greeting\n rpc Hello(HelloInput) returns (HelloOutput) {\n option (temporal.v1.workflow) = {\n query: { ref: "GetHelloStatus" }\n };\n }\n\n // GetHelloStatus retrieves the status of a Hello workflow\n rpc GetHelloStatus(GetHelloStatusInput) returns (GetHelloStatusOutput) {\n option (temporal.v1.query) = {};\n }\n}\n'})})})]}),"\n",(0,l.jsx)(t.h3,{id:"parameters",children:"Parameters"}),"\n",(0,l.jsxs)(t.p,{children:["Query definitions can omit an input parameter by specifying the native ",(0,l.jsx)(t.code,{children:"google.protobuf.Empty"})," message type in its place. This requires an additional ",(0,l.jsx)(t.code,{children:"google/protobuf/empty.proto"})," protobuf import."]}),"\n",(0,l.jsx)(t.admonition,{type:"warning",children:(0,l.jsx)(t.p,{children:"Query definitions must specify a non-empty output parameter."})}),"\n",(0,l.jsxs)(a.A,{children:[(0,l.jsx)(o.A,{value:"implementation-go",label:"Go",children:(0,l.jsx)(t.pre,{children:(0,l.jsx)(t.code,{className:"language-go",metastring:'title="example.go"',children:'package example\n\nimport (\n examplev1 "path/to/gen/example/v1"\n "go.temporal.io/sdk/workflow"\n)\n\ntype HelloWorkflow struct {\n *examplev1.HelloWorkflowInput\n}\n\nfunc (w *HelloWorkflow) Execute(ctx workflow.Context) (*examplev1.HelloOutput, error) {\n workflow.GetLogger(ctx).Info("executing hello workflow", "input", w.Req)\n return &examplev1.HelloOutput{}, nil\n}\n\nfunc (w *HelloWorkflow) GetHelloStatus() (*examplev1.GetHelloStatusOutput, error) {\n return &examplev1.GetHelloStatusOutput{\n Status: w.Req.GetStatus(),\n }, nil\n}\n'})})}),(0,l.jsx)(o.A,{value:"implementation-schema",label:"Schema",children:(0,l.jsx)(t.pre,{children:(0,l.jsx)(t.code,{className:"language-protobuf",metastring:'title="example.proto"',children:'syntax="proto3";\n\npackage example.v1;\n\nimport "google/protobuf/empty.proto";\nimport "temporal/v1/temporal.proto";\n\nservice Example {\n // Hello returns a friendly greeting\n rpc Hello(HelloInput) returns (HelloOutput) {\n option (temporal.v1.workflow) = {\n query: { ref: "GetHelloStatus" }\n };\n }\n\n // GetHelloStatus retrieves the status of a Hello workflow\n rpc GetHelloStatus(google.protobuf.Empty) returns (GetHelloStatusOutput) {\n option (temporal.v1.query) = {};\n }\n}\n'})})})]}),"\n",(0,l.jsx)(t.h2,{id:"invocation",children:"Invocation"}),"\n",(0,l.jsx)(t.p,{children:"This plugin supports several methods for executing protobuf queries, each of which is outlined in more detail below."}),"\n",(0,l.jsx)(t.h3,{id:"client",children:"Client"}),"\n",(0,l.jsxs)(t.p,{children:["Consumers can utilize the generated Client to execute queries from any Go application. See the ",(0,l.jsx)(t.a,{href:"/docs/guides/clients",children:"Clients guide"})," for more usage details."]}),"\n",(0,l.jsxs)(a.A,{children:[(0,l.jsx)(o.A,{value:"client-go",label:"Go",children:(0,l.jsx)(t.pre,{children:(0,l.jsx)(t.code,{className:"language-go",metastring:'title="main.go"',children:'package main\n\nimport (\n "context"\n "log"\n\n examplev1 "path/to/gen/example/v1"\n "go.temporal.io/sdk/client"\n)\n\nfunc main() {\n // initialize temporal client\n c, err := client.Dial(client.Options{})\n if err != nil {\n log.Fatalf("error initializing client: %v", err)\n }\n\n // initialize temporal protobuf client\n ctx, client := context.Background(), examplev1.NewExampleClient(c)\n\n // execute an example.v1.Example.GetHelloStatus query\n // via workflow ID\n status, err := client.GetHelloStatus(ctx, "wf-id", "", &examplev1.GetHelloStatusInput{})\n if err != nil {\n log.Fatalf("error executing example.v1.Example.GetHelloStatus query: %v", err)\n }\n\n // or use the corresponding query method defined on the\n // workflow run\n run, err := client.HelloAsync(ctx, &examplev1.HelloInput{})\n if err != nil {\n log.Fatalf("error starting example.v1.Example.Hello workflow: %v", err)\n }\n status, err = run.GetHelloStatus(&examplev1.GetHelloStatusInput{})\n if err != nil {\n log.Fatalf("error executing example.v1.Example.GetHelloStatus query: %v", err)\n }\n}\n'})})}),(0,l.jsx)(o.A,{value:"client-schema",label:"Schema",children:(0,l.jsx)(t.pre,{children:(0,l.jsx)(t.code,{className:"language-protobuf",metastring:'title="example.proto"',children:'syntax="proto3";\n\npackage example.v1;\n\nservice Example {\n option (temporal.v1.service) = {\n task_queue: "example-v1"\n }\n\n rpc Hello(HelloInput) returns (HelloOutput) {\n option (temporal.v1.workflow) = {};\n }\n\n rpc GetHelloStatus(GetHelloStatusInput) returns (GetHelloStatusOutput) {\n option (temporal.v1.query) = {};\n }\n}\n'})})})]}),"\n",(0,l.jsx)(t.h3,{id:"command-line-interface",children:"Command Line Interface"}),"\n",(0,l.jsxs)(t.p,{children:["Consumers can utilize the generated Command Line Interface as a standalone application for executing queries. See the ",(0,l.jsx)(t.a,{href:"/docs/guides/cli",children:"CLI guide"})," for more usage details."]}),"\n",(0,l.jsxs)(a.A,{children:[(0,l.jsxs)(o.A,{value:"cli-shell",label:"Shell",children:[(0,l.jsx)(t.pre,{children:(0,l.jsx)(t.code,{className:"language-sh",metastring:'title="example -h"',children:"NAME:\n example - an example temporal cli\n\nUSAGE:\n example [global options] command [command options] [arguments...]\n\nCOMMANDS:\n help, h Shows a list of commands or help for one command\n QUERIES:\n get-hello-status GetHelloStatus retrieves the status of a Hello workflow\n WORKFLOWS:\n hello Hello returns a friendly greeting\n"})}),(0,l.jsx)(t.pre,{children:(0,l.jsx)(t.code,{className:"language-sh",metastring:'title="example get-hello-status -h"',children:"NAME:\n example get-hello-status - GetHelloStatus retrieves the status of a Hello workflow\n\nUSAGE:\n example get-hello-status [command options] [arguments...]\n\nCATEGORY:\n WORKFLOWS\n\nOPTIONS:\n --help, -h show help\n --input-file value, -f value path to json-formatted input file\n --run-id value, -r value run id\n --workflow-id value, -w value workflow id\n\n INPUT\n\n --format value // Format specifies the output format\n"})}),(0,l.jsx)(t.pre,{children:(0,l.jsx)(t.code,{className:"language-json",metastring:'title="example get-hello-status -w foo --format json"',children:'{\n "result": "..."\n}\n'})})]}),(0,l.jsx)(o.A,{value:"cli-go",label:"Go",children:(0,l.jsx)(t.pre,{children:(0,l.jsx)(t.code,{className:"language-go",metastring:'title="main.go"',children:'package main\n\nimport (\n "log"\n "os"\n\n examplev1 "path/to/gen/example/v1"\n)\n\nfunc main() {\n app, err := examplev1.NewExampleCLI()\n if err != nil {\n log.Fatalf("error initializing cli: %v", err)\n }\n\n if err := app.Run(os.Args); err != nil {\n log.Fatal(err)\n }\n}\n'})})}),(0,l.jsx)(o.A,{value:"cli-schema",label:"Schema",children:(0,l.jsx)(t.pre,{children:(0,l.jsx)(t.code,{className:"language-protobuf",metastring:'title="example.proto"',children:'syntax="proto3";\n\npackage example.v1;\n\nservice Example {\n option (temporal.v1.service) = {\n task_queue: "example-v1"\n }\n\n // Hello returns a friendly greeting\n rpc Hello(HelloInput) returns (HelloOutput) {\n option (temporal.v1.workflow) = {};\n }\n\n // GetHelloStatus retrieves the status of a Hello workflow\n rpc GetHelloStatus(GetHelloStatusInput) returns (GetHelloStatusOutput) {\n option (temporal.v1.query) = {};\n }\n}\n\nmessage HelloInput {\n // Name specifies the subject to greet\n string name = 1;\n}\n\nmessage HelloOutput {\n string result = 1;\n}\n\nmessage GetHelloStatusInput {\n // Format specifies the output format\n string format = 1;\n}\n\nmessage GetHelloStatusOutput {\n string status = 1;\n}\n'})})})]}),"\n",(0,l.jsx)(t.h3,{id:"cross-namespace-xns",children:"Cross-Namespace (XNS)"}),"\n",(0,l.jsxs)(t.p,{children:["Queries can be executed from other workflows in a different Temporal namespace or even an entirely separate Temporal cluster (e.g. on-prem to cloud). See the ",(0,l.jsx)(t.a,{href:"/docs/guides/xns",children:"Cross-Namespace guide"})," for more usage details."]}),"\n",(0,l.jsxs)(a.A,{children:[(0,l.jsx)(o.A,{value:"xns-go",label:"Go",children:(0,l.jsx)(t.pre,{children:(0,l.jsx)(t.code,{className:"language-go",metastring:'title="example.go"',children:'package example\n\nimport (\n "fmt"\n\n examplev1 "path/to/gen/example/v1"\n "path/to/gen/example/v1/examplev1xns"\n "go.temporal.io/sdk/workflow"\n)\n\nfunc MyWorkflow(ctx workflow.Context) error {\n run, err := examplev1xns.HelloAsync(ctx, &examplev1.HelloInput{})\n if err != nil {\n return fmt.Errorf("error starting example.v1.Example.Hello xns workflow: %w", err)\n }\n\n status, err := run.GetHelloStatus(ctx, &examplev1.GetHelloStatusInput{})\n if err != nil {\n return fmt.Errorf("error querying workflow: %w", err)\n }\n\n _, err = run.Get(ctx)\n return err\n}\n'})})}),(0,l.jsx)(o.A,{value:"xns-schema",label:"Schema",children:(0,l.jsx)(t.pre,{children:(0,l.jsx)(t.code,{className:"language-protobuf",metastring:'title="example.proto"',children:'syntax="proto3";\n\npackage example.v1;\n\nservice Example {\n option (temporal.v1.service) = {\n task_queue: "example-v1"\n }\n\n rpc Hello(HelloInput) returns (HelloOutput) {\n option (temporal.v1.workflow) = {\n xns: {\n heartbeat_interval: { seconds: 10 }\n heartbeat_timeout: { seconds: 30 }\n start_to_close_timeout: { seconds: 300 }\n }\n };\n }\n\n rpc GetHelloStatus(GetHelloStatusInput) returns (GetHelloStatusOutput) {\n option (temporal.v1.query) = {\n xns: {\n heartbeat_interval: { seconds: 10 }\n heartbeat_timeout: { seconds: 30 }\n start_to_close_timeout: { seconds: 60 }\n }\n };\n }\n}\n'})})})]})]})}function d(e={}){const{wrapper:t}={...(0,r.R)(),...e.components};return t?(0,l.jsx)(t,{...e,children:(0,l.jsx)(m,{...e})}):m(e)}},9365:(e,t,n)=>{n.d(t,{A:()=>o});n(6540);var l=n(4164);const r={tabItem:"tabItem_Ymn6"};var a=n(4848);function o(e){let{children:t,hidden:n,className:o}=e;return(0,a.jsx)("div",{role:"tabpanel",className:(0,l.A)(r.tabItem,o),hidden:n,children:t})}},1470:(e,t,n)=>{n.d(t,{A:()=>j});var l=n(6540),r=n(4164),a=n(3104),o=n(6347),s=n(205),i=n(7485),u=n(1682),c=n(9466);function p(e){return l.Children.toArray(e).filter((e=>"\n"!==e)).map((e=>{if(!e||(0,l.isValidElement)(e)&&function(e){const{props:t}=e;return!!t&&"object"==typeof t&&"value"in t}(e))return e;throw new Error(`Docusaurus error: Bad child <${"string"==typeof e.type?e.type:e.type.name}>: all children of the component should be , and every should have a unique "value" prop.`)}))?.filter(Boolean)??[]}function m(e){const{values:t,children:n}=e;return(0,l.useMemo)((()=>{const e=t??function(e){return p(e).map((e=>{let{props:{value:t,label:n,attributes:l,default:r}}=e;return{value:t,label:n,attributes:l,default:r}}))}(n);return function(e){const t=(0,u.X)(e,((e,t)=>e.value===t.value));if(t.length>0)throw new Error(`Docusaurus error: Duplicate values "${t.map((e=>e.value)).join(", ")}" found in . Every value needs to be unique.`)}(e),e}),[t,n])}function d(e){let{value:t,tabValues:n}=e;return n.some((e=>e.value===t))}function h(e){let{queryString:t=!1,groupId:n}=e;const r=(0,o.W6)(),a=function(e){let{queryString:t=!1,groupId:n}=e;if("string"==typeof t)return t;if(!1===t)return null;if(!0===t&&!n)throw new Error('Docusaurus error: The component groupId prop is required if queryString=true, because this value is used as the search param name. You can also provide an explicit value such as queryString="my-search-param".');return n??null}({queryString:t,groupId:n});return[(0,i.aZ)(a),(0,l.useCallback)((e=>{if(!a)return;const t=new URLSearchParams(r.location.search);t.set(a,e),r.replace({...r.location,search:t.toString()})}),[a,r])]}function x(e){const{defaultValue:t,queryString:n=!1,groupId:r}=e,a=m(e),[o,i]=(0,l.useState)((()=>function(e){let{defaultValue:t,tabValues:n}=e;if(0===n.length)throw new Error("Docusaurus error: the component requires at least one children component");if(t){if(!d({value:t,tabValues:n}))throw new Error(`Docusaurus error: The has a defaultValue "${t}" but none of its children has the corresponding value. Available values are: ${n.map((e=>e.value)).join(", ")}. If you intend to show no default tab, use defaultValue={null} instead.`);return t}const l=n.find((e=>e.default))??n[0];if(!l)throw new Error("Unexpected error: 0 tabValues");return l.value}({defaultValue:t,tabValues:a}))),[u,p]=h({queryString:n,groupId:r}),[x,f]=function(e){let{groupId:t}=e;const n=function(e){return e?`docusaurus.tab.${e}`:null}(t),[r,a]=(0,c.Dv)(n);return[r,(0,l.useCallback)((e=>{n&&a.set(e)}),[n,a])]}({groupId:r}),g=(()=>{const e=u??x;return d({value:e,tabValues:a})?e:null})();(0,s.A)((()=>{g&&i(g)}),[g]);return{selectedValue:o,selectValue:(0,l.useCallback)((e=>{if(!d({value:e,tabValues:a}))throw new Error(`Can't select invalid tab value=${e}`);i(e),p(e),f(e)}),[p,f,a]),tabValues:a}}var f=n(2303);const g={tabList:"tabList__CuJ",tabItem:"tabItem_LNqP"};var v=n(4848);function w(e){let{className:t,block:n,selectedValue:l,selectValue:o,tabValues:s}=e;const i=[],{blockElementScrollPositionUntilNextRender:u}=(0,a.a_)(),c=e=>{const t=e.currentTarget,n=i.indexOf(t),r=s[n].value;r!==l&&(u(t),o(r))},p=e=>{let t=null;switch(e.key){case"Enter":c(e);break;case"ArrowRight":{const n=i.indexOf(e.currentTarget)+1;t=i[n]??i[0];break}case"ArrowLeft":{const n=i.indexOf(e.currentTarget)-1;t=i[n]??i[i.length-1];break}}t?.focus()};return(0,v.jsx)("ul",{role:"tablist","aria-orientation":"horizontal",className:(0,r.A)("tabs",{"tabs--block":n},t),children:s.map((e=>{let{value:t,label:n,attributes:a}=e;return(0,v.jsx)("li",{role:"tab",tabIndex:l===t?0:-1,"aria-selected":l===t,ref:e=>i.push(e),onKeyDown:p,onClick:c,...a,className:(0,r.A)("tabs__item",g.tabItem,a?.className,{"tabs__item--active":l===t}),children:n??t},t)}))})}function b(e){let{lazy:t,children:n,selectedValue:r}=e;const a=(Array.isArray(n)?n:[n]).filter(Boolean);if(t){const e=a.find((e=>e.props.value===r));return e?(0,l.cloneElement)(e,{className:"margin-top--md"}):null}return(0,v.jsx)("div",{className:"margin-top--md",children:a.map(((e,t)=>(0,l.cloneElement)(e,{key:t,hidden:e.props.value!==r})))})}function H(e){const t=x(e);return(0,v.jsxs)("div",{className:(0,r.A)("tabs-container",g.tabList),children:[(0,v.jsx)(w,{...e,...t}),(0,v.jsx)(b,{...e,...t})]})}function j(e){const t=(0,f.A)();return(0,v.jsx)(H,{...e,children:p(e.children)},String(t))}},8453:(e,t,n)=>{n.d(t,{R:()=>o,x:()=>s});var l=n(6540);const r={},a=l.createContext(r);function o(e){const t=l.useContext(a);return l.useMemo((function(){return"function"==typeof e?e(t):{...t,...e}}),[t,e])}function s(e){let t;return t=e.disableParentContext?"function"==typeof e.components?e.components(r):e.components||r:o(e.components),l.createElement(a.Provider,{value:t},e.children)}}}]); \ No newline at end of file diff --git a/assets/js/e17b2e0e.9e2f228c.js b/assets/js/e17b2e0e.9e2f228c.js new file mode 100644 index 00000000..a7962638 --- /dev/null +++ b/assets/js/e17b2e0e.9e2f228c.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunkdocs=self.webpackChunkdocs||[]).push([[3456],{8050:(e,t,n)=>{n.r(t),n.d(t,{assets:()=>c,contentTitle:()=>i,default:()=>d,frontMatter:()=>s,metadata:()=>u,toc:()=>p});var l=n(4848),r=n(8453),a=n(1470),o=n(9365);const s={},i="Queries",u={id:"guides/queries",title:"Queries",description:"Implementation",source:"@site/docs/guides/queries.mdx",sourceDirName:"guides",slug:"/guides/queries",permalink:"/protoc-gen-go-temporal/docs/guides/queries",draft:!1,unlisted:!1,editUrl:"https://github.com/facebook/docusaurus/tree/main/packages/create-docusaurus/templates/shared/docs/guides/queries.mdx",tags:[],version:"current",frontMatter:{},sidebar:"docs",previous:{title:"Activities",permalink:"/protoc-gen-go-temporal/docs/guides/activities"},next:{title:"Signals",permalink:"/protoc-gen-go-temporal/docs/guides/signals"}},c={},p=[{value:"Implementation",id:"implementation",level:2},{value:"Parameters",id:"parameters",level:3},{value:"Invocation",id:"invocation",level:2},{value:"Client",id:"client",level:3},{value:"Command Line Interface",id:"command-line-interface",level:3},{value:"Cross-Namespace (XNS)",id:"cross-namespace-xns",level:3}];function m(e){const t={a:"a",admonition:"admonition",code:"code",h1:"h1",h2:"h2",h3:"h3",p:"p",pre:"pre",...(0,r.R)(),...e.components};return(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(t.h1,{id:"queries",children:"Queries"}),"\n",(0,l.jsx)(t.h2,{id:"implementation",children:"Implementation"}),"\n",(0,l.jsx)(t.p,{children:"A query is implemented as a method on a workflow struct."}),"\n",(0,l.jsxs)(a.A,{children:[(0,l.jsx)(o.A,{value:"implementation-go",label:"Go",children:(0,l.jsx)(t.pre,{children:(0,l.jsx)(t.code,{className:"language-go",metastring:'title="example.go"',children:'package example\n\nimport (\n examplev1 "path/to/gen/example/v1"\n "go.temporal.io/sdk/workflow"\n)\n\ntype HelloWorkflow struct {\n *examplev1.HelloWorkflowInput\n}\n\nfunc (w *HelloWorkflow) Execute(ctx workflow.Context) (*examplev1.HelloOutput, error) {\n workflow.GetLogger(ctx).Info("executing hello workflow", "input", w.Req)\n return &examplev1.HelloOutput{}, nil\n}\n\nfunc (w *HelloWorkflow) GetHelloStatus(input *examplev1.GetHelloStatusInput) (*examplev1.GetHelloStatusOutput, error) {\n return &examplev1.GetHelloStatusOutput{\n Status: w.Req.GetStatus(),\n }, nil\n}\n'})})}),(0,l.jsx)(o.A,{value:"implementation-schema",label:"Schema",children:(0,l.jsx)(t.pre,{children:(0,l.jsx)(t.code,{className:"language-protobuf",metastring:'title="example.proto"',children:'syntax="proto3";\n\npackage example.v1;\n\nimport "temporal/v1/temporal.proto";\n\nservice Example {\n // Hello returns a friendly greeting\n rpc Hello(HelloInput) returns (HelloOutput) {\n option (temporal.v1.workflow) = {\n query: { ref: "GetHelloStatus" }\n };\n }\n\n // GetHelloStatus retrieves the status of a Hello workflow\n rpc GetHelloStatus(GetHelloStatusInput) returns (GetHelloStatusOutput) {\n option (temporal.v1.query) = {};\n }\n}\n'})})})]}),"\n",(0,l.jsx)(t.h3,{id:"parameters",children:"Parameters"}),"\n",(0,l.jsxs)(t.p,{children:["Query definitions can omit an input parameter by specifying the native ",(0,l.jsx)(t.code,{children:"google.protobuf.Empty"})," message type in its place. This requires an additional ",(0,l.jsx)(t.code,{children:"google/protobuf/empty.proto"})," protobuf import."]}),"\n",(0,l.jsx)(t.admonition,{type:"warning",children:(0,l.jsx)(t.p,{children:"Query definitions must specify a non-empty output parameter."})}),"\n",(0,l.jsxs)(a.A,{children:[(0,l.jsx)(o.A,{value:"implementation-go",label:"Go",children:(0,l.jsx)(t.pre,{children:(0,l.jsx)(t.code,{className:"language-go",metastring:'title="example.go"',children:'package example\n\nimport (\n examplev1 "path/to/gen/example/v1"\n "go.temporal.io/sdk/workflow"\n)\n\ntype HelloWorkflow struct {\n *examplev1.HelloWorkflowInput\n}\n\nfunc (w *HelloWorkflow) Execute(ctx workflow.Context) (*examplev1.HelloOutput, error) {\n workflow.GetLogger(ctx).Info("executing hello workflow", "input", w.Req)\n return &examplev1.HelloOutput{}, nil\n}\n\nfunc (w *HelloWorkflow) GetHelloStatus() (*examplev1.GetHelloStatusOutput, error) {\n return &examplev1.GetHelloStatusOutput{\n Status: w.Req.GetStatus(),\n }, nil\n}\n'})})}),(0,l.jsx)(o.A,{value:"implementation-schema",label:"Schema",children:(0,l.jsx)(t.pre,{children:(0,l.jsx)(t.code,{className:"language-protobuf",metastring:'title="example.proto"',children:'syntax="proto3";\n\npackage example.v1;\n\nimport "google/protobuf/empty.proto";\nimport "temporal/v1/temporal.proto";\n\nservice Example {\n // Hello returns a friendly greeting\n rpc Hello(HelloInput) returns (HelloOutput) {\n option (temporal.v1.workflow) = {\n query: { ref: "GetHelloStatus" }\n };\n }\n\n // GetHelloStatus retrieves the status of a Hello workflow\n rpc GetHelloStatus(google.protobuf.Empty) returns (GetHelloStatusOutput) {\n option (temporal.v1.query) = {};\n }\n}\n'})})})]}),"\n",(0,l.jsx)(t.h2,{id:"invocation",children:"Invocation"}),"\n",(0,l.jsx)(t.p,{children:"This plugin supports several methods for executing protobuf queries, each of which is outlined in more detail below."}),"\n",(0,l.jsx)(t.h3,{id:"client",children:"Client"}),"\n",(0,l.jsxs)(t.p,{children:["Consumers can utilize the generated Client to execute queries from any Go application. See the ",(0,l.jsx)(t.a,{href:"/docs/guides/clients",children:"Clients guide"})," for more usage details."]}),"\n",(0,l.jsxs)(a.A,{children:[(0,l.jsx)(o.A,{value:"client-go",label:"Go",children:(0,l.jsx)(t.pre,{children:(0,l.jsx)(t.code,{className:"language-go",metastring:'title="main.go"',children:'package main\n\nimport (\n "context"\n "log"\n\n examplev1 "path/to/gen/example/v1"\n "go.temporal.io/sdk/client"\n)\n\nfunc main() {\n // initialize temporal client\n c, err := client.Dial(client.Options{})\n if err != nil {\n log.Fatalf("error initializing client: %v", err)\n }\n\n // initialize temporal protobuf client\n ctx, client := context.Background(), examplev1.NewExampleClient(c)\n\n // execute an example.v1.Example.GetHelloStatus query\n // via workflow ID\n status, err := client.GetHelloStatus(ctx, "wf-id", "", &examplev1.GetHelloStatusInput{})\n if err != nil {\n log.Fatalf("error executing example.v1.Example.GetHelloStatus query: %v", err)\n }\n\n // or use the corresponding query method defined on the\n // workflow run\n run, err := client.HelloAsync(ctx, &examplev1.HelloInput{})\n if err != nil {\n log.Fatalf("error starting example.v1.Example.Hello workflow: %v", err)\n }\n status, err = run.GetHelloStatus(&examplev1.GetHelloStatusInput{})\n if err != nil {\n log.Fatalf("error executing example.v1.Example.GetHelloStatus query: %v", err)\n }\n}\n'})})}),(0,l.jsx)(o.A,{value:"client-schema",label:"Schema",children:(0,l.jsx)(t.pre,{children:(0,l.jsx)(t.code,{className:"language-protobuf",metastring:'title="example.proto"',children:'syntax="proto3";\n\npackage example.v1;\n\nservice Example {\n option (temporal.v1.service) = {\n task_queue: "example-v1"\n }\n\n rpc Hello(HelloInput) returns (HelloOutput) {\n option (temporal.v1.workflow) = {};\n }\n\n rpc GetHelloStatus(GetHelloStatusInput) returns (GetHelloStatusOutput) {\n option (temporal.v1.query) = {};\n }\n}\n'})})})]}),"\n",(0,l.jsx)(t.h3,{id:"command-line-interface",children:"Command Line Interface"}),"\n",(0,l.jsxs)(t.p,{children:["Consumers can utilize the generated Command Line Interface as a standalone application for executing queries. See the ",(0,l.jsx)(t.a,{href:"/docs/guides/cli",children:"CLI guide"})," for more usage details."]}),"\n",(0,l.jsxs)(a.A,{children:[(0,l.jsxs)(o.A,{value:"cli-shell",label:"Shell",children:[(0,l.jsx)(t.pre,{children:(0,l.jsx)(t.code,{className:"language-sh",metastring:'title="example -h"',children:"NAME:\n example - an example temporal cli\n\nUSAGE:\n example [global options] command [command options] [arguments...]\n\nCOMMANDS:\n help, h Shows a list of commands or help for one command\n QUERIES:\n get-hello-status GetHelloStatus retrieves the status of a Hello workflow\n WORKFLOWS:\n hello Hello returns a friendly greeting\n"})}),(0,l.jsx)(t.pre,{children:(0,l.jsx)(t.code,{className:"language-sh",metastring:'title="example get-hello-status -h"',children:"NAME:\n example get-hello-status - GetHelloStatus retrieves the status of a Hello workflow\n\nUSAGE:\n example get-hello-status [command options] [arguments...]\n\nCATEGORY:\n WORKFLOWS\n\nOPTIONS:\n --help, -h show help\n --input-file value, -f value path to json-formatted input file\n --run-id value, -r value run id\n --workflow-id value, -w value workflow id\n\n INPUT\n\n --format value // Format specifies the output format\n"})}),(0,l.jsx)(t.pre,{children:(0,l.jsx)(t.code,{className:"language-json",metastring:'title="example get-hello-status -w foo --format json"',children:'{\n "result": "..."\n}\n'})})]}),(0,l.jsx)(o.A,{value:"cli-go",label:"Go",children:(0,l.jsx)(t.pre,{children:(0,l.jsx)(t.code,{className:"language-go",metastring:'title="main.go"',children:'package main\n\nimport (\n "log"\n "os"\n\n examplev1 "path/to/gen/example/v1"\n)\n\nfunc main() {\n app, err := examplev1.NewExampleCLI()\n if err != nil {\n log.Fatalf("error initializing cli: %v", err)\n }\n\n if err := app.Run(os.Args); err != nil {\n log.Fatal(err)\n }\n}\n'})})}),(0,l.jsx)(o.A,{value:"cli-schema",label:"Schema",children:(0,l.jsx)(t.pre,{children:(0,l.jsx)(t.code,{className:"language-protobuf",metastring:'title="example.proto"',children:'syntax="proto3";\n\npackage example.v1;\n\nservice Example {\n option (temporal.v1.service) = {\n task_queue: "example-v1"\n }\n\n // Hello returns a friendly greeting\n rpc Hello(HelloInput) returns (HelloOutput) {\n option (temporal.v1.workflow) = {};\n }\n\n // GetHelloStatus retrieves the status of a Hello workflow\n rpc GetHelloStatus(GetHelloStatusInput) returns (GetHelloStatusOutput) {\n option (temporal.v1.query) = {};\n }\n}\n\nmessage HelloInput {\n // Name specifies the subject to greet\n string name = 1;\n}\n\nmessage HelloOutput {\n string result = 1;\n}\n\nmessage GetHelloStatusInput {\n // Format specifies the output format\n string format = 1;\n}\n\nmessage GetHelloStatusOutput {\n string status = 1;\n}\n'})})})]}),"\n",(0,l.jsx)(t.h3,{id:"cross-namespace-xns",children:"Cross-Namespace (XNS)"}),"\n",(0,l.jsxs)(t.p,{children:["Queries can be executed from other workflows in a different Temporal namespace or even an entirely separate Temporal cluster (e.g. on-prem to cloud). See the ",(0,l.jsx)(t.a,{href:"/docs/guides/xns",children:"Cross-Namespace guide"})," for more usage details."]}),"\n",(0,l.jsxs)(a.A,{children:[(0,l.jsx)(o.A,{value:"xns-go",label:"Go",children:(0,l.jsx)(t.pre,{children:(0,l.jsx)(t.code,{className:"language-go",metastring:'title="example.go"',children:'package example\n\nimport (\n "fmt"\n\n examplev1 "path/to/gen/example/v1"\n "path/to/gen/example/v1/examplev1xns"\n "go.temporal.io/sdk/workflow"\n)\n\nfunc MyWorkflow(ctx workflow.Context) error {\n run, err := examplev1xns.HelloAsync(ctx, &examplev1.HelloInput{})\n if err != nil {\n return fmt.Errorf("error starting example.v1.Example.Hello xns workflow: %w", err)\n }\n\n status, err := run.GetHelloStatus(ctx, &examplev1.GetHelloStatusInput{})\n if err != nil {\n return fmt.Errorf("error querying workflow: %w", err)\n }\n\n _, err = run.Get(ctx)\n return err\n}\n'})})}),(0,l.jsx)(o.A,{value:"xns-schema",label:"Schema",children:(0,l.jsx)(t.pre,{children:(0,l.jsx)(t.code,{className:"language-protobuf",metastring:'title="example.proto"',children:'syntax="proto3";\n\npackage example.v1;\n\nservice Example {\n option (temporal.v1.service) = {\n task_queue: "example-v1"\n }\n\n rpc Hello(HelloInput) returns (HelloOutput) {\n option (temporal.v1.workflow) = {\n xns: {\n heartbeat_interval: { seconds: 10 }\n heartbeat_timeout: { seconds: 30 }\n start_to_close_timeout: { seconds: 300 }\n }\n };\n }\n\n rpc GetHelloStatus(GetHelloStatusInput) returns (GetHelloStatusOutput) {\n option (temporal.v1.query) = {\n xns: {\n heartbeat_interval: { seconds: 10 }\n heartbeat_timeout: { seconds: 30 }\n start_to_close_timeout: { seconds: 60 }\n }\n };\n }\n}\n'})})})]})]})}function d(e={}){const{wrapper:t}={...(0,r.R)(),...e.components};return t?(0,l.jsx)(t,{...e,children:(0,l.jsx)(m,{...e})}):m(e)}},9365:(e,t,n)=>{n.d(t,{A:()=>o});n(6540);var l=n(4164);const r={tabItem:"tabItem_Ymn6"};var a=n(4848);function o(e){let{children:t,hidden:n,className:o}=e;return(0,a.jsx)("div",{role:"tabpanel",className:(0,l.A)(r.tabItem,o),hidden:n,children:t})}},1470:(e,t,n)=>{n.d(t,{A:()=>j});var l=n(6540),r=n(4164),a=n(3104),o=n(6347),s=n(205),i=n(7485),u=n(1682),c=n(9466);function p(e){return l.Children.toArray(e).filter((e=>"\n"!==e)).map((e=>{if(!e||(0,l.isValidElement)(e)&&function(e){const{props:t}=e;return!!t&&"object"==typeof t&&"value"in t}(e))return e;throw new Error(`Docusaurus error: Bad child <${"string"==typeof e.type?e.type:e.type.name}>: all children of the component should be , and every should have a unique "value" prop.`)}))?.filter(Boolean)??[]}function m(e){const{values:t,children:n}=e;return(0,l.useMemo)((()=>{const e=t??function(e){return p(e).map((e=>{let{props:{value:t,label:n,attributes:l,default:r}}=e;return{value:t,label:n,attributes:l,default:r}}))}(n);return function(e){const t=(0,u.X)(e,((e,t)=>e.value===t.value));if(t.length>0)throw new Error(`Docusaurus error: Duplicate values "${t.map((e=>e.value)).join(", ")}" found in . Every value needs to be unique.`)}(e),e}),[t,n])}function d(e){let{value:t,tabValues:n}=e;return n.some((e=>e.value===t))}function h(e){let{queryString:t=!1,groupId:n}=e;const r=(0,o.W6)(),a=function(e){let{queryString:t=!1,groupId:n}=e;if("string"==typeof t)return t;if(!1===t)return null;if(!0===t&&!n)throw new Error('Docusaurus error: The component groupId prop is required if queryString=true, because this value is used as the search param name. You can also provide an explicit value such as queryString="my-search-param".');return n??null}({queryString:t,groupId:n});return[(0,i.aZ)(a),(0,l.useCallback)((e=>{if(!a)return;const t=new URLSearchParams(r.location.search);t.set(a,e),r.replace({...r.location,search:t.toString()})}),[a,r])]}function x(e){const{defaultValue:t,queryString:n=!1,groupId:r}=e,a=m(e),[o,i]=(0,l.useState)((()=>function(e){let{defaultValue:t,tabValues:n}=e;if(0===n.length)throw new Error("Docusaurus error: the component requires at least one children component");if(t){if(!d({value:t,tabValues:n}))throw new Error(`Docusaurus error: The has a defaultValue "${t}" but none of its children has the corresponding value. Available values are: ${n.map((e=>e.value)).join(", ")}. If you intend to show no default tab, use defaultValue={null} instead.`);return t}const l=n.find((e=>e.default))??n[0];if(!l)throw new Error("Unexpected error: 0 tabValues");return l.value}({defaultValue:t,tabValues:a}))),[u,p]=h({queryString:n,groupId:r}),[x,f]=function(e){let{groupId:t}=e;const n=function(e){return e?`docusaurus.tab.${e}`:null}(t),[r,a]=(0,c.Dv)(n);return[r,(0,l.useCallback)((e=>{n&&a.set(e)}),[n,a])]}({groupId:r}),g=(()=>{const e=u??x;return d({value:e,tabValues:a})?e:null})();(0,s.A)((()=>{g&&i(g)}),[g]);return{selectedValue:o,selectValue:(0,l.useCallback)((e=>{if(!d({value:e,tabValues:a}))throw new Error(`Can't select invalid tab value=${e}`);i(e),p(e),f(e)}),[p,f,a]),tabValues:a}}var f=n(2303);const g={tabList:"tabList__CuJ",tabItem:"tabItem_LNqP"};var v=n(4848);function w(e){let{className:t,block:n,selectedValue:l,selectValue:o,tabValues:s}=e;const i=[],{blockElementScrollPositionUntilNextRender:u}=(0,a.a_)(),c=e=>{const t=e.currentTarget,n=i.indexOf(t),r=s[n].value;r!==l&&(u(t),o(r))},p=e=>{let t=null;switch(e.key){case"Enter":c(e);break;case"ArrowRight":{const n=i.indexOf(e.currentTarget)+1;t=i[n]??i[0];break}case"ArrowLeft":{const n=i.indexOf(e.currentTarget)-1;t=i[n]??i[i.length-1];break}}t?.focus()};return(0,v.jsx)("ul",{role:"tablist","aria-orientation":"horizontal",className:(0,r.A)("tabs",{"tabs--block":n},t),children:s.map((e=>{let{value:t,label:n,attributes:a}=e;return(0,v.jsx)("li",{role:"tab",tabIndex:l===t?0:-1,"aria-selected":l===t,ref:e=>i.push(e),onKeyDown:p,onClick:c,...a,className:(0,r.A)("tabs__item",g.tabItem,a?.className,{"tabs__item--active":l===t}),children:n??t},t)}))})}function b(e){let{lazy:t,children:n,selectedValue:r}=e;const a=(Array.isArray(n)?n:[n]).filter(Boolean);if(t){const e=a.find((e=>e.props.value===r));return e?(0,l.cloneElement)(e,{className:"margin-top--md"}):null}return(0,v.jsx)("div",{className:"margin-top--md",children:a.map(((e,t)=>(0,l.cloneElement)(e,{key:t,hidden:e.props.value!==r})))})}function H(e){const t=x(e);return(0,v.jsxs)("div",{className:(0,r.A)("tabs-container",g.tabList),children:[(0,v.jsx)(w,{...e,...t}),(0,v.jsx)(b,{...e,...t})]})}function j(e){const t=(0,f.A)();return(0,v.jsx)(H,{...e,children:p(e.children)},String(t))}},8453:(e,t,n)=>{n.d(t,{R:()=>o,x:()=>s});var l=n(6540);const r={},a=l.createContext(r);function o(e){const t=l.useContext(a);return l.useMemo((function(){return"function"==typeof e?e(t):{...t,...e}}),[t,e])}function s(e){let t;return t=e.disableParentContext?"function"==typeof e.components?e.components(r):e.components||r:o(e.components),l.createElement(a.Provider,{value:t},e.children)}}}]); \ No newline at end of file diff --git a/assets/js/e273c56f.a2f3ff95.js b/assets/js/e273c56f.a2f3ff95.js deleted file mode 100644 index b02e9f78..00000000 --- a/assets/js/e273c56f.a2f3ff95.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunkdocs=self.webpackChunkdocs||[]).push([[9328],{4014:(t,e,o)=>{o.r(e),o.d(e,{assets:()=>n,contentTitle:()=>u,default:()=>m,frontMatter:()=>r,metadata:()=>i,toc:()=>l});var s=o(4848),a=o(8453);const r={slug:"first-blog-post",title:"First Blog Post",authors:{name:"Gao Wei",title:"Docusaurus Core Team",url:"https://github.com/wgao19",image_url:"https://github.com/wgao19.png"},tags:["hola","docusaurus"]},u=void 0,i={permalink:"/blog/first-blog-post",editUrl:"https://github.com/facebook/docusaurus/tree/main/packages/create-docusaurus/templates/shared/blog/2019-05-28-first-blog-post.md",source:"@site/blog/2019-05-28-first-blog-post.md",title:"First Blog Post",description:"Lorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque elementum dignissim ultricies. Fusce rhoncus ipsum tempor eros aliquam consequat. Lorem ipsum dolor sit amet",date:"2019-05-28T00:00:00.000Z",formattedDate:"May 28, 2019",tags:[{label:"hola",permalink:"/blog/tags/hola"},{label:"docusaurus",permalink:"/blog/tags/docusaurus"}],readingTime:.12,hasTruncateMarker:!1,authors:[{name:"Gao Wei",title:"Docusaurus Core Team",url:"https://github.com/wgao19",image_url:"https://github.com/wgao19.png",imageURL:"https://github.com/wgao19.png"}],frontMatter:{slug:"first-blog-post",title:"First Blog Post",authors:{name:"Gao Wei",title:"Docusaurus Core Team",url:"https://github.com/wgao19",image_url:"https://github.com/wgao19.png",imageURL:"https://github.com/wgao19.png"},tags:["hola","docusaurus"]},unlisted:!1,prevItem:{title:"Long Blog Post",permalink:"/blog/long-blog-post"}},n={authorsImageUrls:[void 0]},l=[];function c(t){const e={p:"p",...(0,a.R)(),...t.components};return(0,s.jsx)(e.p,{children:"Lorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque elementum dignissim ultricies. Fusce rhoncus ipsum tempor eros aliquam consequat. Lorem ipsum dolor sit amet"})}function m(t={}){const{wrapper:e}={...(0,a.R)(),...t.components};return e?(0,s.jsx)(e,{...t,children:(0,s.jsx)(c,{...t})}):c(t)}},8453:(t,e,o)=>{o.d(e,{R:()=>u,x:()=>i});var s=o(6540);const a={},r=s.createContext(a);function u(t){const e=s.useContext(r);return s.useMemo((function(){return"function"==typeof t?t(e):{...e,...t}}),[e,t])}function i(t){let e;return e=t.disableParentContext?"function"==typeof t.components?t.components(a):t.components||a:u(t.components),s.createElement(r.Provider,{value:e},t.children)}}}]); \ No newline at end of file diff --git a/assets/js/e273c56f.d7239e79.js b/assets/js/e273c56f.d7239e79.js new file mode 100644 index 00000000..d291bc31 --- /dev/null +++ b/assets/js/e273c56f.d7239e79.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunkdocs=self.webpackChunkdocs||[]).push([[9328],{4014:(t,o,e)=>{e.r(o),e.d(o,{assets:()=>n,contentTitle:()=>u,default:()=>m,frontMatter:()=>a,metadata:()=>i,toc:()=>l});var s=e(4848),r=e(8453);const a={slug:"first-blog-post",title:"First Blog Post",authors:{name:"Gao Wei",title:"Docusaurus Core Team",url:"https://github.com/wgao19",image_url:"https://github.com/wgao19.png"},tags:["hola","docusaurus"]},u=void 0,i={permalink:"/protoc-gen-go-temporal/blog/first-blog-post",editUrl:"https://github.com/facebook/docusaurus/tree/main/packages/create-docusaurus/templates/shared/blog/2019-05-28-first-blog-post.md",source:"@site/blog/2019-05-28-first-blog-post.md",title:"First Blog Post",description:"Lorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque elementum dignissim ultricies. Fusce rhoncus ipsum tempor eros aliquam consequat. Lorem ipsum dolor sit amet",date:"2019-05-28T00:00:00.000Z",formattedDate:"May 28, 2019",tags:[{label:"hola",permalink:"/protoc-gen-go-temporal/blog/tags/hola"},{label:"docusaurus",permalink:"/protoc-gen-go-temporal/blog/tags/docusaurus"}],readingTime:.12,hasTruncateMarker:!1,authors:[{name:"Gao Wei",title:"Docusaurus Core Team",url:"https://github.com/wgao19",image_url:"https://github.com/wgao19.png",imageURL:"https://github.com/wgao19.png"}],frontMatter:{slug:"first-blog-post",title:"First Blog Post",authors:{name:"Gao Wei",title:"Docusaurus Core Team",url:"https://github.com/wgao19",image_url:"https://github.com/wgao19.png",imageURL:"https://github.com/wgao19.png"},tags:["hola","docusaurus"]},unlisted:!1,prevItem:{title:"Long Blog Post",permalink:"/protoc-gen-go-temporal/blog/long-blog-post"}},n={authorsImageUrls:[void 0]},l=[];function c(t){const o={p:"p",...(0,r.R)(),...t.components};return(0,s.jsx)(o.p,{children:"Lorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque elementum dignissim ultricies. Fusce rhoncus ipsum tempor eros aliquam consequat. Lorem ipsum dolor sit amet"})}function m(t={}){const{wrapper:o}={...(0,r.R)(),...t.components};return o?(0,s.jsx)(o,{...t,children:(0,s.jsx)(c,{...t})}):c(t)}},8453:(t,o,e)=>{e.d(o,{R:()=>u,x:()=>i});var s=e(6540);const r={},a=s.createContext(r);function u(t){const o=s.useContext(a);return s.useMemo((function(){return"function"==typeof t?t(o):{...o,...t}}),[o,t])}function i(t){let o;return o=t.disableParentContext?"function"==typeof t.components?t.components(r):t.components||r:u(t.components),s.createElement(a.Provider,{value:o},t.children)}}}]); \ No newline at end of file diff --git a/assets/js/eb3fa7af.157c54ef.js b/assets/js/eb3fa7af.157c54ef.js new file mode 100644 index 00000000..b6059db6 --- /dev/null +++ b/assets/js/eb3fa7af.157c54ef.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunkdocs=self.webpackChunkdocs||[]).push([[5800],{2299:o=>{o.exports=JSON.parse('{"permalink":"/protoc-gen-go-temporal/blog/tags/hello","page":1,"postsPerPage":10,"totalPages":1,"totalCount":2,"blogDescription":"Blog","blogTitle":"Blog"}')}}]); \ No newline at end of file diff --git a/assets/js/ee3a5f89.04ffe02a.js b/assets/js/ee3a5f89.04ffe02a.js new file mode 100644 index 00000000..6f041e07 --- /dev/null +++ b/assets/js/ee3a5f89.04ffe02a.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunkdocs=self.webpackChunkdocs||[]).push([[1793],{7129:o=>{o.exports=JSON.parse('{"permalink":"/protoc-gen-go-temporal/blog/tags/docusaurus","page":1,"postsPerPage":10,"totalPages":1,"totalCount":4,"blogDescription":"Blog","blogTitle":"Blog"}')}}]); \ No newline at end of file diff --git a/assets/js/f4f34a3a.0f36b332.js b/assets/js/f4f34a3a.0f36b332.js new file mode 100644 index 00000000..9cbe05bd --- /dev/null +++ b/assets/js/f4f34a3a.0f36b332.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunkdocs=self.webpackChunkdocs||[]).push([[3637],{5512:(t,e,o)=>{o.r(e),o.d(e,{assets:()=>l,contentTitle:()=>a,default:()=>p,frontMatter:()=>n,metadata:()=>c,toc:()=>u});var s=o(4848),r=o(8453);const n={slug:"mdx-blog-post",title:"MDX Blog Post",authors:["slorber"],tags:["docusaurus"]},a=void 0,c={permalink:"/protoc-gen-go-temporal/blog/mdx-blog-post",editUrl:"https://github.com/facebook/docusaurus/tree/main/packages/create-docusaurus/templates/shared/blog/2021-08-01-mdx-blog-post.mdx",source:"@site/blog/2021-08-01-mdx-blog-post.mdx",title:"MDX Blog Post",description:"Blog posts support Docusaurus Markdown features, such as MDX.",date:"2021-08-01T00:00:00.000Z",formattedDate:"August 1, 2021",tags:[{label:"docusaurus",permalink:"/protoc-gen-go-temporal/blog/tags/docusaurus"}],readingTime:.175,hasTruncateMarker:!1,authors:[{name:"S\xe9bastien Lorber",title:"Docusaurus maintainer",url:"https://sebastienlorber.com",imageURL:"https://github.com/slorber.png",key:"slorber"}],frontMatter:{slug:"mdx-blog-post",title:"MDX Blog Post",authors:["slorber"],tags:["docusaurus"]},unlisted:!1,prevItem:{title:"Welcome",permalink:"/protoc-gen-go-temporal/blog/welcome"},nextItem:{title:"Long Blog Post",permalink:"/protoc-gen-go-temporal/blog/long-blog-post"}},l={authorsImageUrls:[void 0]},u=[];function i(t){const e={a:"a",admonition:"admonition",code:"code",p:"p",pre:"pre",...(0,r.R)(),...t.components};return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)(e.p,{children:["Blog posts support ",(0,s.jsx)(e.a,{href:"https://docusaurus.io/docs/markdown-features",children:"Docusaurus Markdown features"}),", such as ",(0,s.jsx)(e.a,{href:"https://mdxjs.com/",children:"MDX"}),"."]}),"\n",(0,s.jsxs)(e.admonition,{type:"tip",children:[(0,s.jsx)(e.p,{children:"Use the power of React to create interactive blog posts."}),(0,s.jsx)(e.pre,{children:(0,s.jsx)(e.code,{className:"language-js",children:"\n"})}),(0,s.jsx)("button",{onClick:()=>alert("button clicked!"),children:"Click me!"})]})]})}function p(t={}){const{wrapper:e}={...(0,r.R)(),...t.components};return e?(0,s.jsx)(e,{...t,children:(0,s.jsx)(i,{...t})}):i(t)}},8453:(t,e,o)=>{o.d(e,{R:()=>a,x:()=>c});var s=o(6540);const r={},n=s.createContext(r);function a(t){const e=s.useContext(n);return s.useMemo((function(){return"function"==typeof t?t(e):{...e,...t}}),[e,t])}function c(t){let e;return e=t.disableParentContext?"function"==typeof t.components?t.components(r):t.components||r:a(t.components),s.createElement(n.Provider,{value:e},t.children)}}}]); \ No newline at end of file diff --git a/assets/js/f4f34a3a.84d9f4d2.js b/assets/js/f4f34a3a.84d9f4d2.js deleted file mode 100644 index fcbd9924..00000000 --- a/assets/js/f4f34a3a.84d9f4d2.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunkdocs=self.webpackChunkdocs||[]).push([[3637],{5512:(t,e,o)=>{o.r(e),o.d(e,{assets:()=>u,contentTitle:()=>a,default:()=>d,frontMatter:()=>n,metadata:()=>c,toc:()=>l});var s=o(4848),r=o(8453);const n={slug:"mdx-blog-post",title:"MDX Blog Post",authors:["slorber"],tags:["docusaurus"]},a=void 0,c={permalink:"/blog/mdx-blog-post",editUrl:"https://github.com/facebook/docusaurus/tree/main/packages/create-docusaurus/templates/shared/blog/2021-08-01-mdx-blog-post.mdx",source:"@site/blog/2021-08-01-mdx-blog-post.mdx",title:"MDX Blog Post",description:"Blog posts support Docusaurus Markdown features, such as MDX.",date:"2021-08-01T00:00:00.000Z",formattedDate:"August 1, 2021",tags:[{label:"docusaurus",permalink:"/blog/tags/docusaurus"}],readingTime:.175,hasTruncateMarker:!1,authors:[{name:"S\xe9bastien Lorber",title:"Docusaurus maintainer",url:"https://sebastienlorber.com",imageURL:"https://github.com/slorber.png",key:"slorber"}],frontMatter:{slug:"mdx-blog-post",title:"MDX Blog Post",authors:["slorber"],tags:["docusaurus"]},unlisted:!1,prevItem:{title:"Welcome",permalink:"/blog/welcome"},nextItem:{title:"Long Blog Post",permalink:"/blog/long-blog-post"}},u={authorsImageUrls:[void 0]},l=[];function i(t){const e={a:"a",admonition:"admonition",code:"code",p:"p",pre:"pre",...(0,r.R)(),...t.components};return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)(e.p,{children:["Blog posts support ",(0,s.jsx)(e.a,{href:"https://docusaurus.io/docs/markdown-features",children:"Docusaurus Markdown features"}),", such as ",(0,s.jsx)(e.a,{href:"https://mdxjs.com/",children:"MDX"}),"."]}),"\n",(0,s.jsxs)(e.admonition,{type:"tip",children:[(0,s.jsx)(e.p,{children:"Use the power of React to create interactive blog posts."}),(0,s.jsx)(e.pre,{children:(0,s.jsx)(e.code,{className:"language-js",children:"\n"})}),(0,s.jsx)("button",{onClick:()=>alert("button clicked!"),children:"Click me!"})]})]})}function d(t={}){const{wrapper:e}={...(0,r.R)(),...t.components};return e?(0,s.jsx)(e,{...t,children:(0,s.jsx)(i,{...t})}):i(t)}},8453:(t,e,o)=>{o.d(e,{R:()=>a,x:()=>c});var s=o(6540);const r={},n=s.createContext(r);function a(t){const e=s.useContext(n);return s.useMemo((function(){return"function"==typeof t?t(e):{...e,...t}}),[e,t])}function c(t){let e;return e=t.disableParentContext?"function"==typeof t.components?t.components(r):t.components||r:a(t.components),s.createElement(n.Provider,{value:e},t.children)}}}]); \ No newline at end of file diff --git a/assets/js/main.8b0a5f68.js b/assets/js/main.8b0a5f68.js deleted file mode 100644 index 018b743c..00000000 --- a/assets/js/main.8b0a5f68.js +++ /dev/null @@ -1,2 +0,0 @@ -/*! For license information please see main.8b0a5f68.js.LICENSE.txt */ -(self.webpackChunkdocs=self.webpackChunkdocs||[]).push([[8792],{8328:(e,t,n)=>{"use strict";n.d(t,{A:()=>f});n(6540);var r=n(3259),a=n.n(r),o=n(4054);const i={"0145b50a":[()=>Promise.all([n.e(1869),n.e(5394),n.e(4737)]).then(n.bind(n,3829)),"@site/docs/examples/helloworld.mdx",3829],"01a85c17":[()=>Promise.all([n.e(1869),n.e(8209)]).then(n.bind(n,9158)),"@theme/BlogTagsListPage",9158],"031793e1":[()=>n.e(6334).then(n.t.bind(n,1794,19)),"~blog/default/blog-tags-facebook-038.json",1794],"04146f1b":[()=>n.e(6993).then(n.t.bind(n,1966,19)),"/Users/chrisludden/workspaces/cludden/protoc-gen-go-temporal/docs/.docusaurus/docusaurus-plugin-content-docs/default/plugin-route-context-module-100.json",1966],"046e2194":[()=>Promise.all([n.e(1869),n.e(3568)]).then(n.bind(n,7607)),"@site/docs/install.mdx",7607],"096bfee4":[()=>n.e(1398).then(n.t.bind(n,5305,19)),"~blog/default/blog-tags-facebook-038-list.json",5305],"0c3ea4cb":[()=>Promise.all([n.e(1869),n.e(5394),n.e(7312)]).then(n.bind(n,1528)),"@site/docs/examples/updatabletimer.mdx",1528],"0ec9a4c5":[()=>Promise.all([n.e(1869),n.e(5394),n.e(8249)]).then(n.bind(n,6140)),"@site/docs/examples/codecserver.mdx",6140],"0fe4f122":[()=>Promise.all([n.e(1869),n.e(5394),n.e(9517)]).then(n.bind(n,8562)),"@site/docs/examples/searchattributes.mdx",8562],"13f3ef77":[()=>Promise.all([n.e(1869),n.e(2241)]).then(n.bind(n,8952)),"@site/docs/guides/cli.mdx",8952],17896441:[()=>Promise.all([n.e(1869),n.e(5394),n.e(5238),n.e(8401)]).then(n.bind(n,5022)),"@theme/DocItem",5022],"183ed9a2":[()=>Promise.all([n.e(1869),n.e(7104)]).then(n.bind(n,58)),"@site/docs/guides/testing.mdx",58],"1df93b7f":[()=>Promise.all([n.e(1869),n.e(4583)]).then(n.bind(n,5579)),"@site/src/pages/index.tsx",5579],"1f391b9e":[()=>Promise.all([n.e(1869),n.e(5394),n.e(5238),n.e(6061)]).then(n.bind(n,7973)),"@theme/MDXPage",7973],"24b40d04":[()=>Promise.all([n.e(1869),n.e(8975)]).then(n.bind(n,1534)),"@site/docs/guides/clients.mdx",1534],"2c4b19b8":[()=>Promise.all([n.e(1869),n.e(6940)]).then(n.bind(n,2922)),"@site/docs/guides/codec-server.mdx",2922],"3021cf83":[()=>Promise.all([n.e(1869),n.e(2857)]).then(n.bind(n,6942)),"@site/docs/getting-started.mdx",6942],"30a24c52":[()=>n.e(3669).then(n.t.bind(n,6833,19)),"~blog/default/blog-tags-hello-039.json",6833],"328da6b0":[()=>Promise.all([n.e(1869),n.e(4163)]).then(n.bind(n,2503)),"@site/docs/guides/xns.mdx",2503],"35b74448":[()=>Promise.all([n.e(1869),n.e(9614)]).then(n.bind(n,5765)),"@site/docs/guides/bloblang.mdx",5765],36041992:[()=>Promise.all([n.e(1869),n.e(5394),n.e(8351)]).then(n.bind(n,2679)),"@site/docs/about.mdx",2679],"393be207":[()=>n.e(4134).then(n.bind(n,6602)),"@site/src/pages/markdown-page.md",6602],"3b2073fd":[()=>n.e(4754).then(n.t.bind(n,2945,19)),"/Users/chrisludden/workspaces/cludden/protoc-gen-go-temporal/docs/.docusaurus/docusaurus-plugin-content-blog/default/plugin-route-context-module-100.json",2945],"3fa420c0":[()=>Promise.all([n.e(1869),n.e(144)]).then(n.bind(n,1493)),"@site/docs/configuration/query.mdx",1493],"437149ac":[()=>Promise.all([n.e(1869),n.e(8509)]).then(n.bind(n,7697)),"@site/docs/guides/child-workflows.mdx",7697],"4c9e35b1":[()=>n.e(2161).then(n.t.bind(n,4722,19)),"~blog/default/blog-tags-hola-ea2-list.json",4722],"53df995c":[()=>Promise.all([n.e(1869),n.e(8507)]).then(n.bind(n,3818)),"@site/docs/configuration/workflow.mdx",3818],59362658:[()=>n.e(9325).then(n.bind(n,1180)),"@site/blog/2021-08-01-mdx-blog-post.mdx",1180],"5e95c892":[()=>n.e(9647).then(n.bind(n,7121)),"@theme/DocsRoot",7121],"5e9f5e1a":[()=>Promise.resolve().then(n.bind(n,4784)),"@generated/docusaurus.config",4784],"608ae6a4":[()=>n.e(4722).then(n.t.bind(n,1557,19)),"~blog/default/blog-tags-docusaurus-0e0-list.json",1557],66406991:[()=>n.e(4374).then(n.t.bind(n,576,19)),"~blog/default/blog-tags-hello-039-list.json",576],"6875c492":[()=>Promise.all([n.e(1869),n.e(5394),n.e(5238),n.e(8747),n.e(4813)]).then(n.bind(n,3069)),"@theme/BlogTagsPostsPage",3069],"7081f529":[()=>n.e(5995).then(n.bind(n,528)),"@site/docs/configuration/service.mdx",528],"73664a40":[()=>n.e(1972).then(n.bind(n,9581)),"@site/blog/2019-05-29-long-blog-post.md",9581],"7661071f":[()=>n.e(8737).then(n.bind(n,4137)),"@site/blog/2021-08-26-welcome/index.md?truncated=true",4137],77587487:[()=>n.e(8232).then(n.bind(n,9339)),"@site/docs/reference.md",9339],"7f7ed216":[()=>Promise.all([n.e(1869),n.e(1039)]).then(n.bind(n,194)),"@site/docs/configuration/update.mdx",194],"814f3328":[()=>n.e(7472).then(n.t.bind(n,5513,19)),"~blog/default/blog-post-list-prop-default.json",5513],"8717b14a":[()=>n.e(3694).then(n.bind(n,1615)),"@site/blog/2019-05-29-long-blog-post.md?truncated=true",1615],"925b3f96":[()=>n.e(8609).then(n.bind(n,5026)),"@site/blog/2019-05-28-first-blog-post.md?truncated=true",5026],"935f2afb":[()=>n.e(8581).then(n.t.bind(n,5610,19)),"~docs/default/version-current-metadata-prop-751.json",5610],"93fb8980":[()=>Promise.all([n.e(1869),n.e(1482)]).then(n.bind(n,2958)),"@site/docs/configuration/activity.mdx",2958],94350439:[()=>Promise.all([n.e(1869),n.e(9080)]).then(n.bind(n,6377)),"@site/docs/configuration/signal.mdx",6377],"956a4e1f":[()=>Promise.all([n.e(1869),n.e(5570)]).then(n.bind(n,7252)),"@site/docs/configuration/plugin.mdx",7252],98260113:[()=>Promise.all([n.e(1869),n.e(9441)]).then(n.bind(n,8439)),"@site/docs/guides/activities.mdx",8439],"9e4087bc":[()=>n.e(2711).then(n.bind(n,9331)),"@theme/BlogArchivePage",9331],a6aa9e1f:[()=>Promise.all([n.e(1869),n.e(5394),n.e(5238),n.e(8747),n.e(7643)]).then(n.bind(n,7785)),"@theme/BlogListPage",7785],a7023ddc:[()=>n.e(9267).then(n.t.bind(n,8289,19)),"~blog/default/blog-tags-tags-4c2.json",8289],a7bd4aaa:[()=>n.e(7098).then(n.bind(n,4532)),"@theme/DocVersionRoot",4532],a80da1cf:[()=>n.e(497).then(n.t.bind(n,1550,19)),"~blog/default/blog-tags-docusaurus-0e0.json",1550],a94703ab:[()=>Promise.all([n.e(1869),n.e(9048)]).then(n.bind(n,2559)),"@theme/DocRoot",2559],b2b675dd:[()=>n.e(1991).then(n.t.bind(n,9775,19)),"~blog/default/blog-c06.json",9775],b2f554cd:[()=>n.e(5894).then(n.t.bind(n,6042,19)),"~blog/default/blog-archive-80c.json",6042],b9958750:[()=>Promise.all([n.e(1869),n.e(7414)]).then(n.bind(n,9208)),"@site/docs/guides/documentation.mdx",9208],cb7b72ef:[()=>Promise.all([n.e(1869),n.e(7125)]).then(n.bind(n,2780)),"@site/docs/guides/updates.mdx",2780],ccc49370:[()=>Promise.all([n.e(1869),n.e(5394),n.e(5238),n.e(8747),n.e(3249)]).then(n.bind(n,4029)),"@theme/BlogPostPage",4029],d6629652:[()=>Promise.all([n.e(1869),n.e(6325)]).then(n.bind(n,1912)),"@site/docs/guides/workflows.mdx",1912],d9f32620:[()=>n.e(5557).then(n.bind(n,7447)),"@site/blog/2021-08-26-welcome/index.md",7447],dd7fddbf:[()=>Promise.all([n.e(1869),n.e(4792)]).then(n.bind(n,7685)),"@site/docs/guides/signals.mdx",7685],e16015ca:[()=>n.e(1497).then(n.t.bind(n,9635,19)),"~blog/default/blog-tags-hola-ea2.json",9635],e17b2e0e:[()=>Promise.all([n.e(1869),n.e(3456)]).then(n.bind(n,8050)),"@site/docs/guides/queries.mdx",8050],e273c56f:[()=>n.e(9328).then(n.bind(n,4014)),"@site/blog/2019-05-28-first-blog-post.md",4014],f4f34a3a:[()=>n.e(3637).then(n.bind(n,5512)),"@site/blog/2021-08-01-mdx-blog-post.mdx?truncated=true",5512],f6e782c4:[()=>n.e(2424).then(n.t.bind(n,4061,19)),"/Users/chrisludden/workspaces/cludden/protoc-gen-go-temporal/docs/.docusaurus/docusaurus-plugin-content-pages/default/plugin-route-context-module-100.json",4061]};var l=n(4848);function s(e){let{error:t,retry:n,pastDelay:r}=e;return t?(0,l.jsxs)("div",{style:{textAlign:"center",color:"#fff",backgroundColor:"#fa383e",borderColor:"#fa383e",borderStyle:"solid",borderRadius:"0.25rem",borderWidth:"1px",boxSizing:"border-box",display:"block",padding:"1rem",flex:"0 0 50%",marginLeft:"25%",marginRight:"25%",marginTop:"5rem",maxWidth:"50%",width:"100%"},children:[(0,l.jsx)("p",{children:String(t)}),(0,l.jsx)("div",{children:(0,l.jsx)("button",{type:"button",onClick:n,children:"Retry"})})]}):r?(0,l.jsx)("div",{style:{display:"flex",justifyContent:"center",alignItems:"center",height:"100vh"},children:(0,l.jsx)("svg",{id:"loader",style:{width:128,height:110,position:"absolute",top:"calc(100vh - 64%)"},viewBox:"0 0 45 45",xmlns:"http://www.w3.org/2000/svg",stroke:"#61dafb",children:(0,l.jsxs)("g",{fill:"none",fillRule:"evenodd",transform:"translate(1 1)",strokeWidth:"2",children:[(0,l.jsxs)("circle",{cx:"22",cy:"22",r:"6",strokeOpacity:"0",children:[(0,l.jsx)("animate",{attributeName:"r",begin:"1.5s",dur:"3s",values:"6;22",calcMode:"linear",repeatCount:"indefinite"}),(0,l.jsx)("animate",{attributeName:"stroke-opacity",begin:"1.5s",dur:"3s",values:"1;0",calcMode:"linear",repeatCount:"indefinite"}),(0,l.jsx)("animate",{attributeName:"stroke-width",begin:"1.5s",dur:"3s",values:"2;0",calcMode:"linear",repeatCount:"indefinite"})]}),(0,l.jsxs)("circle",{cx:"22",cy:"22",r:"6",strokeOpacity:"0",children:[(0,l.jsx)("animate",{attributeName:"r",begin:"3s",dur:"3s",values:"6;22",calcMode:"linear",repeatCount:"indefinite"}),(0,l.jsx)("animate",{attributeName:"stroke-opacity",begin:"3s",dur:"3s",values:"1;0",calcMode:"linear",repeatCount:"indefinite"}),(0,l.jsx)("animate",{attributeName:"stroke-width",begin:"3s",dur:"3s",values:"2;0",calcMode:"linear",repeatCount:"indefinite"})]}),(0,l.jsx)("circle",{cx:"22",cy:"22",r:"8",children:(0,l.jsx)("animate",{attributeName:"r",begin:"0s",dur:"1.5s",values:"6;1;2;3;4;5;6",calcMode:"linear",repeatCount:"indefinite"})})]})})}):null}var u=n(6921),c=n(3102);function d(e,t){if("*"===e)return a()({loading:s,loader:()=>n.e(2237).then(n.bind(n,2237)),modules:["@theme/NotFound"],webpack:()=>[2237],render(e,t){const n=e.default;return(0,l.jsx)(c.W,{value:{plugin:{name:"native",id:"default"}},children:(0,l.jsx)(n,{...t})})}});const r=o[`${e}-${t}`],d={},f=[],p=[],g=(0,u.A)(r);return Object.entries(g).forEach((e=>{let[t,n]=e;const r=i[n];r&&(d[t]=r[0],f.push(r[1]),p.push(r[2]))})),a().Map({loading:s,loader:d,modules:f,webpack:()=>p,render(t,n){const a=JSON.parse(JSON.stringify(r));Object.entries(t).forEach((t=>{let[n,r]=t;const o=r.default;if(!o)throw new Error(`The page component at ${e} doesn't have a default export. This makes it impossible to render anything. Consider default-exporting a React component.`);"object"!=typeof o&&"function"!=typeof o||Object.keys(r).filter((e=>"default"!==e)).forEach((e=>{o[e]=r[e]}));let i=a;const l=n.split(".");l.slice(0,-1).forEach((e=>{i=i[e]})),i[l[l.length-1]]=o}));const o=a.__comp;delete a.__comp;const i=a.__context;return delete a.__context,(0,l.jsx)(c.W,{value:i,children:(0,l.jsx)(o,{...a,...n})})}})}const f=[{path:"/blog",component:d("/blog","16a"),exact:!0},{path:"/blog/archive",component:d("/blog/archive","7b7"),exact:!0},{path:"/blog/first-blog-post",component:d("/blog/first-blog-post","ced"),exact:!0},{path:"/blog/long-blog-post",component:d("/blog/long-blog-post","177"),exact:!0},{path:"/blog/mdx-blog-post",component:d("/blog/mdx-blog-post","bd2"),exact:!0},{path:"/blog/tags",component:d("/blog/tags","d06"),exact:!0},{path:"/blog/tags/docusaurus",component:d("/blog/tags/docusaurus","8c1"),exact:!0},{path:"/blog/tags/facebook",component:d("/blog/tags/facebook","b04"),exact:!0},{path:"/blog/tags/hello",component:d("/blog/tags/hello","3f5"),exact:!0},{path:"/blog/tags/hola",component:d("/blog/tags/hola","098"),exact:!0},{path:"/blog/welcome",component:d("/blog/welcome","e5f"),exact:!0},{path:"/markdown-page",component:d("/markdown-page","664"),exact:!0},{path:"/docs",component:d("/docs","337"),routes:[{path:"/docs",component:d("/docs","cf7"),routes:[{path:"/docs",component:d("/docs","a9e"),routes:[{path:"/docs/about",component:d("/docs/about","36d"),exact:!0,sidebar:"docs"},{path:"/docs/configuration/activity",component:d("/docs/configuration/activity","edd"),exact:!0,sidebar:"docs"},{path:"/docs/configuration/plugin",component:d("/docs/configuration/plugin","c27"),exact:!0,sidebar:"docs"},{path:"/docs/configuration/query",component:d("/docs/configuration/query","810"),exact:!0,sidebar:"docs"},{path:"/docs/configuration/service",component:d("/docs/configuration/service","272"),exact:!0,sidebar:"docs"},{path:"/docs/configuration/signal",component:d("/docs/configuration/signal","d59"),exact:!0,sidebar:"docs"},{path:"/docs/configuration/update",component:d("/docs/configuration/update","778"),exact:!0,sidebar:"docs"},{path:"/docs/configuration/workflow",component:d("/docs/configuration/workflow","caa"),exact:!0,sidebar:"docs"},{path:"/docs/examples/codecserver",component:d("/docs/examples/codecserver","868"),exact:!0,sidebar:"examples"},{path:"/docs/examples/helloworld",component:d("/docs/examples/helloworld","d01"),exact:!0,sidebar:"examples"},{path:"/docs/examples/searchattributes",component:d("/docs/examples/searchattributes","b55"),exact:!0,sidebar:"examples"},{path:"/docs/examples/updatabletimer",component:d("/docs/examples/updatabletimer","a6d"),exact:!0,sidebar:"examples"},{path:"/docs/getting-started",component:d("/docs/getting-started","9d0"),exact:!0,sidebar:"docs"},{path:"/docs/guides/activities",component:d("/docs/guides/activities","654"),exact:!0,sidebar:"docs"},{path:"/docs/guides/bloblang",component:d("/docs/guides/bloblang","1eb"),exact:!0,sidebar:"docs"},{path:"/docs/guides/child-workflows",component:d("/docs/guides/child-workflows","198"),exact:!0,sidebar:"docs"},{path:"/docs/guides/cli",component:d("/docs/guides/cli","a79"),exact:!0,sidebar:"docs"},{path:"/docs/guides/clients",component:d("/docs/guides/clients","fcf"),exact:!0,sidebar:"docs"},{path:"/docs/guides/codec-server",component:d("/docs/guides/codec-server","159"),exact:!0,sidebar:"docs"},{path:"/docs/guides/documentation",component:d("/docs/guides/documentation","a32"),exact:!0,sidebar:"docs"},{path:"/docs/guides/queries",component:d("/docs/guides/queries","f4f"),exact:!0,sidebar:"docs"},{path:"/docs/guides/signals",component:d("/docs/guides/signals","988"),exact:!0,sidebar:"docs"},{path:"/docs/guides/testing",component:d("/docs/guides/testing","033"),exact:!0,sidebar:"docs"},{path:"/docs/guides/updates",component:d("/docs/guides/updates","db4"),exact:!0,sidebar:"docs"},{path:"/docs/guides/workflows",component:d("/docs/guides/workflows","b2f"),exact:!0,sidebar:"docs"},{path:"/docs/guides/xns",component:d("/docs/guides/xns","090"),exact:!0,sidebar:"docs"},{path:"/docs/install",component:d("/docs/install","7a2"),exact:!0,sidebar:"docs"},{path:"/docs/reference",component:d("/docs/reference","d1e"),exact:!0}]}]}]},{path:"/",component:d("/","1ec"),exact:!0},{path:"*",component:d("*")}]},6125:(e,t,n)=>{"use strict";n.d(t,{o:()=>o,x:()=>i});var r=n(6540),a=n(4848);const o=r.createContext(!1);function i(e){let{children:t}=e;const[n,i]=(0,r.useState)(!1);return(0,r.useEffect)((()=>{i(!0)}),[]),(0,a.jsx)(o.Provider,{value:n,children:t})}},8536:(e,t,n)=>{"use strict";var r=n(6540),a=n(5338),o=n(4625),i=n(545),l=n(8193);const s=[n(119),n(6134),n(6294),n(1043)];var u=n(8328),c=n(6347),d=n(2831),f=n(4848);function p(e){let{children:t}=e;return(0,f.jsx)(f.Fragment,{children:t})}var g=n(5260),m=n(4586),h=n(6025),y=n(6342),b=n(1003),v=n(2131),w=n(4090),k=n(2967),x=n(440),S=n(1463);function E(){const{i18n:{currentLocale:e,defaultLocale:t,localeConfigs:n}}=(0,m.A)(),r=(0,v.o)(),a=n[e].htmlLang,o=e=>e.replace("-","_");return(0,f.jsxs)(g.A,{children:[Object.entries(n).map((e=>{let[t,{htmlLang:n}]=e;return(0,f.jsx)("link",{rel:"alternate",href:r.createUrl({locale:t,fullyQualified:!0}),hrefLang:n},t)})),(0,f.jsx)("link",{rel:"alternate",href:r.createUrl({locale:t,fullyQualified:!0}),hrefLang:"x-default"}),(0,f.jsx)("meta",{property:"og:locale",content:o(a)}),Object.values(n).filter((e=>a!==e.htmlLang)).map((e=>(0,f.jsx)("meta",{property:"og:locale:alternate",content:o(e.htmlLang)},`meta-og-${e.htmlLang}`)))]})}function _(e){let{permalink:t}=e;const{siteConfig:{url:n}}=(0,m.A)(),r=function(){const{siteConfig:{url:e,baseUrl:t,trailingSlash:n}}=(0,m.A)(),{pathname:r}=(0,c.zy)();return e+(0,x.applyTrailingSlash)((0,h.A)(r),{trailingSlash:n,baseUrl:t})}(),a=t?`${n}${t}`:r;return(0,f.jsxs)(g.A,{children:[(0,f.jsx)("meta",{property:"og:url",content:a}),(0,f.jsx)("link",{rel:"canonical",href:a})]})}function C(){const{i18n:{currentLocale:e}}=(0,m.A)(),{metadata:t,image:n}=(0,y.p)();return(0,f.jsxs)(f.Fragment,{children:[(0,f.jsxs)(g.A,{children:[(0,f.jsx)("meta",{name:"twitter:card",content:"summary_large_image"}),(0,f.jsx)("body",{className:w.w})]}),n&&(0,f.jsx)(b.be,{image:n}),(0,f.jsx)(_,{}),(0,f.jsx)(E,{}),(0,f.jsx)(S.A,{tag:k.Cy,locale:e}),(0,f.jsx)(g.A,{children:t.map(((e,t)=>(0,f.jsx)("meta",{...e},t)))})]})}const A=new Map;function T(e){if(A.has(e.pathname))return{...e,pathname:A.get(e.pathname)};if((0,d.u)(u.A,e.pathname).some((e=>{let{route:t}=e;return!0===t.exact})))return A.set(e.pathname,e.pathname),e;const t=e.pathname.trim().replace(/(?:\/index)?\.html$/,"")||"/";return A.set(e.pathname,t),{...e,pathname:t}}var N=n(6125),j=n(6988),P=n(205);function L(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r{const r=t.default?.[e]??t[e];return r?.(...n)}));return()=>a.forEach((e=>e?.()))}const O=function(e){let{children:t,location:n,previousLocation:r}=e;return(0,P.A)((()=>{r!==n&&(!function(e){let{location:t,previousLocation:n}=e;if(!n)return;const r=t.pathname===n.pathname,a=t.hash===n.hash,o=t.search===n.search;if(r&&a&&!o)return;const{hash:i}=t;if(i){const e=decodeURIComponent(i.substring(1)),t=document.getElementById(e);t?.scrollIntoView()}else window.scrollTo(0,0)}({location:n,previousLocation:r}),L("onRouteDidUpdate",{previousLocation:r,location:n}))}),[r,n]),t};function R(e){const t=Array.from(new Set([e,decodeURI(e)])).map((e=>(0,d.u)(u.A,e))).flat();return Promise.all(t.map((e=>e.route.component.preload?.())))}class I extends r.Component{previousLocation;routeUpdateCleanupCb;constructor(e){super(e),this.previousLocation=null,this.routeUpdateCleanupCb=l.A.canUseDOM?L("onRouteUpdate",{previousLocation:null,location:this.props.location}):()=>{},this.state={nextRouteHasLoaded:!0}}shouldComponentUpdate(e,t){if(e.location===this.props.location)return t.nextRouteHasLoaded;const n=e.location;return this.previousLocation=this.props.location,this.setState({nextRouteHasLoaded:!1}),this.routeUpdateCleanupCb=L("onRouteUpdate",{previousLocation:this.previousLocation,location:n}),R(n.pathname).then((()=>{this.routeUpdateCleanupCb(),this.setState({nextRouteHasLoaded:!0})})).catch((e=>{console.warn(e),window.location.reload()})),!1}render(){const{children:e,location:t}=this.props;return(0,f.jsx)(O,{previousLocation:this.previousLocation,location:t,children:(0,f.jsx)(c.qh,{location:t,render:()=>e})})}}const F=I,M="__docusaurus-base-url-issue-banner-container",D="__docusaurus-base-url-issue-banner",z="__docusaurus-base-url-issue-banner-suggestion-container";function B(e){return`\ndocument.addEventListener('DOMContentLoaded', function maybeInsertBanner() {\n var shouldInsert = typeof window['docusaurus'] === 'undefined';\n shouldInsert && insertBanner();\n});\n\nfunction insertBanner() {\n var bannerContainer = document.createElement('div');\n bannerContainer.id = '${M}';\n var bannerHtml = ${JSON.stringify(function(e){return`\n
\n

Your Docusaurus site did not load properly.

\n

A very common reason is a wrong site baseUrl configuration.

\n

Current configured baseUrl = ${e} ${"/"===e?" (default value)":""}

\n

We suggest trying baseUrl =

\n
\n`}(e)).replace(/{if("undefined"==typeof document)return void n();const r=document.createElement("link");r.setAttribute("rel","prefetch"),r.setAttribute("href",e),r.onload=()=>t(),r.onerror=()=>n();const a=document.getElementsByTagName("head")[0]??document.getElementsByName("script")[0]?.parentNode;a?.appendChild(r)}))}:function(e){return new Promise(((t,n)=>{const r=new XMLHttpRequest;r.open("GET",e,!0),r.withCredentials=!0,r.onload=()=>{200===r.status?t():n()},r.send(null)}))};var K=n(6921);const Z=new Set,X=new Set,J=()=>navigator.connection?.effectiveType.includes("2g")||navigator.connection?.saveData,ee={prefetch(e){if(!(e=>!J()&&!X.has(e)&&!Z.has(e))(e))return!1;Z.add(e);const t=(0,d.u)(u.A,e).flatMap((e=>{return t=e.route.path,Object.entries(Y).filter((e=>{let[n]=e;return n.replace(/-[^-]+$/,"")===t})).flatMap((e=>{let[,t]=e;return Object.values((0,K.A)(t))}));var t}));return Promise.all(t.map((e=>{const t=n.gca(e);return t&&!t.includes("undefined")?Q(t).catch((()=>{})):Promise.resolve()})))},preload:e=>!!(e=>!J()&&!X.has(e))(e)&&(X.add(e),R(e))},te=Object.freeze(ee),ne=Boolean(!0);if(l.A.canUseDOM){window.docusaurus=te;const e=document.getElementById("__docusaurus"),t=(0,f.jsx)(i.vd,{children:(0,f.jsx)(o.Kd,{children:(0,f.jsx)(G,{})})}),n=(e,t)=>{console.error("Docusaurus React Root onRecoverableError:",e,t)},l=()=>{if(ne)r.startTransition((()=>{a.hydrateRoot(e,t,{onRecoverableError:n})}));else{const o=a.createRoot(e,{onRecoverableError:n});r.startTransition((()=>{o.render(t)}))}};R(window.location.pathname).then(l)}},6988:(e,t,n)=>{"use strict";n.d(t,{o:()=>d,l:()=>f});var r=n(6540),a=n(4784);const o=JSON.parse('{"docusaurus-plugin-content-docs":{"default":{"path":"/docs","versions":[{"name":"current","label":"Next","isLast":true,"path":"/docs","mainDocId":"about","docs":[{"id":"about","path":"/docs/about","sidebar":"docs"},{"id":"configuration/activity","path":"/docs/configuration/activity","sidebar":"docs"},{"id":"configuration/plugin","path":"/docs/configuration/plugin","sidebar":"docs"},{"id":"configuration/query","path":"/docs/configuration/query","sidebar":"docs"},{"id":"configuration/service","path":"/docs/configuration/service","sidebar":"docs"},{"id":"configuration/signal","path":"/docs/configuration/signal","sidebar":"docs"},{"id":"configuration/update","path":"/docs/configuration/update","sidebar":"docs"},{"id":"configuration/workflow","path":"/docs/configuration/workflow","sidebar":"docs"},{"id":"examples/codecserver","path":"/docs/examples/codecserver","sidebar":"examples"},{"id":"examples/helloworld","path":"/docs/examples/helloworld","sidebar":"examples"},{"id":"examples/searchattributes","path":"/docs/examples/searchattributes","sidebar":"examples"},{"id":"examples/updatabletimer","path":"/docs/examples/updatabletimer","sidebar":"examples"},{"id":"getting-started","path":"/docs/getting-started","sidebar":"docs"},{"id":"guides/activities","path":"/docs/guides/activities","sidebar":"docs"},{"id":"guides/bloblang","path":"/docs/guides/bloblang","sidebar":"docs"},{"id":"guides/child-workflows","path":"/docs/guides/child-workflows","sidebar":"docs"},{"id":"guides/cli","path":"/docs/guides/cli","sidebar":"docs"},{"id":"guides/clients","path":"/docs/guides/clients","sidebar":"docs"},{"id":"guides/codec-server","path":"/docs/guides/codec-server","sidebar":"docs"},{"id":"guides/documentation","path":"/docs/guides/documentation","sidebar":"docs"},{"id":"guides/queries","path":"/docs/guides/queries","sidebar":"docs"},{"id":"guides/signals","path":"/docs/guides/signals","sidebar":"docs"},{"id":"guides/testing","path":"/docs/guides/testing","sidebar":"docs"},{"id":"guides/updates","path":"/docs/guides/updates","sidebar":"docs"},{"id":"guides/workflows","path":"/docs/guides/workflows","sidebar":"docs"},{"id":"guides/xns","path":"/docs/guides/xns","sidebar":"docs"},{"id":"install","path":"/docs/install","sidebar":"docs"},{"id":"reference","path":"/docs/reference"}],"draftIds":[],"sidebars":{"docs":{"link":{"path":"/docs/about","label":"About"}},"examples":{"link":{"path":"/docs/examples/helloworld","label":"Hello World"}}}}],"breadcrumbs":true}}}'),i=JSON.parse('{"defaultLocale":"en","locales":["en"],"path":"i18n","currentLocale":"en","localeConfigs":{"en":{"label":"English","direction":"ltr","htmlLang":"en","calendar":"gregory","path":"en"}}}');var l=n(2654);const s=JSON.parse('{"docusaurusVersion":"3.1.1","siteVersion":"0.0.0","pluginVersions":{"docusaurus-plugin-content-docs":{"type":"package","name":"@docusaurus/plugin-content-docs","version":"3.1.1"},"docusaurus-plugin-content-blog":{"type":"package","name":"@docusaurus/plugin-content-blog","version":"3.1.1"},"docusaurus-plugin-content-pages":{"type":"package","name":"@docusaurus/plugin-content-pages","version":"3.1.1"},"docusaurus-plugin-sitemap":{"type":"package","name":"@docusaurus/plugin-sitemap","version":"3.1.1"},"docusaurus-theme-classic":{"type":"package","name":"@docusaurus/theme-classic","version":"3.1.1"}}}');var u=n(4848);const c={siteConfig:a.default,siteMetadata:s,globalData:o,i18n:i,codeTranslations:l},d=r.createContext(c);function f(e){let{children:t}=e;return(0,u.jsx)(d.Provider,{value:c,children:t})}},7489:(e,t,n)=>{"use strict";n.d(t,{A:()=>p});var r=n(6540),a=n(8193),o=n(5260),i=n(440),l=n(781),s=n(4848);function u(e){let{error:t,tryAgain:n}=e;return(0,s.jsxs)("div",{style:{display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"flex-start",minHeight:"100vh",width:"100%",maxWidth:"80ch",fontSize:"20px",margin:"0 auto",padding:"1rem"},children:[(0,s.jsx)("h1",{style:{fontSize:"3rem"},children:"This page crashed"}),(0,s.jsx)("button",{type:"button",onClick:n,style:{margin:"1rem 0",fontSize:"2rem",cursor:"pointer",borderRadius:20,padding:"1rem"},children:"Try again"}),(0,s.jsx)(c,{error:t})]})}function c(e){let{error:t}=e;const n=(0,i.getErrorCausalChain)(t).map((e=>e.message)).join("\n\nCause:\n");return(0,s.jsx)("p",{style:{whiteSpace:"pre-wrap"},children:n})}function d(e){let{error:t,tryAgain:n}=e;return(0,s.jsxs)(p,{fallback:()=>(0,s.jsx)(u,{error:t,tryAgain:n}),children:[(0,s.jsx)(o.A,{children:(0,s.jsx)("title",{children:"Page Error"})}),(0,s.jsx)(l.A,{children:(0,s.jsx)(u,{error:t,tryAgain:n})})]})}const f=e=>(0,s.jsx)(d,{...e});class p extends r.Component{constructor(e){super(e),this.state={error:null}}componentDidCatch(e){a.A.canUseDOM&&this.setState({error:e})}render(){const{children:e}=this.props,{error:t}=this.state;if(t){const e={error:t,tryAgain:()=>this.setState({error:null})};return(this.props.fallback??f)(e)}return e??null}}},8193:(e,t,n)=>{"use strict";n.d(t,{A:()=>a});const r="undefined"!=typeof window&&"document"in window&&"createElement"in window.document,a={canUseDOM:r,canUseEventListeners:r&&("addEventListener"in window||"attachEvent"in window),canUseIntersectionObserver:r&&"IntersectionObserver"in window,canUseViewport:r&&"screen"in window}},5260:(e,t,n)=>{"use strict";n.d(t,{A:()=>o});n(6540);var r=n(545),a=n(4848);function o(e){return(0,a.jsx)(r.mg,{...e})}},8774:(e,t,n)=>{"use strict";n.d(t,{A:()=>p});var r=n(6540),a=n(4625),o=n(440),i=n(4586),l=n(6654),s=n(8193),u=n(3427),c=n(6025),d=n(4848);function f(e,t){let{isNavLink:n,to:f,href:p,activeClassName:g,isActive:m,"data-noBrokenLinkCheck":h,autoAddBaseUrl:y=!0,...b}=e;const{siteConfig:{trailingSlash:v,baseUrl:w}}=(0,i.A)(),{withBaseUrl:k}=(0,c.h)(),x=(0,u.A)(),S=(0,r.useRef)(null);(0,r.useImperativeHandle)(t,(()=>S.current));const E=f||p;const _=(0,l.A)(E),C=E?.replace("pathname://","");let A=void 0!==C?(T=C,y&&(e=>e.startsWith("/"))(T)?k(T):T):void 0;var T;A&&_&&(A=(0,o.applyTrailingSlash)(A,{trailingSlash:v,baseUrl:w}));const N=(0,r.useRef)(!1),j=n?a.k2:a.N_,P=s.A.canUseIntersectionObserver,L=(0,r.useRef)(),O=()=>{N.current||null==A||(window.docusaurus.preload(A),N.current=!0)};(0,r.useEffect)((()=>(!P&&_&&null!=A&&window.docusaurus.prefetch(A),()=>{P&&L.current&&L.current.disconnect()})),[L,A,P,_]);const R=A?.startsWith("#")??!1,I=!b.target||"_self"===b.target,F=!A||!_||!I||R;return h||!R&&F||x.collectLink(A),b.id&&x.collectAnchor(b.id),F?(0,d.jsx)("a",{ref:S,href:A,...E&&!_&&{target:"_blank",rel:"noopener noreferrer"},...b}):(0,d.jsx)(j,{...b,onMouseEnter:O,onTouchStart:O,innerRef:e=>{S.current=e,P&&e&&_&&(L.current=new window.IntersectionObserver((t=>{t.forEach((t=>{e===t.target&&(t.isIntersecting||t.intersectionRatio>0)&&(L.current.unobserve(e),L.current.disconnect(),null!=A&&window.docusaurus.prefetch(A))}))})),L.current.observe(e))},to:A,...n&&{isActive:m,activeClassName:g}})}const p=r.forwardRef(f)},418:(e,t,n)=>{"use strict";n.d(t,{A:()=>r});const r=()=>null},1312:(e,t,n)=>{"use strict";n.d(t,{A:()=>u,T:()=>s});var r=n(6540),a=n(4848);function o(e,t){const n=e.split(/(\{\w+\})/).map(((e,n)=>{if(n%2==1){const n=t?.[e.slice(1,-1)];if(void 0!==n)return n}return e}));return n.some((e=>(0,r.isValidElement)(e)))?n.map(((e,t)=>(0,r.isValidElement)(e)?r.cloneElement(e,{key:t}):e)).filter((e=>""!==e)):n.join("")}var i=n(2654);function l(e){let{id:t,message:n}=e;if(void 0===t&&void 0===n)throw new Error("Docusaurus translation declarations must have at least a translation id or a default translation message");return i[t??n]??n??t}function s(e,t){let{message:n,id:r}=e;return o(l({message:n,id:r}),t)}function u(e){let{children:t,id:n,values:r}=e;if(t&&"string"!=typeof t)throw console.warn("Illegal children",t),new Error("The Docusaurus component only accept simple string values");const i=l({message:t,id:n});return(0,a.jsx)(a.Fragment,{children:o(i,r)})}},7065:(e,t,n)=>{"use strict";n.d(t,{W:()=>r});const r="default"},6654:(e,t,n)=>{"use strict";function r(e){return/^(?:\w*:|\/\/)/.test(e)}function a(e){return void 0!==e&&!r(e)}n.d(t,{A:()=>a,z:()=>r})},6025:(e,t,n)=>{"use strict";n.d(t,{A:()=>l,h:()=>i});var r=n(6540),a=n(4586),o=n(6654);function i(){const{siteConfig:{baseUrl:e,url:t}}=(0,a.A)(),n=(0,r.useCallback)(((n,r)=>function(e,t,n,r){let{forcePrependBaseUrl:a=!1,absolute:i=!1}=void 0===r?{}:r;if(!n||n.startsWith("#")||(0,o.z)(n))return n;if(a)return t+n.replace(/^\//,"");if(n===t.replace(/\/$/,""))return t;const l=n.startsWith(t)?n:t+n.replace(/^\//,"");return i?e+l:l}(t,e,n,r)),[t,e]);return{withBaseUrl:n}}function l(e,t){void 0===t&&(t={});const{withBaseUrl:n}=i();return n(e,t)}},3427:(e,t,n)=>{"use strict";n.d(t,{A:()=>i});var r=n(6540);n(4848);const a=r.createContext({collectAnchor:()=>{},collectLink:()=>{}}),o=()=>(0,r.useContext)(a);function i(){return o()}},4586:(e,t,n)=>{"use strict";n.d(t,{A:()=>o});var r=n(6540),a=n(6988);function o(){return(0,r.useContext)(a.o)}},2303:(e,t,n)=>{"use strict";n.d(t,{A:()=>o});var r=n(6540),a=n(6125);function o(){return(0,r.useContext)(a.o)}},205:(e,t,n)=>{"use strict";n.d(t,{A:()=>a});var r=n(6540);const a=n(8193).A.canUseDOM?r.useLayoutEffect:r.useEffect},6921:(e,t,n)=>{"use strict";n.d(t,{A:()=>a});const r=e=>"object"==typeof e&&!!e&&Object.keys(e).length>0;function a(e){const t={};return function e(n,a){Object.entries(n).forEach((n=>{let[o,i]=n;const l=a?`${a}.${o}`:o;r(i)?e(i,l):t[l]=i}))}(e),t}},3102:(e,t,n)=>{"use strict";n.d(t,{W:()=>i,o:()=>o});var r=n(6540),a=n(4848);const o=r.createContext(null);function i(e){let{children:t,value:n}=e;const i=r.useContext(o),l=(0,r.useMemo)((()=>function(e){let{parent:t,value:n}=e;if(!t){if(!n)throw new Error("Unexpected: no Docusaurus route context found");if(!("plugin"in n))throw new Error("Unexpected: Docusaurus topmost route context has no `plugin` attribute");return n}const r={...t.data,...n?.data};return{plugin:t.plugin,data:r}}({parent:i,value:n})),[i,n]);return(0,a.jsx)(o.Provider,{value:l,children:t})}},4070:(e,t,n)=>{"use strict";n.d(t,{zK:()=>m,vT:()=>f,Gy:()=>c,HW:()=>h,ht:()=>d,r7:()=>g,jh:()=>p});var r=n(6347),a=n(4586),o=n(7065);function i(e,t){void 0===t&&(t={});const n=function(){const{globalData:e}=(0,a.A)();return e}()[e];if(!n&&t.failfast)throw new Error(`Docusaurus plugin global data not found for "${e}" plugin.`);return n}const l=e=>e.versions.find((e=>e.isLast));function s(e,t){const n=function(e,t){const n=l(e);return[...e.versions.filter((e=>e!==n)),n].find((e=>!!(0,r.B6)(t,{path:e.path,exact:!1,strict:!1})))}(e,t),a=n?.docs.find((e=>!!(0,r.B6)(t,{path:e.path,exact:!0,strict:!1})));return{activeVersion:n,activeDoc:a,alternateDocVersions:a?function(t){const n={};return e.versions.forEach((e=>{e.docs.forEach((r=>{r.id===t&&(n[e.name]=r)}))})),n}(a.id):{}}}const u={},c=()=>i("docusaurus-plugin-content-docs")??u,d=e=>function(e,t,n){void 0===t&&(t=o.W),void 0===n&&(n={});const r=i(e),a=r?.[t];if(!a&&n.failfast)throw new Error(`Docusaurus plugin global data not found for "${e}" plugin with id "${t}".`);return a}("docusaurus-plugin-content-docs",e,{failfast:!0});function f(e){void 0===e&&(e={});const t=c(),{pathname:n}=(0,r.zy)();return function(e,t,n){void 0===n&&(n={});const a=Object.entries(e).sort(((e,t)=>t[1].path.localeCompare(e[1].path))).find((e=>{let[,n]=e;return!!(0,r.B6)(t,{path:n.path,exact:!1,strict:!1})})),o=a?{pluginId:a[0],pluginData:a[1]}:void 0;if(!o&&n.failfast)throw new Error(`Can't find active docs plugin for "${t}" pathname, while it was expected to be found. Maybe you tried to use a docs feature that can only be used on a docs-related page? Existing docs plugin paths are: ${Object.values(e).map((e=>e.path)).join(", ")}`);return o}(t,n,e)}function p(e){return d(e).versions}function g(e){const t=d(e);return l(t)}function m(e){const t=d(e),{pathname:n}=(0,r.zy)();return s(t,n)}function h(e){const t=d(e),{pathname:n}=(0,r.zy)();return function(e,t){const n=l(e);return{latestDocSuggestion:s(e,t).alternateDocVersions[n.name],latestVersionSuggestion:n}}(t,n)}},6294:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>o});var r=n(5947),a=n.n(r);a().configure({showSpinner:!1});const o={onRouteUpdate(e){let{location:t,previousLocation:n}=e;if(n&&t.pathname!==n.pathname){const e=window.setTimeout((()=>{a().start()}),200);return()=>window.clearTimeout(e)}},onRouteDidUpdate(){a().done()}}},6134:(e,t,n)=>{"use strict";n.r(t);var r=n(1765),a=n(4784);!function(e){const{themeConfig:{prism:t}}=a.default,{additionalLanguages:r}=t;globalThis.Prism=e,r.forEach((e=>{"php"===e&&n(9700),n(3314)(`./prism-${e}`)})),delete globalThis.Prism}(r.My)},1107:(e,t,n)=>{"use strict";n.d(t,{A:()=>c});n(6540);var r=n(4164),a=n(1312),o=n(6342),i=n(8774),l=n(3427);const s={anchorWithStickyNavbar:"anchorWithStickyNavbar_LWe7",anchorWithHideOnScrollNavbar:"anchorWithHideOnScrollNavbar_WYt5"};var u=n(4848);function c(e){let{as:t,id:n,...c}=e;const d=(0,l.A)(),{navbar:{hideOnScroll:f}}=(0,o.p)();if("h1"===t||!n)return(0,u.jsx)(t,{...c,id:void 0});d.collectAnchor(n);const p=(0,a.T)({id:"theme.common.headingLinkTitle",message:"Direct link to {heading}",description:"Title for link to heading"},{heading:"string"==typeof c.children?c.children:n});return(0,u.jsxs)(t,{...c,className:(0,r.A)("anchor",f?s.anchorWithHideOnScrollNavbar:s.anchorWithStickyNavbar,c.className),id:n,children:[c.children,(0,u.jsx)(i.A,{className:"hash-link",to:`#${n}`,"aria-label":p,title:p,children:"\u200b"})]})}},3186:(e,t,n)=>{"use strict";n.d(t,{A:()=>o});n(6540);const r={iconExternalLink:"iconExternalLink_nPIU"};var a=n(4848);function o(e){let{width:t=13.5,height:n=13.5}=e;return(0,a.jsx)("svg",{width:t,height:n,"aria-hidden":"true",viewBox:"0 0 24 24",className:r.iconExternalLink,children:(0,a.jsx)("path",{fill:"currentColor",d:"M21 13v10h-21v-19h12v2h-10v15h17v-8h2zm3-12h-10.988l4.035 4-6.977 7.07 2.828 2.828 6.977-7.07 4.125 4.172v-11z"})})}},781:(e,t,n)=>{"use strict";n.d(t,{A:()=>pt});var r=n(6540),a=n(4164),o=n(7489),i=n(1003),l=n(6347),s=n(1312),u=n(5062),c=n(4848);const d="__docusaurus_skipToContent_fallback";function f(e){e.setAttribute("tabindex","-1"),e.focus(),e.removeAttribute("tabindex")}function p(){const e=(0,r.useRef)(null),{action:t}=(0,l.W6)(),n=(0,r.useCallback)((e=>{e.preventDefault();const t=document.querySelector("main:first-of-type")??document.getElementById(d);t&&f(t)}),[]);return(0,u.$)((n=>{let{location:r}=n;e.current&&!r.hash&&"PUSH"===t&&f(e.current)})),{containerRef:e,onClick:n}}const g=(0,s.T)({id:"theme.common.skipToMainContent",description:"The skip to content label used for accessibility, allowing to rapidly navigate to main content with keyboard tab/enter navigation",message:"Skip to main content"});function m(e){const t=e.children??g,{containerRef:n,onClick:r}=p();return(0,c.jsx)("div",{ref:n,role:"region","aria-label":g,children:(0,c.jsx)("a",{...e,href:`#${d}`,onClick:r,children:t})})}var h=n(7559),y=n(4090);const b={skipToContent:"skipToContent_fXgn"};function v(){return(0,c.jsx)(m,{className:b.skipToContent})}var w=n(6342),k=n(5041);function x(e){let{width:t=21,height:n=21,color:r="currentColor",strokeWidth:a=1.2,className:o,...i}=e;return(0,c.jsx)("svg",{viewBox:"0 0 15 15",width:t,height:n,...i,children:(0,c.jsx)("g",{stroke:r,strokeWidth:a,children:(0,c.jsx)("path",{d:"M.75.75l13.5 13.5M14.25.75L.75 14.25"})})})}const S={closeButton:"closeButton_CVFx"};function E(e){return(0,c.jsx)("button",{type:"button","aria-label":(0,s.T)({id:"theme.AnnouncementBar.closeButtonAriaLabel",message:"Close",description:"The ARIA label for close button of announcement bar"}),...e,className:(0,a.A)("clean-btn close",S.closeButton,e.className),children:(0,c.jsx)(x,{width:14,height:14,strokeWidth:3.1})})}const _={content:"content_knG7"};function C(e){const{announcementBar:t}=(0,w.p)(),{content:n}=t;return(0,c.jsx)("div",{...e,className:(0,a.A)(_.content,e.className),dangerouslySetInnerHTML:{__html:n}})}const A={announcementBar:"announcementBar_mb4j",announcementBarPlaceholder:"announcementBarPlaceholder_vyr4",announcementBarClose:"announcementBarClose_gvF7",announcementBarContent:"announcementBarContent_xLdY"};function T(){const{announcementBar:e}=(0,w.p)(),{isActive:t,close:n}=(0,k.Mj)();if(!t)return null;const{backgroundColor:r,textColor:a,isCloseable:o}=e;return(0,c.jsxs)("div",{className:A.announcementBar,style:{backgroundColor:r,color:a},role:"banner",children:[o&&(0,c.jsx)("div",{className:A.announcementBarPlaceholder}),(0,c.jsx)(C,{className:A.announcementBarContent}),o&&(0,c.jsx)(E,{onClick:n,className:A.announcementBarClose})]})}var N=n(2069),j=n(3104);var P=n(9532),L=n(5600);const O=r.createContext(null);function R(e){let{children:t}=e;const n=function(){const e=(0,N.M)(),t=(0,L.YL)(),[n,a]=(0,r.useState)(!1),o=null!==t.component,i=(0,P.ZC)(o);return(0,r.useEffect)((()=>{o&&!i&&a(!0)}),[o,i]),(0,r.useEffect)((()=>{o?e.shown||a(!0):a(!1)}),[e.shown,o]),(0,r.useMemo)((()=>[n,a]),[n])}();return(0,c.jsx)(O.Provider,{value:n,children:t})}function I(e){if(e.component){const t=e.component;return(0,c.jsx)(t,{...e.props})}}function F(){const e=(0,r.useContext)(O);if(!e)throw new P.dV("NavbarSecondaryMenuDisplayProvider");const[t,n]=e,a=(0,r.useCallback)((()=>n(!1)),[n]),o=(0,L.YL)();return(0,r.useMemo)((()=>({shown:t,hide:a,content:I(o)})),[a,o,t])}function M(e){let{header:t,primaryMenu:n,secondaryMenu:r}=e;const{shown:o}=F();return(0,c.jsxs)("div",{className:"navbar-sidebar",children:[t,(0,c.jsxs)("div",{className:(0,a.A)("navbar-sidebar__items",{"navbar-sidebar__items--show-secondary":o}),children:[(0,c.jsx)("div",{className:"navbar-sidebar__item menu",children:n}),(0,c.jsx)("div",{className:"navbar-sidebar__item menu",children:r})]})]})}var D=n(5293),z=n(2303);function B(e){return(0,c.jsx)("svg",{viewBox:"0 0 24 24",width:24,height:24,...e,children:(0,c.jsx)("path",{fill:"currentColor",d:"M12,9c1.65,0,3,1.35,3,3s-1.35,3-3,3s-3-1.35-3-3S10.35,9,12,9 M12,7c-2.76,0-5,2.24-5,5s2.24,5,5,5s5-2.24,5-5 S14.76,7,12,7L12,7z M2,13l2,0c0.55,0,1-0.45,1-1s-0.45-1-1-1l-2,0c-0.55,0-1,0.45-1,1S1.45,13,2,13z M20,13l2,0c0.55,0,1-0.45,1-1 s-0.45-1-1-1l-2,0c-0.55,0-1,0.45-1,1S19.45,13,20,13z M11,2v2c0,0.55,0.45,1,1,1s1-0.45,1-1V2c0-0.55-0.45-1-1-1S11,1.45,11,2z M11,20v2c0,0.55,0.45,1,1,1s1-0.45,1-1v-2c0-0.55-0.45-1-1-1C11.45,19,11,19.45,11,20z M5.99,4.58c-0.39-0.39-1.03-0.39-1.41,0 c-0.39,0.39-0.39,1.03,0,1.41l1.06,1.06c0.39,0.39,1.03,0.39,1.41,0s0.39-1.03,0-1.41L5.99,4.58z M18.36,16.95 c-0.39-0.39-1.03-0.39-1.41,0c-0.39,0.39-0.39,1.03,0,1.41l1.06,1.06c0.39,0.39,1.03,0.39,1.41,0c0.39-0.39,0.39-1.03,0-1.41 L18.36,16.95z M19.42,5.99c0.39-0.39,0.39-1.03,0-1.41c-0.39-0.39-1.03-0.39-1.41,0l-1.06,1.06c-0.39,0.39-0.39,1.03,0,1.41 s1.03,0.39,1.41,0L19.42,5.99z M7.05,18.36c0.39-0.39,0.39-1.03,0-1.41c-0.39-0.39-1.03-0.39-1.41,0l-1.06,1.06 c-0.39,0.39-0.39,1.03,0,1.41s1.03,0.39,1.41,0L7.05,18.36z"})})}function $(e){return(0,c.jsx)("svg",{viewBox:"0 0 24 24",width:24,height:24,...e,children:(0,c.jsx)("path",{fill:"currentColor",d:"M9.37,5.51C9.19,6.15,9.1,6.82,9.1,7.5c0,4.08,3.32,7.4,7.4,7.4c0.68,0,1.35-0.09,1.99-0.27C17.45,17.19,14.93,19,12,19 c-3.86,0-7-3.14-7-7C5,9.07,6.81,6.55,9.37,5.51z M12,3c-4.97,0-9,4.03-9,9s4.03,9,9,9s9-4.03,9-9c0-0.46-0.04-0.92-0.1-1.36 c-0.98,1.37-2.58,2.26-4.4,2.26c-2.98,0-5.4-2.42-5.4-5.4c0-1.81,0.89-3.42,2.26-4.4C12.92,3.04,12.46,3,12,3L12,3z"})})}const U={toggle:"toggle_vylO",toggleButton:"toggleButton_gllP",darkToggleIcon:"darkToggleIcon_wfgR",lightToggleIcon:"lightToggleIcon_pyhR",toggleButtonDisabled:"toggleButtonDisabled_aARS"};function H(e){let{className:t,buttonClassName:n,value:r,onChange:o}=e;const i=(0,z.A)(),l=(0,s.T)({message:"Switch between dark and light mode (currently {mode})",id:"theme.colorToggle.ariaLabel",description:"The ARIA label for the navbar color mode toggle"},{mode:"dark"===r?(0,s.T)({message:"dark mode",id:"theme.colorToggle.ariaLabel.mode.dark",description:"The name for the dark color mode"}):(0,s.T)({message:"light mode",id:"theme.colorToggle.ariaLabel.mode.light",description:"The name for the light color mode"})});return(0,c.jsx)("div",{className:(0,a.A)(U.toggle,t),children:(0,c.jsxs)("button",{className:(0,a.A)("clean-btn",U.toggleButton,!i&&U.toggleButtonDisabled,n),type:"button",onClick:()=>o("dark"===r?"light":"dark"),disabled:!i,title:l,"aria-label":l,"aria-live":"polite",children:[(0,c.jsx)(B,{className:(0,a.A)(U.toggleIcon,U.lightToggleIcon)}),(0,c.jsx)($,{className:(0,a.A)(U.toggleIcon,U.darkToggleIcon)})]})})}const V=r.memo(H),W={darkNavbarColorModeToggle:"darkNavbarColorModeToggle_X3D1"};function q(e){let{className:t}=e;const n=(0,w.p)().navbar.style,r=(0,w.p)().colorMode.disableSwitch,{colorMode:a,setColorMode:o}=(0,D.G)();return r?null:(0,c.jsx)(V,{className:t,buttonClassName:"dark"===n?W.darkNavbarColorModeToggle:void 0,value:a,onChange:o})}var G=n(3465);function Y(){return(0,c.jsx)(G.A,{className:"navbar__brand",imageClassName:"navbar__logo",titleClassName:"navbar__title text--truncate"})}function Q(){const e=(0,N.M)();return(0,c.jsx)("button",{type:"button","aria-label":(0,s.T)({id:"theme.docs.sidebar.closeSidebarButtonAriaLabel",message:"Close navigation bar",description:"The ARIA label for close button of mobile sidebar"}),className:"clean-btn navbar-sidebar__close",onClick:()=>e.toggle(),children:(0,c.jsx)(x,{color:"var(--ifm-color-emphasis-600)"})})}function K(){return(0,c.jsxs)("div",{className:"navbar-sidebar__brand",children:[(0,c.jsx)(Y,{}),(0,c.jsx)(q,{className:"margin-right--md"}),(0,c.jsx)(Q,{})]})}var Z=n(8774),X=n(6025),J=n(6654);function ee(e,t){return void 0!==e&&void 0!==t&&new RegExp(e,"gi").test(t)}var te=n(3186);function ne(e){let{activeBasePath:t,activeBaseRegex:n,to:r,href:a,label:o,html:i,isDropdownLink:l,prependBaseUrlToHref:s,...u}=e;const d=(0,X.A)(r),f=(0,X.A)(t),p=(0,X.A)(a,{forcePrependBaseUrl:!0}),g=o&&a&&!(0,J.A)(a),m=i?{dangerouslySetInnerHTML:{__html:i}}:{children:(0,c.jsxs)(c.Fragment,{children:[o,g&&(0,c.jsx)(te.A,{...l&&{width:12,height:12}})]})};return a?(0,c.jsx)(Z.A,{href:s?p:a,...u,...m}):(0,c.jsx)(Z.A,{to:d,isNavLink:!0,...(t||n)&&{isActive:(e,t)=>n?ee(n,t.pathname):t.pathname.startsWith(f)},...u,...m})}function re(e){let{className:t,isDropdownItem:n=!1,...r}=e;const o=(0,c.jsx)(ne,{className:(0,a.A)(n?"dropdown__link":"navbar__item navbar__link",t),isDropdownLink:n,...r});return n?(0,c.jsx)("li",{children:o}):o}function ae(e){let{className:t,isDropdownItem:n,...r}=e;return(0,c.jsx)("li",{className:"menu__list-item",children:(0,c.jsx)(ne,{className:(0,a.A)("menu__link",t),...r})})}function oe(e){let{mobile:t=!1,position:n,...r}=e;const a=t?ae:re;return(0,c.jsx)(a,{...r,activeClassName:r.activeClassName??(t?"menu__link--active":"navbar__link--active")})}var ie=n(1422),le=n(9169),se=n(4586);const ue={dropdownNavbarItemMobile:"dropdownNavbarItemMobile_S0Fm"};function ce(e,t){return e.some((e=>function(e,t){return!!(0,le.ys)(e.to,t)||!!ee(e.activeBaseRegex,t)||!(!e.activeBasePath||!t.startsWith(e.activeBasePath))}(e,t)))}function de(e){let{items:t,position:n,className:o,onClick:i,...l}=e;const s=(0,r.useRef)(null),[u,d]=(0,r.useState)(!1);return(0,r.useEffect)((()=>{const e=e=>{s.current&&!s.current.contains(e.target)&&d(!1)};return document.addEventListener("mousedown",e),document.addEventListener("touchstart",e),document.addEventListener("focusin",e),()=>{document.removeEventListener("mousedown",e),document.removeEventListener("touchstart",e),document.removeEventListener("focusin",e)}}),[s]),(0,c.jsxs)("div",{ref:s,className:(0,a.A)("navbar__item","dropdown","dropdown--hoverable",{"dropdown--right":"right"===n,"dropdown--show":u}),children:[(0,c.jsx)(ne,{"aria-haspopup":"true","aria-expanded":u,role:"button",href:l.to?void 0:"#",className:(0,a.A)("navbar__link",o),...l,onClick:l.to?void 0:e=>e.preventDefault(),onKeyDown:e=>{"Enter"===e.key&&(e.preventDefault(),d(!u))},children:l.children??l.label}),(0,c.jsx)("ul",{className:"dropdown__menu",children:t.map(((e,t)=>(0,r.createElement)(_e,{isDropdownItem:!0,activeClassName:"dropdown__link--active",...e,key:t})))})]})}function fe(e){let{items:t,className:n,position:o,onClick:i,...s}=e;const u=function(){const{siteConfig:{baseUrl:e}}=(0,se.A)(),{pathname:t}=(0,l.zy)();return t.replace(e,"/")}(),d=ce(t,u),{collapsed:f,toggleCollapsed:p,setCollapsed:g}=(0,ie.u)({initialState:()=>!d});return(0,r.useEffect)((()=>{d&&g(!d)}),[u,d,g]),(0,c.jsxs)("li",{className:(0,a.A)("menu__list-item",{"menu__list-item--collapsed":f}),children:[(0,c.jsx)(ne,{role:"button",className:(0,a.A)(ue.dropdownNavbarItemMobile,"menu__link menu__link--sublist menu__link--sublist-caret",n),...s,onClick:e=>{e.preventDefault(),p()},children:s.children??s.label}),(0,c.jsx)(ie.N,{lazy:!0,as:"ul",className:"menu__list",collapsed:f,children:t.map(((e,t)=>(0,r.createElement)(_e,{mobile:!0,isDropdownItem:!0,onClick:i,activeClassName:"menu__link--active",...e,key:t})))})]})}function pe(e){let{mobile:t=!1,...n}=e;const r=t?fe:de;return(0,c.jsx)(r,{...n})}var ge=n(2131);function me(e){let{width:t=20,height:n=20,...r}=e;return(0,c.jsx)("svg",{viewBox:"0 0 24 24",width:t,height:n,"aria-hidden":!0,...r,children:(0,c.jsx)("path",{fill:"currentColor",d:"M12.87 15.07l-2.54-2.51.03-.03c1.74-1.94 2.98-4.17 3.71-6.53H17V4h-7V2H8v2H1v1.99h11.17C11.5 7.92 10.44 9.75 9 11.35 8.07 10.32 7.3 9.19 6.69 8h-2c.73 1.63 1.73 3.17 2.98 4.56l-5.09 5.02L4 19l5-5 3.11 3.11.76-2.04zM18.5 10h-2L12 22h2l1.12-3h4.75L21 22h2l-4.5-12zm-2.62 7l1.62-4.33L19.12 17h-3.24z"})})}const he="iconLanguage_nlXk";var ye=n(418);const be={navbarSearchContainer:"navbarSearchContainer_Bca1"};function ve(e){let{children:t,className:n}=e;return(0,c.jsx)("div",{className:(0,a.A)(n,be.navbarSearchContainer),children:t})}var we=n(4070),ke=n(4142);var xe=n(5597);const Se=e=>e.docs.find((t=>t.id===e.mainDocId));const Ee={default:oe,localeDropdown:function(e){let{mobile:t,dropdownItemsBefore:n,dropdownItemsAfter:r,queryString:a="",...o}=e;const{i18n:{currentLocale:i,locales:u,localeConfigs:d}}=(0,se.A)(),f=(0,ge.o)(),{search:p,hash:g}=(0,l.zy)(),m=[...n,...u.map((e=>{const n=`${`pathname://${f.createUrl({locale:e,fullyQualified:!1})}`}${p}${g}${a}`;return{label:d[e].label,lang:d[e].htmlLang,to:n,target:"_self",autoAddBaseUrl:!1,className:e===i?t?"menu__link--active":"dropdown__link--active":""}})),...r],h=t?(0,s.T)({message:"Languages",id:"theme.navbar.mobileLanguageDropdown.label",description:"The label for the mobile language switcher dropdown"}):d[i].label;return(0,c.jsx)(pe,{...o,mobile:t,label:(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(me,{className:he}),h]}),items:m})},search:function(e){let{mobile:t,className:n}=e;return t?null:(0,c.jsx)(ve,{className:n,children:(0,c.jsx)(ye.A,{})})},dropdown:pe,html:function(e){let{value:t,className:n,mobile:r=!1,isDropdownItem:o=!1}=e;const i=o?"li":"div";return(0,c.jsx)(i,{className:(0,a.A)({navbar__item:!r&&!o,"menu__list-item":r},n),dangerouslySetInnerHTML:{__html:t}})},doc:function(e){let{docId:t,label:n,docsPluginId:r,...a}=e;const{activeDoc:o}=(0,we.zK)(r),i=(0,ke.QB)(t,r),l=o?.path===i?.path;return null===i||i.unlisted&&!l?null:(0,c.jsx)(oe,{exact:!0,...a,isActive:()=>l||!!o?.sidebar&&o.sidebar===i.sidebar,label:n??i.id,to:i.path})},docSidebar:function(e){let{sidebarId:t,label:n,docsPluginId:r,...a}=e;const{activeDoc:o}=(0,we.zK)(r),i=(0,ke.fW)(t,r).link;if(!i)throw new Error(`DocSidebarNavbarItem: Sidebar with ID "${t}" doesn't have anything to be linked to.`);return(0,c.jsx)(oe,{exact:!0,...a,isActive:()=>o?.sidebar===t,label:n??i.label,to:i.path})},docsVersion:function(e){let{label:t,to:n,docsPluginId:r,...a}=e;const o=(0,ke.Vd)(r)[0],i=t??o.label,l=n??(e=>e.docs.find((t=>t.id===e.mainDocId)))(o).path;return(0,c.jsx)(oe,{...a,label:i,to:l})},docsVersionDropdown:function(e){let{mobile:t,docsPluginId:n,dropdownActiveClassDisabled:r,dropdownItemsBefore:a,dropdownItemsAfter:o,...i}=e;const{search:u,hash:d}=(0,l.zy)(),f=(0,we.zK)(n),p=(0,we.jh)(n),{savePreferredVersionName:g}=(0,xe.g1)(n),m=[...a,...p.map((e=>{const t=f.alternateDocVersions[e.name]??Se(e);return{label:e.label,to:`${t.path}${u}${d}`,isActive:()=>e===f.activeVersion,onClick:()=>g(e.name)}})),...o],h=(0,ke.Vd)(n)[0],y=t&&m.length>1?(0,s.T)({id:"theme.navbar.mobileVersionsDropdown.label",message:"Versions",description:"The label for the navbar versions dropdown on mobile view"}):h.label,b=t&&m.length>1?void 0:Se(h).path;return m.length<=1?(0,c.jsx)(oe,{...i,mobile:t,label:y,to:b,isActive:r?()=>!1:void 0}):(0,c.jsx)(pe,{...i,mobile:t,label:y,to:b,items:m,isActive:r?()=>!1:void 0})}};function _e(e){let{type:t,...n}=e;const r=function(e,t){return e&&"default"!==e?e:"items"in t?"dropdown":"default"}(t,n),a=Ee[r];if(!a)throw new Error(`No NavbarItem component found for type "${t}".`);return(0,c.jsx)(a,{...n})}function Ce(){const e=(0,N.M)(),t=(0,w.p)().navbar.items;return(0,c.jsx)("ul",{className:"menu__list",children:t.map(((t,n)=>(0,r.createElement)(_e,{mobile:!0,...t,onClick:()=>e.toggle(),key:n})))})}function Ae(e){return(0,c.jsx)("button",{...e,type:"button",className:"clean-btn navbar-sidebar__back",children:(0,c.jsx)(s.A,{id:"theme.navbar.mobileSidebarSecondaryMenu.backButtonLabel",description:"The label of the back button to return to main menu, inside the mobile navbar sidebar secondary menu (notably used to display the docs sidebar)",children:"\u2190 Back to main menu"})})}function Te(){const e=0===(0,w.p)().navbar.items.length,t=F();return(0,c.jsxs)(c.Fragment,{children:[!e&&(0,c.jsx)(Ae,{onClick:()=>t.hide()}),t.content]})}function Ne(){const e=(0,N.M)();var t;return void 0===(t=e.shown)&&(t=!0),(0,r.useEffect)((()=>(document.body.style.overflow=t?"hidden":"visible",()=>{document.body.style.overflow="visible"})),[t]),e.shouldRender?(0,c.jsx)(M,{header:(0,c.jsx)(K,{}),primaryMenu:(0,c.jsx)(Ce,{}),secondaryMenu:(0,c.jsx)(Te,{})}):null}const je={navbarHideable:"navbarHideable_m1mJ",navbarHidden:"navbarHidden_jGov"};function Pe(e){return(0,c.jsx)("div",{role:"presentation",...e,className:(0,a.A)("navbar-sidebar__backdrop",e.className)})}function Le(e){let{children:t}=e;const{navbar:{hideOnScroll:n,style:o}}=(0,w.p)(),i=(0,N.M)(),{navbarRef:l,isNavbarVisible:d}=function(e){const[t,n]=(0,r.useState)(e),a=(0,r.useRef)(!1),o=(0,r.useRef)(0),i=(0,r.useCallback)((e=>{null!==e&&(o.current=e.getBoundingClientRect().height)}),[]);return(0,j.Mq)(((t,r)=>{let{scrollY:i}=t;if(!e)return;if(i=l?n(!1):i+u{if(!e)return;const r=t.location.hash;if(r?document.getElementById(r.substring(1)):void 0)return a.current=!0,void n(!1);n(!0)})),{navbarRef:i,isNavbarVisible:t}}(n);return(0,c.jsxs)("nav",{ref:l,"aria-label":(0,s.T)({id:"theme.NavBar.navAriaLabel",message:"Main",description:"The ARIA label for the main navigation"}),className:(0,a.A)("navbar","navbar--fixed-top",n&&[je.navbarHideable,!d&&je.navbarHidden],{"navbar--dark":"dark"===o,"navbar--primary":"primary"===o,"navbar-sidebar--show":i.shown}),children:[t,(0,c.jsx)(Pe,{onClick:i.toggle}),(0,c.jsx)(Ne,{})]})}var Oe=n(440);const Re={errorBoundaryError:"errorBoundaryError_a6uf",errorBoundaryFallback:"errorBoundaryFallback_VBag"};function Ie(e){return(0,c.jsx)("button",{type:"button",...e,children:(0,c.jsx)(s.A,{id:"theme.ErrorPageContent.tryAgain",description:"The label of the button to try again rendering when the React error boundary captures an error",children:"Try again"})})}function Fe(e){let{error:t}=e;const n=(0,Oe.getErrorCausalChain)(t).map((e=>e.message)).join("\n\nCause:\n");return(0,c.jsx)("p",{className:Re.errorBoundaryError,children:n})}class Me extends r.Component{componentDidCatch(e,t){throw this.props.onError(e,t)}render(){return this.props.children}}const De="right";function ze(e){let{width:t=30,height:n=30,className:r,...a}=e;return(0,c.jsx)("svg",{className:r,width:t,height:n,viewBox:"0 0 30 30","aria-hidden":"true",...a,children:(0,c.jsx)("path",{stroke:"currentColor",strokeLinecap:"round",strokeMiterlimit:"10",strokeWidth:"2",d:"M4 7h22M4 15h22M4 23h22"})})}function Be(){const{toggle:e,shown:t}=(0,N.M)();return(0,c.jsx)("button",{onClick:e,"aria-label":(0,s.T)({id:"theme.docs.sidebar.toggleSidebarButtonAriaLabel",message:"Toggle navigation bar",description:"The ARIA label for hamburger menu button of mobile navigation"}),"aria-expanded":t,className:"navbar__toggle clean-btn",type:"button",children:(0,c.jsx)(ze,{})})}const $e={colorModeToggle:"colorModeToggle_DEke"};function Ue(e){let{items:t}=e;return(0,c.jsx)(c.Fragment,{children:t.map(((e,t)=>(0,c.jsx)(Me,{onError:t=>new Error(`A theme navbar item failed to render.\nPlease double-check the following navbar item (themeConfig.navbar.items) of your Docusaurus config:\n${JSON.stringify(e,null,2)}`,{cause:t}),children:(0,c.jsx)(_e,{...e})},t)))})}function He(e){let{left:t,right:n}=e;return(0,c.jsxs)("div",{className:"navbar__inner",children:[(0,c.jsx)("div",{className:"navbar__items",children:t}),(0,c.jsx)("div",{className:"navbar__items navbar__items--right",children:n})]})}function Ve(){const e=(0,N.M)(),t=(0,w.p)().navbar.items,[n,r]=function(e){function t(e){return"left"===(e.position??De)}return[e.filter(t),e.filter((e=>!t(e)))]}(t),a=t.find((e=>"search"===e.type));return(0,c.jsx)(He,{left:(0,c.jsxs)(c.Fragment,{children:[!e.disabled&&(0,c.jsx)(Be,{}),(0,c.jsx)(Y,{}),(0,c.jsx)(Ue,{items:n})]}),right:(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(Ue,{items:r}),(0,c.jsx)(q,{className:$e.colorModeToggle}),!a&&(0,c.jsx)(ve,{children:(0,c.jsx)(ye.A,{})})]})})}function We(){return(0,c.jsx)(Le,{children:(0,c.jsx)(Ve,{})})}function qe(e){let{item:t}=e;const{to:n,href:r,label:a,prependBaseUrlToHref:o,...i}=t,l=(0,X.A)(n),s=(0,X.A)(r,{forcePrependBaseUrl:!0});return(0,c.jsxs)(Z.A,{className:"footer__link-item",...r?{href:o?s:r}:{to:l},...i,children:[a,r&&!(0,J.A)(r)&&(0,c.jsx)(te.A,{})]})}function Ge(e){let{item:t}=e;return t.html?(0,c.jsx)("li",{className:"footer__item",dangerouslySetInnerHTML:{__html:t.html}}):(0,c.jsx)("li",{className:"footer__item",children:(0,c.jsx)(qe,{item:t})},t.href??t.to)}function Ye(e){let{column:t}=e;return(0,c.jsxs)("div",{className:"col footer__col",children:[(0,c.jsx)("div",{className:"footer__title",children:t.title}),(0,c.jsx)("ul",{className:"footer__items clean-list",children:t.items.map(((e,t)=>(0,c.jsx)(Ge,{item:e},t)))})]})}function Qe(e){let{columns:t}=e;return(0,c.jsx)("div",{className:"row footer__links",children:t.map(((e,t)=>(0,c.jsx)(Ye,{column:e},t)))})}function Ke(){return(0,c.jsx)("span",{className:"footer__link-separator",children:"\xb7"})}function Ze(e){let{item:t}=e;return t.html?(0,c.jsx)("span",{className:"footer__link-item",dangerouslySetInnerHTML:{__html:t.html}}):(0,c.jsx)(qe,{item:t})}function Xe(e){let{links:t}=e;return(0,c.jsx)("div",{className:"footer__links text--center",children:(0,c.jsx)("div",{className:"footer__links",children:t.map(((e,n)=>(0,c.jsxs)(r.Fragment,{children:[(0,c.jsx)(Ze,{item:e}),t.length!==n+1&&(0,c.jsx)(Ke,{})]},n)))})})}function Je(e){let{links:t}=e;return function(e){return"title"in e[0]}(t)?(0,c.jsx)(Qe,{columns:t}):(0,c.jsx)(Xe,{links:t})}var et=n(1122);const tt={footerLogoLink:"footerLogoLink_BH7S"};function nt(e){let{logo:t}=e;const{withBaseUrl:n}=(0,X.h)(),r={light:n(t.src),dark:n(t.srcDark??t.src)};return(0,c.jsx)(et.A,{className:(0,a.A)("footer__logo",t.className),alt:t.alt,sources:r,width:t.width,height:t.height,style:t.style})}function rt(e){let{logo:t}=e;return t.href?(0,c.jsx)(Z.A,{href:t.href,className:tt.footerLogoLink,target:t.target,children:(0,c.jsx)(nt,{logo:t})}):(0,c.jsx)(nt,{logo:t})}function at(e){let{copyright:t}=e;return(0,c.jsx)("div",{className:"footer__copyright",dangerouslySetInnerHTML:{__html:t}})}function ot(e){let{style:t,links:n,logo:r,copyright:o}=e;return(0,c.jsx)("footer",{className:(0,a.A)("footer",{"footer--dark":"dark"===t}),children:(0,c.jsxs)("div",{className:"container container-fluid",children:[n,(r||o)&&(0,c.jsxs)("div",{className:"footer__bottom text--center",children:[r&&(0,c.jsx)("div",{className:"margin-bottom--sm",children:r}),o]})]})})}function it(){const{footer:e}=(0,w.p)();if(!e)return null;const{copyright:t,links:n,logo:r,style:a}=e;return(0,c.jsx)(ot,{style:a,links:n&&n.length>0&&(0,c.jsx)(Je,{links:n}),logo:r&&(0,c.jsx)(rt,{logo:r}),copyright:t&&(0,c.jsx)(at,{copyright:t})})}const lt=r.memo(it),st=(0,P.fM)([D.a,k.oq,j.Tv,xe.VQ,i.Jx,function(e){let{children:t}=e;return(0,c.jsx)(L.y_,{children:(0,c.jsx)(N.e,{children:(0,c.jsx)(R,{children:t})})})}]);function ut(e){let{children:t}=e;return(0,c.jsx)(st,{children:t})}var ct=n(1107);function dt(e){let{error:t,tryAgain:n}=e;return(0,c.jsx)("main",{className:"container margin-vert--xl",children:(0,c.jsx)("div",{className:"row",children:(0,c.jsxs)("div",{className:"col col--6 col--offset-3",children:[(0,c.jsx)(ct.A,{as:"h1",className:"hero__title",children:(0,c.jsx)(s.A,{id:"theme.ErrorPageContent.title",description:"The title of the fallback page when the page crashed",children:"This page crashed."})}),(0,c.jsx)("div",{className:"margin-vert--lg",children:(0,c.jsx)(Ie,{onClick:n,className:"button button--primary shadow--lw"})}),(0,c.jsx)("hr",{}),(0,c.jsx)("div",{className:"margin-vert--md",children:(0,c.jsx)(Fe,{error:t})})]})})})}const ft={mainWrapper:"mainWrapper_z2l0"};function pt(e){const{children:t,noFooter:n,wrapperClassName:r,title:l,description:s}=e;return(0,y.J)(),(0,c.jsxs)(ut,{children:[(0,c.jsx)(i.be,{title:l,description:s}),(0,c.jsx)(v,{}),(0,c.jsx)(T,{}),(0,c.jsx)(We,{}),(0,c.jsx)("div",{id:d,className:(0,a.A)(h.G.wrapper.main,ft.mainWrapper,r),children:(0,c.jsx)(o.A,{fallback:e=>(0,c.jsx)(dt,{...e}),children:t})}),!n&&(0,c.jsx)(lt,{})]})}},3465:(e,t,n)=>{"use strict";n.d(t,{A:()=>c});n(6540);var r=n(8774),a=n(6025),o=n(4586),i=n(6342),l=n(1122),s=n(4848);function u(e){let{logo:t,alt:n,imageClassName:r}=e;const o={light:(0,a.A)(t.src),dark:(0,a.A)(t.srcDark||t.src)},i=(0,s.jsx)(l.A,{className:t.className,sources:o,height:t.height,width:t.width,alt:n,style:t.style});return r?(0,s.jsx)("div",{className:r,children:i}):i}function c(e){const{siteConfig:{title:t}}=(0,o.A)(),{navbar:{title:n,logo:l}}=(0,i.p)(),{imageClassName:c,titleClassName:d,...f}=e,p=(0,a.A)(l?.href||"/"),g=n?"":t,m=l?.alt??g;return(0,s.jsxs)(r.A,{to:p,...f,...l?.target&&{target:l.target},children:[l&&(0,s.jsx)(u,{logo:l,alt:m,imageClassName:c}),null!=n&&(0,s.jsx)("b",{className:d,children:n})]})}},1463:(e,t,n)=>{"use strict";n.d(t,{A:()=>o});n(6540);var r=n(5260),a=n(4848);function o(e){let{locale:t,version:n,tag:o}=e;const i=t;return(0,a.jsxs)(r.A,{children:[t&&(0,a.jsx)("meta",{name:"docusaurus_locale",content:t}),n&&(0,a.jsx)("meta",{name:"docusaurus_version",content:n}),o&&(0,a.jsx)("meta",{name:"docusaurus_tag",content:o}),i&&(0,a.jsx)("meta",{name:"docsearch:language",content:i}),n&&(0,a.jsx)("meta",{name:"docsearch:version",content:n}),o&&(0,a.jsx)("meta",{name:"docsearch:docusaurus_tag",content:o})]})}},1122:(e,t,n)=>{"use strict";n.d(t,{A:()=>c});var r=n(6540),a=n(4164),o=n(2303),i=n(5293);const l={themedComponent:"themedComponent_mlkZ","themedComponent--light":"themedComponent--light_NVdE","themedComponent--dark":"themedComponent--dark_xIcU"};var s=n(4848);function u(e){let{className:t,children:n}=e;const u=(0,o.A)(),{colorMode:c}=(0,i.G)();return(0,s.jsx)(s.Fragment,{children:(u?"dark"===c?["dark"]:["light"]:["light","dark"]).map((e=>{const o=n({theme:e,className:(0,a.A)(t,l.themedComponent,l[`themedComponent--${e}`])});return(0,s.jsx)(r.Fragment,{children:o},e)}))})}function c(e){const{sources:t,className:n,alt:r,...a}=e;return(0,s.jsx)(u,{className:n,children:e=>{let{theme:n,className:o}=e;return(0,s.jsx)("img",{src:t[n],alt:r,className:o,...a})}})}},1422:(e,t,n)=>{"use strict";n.d(t,{N:()=>y,u:()=>u});var r=n(6540),a=n(8193),o=n(205),i=n(3109),l=n(4848);const s="ease-in-out";function u(e){let{initialState:t}=e;const[n,a]=(0,r.useState)(t??!1),o=(0,r.useCallback)((()=>{a((e=>!e))}),[]);return{collapsed:n,setCollapsed:a,toggleCollapsed:o}}const c={display:"none",overflow:"hidden",height:"0px"},d={display:"block",overflow:"visible",height:"auto"};function f(e,t){const n=t?c:d;e.style.display=n.display,e.style.overflow=n.overflow,e.style.height=n.height}function p(e){let{collapsibleRef:t,collapsed:n,animation:a}=e;const o=(0,r.useRef)(!1);(0,r.useEffect)((()=>{const e=t.current;function r(){const t=e.scrollHeight,n=a?.duration??function(e){if((0,i.O)())return 1;const t=e/36;return Math.round(10*(4+15*t**.25+t/5))}(t);return{transition:`height ${n}ms ${a?.easing??s}`,height:`${t}px`}}function l(){const t=r();e.style.transition=t.transition,e.style.height=t.height}if(!o.current)return f(e,n),void(o.current=!0);return e.style.willChange="height",function(){const t=requestAnimationFrame((()=>{n?(l(),requestAnimationFrame((()=>{e.style.height=c.height,e.style.overflow=c.overflow}))):(e.style.display="block",requestAnimationFrame((()=>{l()})))}));return()=>cancelAnimationFrame(t)}()}),[t,n,a])}function g(e){if(!a.A.canUseDOM)return e?c:d}function m(e){let{as:t="div",collapsed:n,children:a,animation:o,onCollapseTransitionEnd:i,className:s,disableSSRStyle:u}=e;const c=(0,r.useRef)(null);return p({collapsibleRef:c,collapsed:n,animation:o}),(0,l.jsx)(t,{ref:c,style:u?void 0:g(n),onTransitionEnd:e=>{"height"===e.propertyName&&(f(c.current,n),i?.(n))},className:s,children:a})}function h(e){let{collapsed:t,...n}=e;const[a,i]=(0,r.useState)(!t),[s,u]=(0,r.useState)(t);return(0,o.A)((()=>{t||i(!0)}),[t]),(0,o.A)((()=>{a&&u(t)}),[a,t]),a?(0,l.jsx)(m,{...n,collapsed:s}):null}function y(e){let{lazy:t,...n}=e;const r=t?h:m;return(0,l.jsx)(r,{...n})}},5041:(e,t,n)=>{"use strict";n.d(t,{Mj:()=>m,oq:()=>g});var r=n(6540),a=n(2303),o=n(9466),i=n(9532),l=n(6342),s=n(4848);const u=(0,o.Wf)("docusaurus.announcement.dismiss"),c=(0,o.Wf)("docusaurus.announcement.id"),d=()=>"true"===u.get(),f=e=>u.set(String(e)),p=r.createContext(null);function g(e){let{children:t}=e;const n=function(){const{announcementBar:e}=(0,l.p)(),t=(0,a.A)(),[n,o]=(0,r.useState)((()=>!!t&&d()));(0,r.useEffect)((()=>{o(d())}),[]);const i=(0,r.useCallback)((()=>{f(!0),o(!0)}),[]);return(0,r.useEffect)((()=>{if(!e)return;const{id:t}=e;let n=c.get();"annoucement-bar"===n&&(n="announcement-bar");const r=t!==n;c.set(t),r&&f(!1),!r&&d()||o(!1)}),[e]),(0,r.useMemo)((()=>({isActive:!!e&&!n,close:i})),[e,n,i])}();return(0,s.jsx)(p.Provider,{value:n,children:t})}function m(){const e=(0,r.useContext)(p);if(!e)throw new i.dV("AnnouncementBarProvider");return e}},5293:(e,t,n)=>{"use strict";n.d(t,{G:()=>y,a:()=>h});var r=n(6540),a=n(8193),o=n(9532),i=n(9466),l=n(6342),s=n(4848);const u=r.createContext(void 0),c="theme",d=(0,i.Wf)(c),f={light:"light",dark:"dark"},p=e=>e===f.dark?f.dark:f.light,g=e=>a.A.canUseDOM?p(document.documentElement.getAttribute("data-theme")):p(e),m=e=>{d.set(p(e))};function h(e){let{children:t}=e;const n=function(){const{colorMode:{defaultMode:e,disableSwitch:t,respectPrefersColorScheme:n}}=(0,l.p)(),[a,o]=(0,r.useState)(g(e));(0,r.useEffect)((()=>{t&&d.del()}),[t]);const i=(0,r.useCallback)((function(t,r){void 0===r&&(r={});const{persist:a=!0}=r;t?(o(t),a&&m(t)):(o(n?window.matchMedia("(prefers-color-scheme: dark)").matches?f.dark:f.light:e),d.del())}),[n,e]);(0,r.useEffect)((()=>{document.documentElement.setAttribute("data-theme",p(a))}),[a]),(0,r.useEffect)((()=>{if(t)return;const e=e=>{if(e.key!==c)return;const t=d.get();null!==t&&i(p(t))};return window.addEventListener("storage",e),()=>window.removeEventListener("storage",e)}),[t,i]);const s=(0,r.useRef)(!1);return(0,r.useEffect)((()=>{if(t&&!n)return;const e=window.matchMedia("(prefers-color-scheme: dark)"),r=()=>{window.matchMedia("print").matches||s.current?s.current=window.matchMedia("print").matches:i(null)};return e.addListener(r),()=>e.removeListener(r)}),[i,t,n]),(0,r.useMemo)((()=>({colorMode:a,setColorMode:i,get isDarkTheme(){return a===f.dark},setLightTheme(){i(f.light)},setDarkTheme(){i(f.dark)}})),[a,i])}();return(0,s.jsx)(u.Provider,{value:n,children:t})}function y(){const e=(0,r.useContext)(u);if(null==e)throw new o.dV("ColorModeProvider","Please see https://docusaurus.io/docs/api/themes/configuration#use-color-mode.");return e}},5597:(e,t,n)=>{"use strict";n.d(t,{VQ:()=>y,g1:()=>v});var r=n(6540),a=n(4070),o=n(7065),i=n(6342),l=n(4142),s=n(9532),u=n(9466),c=n(4848);const d=e=>`docs-preferred-version-${e}`,f={save:(e,t,n)=>{(0,u.Wf)(d(e),{persistence:t}).set(n)},read:(e,t)=>(0,u.Wf)(d(e),{persistence:t}).get(),clear:(e,t)=>{(0,u.Wf)(d(e),{persistence:t}).del()}},p=e=>Object.fromEntries(e.map((e=>[e,{preferredVersionName:null}])));const g=r.createContext(null);function m(){const e=(0,a.Gy)(),t=(0,i.p)().docs.versionPersistence,n=(0,r.useMemo)((()=>Object.keys(e)),[e]),[o,l]=(0,r.useState)((()=>p(n)));(0,r.useEffect)((()=>{l(function(e){let{pluginIds:t,versionPersistence:n,allDocsData:r}=e;function a(e){const t=f.read(e,n);return r[e].versions.some((e=>e.name===t))?{preferredVersionName:t}:(f.clear(e,n),{preferredVersionName:null})}return Object.fromEntries(t.map((e=>[e,a(e)])))}({allDocsData:e,versionPersistence:t,pluginIds:n}))}),[e,t,n]);return[o,(0,r.useMemo)((()=>({savePreferredVersion:function(e,n){f.save(e,t,n),l((t=>({...t,[e]:{preferredVersionName:n}})))}})),[t])]}function h(e){let{children:t}=e;const n=m();return(0,c.jsx)(g.Provider,{value:n,children:t})}function y(e){let{children:t}=e;return l.C5?(0,c.jsx)(h,{children:t}):(0,c.jsx)(c.Fragment,{children:t})}function b(){const e=(0,r.useContext)(g);if(!e)throw new s.dV("DocsPreferredVersionContextProvider");return e}function v(e){void 0===e&&(e=o.W);const t=(0,a.ht)(e),[n,i]=b(),{preferredVersionName:l}=n[e];return{preferredVersion:t.versions.find((e=>e.name===l))??null,savePreferredVersionName:(0,r.useCallback)((t=>{i.savePreferredVersion(e,t)}),[i,e])}}},6588:(e,t,n)=>{"use strict";n.d(t,{V:()=>s,t:()=>u});var r=n(6540),a=n(9532),o=n(4848);const i=Symbol("EmptyContext"),l=r.createContext(i);function s(e){let{children:t,name:n,items:a}=e;const i=(0,r.useMemo)((()=>n&&a?{name:n,items:a}:null),[n,a]);return(0,o.jsx)(l.Provider,{value:i,children:t})}function u(){const e=(0,r.useContext)(l);if(e===i)throw new a.dV("DocsSidebarProvider");return e}},2252:(e,t,n)=>{"use strict";n.d(t,{n:()=>l,r:()=>s});var r=n(6540),a=n(9532),o=n(4848);const i=r.createContext(null);function l(e){let{children:t,version:n}=e;return(0,o.jsx)(i.Provider,{value:n,children:t})}function s(){const e=(0,r.useContext)(i);if(null===e)throw new a.dV("DocsVersionProvider");return e}},2069:(e,t,n)=>{"use strict";n.d(t,{M:()=>p,e:()=>f});var r=n(6540),a=n(5600),o=n(4581),i=n(7485),l=n(6342),s=n(9532),u=n(4848);const c=r.createContext(void 0);function d(){const e=function(){const e=(0,a.YL)(),{items:t}=(0,l.p)().navbar;return 0===t.length&&!e.component}(),t=(0,o.l)(),n=!e&&"mobile"===t,[s,u]=(0,r.useState)(!1);(0,i.$Z)((()=>{if(s)return u(!1),!1}));const c=(0,r.useCallback)((()=>{u((e=>!e))}),[]);return(0,r.useEffect)((()=>{"desktop"===t&&u(!1)}),[t]),(0,r.useMemo)((()=>({disabled:e,shouldRender:n,toggle:c,shown:s})),[e,n,c,s])}function f(e){let{children:t}=e;const n=d();return(0,u.jsx)(c.Provider,{value:n,children:t})}function p(){const e=r.useContext(c);if(void 0===e)throw new s.dV("NavbarMobileSidebarProvider");return e}},5600:(e,t,n)=>{"use strict";n.d(t,{GX:()=>u,YL:()=>s,y_:()=>l});var r=n(6540),a=n(9532),o=n(4848);const i=r.createContext(null);function l(e){let{children:t}=e;const n=(0,r.useState)({component:null,props:null});return(0,o.jsx)(i.Provider,{value:n,children:t})}function s(){const e=(0,r.useContext)(i);if(!e)throw new a.dV("NavbarSecondaryMenuContentProvider");return e[0]}function u(e){let{component:t,props:n}=e;const o=(0,r.useContext)(i);if(!o)throw new a.dV("NavbarSecondaryMenuContentProvider");const[,l]=o,s=(0,a.Be)(n);return(0,r.useEffect)((()=>{l({component:t,props:s})}),[l,t,s]),(0,r.useEffect)((()=>()=>l({component:null,props:null})),[l]),null}},4090:(e,t,n)=>{"use strict";n.d(t,{w:()=>a,J:()=>o});var r=n(6540);const a="navigation-with-keyboard";function o(){(0,r.useEffect)((()=>{function e(e){"keydown"===e.type&&"Tab"===e.key&&document.body.classList.add(a),"mousedown"===e.type&&document.body.classList.remove(a)}return document.addEventListener("keydown",e),document.addEventListener("mousedown",e),()=>{document.body.classList.remove(a),document.removeEventListener("keydown",e),document.removeEventListener("mousedown",e)}}),[])}},4581:(e,t,n)=>{"use strict";n.d(t,{l:()=>l});var r=n(6540),a=n(8193);const o={desktop:"desktop",mobile:"mobile",ssr:"ssr"},i=996;function l(e){let{desktopBreakpoint:t=i}=void 0===e?{}:e;const[n,l]=(0,r.useState)((()=>"ssr"));return(0,r.useEffect)((()=>{function e(){l(function(e){if(!a.A.canUseDOM)throw new Error("getWindowSize() should only be called after React hydration");return window.innerWidth>e?o.desktop:o.mobile}(t))}return e(),window.addEventListener("resize",e),()=>{window.removeEventListener("resize",e)}}),[t]),n}},7559:(e,t,n)=>{"use strict";n.d(t,{G:()=>r});const r={page:{blogListPage:"blog-list-page",blogPostPage:"blog-post-page",blogTagsListPage:"blog-tags-list-page",blogTagPostListPage:"blog-tags-post-list-page",docsDocPage:"docs-doc-page",docsTagsListPage:"docs-tags-list-page",docsTagDocListPage:"docs-tags-doc-list-page",mdxPage:"mdx-page"},wrapper:{main:"main-wrapper",blogPages:"blog-wrapper",docsPages:"docs-wrapper",mdxPages:"mdx-wrapper"},common:{editThisPage:"theme-edit-this-page",lastUpdated:"theme-last-updated",backToTopButton:"theme-back-to-top-button",codeBlock:"theme-code-block",admonition:"theme-admonition",unlistedBanner:"theme-unlisted-banner",admonitionType:e=>`theme-admonition-${e}`},layout:{},docs:{docVersionBanner:"theme-doc-version-banner",docVersionBadge:"theme-doc-version-badge",docBreadcrumbs:"theme-doc-breadcrumbs",docMarkdown:"theme-doc-markdown",docTocMobile:"theme-doc-toc-mobile",docTocDesktop:"theme-doc-toc-desktop",docFooter:"theme-doc-footer",docFooterTagsRow:"theme-doc-footer-tags-row",docFooterEditMetaRow:"theme-doc-footer-edit-meta-row",docSidebarContainer:"theme-doc-sidebar-container",docSidebarMenu:"theme-doc-sidebar-menu",docSidebarItemCategory:"theme-doc-sidebar-item-category",docSidebarItemLink:"theme-doc-sidebar-item-link",docSidebarItemCategoryLevel:e=>`theme-doc-sidebar-item-category-level-${e}`,docSidebarItemLinkLevel:e=>`theme-doc-sidebar-item-link-level-${e}`},blog:{}}},3109:(e,t,n)=>{"use strict";function r(){return window.matchMedia("(prefers-reduced-motion: reduce)").matches}n.d(t,{O:()=>r})},4142:(e,t,n)=>{"use strict";n.d(t,{B5:()=>E,C5:()=>f,Nr:()=>p,OF:()=>w,QB:()=>S,Vd:()=>k,Y:()=>b,fW:()=>x,w8:()=>h});var r=n(6540),a=n(6347),o=n(2831),i=n(4070),l=n(5597),s=n(2252),u=n(6588),c=n(1682),d=n(9169);const f=!!i.Gy;function p(e){return"link"!==e.type||e.unlisted?"category"===e.type?function(e){if(e.href&&!e.linkUnlisted)return e.href;for(const t of e.items){const e=p(t);if(e)return e}}(e):void 0:e.href}const g=(e,t)=>void 0!==e&&(0,d.ys)(e,t),m=(e,t)=>e.some((e=>h(e,t)));function h(e,t){return"link"===e.type?g(e.href,t):"category"===e.type&&(g(e.href,t)||m(e.items,t))}function y(e,t){switch(e.type){case"category":return h(e,t)||e.items.some((e=>y(e,t)));case"link":return!e.unlisted||h(e,t);default:return!0}}function b(e,t){return(0,r.useMemo)((()=>e.filter((e=>y(e,t)))),[e,t])}function v(e){let{sidebarItems:t,pathname:n,onlyCategories:r=!1}=e;const a=[];return function e(t){for(const o of t)if("category"===o.type&&((0,d.ys)(o.href,n)||e(o.items))||"link"===o.type&&(0,d.ys)(o.href,n)){return r&&"category"!==o.type||a.unshift(o),!0}return!1}(t),a}function w(){const e=(0,u.t)(),{pathname:t}=(0,a.zy)(),n=(0,i.vT)()?.pluginData.breadcrumbs;return!1!==n&&e?v({sidebarItems:e.items,pathname:t}):null}function k(e){const{activeVersion:t}=(0,i.zK)(e),{preferredVersion:n}=(0,l.g1)(e),a=(0,i.r7)(e);return(0,r.useMemo)((()=>(0,c.s)([t,n,a].filter(Boolean))),[t,n,a])}function x(e,t){const n=k(t);return(0,r.useMemo)((()=>{const t=n.flatMap((e=>e.sidebars?Object.entries(e.sidebars):[])),r=t.find((t=>t[0]===e));if(!r)throw new Error(`Can't find any sidebar with id "${e}" in version${n.length>1?"s":""} ${n.map((e=>e.name)).join(", ")}".\nAvailable sidebar ids are:\n- ${t.map((e=>e[0])).join("\n- ")}`);return r[1]}),[e,n])}function S(e,t){const n=k(t);return(0,r.useMemo)((()=>{const t=n.flatMap((e=>e.docs)),r=t.find((t=>t.id===e));if(!r){if(n.flatMap((e=>e.draftIds)).includes(e))return null;throw new Error(`Couldn't find any doc with id "${e}" in version${n.length>1?"s":""} "${n.map((e=>e.name)).join(", ")}".\nAvailable doc ids are:\n- ${(0,c.s)(t.map((e=>e.id))).join("\n- ")}`)}return r}),[e,n])}function E(e){let{route:t}=e;const n=(0,a.zy)(),r=(0,s.r)(),i=t.routes,l=i.find((e=>(0,a.B6)(n.pathname,e)));if(!l)return null;const u=l.sidebar,c=u?r.docsSidebars[u]:void 0;return{docElement:(0,o.v)(i),sidebarName:u,sidebarItems:c}}},7485:(e,t,n)=>{"use strict";n.d(t,{$Z:()=>i,aZ:()=>l});var r=n(6540),a=n(6347),o=n(9532);function i(e){!function(e){const t=(0,a.W6)(),n=(0,o._q)(e);(0,r.useEffect)((()=>t.block(((e,t)=>n(e,t)))),[t,n])}(((t,n)=>{if("POP"===n)return e(t,n)}))}function l(e){return function(e){const t=(0,a.W6)();return(0,r.useSyncExternalStore)(t.listen,(()=>e(t)),(()=>e(t)))}((t=>null===e?null:new URLSearchParams(t.location.search).get(e)))}},1682:(e,t,n)=>{"use strict";function r(e,t){return void 0===t&&(t=(e,t)=>e===t),e.filter(((n,r)=>e.findIndex((e=>t(e,n)))!==r))}function a(e){return Array.from(new Set(e))}n.d(t,{X:()=>r,s:()=>a})},1003:(e,t,n)=>{"use strict";n.d(t,{e3:()=>p,be:()=>d,Jx:()=>g});var r=n(6540),a=n(4164),o=n(5260),i=n(3102);function l(){const e=r.useContext(i.o);if(!e)throw new Error("Unexpected: no Docusaurus route context found");return e}var s=n(6025),u=n(4586);var c=n(4848);function d(e){let{title:t,description:n,keywords:r,image:a,children:i}=e;const l=function(e){const{siteConfig:t}=(0,u.A)(),{title:n,titleDelimiter:r}=t;return e?.trim().length?`${e.trim()} ${r} ${n}`:n}(t),{withBaseUrl:d}=(0,s.h)(),f=a?d(a,{absolute:!0}):void 0;return(0,c.jsxs)(o.A,{children:[t&&(0,c.jsx)("title",{children:l}),t&&(0,c.jsx)("meta",{property:"og:title",content:l}),n&&(0,c.jsx)("meta",{name:"description",content:n}),n&&(0,c.jsx)("meta",{property:"og:description",content:n}),r&&(0,c.jsx)("meta",{name:"keywords",content:Array.isArray(r)?r.join(","):r}),f&&(0,c.jsx)("meta",{property:"og:image",content:f}),f&&(0,c.jsx)("meta",{name:"twitter:image",content:f}),i]})}const f=r.createContext(void 0);function p(e){let{className:t,children:n}=e;const i=r.useContext(f),l=(0,a.A)(i,t);return(0,c.jsxs)(f.Provider,{value:l,children:[(0,c.jsx)(o.A,{children:(0,c.jsx)("html",{className:l})}),n]})}function g(e){let{children:t}=e;const n=l(),r=`plugin-${n.plugin.name.replace(/docusaurus-(?:plugin|theme)-(?:content-)?/gi,"")}`;const o=`plugin-id-${n.plugin.id}`;return(0,c.jsx)(p,{className:(0,a.A)(r,o),children:t})}},9532:(e,t,n)=>{"use strict";n.d(t,{Be:()=>u,ZC:()=>l,_q:()=>i,dV:()=>s,fM:()=>c});var r=n(6540),a=n(205),o=n(4848);function i(e){const t=(0,r.useRef)(e);return(0,a.A)((()=>{t.current=e}),[e]),(0,r.useCallback)((function(){return t.current(...arguments)}),[])}function l(e){const t=(0,r.useRef)();return(0,a.A)((()=>{t.current=e})),t.current}class s extends Error{constructor(e,t){super(),this.name="ReactContextError",this.message=`Hook ${this.stack?.split("\n")[1]?.match(/at (?:\w+\.)?(?\w+)/)?.groups.name??""} is called outside the <${e}>. ${t??""}`}}function u(e){const t=Object.entries(e);return t.sort(((e,t)=>e[0].localeCompare(t[0]))),(0,r.useMemo)((()=>e),t.flat())}function c(e){return t=>{let{children:n}=t;return(0,o.jsx)(o.Fragment,{children:e.reduceRight(((e,t)=>(0,o.jsx)(t,{children:e})),n)})}}},9169:(e,t,n)=>{"use strict";n.d(t,{Dt:()=>l,ys:()=>i});var r=n(6540),a=n(8328),o=n(4586);function i(e,t){const n=e=>(!e||e.endsWith("/")?e:`${e}/`)?.toLowerCase();return n(e)===n(t)}function l(){const{baseUrl:e}=(0,o.A)().siteConfig;return(0,r.useMemo)((()=>function(e){let{baseUrl:t,routes:n}=e;function r(e){return e.path===t&&!0===e.exact}function a(e){return e.path===t&&!e.exact}return function e(t){if(0===t.length)return;return t.find(r)||e(t.filter(a).flatMap((e=>e.routes??[])))}(n)}({routes:a.A,baseUrl:e})),[e])}},3104:(e,t,n)=>{"use strict";n.d(t,{Mq:()=>p,Tv:()=>c,a_:()=>g,gk:()=>m});var r=n(6540),a=n(8193),o=n(2303),i=n(205),l=n(9532),s=n(4848);const u=r.createContext(void 0);function c(e){let{children:t}=e;const n=function(){const e=(0,r.useRef)(!0);return(0,r.useMemo)((()=>({scrollEventsEnabledRef:e,enableScrollEvents:()=>{e.current=!0},disableScrollEvents:()=>{e.current=!1}})),[])}();return(0,s.jsx)(u.Provider,{value:n,children:t})}function d(){const e=(0,r.useContext)(u);if(null==e)throw new l.dV("ScrollControllerProvider");return e}const f=()=>a.A.canUseDOM?{scrollX:window.pageXOffset,scrollY:window.pageYOffset}:null;function p(e,t){void 0===t&&(t=[]);const{scrollEventsEnabledRef:n}=d(),a=(0,r.useRef)(f()),o=(0,l._q)(e);(0,r.useEffect)((()=>{const e=()=>{if(!n.current)return;const e=f();o(e,a.current),a.current=e},t={passive:!0};return e(),window.addEventListener("scroll",e,t),()=>window.removeEventListener("scroll",e,t)}),[o,n,...t])}function g(){const e=d(),t=function(){const e=(0,r.useRef)({elem:null,top:0}),t=(0,r.useCallback)((t=>{e.current={elem:t,top:t.getBoundingClientRect().top}}),[]),n=(0,r.useCallback)((()=>{const{current:{elem:t,top:n}}=e;if(!t)return{restored:!1};const r=t.getBoundingClientRect().top-n;return r&&window.scrollBy({left:0,top:r}),e.current={elem:null,top:0},{restored:0!==r}}),[]);return(0,r.useMemo)((()=>({save:t,restore:n})),[n,t])}(),n=(0,r.useRef)(void 0),a=(0,r.useCallback)((r=>{t.save(r),e.disableScrollEvents(),n.current=()=>{const{restored:r}=t.restore();if(n.current=void 0,r){const t=()=>{e.enableScrollEvents(),window.removeEventListener("scroll",t)};window.addEventListener("scroll",t)}else e.enableScrollEvents()}}),[e,t]);return(0,i.A)((()=>{queueMicrotask((()=>n.current?.()))})),{blockElementScrollPositionUntilNextRender:a}}function m(){const e=(0,r.useRef)(null),t=(0,o.A)()&&"smooth"===getComputedStyle(document.documentElement).scrollBehavior;return{startScroll:n=>{e.current=t?function(e){return window.scrollTo({top:e,behavior:"smooth"}),()=>{}}(n):function(e){let t=null;const n=document.documentElement.scrollTop>e;return function r(){const a=document.documentElement.scrollTop;(n&&a>e||!n&&at&&cancelAnimationFrame(t)}(n)},cancelScroll:()=>e.current?.()}}},2967:(e,t,n)=>{"use strict";n.d(t,{Cy:()=>r,tU:()=>a});n(4586);const r="default";function a(e,t){return`docs-${e}-${t}`}},9466:(e,t,n)=>{"use strict";n.d(t,{Dv:()=>c,Wf:()=>u});var r=n(6540);const a="localStorage";function o(e){let{key:t,oldValue:n,newValue:r,storage:a}=e;if(n===r)return;const o=document.createEvent("StorageEvent");o.initStorageEvent("storage",!1,!1,t,n,r,window.location.href,a),window.dispatchEvent(o)}function i(e){if(void 0===e&&(e=a),"undefined"==typeof window)throw new Error("Browser storage is not available on Node.js/Docusaurus SSR process.");if("none"===e)return null;try{return window[e]}catch(n){return t=n,l||(console.warn("Docusaurus browser storage is not available.\nPossible reasons: running Docusaurus in an iframe, in an incognito browser session, or using too strict browser privacy settings.",t),l=!0),null}var t}let l=!1;const s={get:()=>null,set:()=>{},del:()=>{},listen:()=>()=>{}};function u(e,t){if("undefined"==typeof window)return function(e){function t(){throw new Error(`Illegal storage API usage for storage key "${e}".\nDocusaurus storage APIs are not supposed to be called on the server-rendering process.\nPlease only call storage APIs in effects and event handlers.`)}return{get:t,set:t,del:t,listen:t}}(e);const n=i(t?.persistence);return null===n?s:{get:()=>{try{return n.getItem(e)}catch(t){return console.error(`Docusaurus storage error, can't get key=${e}`,t),null}},set:t=>{try{const r=n.getItem(e);n.setItem(e,t),o({key:e,oldValue:r,newValue:t,storage:n})}catch(r){console.error(`Docusaurus storage error, can't set ${e}=${t}`,r)}},del:()=>{try{const t=n.getItem(e);n.removeItem(e),o({key:e,oldValue:t,newValue:null,storage:n})}catch(t){console.error(`Docusaurus storage error, can't delete key=${e}`,t)}},listen:t=>{try{const r=r=>{r.storageArea===n&&r.key===e&&t(r)};return window.addEventListener("storage",r),()=>window.removeEventListener("storage",r)}catch(r){return console.error(`Docusaurus storage error, can't listen for changes of key=${e}`,r),()=>{}}}}}function c(e,t){const n=(0,r.useRef)((()=>null===e?s:u(e,t))).current(),a=(0,r.useCallback)((e=>"undefined"==typeof window?()=>{}:n.listen(e)),[n]);return[(0,r.useSyncExternalStore)(a,(()=>"undefined"==typeof window?null:n.get()),(()=>null)),n]}},2131:(e,t,n)=>{"use strict";n.d(t,{o:()=>i});var r=n(4586),a=n(6347),o=n(440);function i(){const{siteConfig:{baseUrl:e,url:t,trailingSlash:n},i18n:{defaultLocale:i,currentLocale:l}}=(0,r.A)(),{pathname:s}=(0,a.zy)(),u=(0,o.applyTrailingSlash)(s,{trailingSlash:n,baseUrl:e}),c=l===i?e:e.replace(`/${l}/`,"/"),d=u.replace(e,"");return{createUrl:function(e){let{locale:n,fullyQualified:r}=e;return`${r?t:""}${function(e){return e===i?`${c}`:`${c}${e}/`}(n)}${d}`}}}},5062:(e,t,n)=>{"use strict";n.d(t,{$:()=>i});var r=n(6540),a=n(6347),o=n(9532);function i(e){const t=(0,a.zy)(),n=(0,o.ZC)(t),i=(0,o._q)(e);(0,r.useEffect)((()=>{n&&t!==n&&i({location:t,previousLocation:n})}),[i,t,n])}},6342:(e,t,n)=>{"use strict";n.d(t,{p:()=>a});var r=n(4586);function a(){return(0,r.A)().siteConfig.themeConfig}},2983:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t){const{trailingSlash:n,baseUrl:r}=t;if(e.startsWith("#"))return e;if(void 0===n)return e;const[a]=e.split(/[#?]/),o="/"===a||a===r?a:(i=a,n?function(e){return e.endsWith("/")?e:`${e}/`}(i):function(e){return e.endsWith("/")?e.slice(0,-1):e}(i));var i;return e.replace(a,o)}},253:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getErrorCausalChain=void 0,t.getErrorCausalChain=function e(t){return t.cause?[t,...e(t.cause)]:[t]}},440:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.getErrorCausalChain=t.applyTrailingSlash=t.blogPostContainerID=void 0,t.blogPostContainerID="__blog-post-container";var a=n(2983);Object.defineProperty(t,"applyTrailingSlash",{enumerable:!0,get:function(){return r(a).default}});var o=n(253);Object.defineProperty(t,"getErrorCausalChain",{enumerable:!0,get:function(){return o.getErrorCausalChain}})},1513:(e,t,n)=>{"use strict";n.d(t,{zR:()=>w,TM:()=>C,yJ:()=>p,sC:()=>T,AO:()=>f});var r=n(8168);function a(e){return"/"===e.charAt(0)}function o(e,t){for(var n=t,r=n+1,a=e.length;r=0;f--){var p=i[f];"."===p?o(i,f):".."===p?(o(i,f),d++):d&&(o(i,f),d--)}if(!u)for(;d--;d)i.unshift("..");!u||""===i[0]||i[0]&&a(i[0])||i.unshift("");var g=i.join("/");return n&&"/"!==g.substr(-1)&&(g+="/"),g};var l=n(1561);function s(e){return"/"===e.charAt(0)?e:"/"+e}function u(e){return"/"===e.charAt(0)?e.substr(1):e}function c(e,t){return function(e,t){return 0===e.toLowerCase().indexOf(t.toLowerCase())&&-1!=="/?#".indexOf(e.charAt(t.length))}(e,t)?e.substr(t.length):e}function d(e){return"/"===e.charAt(e.length-1)?e.slice(0,-1):e}function f(e){var t=e.pathname,n=e.search,r=e.hash,a=t||"/";return n&&"?"!==n&&(a+="?"===n.charAt(0)?n:"?"+n),r&&"#"!==r&&(a+="#"===r.charAt(0)?r:"#"+r),a}function p(e,t,n,a){var o;"string"==typeof e?(o=function(e){var t=e||"/",n="",r="",a=t.indexOf("#");-1!==a&&(r=t.substr(a),t=t.substr(0,a));var o=t.indexOf("?");return-1!==o&&(n=t.substr(o),t=t.substr(0,o)),{pathname:t,search:"?"===n?"":n,hash:"#"===r?"":r}}(e),o.state=t):(void 0===(o=(0,r.A)({},e)).pathname&&(o.pathname=""),o.search?"?"!==o.search.charAt(0)&&(o.search="?"+o.search):o.search="",o.hash?"#"!==o.hash.charAt(0)&&(o.hash="#"+o.hash):o.hash="",void 0!==t&&void 0===o.state&&(o.state=t));try{o.pathname=decodeURI(o.pathname)}catch(l){throw l instanceof URIError?new URIError('Pathname "'+o.pathname+'" could not be decoded. This is likely caused by an invalid percent-encoding.'):l}return n&&(o.key=n),a?o.pathname?"/"!==o.pathname.charAt(0)&&(o.pathname=i(o.pathname,a.pathname)):o.pathname=a.pathname:o.pathname||(o.pathname="/"),o}function g(){var e=null;var t=[];return{setPrompt:function(t){return e=t,function(){e===t&&(e=null)}},confirmTransitionTo:function(t,n,r,a){if(null!=e){var o="function"==typeof e?e(t,n):e;"string"==typeof o?"function"==typeof r?r(o,a):a(!0):a(!1!==o)}else a(!0)},appendListener:function(e){var n=!0;function r(){n&&e.apply(void 0,arguments)}return t.push(r),function(){n=!1,t=t.filter((function(e){return e!==r}))}},notifyListeners:function(){for(var e=arguments.length,n=new Array(e),r=0;rt?n.splice(t,n.length-t,a):n.push(a),d({action:r,location:a,index:t,entries:n})}}))},replace:function(e,t){var r="REPLACE",a=p(e,t,m(),w.location);c.confirmTransitionTo(a,r,n,(function(e){e&&(w.entries[w.index]=a,d({action:r,location:a}))}))},go:v,goBack:function(){v(-1)},goForward:function(){v(1)},canGo:function(e){var t=w.index+e;return t>=0&&t{"use strict";var r=n(4363),a={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},o={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},i={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},l={};function s(e){return r.isMemo(e)?i:l[e.$$typeof]||a}l[r.ForwardRef]={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},l[r.Memo]=i;var u=Object.defineProperty,c=Object.getOwnPropertyNames,d=Object.getOwnPropertySymbols,f=Object.getOwnPropertyDescriptor,p=Object.getPrototypeOf,g=Object.prototype;e.exports=function e(t,n,r){if("string"!=typeof n){if(g){var a=p(n);a&&a!==g&&e(t,a,r)}var i=c(n);d&&(i=i.concat(d(n)));for(var l=s(t),m=s(n),h=0;h{"use strict";e.exports=function(e,t,n,r,a,o,i,l){if(!e){var s;if(void 0===t)s=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var u=[n,r,a,o,i,l],c=0;(s=new Error(t.replace(/%s/g,(function(){return u[c++]})))).name="Invariant Violation"}throw s.framesToPop=1,s}}},4634:e=>{e.exports=Array.isArray||function(e){return"[object Array]"==Object.prototype.toString.call(e)}},119:(e,t,n)=>{"use strict";n.r(t)},1043:(e,t,n)=>{"use strict";n.r(t)},5947:function(e,t,n){var r,a;r=function(){var e,t,n={version:"0.2.0"},r=n.settings={minimum:.08,easing:"ease",positionUsing:"",speed:200,trickle:!0,trickleRate:.02,trickleSpeed:800,showSpinner:!0,barSelector:'[role="bar"]',spinnerSelector:'[role="spinner"]',parent:"body",template:'
'};function a(e,t,n){return en?n:e}function o(e){return 100*(-1+e)}function i(e,t,n){var a;return(a="translate3d"===r.positionUsing?{transform:"translate3d("+o(e)+"%,0,0)"}:"translate"===r.positionUsing?{transform:"translate("+o(e)+"%,0)"}:{"margin-left":o(e)+"%"}).transition="all "+t+"ms "+n,a}n.configure=function(e){var t,n;for(t in e)void 0!==(n=e[t])&&e.hasOwnProperty(t)&&(r[t]=n);return this},n.status=null,n.set=function(e){var t=n.isStarted();e=a(e,r.minimum,1),n.status=1===e?null:e;var o=n.render(!t),u=o.querySelector(r.barSelector),c=r.speed,d=r.easing;return o.offsetWidth,l((function(t){""===r.positionUsing&&(r.positionUsing=n.getPositioningCSS()),s(u,i(e,c,d)),1===e?(s(o,{transition:"none",opacity:1}),o.offsetWidth,setTimeout((function(){s(o,{transition:"all "+c+"ms linear",opacity:0}),setTimeout((function(){n.remove(),t()}),c)}),c)):setTimeout(t,c)})),this},n.isStarted=function(){return"number"==typeof n.status},n.start=function(){n.status||n.set(0);var e=function(){setTimeout((function(){n.status&&(n.trickle(),e())}),r.trickleSpeed)};return r.trickle&&e(),this},n.done=function(e){return e||n.status?n.inc(.3+.5*Math.random()).set(1):this},n.inc=function(e){var t=n.status;return t?("number"!=typeof e&&(e=(1-t)*a(Math.random()*t,.1,.95)),t=a(t+e,0,.994),n.set(t)):n.start()},n.trickle=function(){return n.inc(Math.random()*r.trickleRate)},e=0,t=0,n.promise=function(r){return r&&"resolved"!==r.state()?(0===t&&n.start(),e++,t++,r.always((function(){0==--t?(e=0,n.done()):n.set((e-t)/e)})),this):this},n.render=function(e){if(n.isRendered())return document.getElementById("nprogress");c(document.documentElement,"nprogress-busy");var t=document.createElement("div");t.id="nprogress",t.innerHTML=r.template;var a,i=t.querySelector(r.barSelector),l=e?"-100":o(n.status||0),u=document.querySelector(r.parent);return s(i,{transition:"all 0 linear",transform:"translate3d("+l+"%,0,0)"}),r.showSpinner||(a=t.querySelector(r.spinnerSelector))&&p(a),u!=document.body&&c(u,"nprogress-custom-parent"),u.appendChild(t),t},n.remove=function(){d(document.documentElement,"nprogress-busy"),d(document.querySelector(r.parent),"nprogress-custom-parent");var e=document.getElementById("nprogress");e&&p(e)},n.isRendered=function(){return!!document.getElementById("nprogress")},n.getPositioningCSS=function(){var e=document.body.style,t="WebkitTransform"in e?"Webkit":"MozTransform"in e?"Moz":"msTransform"in e?"ms":"OTransform"in e?"O":"";return t+"Perspective"in e?"translate3d":t+"Transform"in e?"translate":"margin"};var l=function(){var e=[];function t(){var n=e.shift();n&&n(t)}return function(n){e.push(n),1==e.length&&t()}}(),s=function(){var e=["Webkit","O","Moz","ms"],t={};function n(e){return e.replace(/^-ms-/,"ms-").replace(/-([\da-z])/gi,(function(e,t){return t.toUpperCase()}))}function r(t){var n=document.body.style;if(t in n)return t;for(var r,a=e.length,o=t.charAt(0).toUpperCase()+t.slice(1);a--;)if((r=e[a]+o)in n)return r;return t}function a(e){return e=n(e),t[e]||(t[e]=r(e))}function o(e,t,n){t=a(t),e.style[t]=n}return function(e,t){var n,r,a=arguments;if(2==a.length)for(n in t)void 0!==(r=t[n])&&t.hasOwnProperty(n)&&o(e,n,r);else o(e,a[1],a[2])}}();function u(e,t){return("string"==typeof e?e:f(e)).indexOf(" "+t+" ")>=0}function c(e,t){var n=f(e),r=n+t;u(n,t)||(e.className=r.substring(1))}function d(e,t){var n,r=f(e);u(e,t)&&(n=r.replace(" "+t+" "," "),e.className=n.substring(1,n.length-1))}function f(e){return(" "+(e.className||"")+" ").replace(/\s+/gi," ")}function p(e){e&&e.parentNode&&e.parentNode.removeChild(e)}return n},void 0===(a="function"==typeof r?r.call(t,n,t,e):r)||(e.exports=a)},5302:(e,t,n)=>{var r=n(4634);e.exports=p,e.exports.parse=o,e.exports.compile=function(e,t){return l(o(e,t),t)},e.exports.tokensToFunction=l,e.exports.tokensToRegExp=f;var a=new RegExp(["(\\\\.)","([\\/.])?(?:(?:\\:(\\w+)(?:\\(((?:\\\\.|[^\\\\()])+)\\))?|\\(((?:\\\\.|[^\\\\()])+)\\))([+*?])?|(\\*))"].join("|"),"g");function o(e,t){for(var n,r=[],o=0,i=0,l="",c=t&&t.delimiter||"/";null!=(n=a.exec(e));){var d=n[0],f=n[1],p=n.index;if(l+=e.slice(i,p),i=p+d.length,f)l+=f[1];else{var g=e[i],m=n[2],h=n[3],y=n[4],b=n[5],v=n[6],w=n[7];l&&(r.push(l),l="");var k=null!=m&&null!=g&&g!==m,x="+"===v||"*"===v,S="?"===v||"*"===v,E=n[2]||c,_=y||b;r.push({name:h||o++,prefix:m||"",delimiter:E,optional:S,repeat:x,partial:k,asterisk:!!w,pattern:_?u(_):w?".*":"[^"+s(E)+"]+?"})}}return i{Prism.languages.json={property:{pattern:/(^|[^\\])"(?:\\.|[^\\"\r\n])*"(?=\s*:)/,lookbehind:!0,greedy:!0},string:{pattern:/(^|[^\\])"(?:\\.|[^\\"\r\n])*"(?!\s*:)/,lookbehind:!0,greedy:!0},comment:{pattern:/\/\/.*|\/\*[\s\S]*?(?:\*\/|$)/,greedy:!0},number:/-?\b\d+(?:\.\d+)?(?:e[+-]?\d+)?\b/i,punctuation:/[{}[\],]/,operator:/:/,boolean:/\b(?:false|true)\b/,null:{pattern:/\bnull\b/,alias:"keyword"}},Prism.languages.webmanifest=Prism.languages.json},9700:()=>{!function(e){function t(e,t){return"___"+e.toUpperCase()+t+"___"}Object.defineProperties(e.languages["markup-templating"]={},{buildPlaceholders:{value:function(n,r,a,o){if(n.language===r){var i=n.tokenStack=[];n.code=n.code.replace(a,(function(e){if("function"==typeof o&&!o(e))return e;for(var a,l=i.length;-1!==n.code.indexOf(a=t(r,l));)++l;return i[l]=e,a})),n.grammar=e.languages.markup}}},tokenizePlaceholders:{value:function(n,r){if(n.language===r&&n.tokenStack){n.grammar=e.languages[r];var a=0,o=Object.keys(n.tokenStack);!function i(l){for(var s=0;s=o.length);s++){var u=l[s];if("string"==typeof u||u.content&&"string"==typeof u.content){var c=o[a],d=n.tokenStack[c],f="string"==typeof u?u:u.content,p=t(r,c),g=f.indexOf(p);if(g>-1){++a;var m=f.substring(0,g),h=new e.Token(r,e.tokenize(d,n.grammar),"language-"+r,d),y=f.substring(g+p.length),b=[];m&&b.push.apply(b,i([m])),b.push(h),y&&b.push.apply(b,i([y])),"string"==typeof u?l.splice.apply(l,[s,1].concat(b)):u.content=b}}else u.content&&i(u.content)}return l}(n.tokens)}}}})}(Prism)},9535:()=>{!function(e){var t=/\b(?:bool|bytes|double|s?fixed(?:32|64)|float|[su]?int(?:32|64)|string)\b/;e.languages.protobuf=e.languages.extend("clike",{"class-name":[{pattern:/(\b(?:enum|extend|message|service)\s+)[A-Za-z_]\w*(?=\s*\{)/,lookbehind:!0},{pattern:/(\b(?:rpc\s+\w+|returns)\s*\(\s*(?:stream\s+)?)\.?[A-Za-z_]\w*(?:\.[A-Za-z_]\w*)*(?=\s*\))/,lookbehind:!0}],keyword:/\b(?:enum|extend|extensions|import|message|oneof|option|optional|package|public|repeated|required|reserved|returns|rpc(?=\s+\w)|service|stream|syntax|to)\b(?!\s*=\s*\d)/,function:/\b[a-z_]\w*(?=\s*\()/i}),e.languages.insertBefore("protobuf","operator",{map:{pattern:/\bmap<\s*[\w.]+\s*,\s*[\w.]+\s*>(?=\s+[a-z_]\w*\s*[=;])/i,alias:"class-name",inside:{punctuation:/[<>.,]/,builtin:t}},builtin:t,"positional-class-name":{pattern:/(?:\b|\B\.)[a-z_]\w*(?:\.[a-z_]\w*)*(?=\s+[a-z_]\w*\s*[=;])/i,alias:"class-name",inside:{punctuation:/\./}},annotation:{pattern:/(\[\s*)[a-z_]\w*(?=\s*=)/i,lookbehind:!0}})}(Prism)},3314:(e,t,n)=>{var r={"./prism-json":2514,"./prism-protobuf":9535};function a(e){var t=o(e);return n(t)}function o(e){if(!n.o(r,e)){var t=new Error("Cannot find module '"+e+"'");throw t.code="MODULE_NOT_FOUND",t}return r[e]}a.keys=function(){return Object.keys(r)},a.resolve=o,e.exports=a,a.id=3314},2694:(e,t,n)=>{"use strict";var r=n(6925);function a(){}function o(){}o.resetWarningCache=a,e.exports=function(){function e(e,t,n,a,o,i){if(i!==r){var l=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw l.name="Invariant Violation",l}}function t(){return e}e.isRequired=e;var n={array:e,bigint:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:o,resetWarningCache:a};return n.PropTypes=n,n}},5556:(e,t,n)=>{e.exports=n(2694)()},6925:e=>{"use strict";e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},2551:(e,t,n)=>{"use strict";var r=n(6540),a=n(9982);function o(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;n