Added metadata to provide more information about the extension.
"
25 |
26 | COPY --from=builder /backend/bin/service /
27 | COPY docker-compose.yaml .
28 | COPY metadata.json .
29 | COPY docker.svg .
30 | COPY ui/src ./ui
31 | CMD /service -socket /run/guest-services/extension-volumes.sock
32 |
--------------------------------------------------------------------------------
/samples/vm-service/vm/internal/socket/socket_unix.go:
--------------------------------------------------------------------------------
1 | // +build !windows
2 |
3 | package socket
4 |
5 | import (
6 | "fmt"
7 | "net"
8 | "os"
9 | "path/filepath"
10 | )
11 |
12 | // ListenUnix wraps `net.ListenUnix`.
13 | func ListenUnix(path string) (*net.UnixListener, error) {
14 | if err := os.Remove(path); err != nil && !os.IsNotExist(err) {
15 | return nil, err
16 | }
17 | // Make sure the parent directory exists.
18 | dir := filepath.Dir(path)
19 | if err := os.MkdirAll(dir, 0755); err != nil {
20 | return nil, err
21 | }
22 | short, err := shortenUnixSocketPath(path)
23 | if err != nil {
24 | return nil, err
25 | }
26 | return net.ListenUnix("unix", &net.UnixAddr{Name: short, Net: "unix"})
27 | }
28 |
29 | func DialSocket(socket string) (net.Conn, error) {
30 | return net.Dial("unix", socket)
31 | }
32 |
33 | func shortenUnixSocketPath(path string) (string, error) {
34 | if len(path) <= maxUnixSocketPathLen {
35 | return path, nil
36 | }
37 | // absolute path is too long, attempt to use a relative path
38 | p, err := relative(path)
39 | if err != nil {
40 | return "", err
41 | }
42 |
43 | if len(p) > maxUnixSocketPathLen {
44 | return "", fmt.Errorf("absolute and relative socket path %s longer than %d characters", p, maxUnixSocketPathLen)
45 | }
46 | return p, nil
47 | }
48 |
49 | func relative(p string) (string, error) {
50 | // Assume the parent directory exists already but the child (the socket)
51 | // hasn't been created.
52 | path2, err := filepath.EvalSymlinks(filepath.Dir(p))
53 | if err != nil {
54 | return "", err
55 | }
56 | dir, err := os.Getwd()
57 | if err != nil {
58 | return "", err
59 | }
60 | dir2, err := filepath.EvalSymlinks(dir)
61 | if err != nil {
62 | return "", err
63 | }
64 | rel, err := filepath.Rel(dir2, path2)
65 | if err != nil {
66 | return "", err
67 | }
68 | return filepath.Join(rel, filepath.Base(p)), nil
69 | }
70 |
--------------------------------------------------------------------------------
/.github/ISSUE_TEMPLATE/bug_report.md:
--------------------------------------------------------------------------------
1 | ---
2 | name: Bug report
3 | about: Create a report to help us improve
4 | title: ""
5 | labels: bug
6 | title: ""
7 | ---
8 |
9 |
15 |
16 | **Describe the bug**
17 | A clear and concise description of what the bug is.
18 |
19 | **Add the steps to reproduce**
20 | Steps to reproduce the behavior:
21 |
22 | 1. Go to '...'
23 | 2. Click on '....'
24 | 3. Scroll down to '....'
25 | 4. See error
26 |
27 | **Describe the expected behavior**
28 | A clear and concise description of what you expected to happen.
29 |
30 | **Optional: Add screenshots**
31 | If applicable, add screenshots to help explain your problem.
32 |
33 | **Output of `docker extension version`:**
34 |
35 | ```
36 | (paste your output here)
37 | ```
38 |
39 | **Output of `docker version`:**
40 |
41 | ```
42 | (paste your output here)
43 | ```
44 |
45 | **Include the Diagnostics ID**
46 |
47 |
56 |
57 | ```
58 | (paste your output here)
59 | ```
60 |
61 | **Additional context**
62 | Add any other context about the problem here.
63 |
--------------------------------------------------------------------------------
/samples/kubernetes-sample-extension/Dockerfile:
--------------------------------------------------------------------------------
1 | FROM --platform=$BUILDPLATFORM node:18.3.0-alpine3.16 AS client-builder
2 |
3 | WORKDIR /ui
4 |
5 | # cache packages in layer
6 | COPY ui/package.json /ui/package.json
7 | COPY ui/package-lock.json /ui/package-lock.json
8 |
9 | RUN --mount=type=cache,target=/usr/src/app/.npm \
10 | npm set cache /usr/src/app/.npm && \
11 | npm ci
12 |
13 | # install
14 | COPY ui /ui
15 | RUN npm run build
16 |
17 | FROM alpine
18 | LABEL org.opencontainers.image.title="Kubernetes Sample" \
19 | org.opencontainers.image.description="This is a sample Docker Extension that shows how to interact with a Kubernetes cluster by shipping the kubectl command line too to read the kubeconfig file from your host filesystem." \
20 | org.opencontainers.image.vendor="Docker" \
21 | org.opencontainers.image.licenses="Apache-2.0" \
22 | com.docker.desktop.extension.icon="" \
23 | com.docker.desktop.extension.api.version=">= 0.2.3" \
24 | com.docker.extension.screenshots="" \
25 | com.docker.extension.detailed-description="" \
26 | com.docker.extension.publisher-url="" \
27 | com.docker.extension.additional-urls="" \
28 | com.docker.extension.changelog=""
29 |
30 | RUN apk add curl
31 | RUN curl -LO https://storage.googleapis.com/kubernetes-release/release/$(curl -s https://storage.googleapis.com/kubernetes-release/release/stable.txt)/bin/linux/amd64/kubectl \
32 | && chmod +x ./kubectl && mv ./kubectl /usr/local/bin/kubectl \
33 | && mkdir /linux \
34 | && cp /usr/local/bin/kubectl /linux/
35 |
36 | RUN curl -LO "https://dl.k8s.io/release/$(curl -L -s https://dl.k8s.io/release/stable.txt)/bin/darwin/amd64/kubectl" \
37 | && mkdir /darwin \
38 | && chmod +x ./kubectl && mv ./kubectl /darwin/
39 |
40 | RUN curl -LO "https://dl.k8s.io/release/$(curl -L -s https://dl.k8s.io/release/stable.txt)/bin/windows/amd64/kubectl.exe" \
41 | && mkdir /windows \
42 | && chmod +x ./kubectl.exe && mv ./kubectl.exe /windows/
43 |
44 | COPY metadata.json .
45 | COPY docker.svg .
46 | COPY --from=client-builder /ui/build ui
47 |
--------------------------------------------------------------------------------
/samples/kubernetes-sample-extension/ui/src/helper/kubernetes.ts:
--------------------------------------------------------------------------------
1 | import { v1 } from "@docker/extension-api-client-types";
2 |
3 | export const DockerDesktop = "docker-desktop";
4 | export const CurrentExtensionContext = "currentExtensionContext";
5 | export const IsK8sEnabled = "isK8sEnabled";
6 |
7 | export const listHostContexts = async (ddClient: v1.DockerDesktopClient) => {
8 | const output = await ddClient.extension.host?.cli.exec("kubectl", [
9 | "config",
10 | "view",
11 | "-o",
12 | "jsonpath='{.contexts}'",
13 | ]);
14 | console.log(output);
15 | if (output?.stderr) {
16 | console.log(output.stderr);
17 | return output.stderr;
18 | }
19 |
20 | return output?.stdout;
21 | };
22 |
23 | export const setDockerDesktopContext = async (
24 | ddClient: v1.DockerDesktopClient
25 | ) => {
26 | const output = await ddClient.extension.host?.cli.exec("kubectl", [
27 | "config",
28 | "use-context",
29 | "docker-desktop",
30 | ]);
31 | console.log(output);
32 | if (output?.stderr) {
33 | return output.stderr;
34 | }
35 | return output?.stdout;
36 | };
37 |
38 | export const getCurrentHostContext = async (
39 | ddClient: v1.DockerDesktopClient
40 | ) => {
41 | const output = await ddClient.extension.host?.cli.exec("kubectl", [
42 | "config",
43 | "view",
44 | "-o",
45 | "jsonpath='{.current-context}'",
46 | ]);
47 | console.log(output);
48 | if (output?.stderr) {
49 | return output.stderr;
50 | }
51 | return output?.stdout;
52 | };
53 |
54 | export const checkK8sConnection = async (ddClient: v1.DockerDesktopClient) => {
55 | try {
56 | let output = await ddClient.extension.host?.cli.exec("kubectl", [
57 | "cluster-info",
58 | "--request-timeout",
59 | "2s",
60 | ]);
61 | console.log(output);
62 | if (output?.stderr) {
63 | console.log(output.stderr);
64 | return "false";
65 | }
66 | return "true";
67 | } catch (e: any) {
68 | console.log("[checkK8sConnection] error : ", e);
69 | return "false";
70 | }
71 | };
72 |
73 | export const listNamespaces = async (ddClient: v1.DockerDesktopClient) => {
74 | const output = await ddClient.extension.host?.cli.exec("kubectl", [
75 | "get",
76 | "namespaces",
77 | "--no-headers",
78 | "-o",
79 | 'custom-columns=":metadata.name"',
80 | "--context",
81 | "docker-desktop",
82 | ]);
83 | console.log(output);
84 | if (output?.stderr) {
85 | return output.stderr;
86 | }
87 | return output?.stdout;
88 | };
89 |
--------------------------------------------------------------------------------
/samples/oauth-sample/ui/src/App.tsx:
--------------------------------------------------------------------------------
1 | import React from "react";
2 | import Button from "@mui/material/Button";
3 | import { createDockerDesktopClient } from "@docker/extension-api-client";
4 | import { Stack, TextField, Typography } from "@mui/material";
5 |
6 | const client = createDockerDesktopClient();
7 |
8 | const client_id = "xxxx";
9 | const client_secret = "xxxx";
10 |
11 | function useDockerDesktopClient() {
12 | return client;
13 | }
14 |
15 | export function App() {
16 | const [response, setResponse] = React.useState();
17 | const [loggedIn, setLoggedIn] = React.useState(false);
18 | const ddClient = useDockerDesktopClient();
19 |
20 | const queryParams = new URLSearchParams(window.location.search);
21 | console.log("query: " + queryParams.toString());
22 |
23 | if (!loggedIn && queryParams.get("code")) {
24 | console.log("processing POST with code " + queryParams.get("code"));
25 | const requestOptions = {
26 | method: "POST",
27 | };
28 | fetch(
29 | `https://github.com/login/oauth/access_token?client_id=${client_id}&client_secret=${client_secret}&code=${queryParams.get(
30 | "code"
31 | )}`,
32 | requestOptions
33 | )
34 | .then((response) => response.text())
35 | .then((data) => {
36 | setLoggedIn(true);
37 | setResponse(data);
38 | });
39 | }
40 |
41 | const login = async () => {
42 | ddClient.host.openExternal(
43 | `https://github.com/login/oauth/authorize?client_id=${client_id}`
44 | );
45 | };
46 |
47 | return (
48 | <>
49 | Docker extension Oauth demo
50 |
51 | This is a basic page using OAuth to login in using GitHub OAuth as an
52 | example.
53 |
54 |
55 | Pressing the below button will trigger a login flow and retrieve a
56 | GitHub authentication token once the user is authenticated.
57 |
58 |
59 |
62 |
71 |
72 | >
73 | );
74 | }
75 |
--------------------------------------------------------------------------------
/samples/kubernetes-sample-extension/ui/src/App.tsx:
--------------------------------------------------------------------------------
1 | import React from "react";
2 | import Button from "@mui/material/Button";
3 | import { createDockerDesktopClient } from "@docker/extension-api-client";
4 | import { Grid, Stack, TextField, Typography } from "@mui/material";
5 | import {
6 | checkK8sConnection,
7 | getCurrentHostContext,
8 | listHostContexts,
9 | listNamespaces,
10 | setDockerDesktopContext,
11 | } from "./helper/kubernetes";
12 |
13 | // Note: This line relies on Docker Desktop's presence as a host application.
14 | // If you're running this React app in a browser, it won't work properly.
15 | const client = createDockerDesktopClient();
16 |
17 | function useDockerDesktopClient() {
18 | return client;
19 | }
20 |
21 | export function App() {
22 | const [response, setResponse] = React.useState();
23 | const ddClient = useDockerDesktopClient();
24 |
25 | return (
26 | <>
27 | Kubernetes Sample extension
28 |
29 | This is a sample Docker Extension that shows how to interact with a
30 | Kubernetes cluster by shipping the kubectl command line too to read the
31 | kubeconfig file from your host filesystem.
32 |
33 |
34 |
35 |
36 |
45 |
46 |
55 |
56 |
65 |
66 |
75 |
76 |
85 |
86 |
87 |
88 |
97 |
98 |
99 | >
100 | );
101 | }
102 |
--------------------------------------------------------------------------------
/samples/oauth-sample/docker.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/samples/kubernetes-sample-extension/docker.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/samples/oauth-sample/README.md:
--------------------------------------------------------------------------------
1 | # My extension
2 |
3 | This sample shows how to implement oauth login with extensions.
4 |
5 | This extension is composed of a [frontend](./ui) app in React that shows a login button. When clicked, it will open the browsser to perform a github login, and obtain a oauth token (that will be displayed for the sake of this example).
6 |
7 |
8 |
9 | ## Prepare oauth configuration
10 |
11 | In order to run this example, you needed to create a GitHub OAuth app. See details at https://docs.github.com/en/developers/apps/building-oauth-apps/creating-an-oauth-app
12 |
13 | You can then get a client ID and client secret from the OAuth app, and set the values in /ui/src/App.tsx
14 |
15 | In the OAuth app, you can also set the Authorization callback URL to `docker-desktop://dashboard/extension-tab?extensionId=samples/oauth-extension`. This tells GitHub to redirect to the extension in Docker Desktop at the end of the login process. (Note: this can be configured in code as well, options are dependent on the OAuth provider)
16 |
17 | See details about the overall OAuth flow in the [Extension OAuth documentation](https://docs.docker.com/desktop/extensions-sdk/guides/oauth2-flow/)
18 |
19 | ## Local development
20 |
21 | You can use `docker` to build, install and push your extension. Also, we provide an opinionated [Makefile](Makefile) that could be convenient for you. There isn't a strong preference of using one over the other, so just use the one you're most comfortable with.
22 |
23 | To build the extension, use `make build-extension` **or**:
24 |
25 | ```shell
26 | docker buildx build -t my/awesome-extension:latest . --load
27 | ```
28 |
29 | To install the extension, use `make install-extension` **or**:
30 |
31 | ```shell
32 | docker extension install my/awesome-extension:latest
33 | ```
34 |
35 | > If you want to automate this command, use the `-f` or `--force` flag to accept the warning message.
36 |
37 | To preview the extension in Docker Desktop, open Docker Dashboard once the installation is complete. The left-hand menu displays a new tab with the name of your extension. You can also use `docker extension ls` to see that the extension has been installed successfully.
38 |
39 | ### Frontend development
40 |
41 | During the development of the frontend part, it's helpful to use hot reloading to test your changes without rebuilding your entire extension. To do this, you can configure Docker Desktop to load your UI from a development server.
42 | Assuming your app runs on the default port, start your UI app and then run:
43 |
44 | ```shell
45 | cd ui
46 | npm install
47 | npm run dev
48 | ```
49 |
50 | This starts a development server that listens on port `3000`.
51 |
52 | You can now tell Docker Desktop to use this as the frontend source. In another terminal run:
53 |
54 | ```shell
55 | docker extension dev ui-source my/awesome-extension:latest http://localhost:3000
56 | ```
57 |
58 | In order to open the Chrome Dev Tools for your extension when you click on the extension tab, run:
59 |
60 | ```shell
61 | docker extension dev debug my/awesome-extension:latest
62 | ```
63 |
64 | Each subsequent click on the extension tab will also open Chrome Dev Tools. To stop this behaviour, run:
65 |
66 | ```shell
67 | docker extension dev reset my/awesome-extension:latest
68 | ```
69 |
70 | ### Clean up
71 |
72 | To remove the extension:
73 |
74 | ```shell
75 | docker extension rm my/awesome-extension:latest
76 | ```
77 |
78 | ## What's next?
79 |
80 | - To learn more about how to build your extension refer to the Extension SDK docs at https://docs.docker.com/desktop/extensions-sdk/.
81 | - To publish your extension in the Marketplace visit https://www.docker.com/products/extensions/submissions/.
82 | - To report issues and feedback visit https://github.com/docker/extensions-sdk/issues.
83 | - To look for other ideas of new extensions, or propose new ideas of extensions you would like to see, visit https://github.com/docker/extension-ideas/discussions.
84 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # Docker Extensions
2 |
3 | This repository includes the Extensions CLI and samples to create Docker Extensions.
4 |
5 | ## Prerequisites
6 |
7 | To get started with Docker Extensions you will need the [latest version of Docker Desktop](https://docs.docker.com/desktop/release-notes/). The Docker extension CLI is bundled by default with Docker Desktop version 4.10.0 and higher.
8 |
9 | ## Tutorials
10 |
11 | - [Create a minimal frontend extension](https://docs.docker.com/desktop/extensions-sdk/build/set-up/minimal-frontend-extension/) - a minimal Desktop Extension containing only a UI part based on HTML.
12 | - [Create a minimal backend extension](https://docs.docker.com/desktop/extensions-sdk/build/set-up/minimal-backend-extension/) - a Desktop Extension containing a UI part connecting to a minimal backend.
13 | - [Create a minimal Docker CLI extension](https://docs.docker.com/desktop/extensions-sdk/build/set-up/minimal-frontend-using-docker-cli/) - a minimal Desktop Extension containing only a UI part that invokes Docker CLI commands.
14 | - [Create a ReactJS-based extension](https://docs.docker.com/desktop/extensions-sdk/build/set-up/react-extension/) - a minimal Desktop Extension containing only a UI part based on ReactJS.
15 |
16 | ## Extensions SDK documentation
17 |
18 | Documentation about the Extensions SDK and creating your own extensions can be found [here](https://docs.docker.com/desktop/extensions-sdk/).
19 |
20 | [Contributions](https://github.com/docker/docker.github.io/blob/master/CONTRIBUTING.md) are welcome to update/improve documentation content (see extensions SDK under [desktop/extensions-sdk folder](https://github.com/docker/docker.github.io/tree/master/desktop/extensions-sdk))
21 |
22 | ## Docker Extension Model
23 |
24 | Desktop Extensions are packaged and distributed as Docker images.
25 | Development of extensions can be done locally without the need to push the extension to Docker Hub.
26 | This is described in [Extension Distribution](https://docs.docker.com/desktop/extensions-sdk/extensions/DISTRIBUTION/).
27 |
28 | The extension image must have some specific content as described in [Extension Metadata](https://docs.docker.com/desktop/extensions-sdk/extensions/METADATA/).
29 |
30 | ## Developing Docker Extensions
31 |
32 | The [Extensions CLI](https://docs.docker.com/desktop/extensions-sdk/dev/usage/) is an extension development tool that can be used to manage Docker extensions.
33 |
34 | This repository contains multiple extensions, each one is defined in an individual directories at the root of the repository.
35 | These are Docker developed samples that are not meant to be final products.
36 |
37 | To try one of them, navigate to the directory of the extension then [use the CLI to build and install the extension](https://docs.docker.com/desktop/extensions-sdk/build/build-install/) on Docker Desktop.
38 |
39 | The [Quickstart guide](https://docs.docker.com/desktop/extensions-sdk/quickstart/) describes how to get started developing your custom Docker Extension. It also covers how to open the Chrome Dev Tools and show the extension containers.
40 |
41 | The extension UI has access to an extension API to invoke backend operations from the UI, e.g. listing running containers, images, etc.
42 | Furthermore, you can communicate with your extension backend service or invoke a binary on the host or in the VM.
43 |
44 | ### UI Guidelines
45 |
46 | We are currently in the process of developing our design system but in the meantime, here are some [UI guidelines](https://www.figma.com/file/U7pLWfEf6IQKUHLhdateBI/Docker-Design-Guidelines?node-id=1%3A28771). Docker Desktop's UI is written in React and [Material UI](https://mui.com/), and we strongly recommend adopting this combination in your extensions as well. This brings the benefit of using our [Material UI Theme](https://www.npmjs.com/package/@docker/docker-mui-theme) to easily replicate Docker Desktop's look & feel, and we'll continue to release libraries and utilities targeting this combination.
47 |
48 | You can read more about our design guidelines [here](https://docs.docker.com/desktop/extensions-sdk/design/design-guidelines/).
49 |
--------------------------------------------------------------------------------
/samples/vm-service/vm/go.sum:
--------------------------------------------------------------------------------
1 | github.com/Microsoft/go-winio v0.5.0 h1:Elr9Wn+sGKPlkaBvwu4mTrxtmOp3F3yV9qhaHbXGjwU=
2 | github.com/Microsoft/go-winio v0.5.0/go.mod h1:JPGBdM1cNvN/6ISo+n8V5iA4v8pBzdOpzfwIujj1a84=
3 | github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
4 | github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
5 | github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
6 | github.com/labstack/echo v3.3.10+incompatible h1:pGRcYk231ExFAyoAjAfD85kQzRJCRI8bbnE7CX5OEgg=
7 | github.com/labstack/echo v3.3.10+incompatible/go.mod h1:0INS7j/VjnFxD4E2wkz67b8cVwCLbBmJyDaka6Cmk1s=
8 | github.com/labstack/gommon v0.3.0 h1:JEeO0bvc78PKdyHxloTKiF8BD5iGrH8T6MSeGvSgob0=
9 | github.com/labstack/gommon v0.3.0/go.mod h1:MULnywXg0yavhxWKc+lOruYdAhDwPK9wf0OL7NoOu+k=
10 | github.com/mattn/go-colorable v0.1.2 h1:/bC9yWikZXAL9uJdulbSfyVNIR3n3trXl+v8+1sx8mU=
11 | github.com/mattn/go-colorable v0.1.2/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVcfRqFIhoBtE=
12 | github.com/mattn/go-isatty v0.0.8/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s=
13 | github.com/mattn/go-isatty v0.0.9 h1:d5US/mDsogSGW37IV293h//ZFaeajb69h+EHFsv2xGg=
14 | github.com/mattn/go-isatty v0.0.9/go.mod h1:YNRxwqDuOph6SZLI9vUUz6OYw3QyUt7WiY2yME+cCiQ=
15 | github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4=
16 | github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
17 | github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
18 | github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
19 | github.com/sirupsen/logrus v1.7.0/go.mod h1:yWOB1SBYBC5VeMP7gHvWumXLIWorT60ONWic61uBYv0=
20 | github.com/sirupsen/logrus v1.8.1 h1:dJKuHgqk1NNQlqoA6BTlM1Wf9DOH3NBjQyu0h9+AZZE=
21 | github.com/sirupsen/logrus v1.8.1/go.mod h1:yWOB1SBYBC5VeMP7gHvWumXLIWorT60ONWic61uBYv0=
22 | github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
23 | github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs=
24 | github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4=
25 | github.com/stretchr/testify v1.7.0 h1:nwc3DEeHmmLAfoZucVR881uASk0Mfjw8xYJ99tb5CcY=
26 | github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
27 | github.com/valyala/bytebufferpool v1.0.0 h1:GqA5TC/0021Y/b9FG4Oi9Mr3q7XYx6KllzawFIhcdPw=
28 | github.com/valyala/bytebufferpool v1.0.0/go.mod h1:6bBcMArwyJ5K/AmCkWv1jt77kVWyCJ6HpOuEn7z0Csc=
29 | github.com/valyala/fasttemplate v1.0.1 h1:tY9CJiPnMXf1ERmG2EyK7gNUd+c6RKGD0IfU8WdUSz8=
30 | github.com/valyala/fasttemplate v1.0.1/go.mod h1:UQGH1tvbgY+Nz5t2n7tXsz52dQxojPUpymEIMZ47gx8=
31 | github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY=
32 | golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
33 | golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc=
34 | golang.org/x/crypto v0.19.0/go.mod h1:Iy9bg/ha4yyC70EfRS8jz+B6ybOBKMaSxLj6P6oBDfU=
35 | golang.org/x/crypto v0.21.0 h1:X31++rzVUdKhX5sWmSOFZxx8UW/ldWx55cbf08iNAMA=
36 | golang.org/x/crypto v0.21.0/go.mod h1:0BP7YvVV9gBbVKyeTG0Gyn+gZm94bibOW5BjDEYAOMs=
37 | golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4=
38 | golang.org/x/mod v0.8.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs=
39 | golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
40 | golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg=
41 | golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c=
42 | golang.org/x/net v0.6.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs=
43 | golang.org/x/net v0.10.0/go.mod h1:0qNGK6F8kojg2nk9dLZ2mShWaEBan6FAoqfSigmmuDg=
44 | golang.org/x/net v0.21.0/go.mod h1:bIjVDfnllIU7BJ2DNgfnXvpSvtn8VRwhlsaeUTyUS44=
45 | golang.org/x/net v0.23.0 h1:7EYJ93RZ9vYSZAIb2x3lnuvqO5zneoD6IvWjuhfxjTs=
46 | golang.org/x/net v0.23.0/go.mod h1:JKghWKKOSdJwpW2GEx0Ja7fmaKnMsbu+MWVZTokSYmg=
47 | golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
48 | golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
49 | golang.org/x/sync v0.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
50 | golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
51 | golang.org/x/sys v0.0.0-20190222072716-a9d3bda3a223/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
52 | golang.org/x/sys v0.0.0-20190813064441-fde4db37ae7a/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
53 | golang.org/x/sys v0.0.0-20191026070338-33540a1f6037/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
54 | golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
55 | golang.org/x/sys v0.0.0-20210124154548-22da62e12c0c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
56 | golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
57 | golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
58 | golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
59 | golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
60 | golang.org/x/sys v0.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
61 | golang.org/x/sys v0.17.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
62 | golang.org/x/sys v0.18.0 h1:DBdB3niSjOA/O0blCZBqDefyWNYveAYMNF1Wum0DYQ4=
63 | golang.org/x/sys v0.18.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
64 | golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
65 | golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8=
66 | golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k=
67 | golang.org/x/term v0.8.0/go.mod h1:xPskH00ivmX89bAKVGSKKtLOWNx2+17Eiy94tnKShWo=
68 | golang.org/x/term v0.17.0/go.mod h1:lLRBjIVuehSbZlaOtGMbcMncT+aqLLLmKrsjNrUguwk=
69 | golang.org/x/term v0.18.0/go.mod h1:ILwASektA3OnRv7amZ1xhE/KTR+u50pbXfZ03+6Nx58=
70 | golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
71 | golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
72 | golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ=
73 | golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8=
74 | golang.org/x/text v0.9.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8=
75 | golang.org/x/text v0.14.0 h1:ScX5w1eTa3QqT8oi6+ziP7dTV1S2+ALU0bI+0zXKWiQ=
76 | golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU=
77 | golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
78 | golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
79 | golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc=
80 | golang.org/x/tools v0.6.0/go.mod h1:Xwgl3UAJ/d3gWutnCtw505GrjyAbvKui8lOU390QaIU=
81 | golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
82 | gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM=
83 | gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
84 | gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
85 | gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
86 | gopkg.in/yaml.v3 v3.0.0 h1:hjy8E9ON/egN1tAYqKb61G10WtihqetD4sz2H+8nIeA=
87 | gopkg.in/yaml.v3 v3.0.0/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
88 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 |
2 | Apache License
3 | Version 2.0, January 2004
4 | http://www.apache.org/licenses/
5 |
6 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
7 |
8 | 1. Definitions.
9 |
10 | "License" shall mean the terms and conditions for use, reproduction,
11 | and distribution as defined by Sections 1 through 9 of this document.
12 |
13 | "Licensor" shall mean the copyright owner or entity authorized by
14 | the copyright owner that is granting the License.
15 |
16 | "Legal Entity" shall mean the union of the acting entity and all
17 | other entities that control, are controlled by, or are under common
18 | control with that entity. For the purposes of this definition,
19 | "control" means (i) the power, direct or indirect, to cause the
20 | direction or management of such entity, whether by contract or
21 | otherwise, or (ii) ownership of fifty percent (50%) or more of the
22 | outstanding shares, or (iii) beneficial ownership of such entity.
23 |
24 | "You" (or "Your") shall mean an individual or Legal Entity
25 | exercising permissions granted by this License.
26 |
27 | "Source" form shall mean the preferred form for making modifications,
28 | including but not limited to software source code, documentation
29 | source, and configuration files.
30 |
31 | "Object" form shall mean any form resulting from mechanical
32 | transformation or translation of a Source form, including but
33 | not limited to compiled object code, generated documentation,
34 | and conversions to other media types.
35 |
36 | "Work" shall mean the work of authorship, whether in Source or
37 | Object form, made available under the License, as indicated by a
38 | copyright notice that is included in or attached to the work
39 | (an example is provided in the Appendix below).
40 |
41 | "Derivative Works" shall mean any work, whether in Source or Object
42 | form, that is based on (or derived from) the Work and for which the
43 | editorial revisions, annotations, elaborations, or other modifications
44 | represent, as a whole, an original work of authorship. For the purposes
45 | of this License, Derivative Works shall not include works that remain
46 | separable from, or merely link (or bind by name) to the interfaces of,
47 | the Work and Derivative Works thereof.
48 |
49 | "Contribution" shall mean any work of authorship, including
50 | the original version of the Work and any modifications or additions
51 | to that Work or Derivative Works thereof, that is intentionally
52 | submitted to Licensor for inclusion in the Work by the copyright owner
53 | or by an individual or Legal Entity authorized to submit on behalf of
54 | the copyright owner. For the purposes of this definition, "submitted"
55 | means any form of electronic, verbal, or written communication sent
56 | to the Licensor or its representatives, including but not limited to
57 | communication on electronic mailing lists, source code control systems,
58 | and issue tracking systems that are managed by, or on behalf of, the
59 | Licensor for the purpose of discussing and improving the Work, but
60 | excluding communication that is conspicuously marked or otherwise
61 | designated in writing by the copyright owner as "Not a Contribution."
62 |
63 | "Contributor" shall mean Licensor and any individual or Legal Entity
64 | on behalf of whom a Contribution has been received by Licensor and
65 | subsequently incorporated within the Work.
66 |
67 | 2. Grant of Copyright License. Subject to the terms and conditions of
68 | this License, each Contributor hereby grants to You a perpetual,
69 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable
70 | copyright license to reproduce, prepare Derivative Works of,
71 | publicly display, publicly perform, sublicense, and distribute the
72 | Work and such Derivative Works in Source or Object form.
73 |
74 | 3. Grant of Patent License. Subject to the terms and conditions of
75 | this License, each Contributor hereby grants to You a perpetual,
76 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable
77 | (except as stated in this section) patent license to make, have made,
78 | use, offer to sell, sell, import, and otherwise transfer the Work,
79 | where such license applies only to those patent claims licensable
80 | by such Contributor that are necessarily infringed by their
81 | Contribution(s) alone or by combination of their Contribution(s)
82 | with the Work to which such Contribution(s) was submitted. If You
83 | institute patent litigation against any entity (including a
84 | cross-claim or counterclaim in a lawsuit) alleging that the Work
85 | or a Contribution incorporated within the Work constitutes direct
86 | or contributory patent infringement, then any patent licenses
87 | granted to You under this License for that Work shall terminate
88 | as of the date such litigation is filed.
89 |
90 | 4. Redistribution. You may reproduce and distribute copies of the
91 | Work or Derivative Works thereof in any medium, with or without
92 | modifications, and in Source or Object form, provided that You
93 | meet the following conditions:
94 |
95 | (a) You must give any other recipients of the Work or
96 | Derivative Works a copy of this License; and
97 |
98 | (b) You must cause any modified files to carry prominent notices
99 | stating that You changed the files; and
100 |
101 | (c) You must retain, in the Source form of any Derivative Works
102 | that You distribute, all copyright, patent, trademark, and
103 | attribution notices from the Source form of the Work,
104 | excluding those notices that do not pertain to any part of
105 | the Derivative Works; and
106 |
107 | (d) If the Work includes a "NOTICE" text file as part of its
108 | distribution, then any Derivative Works that You distribute must
109 | include a readable copy of the attribution notices contained
110 | within such NOTICE file, excluding those notices that do not
111 | pertain to any part of the Derivative Works, in at least one
112 | of the following places: within a NOTICE text file distributed
113 | as part of the Derivative Works; within the Source form or
114 | documentation, if provided along with the Derivative Works; or,
115 | within a display generated by the Derivative Works, if and
116 | wherever such third-party notices normally appear. The contents
117 | of the NOTICE file are for informational purposes only and
118 | do not modify the License. You may add Your own attribution
119 | notices within Derivative Works that You distribute, alongside
120 | or as an addendum to the NOTICE text from the Work, provided
121 | that such additional attribution notices cannot be construed
122 | as modifying the License.
123 |
124 | You may add Your own copyright statement to Your modifications and
125 | may provide additional or different license terms and conditions
126 | for use, reproduction, or distribution of Your modifications, or
127 | for any such Derivative Works as a whole, provided Your use,
128 | reproduction, and distribution of the Work otherwise complies with
129 | the conditions stated in this License.
130 |
131 | 5. Submission of Contributions. Unless You explicitly state otherwise,
132 | any Contribution intentionally submitted for inclusion in the Work
133 | by You to the Licensor shall be under the terms and conditions of
134 | this License, without any additional terms or conditions.
135 | Notwithstanding the above, nothing herein shall supersede or modify
136 | the terms of any separate license agreement you may have executed
137 | with Licensor regarding such Contributions.
138 |
139 | 6. Trademarks. This License does not grant permission to use the trade
140 | names, trademarks, service marks, or product names of the Licensor,
141 | except as required for reasonable and customary use in describing the
142 | origin of the Work and reproducing the content of the NOTICE file.
143 |
144 | 7. Disclaimer of Warranty. Unless required by applicable law or
145 | agreed to in writing, Licensor provides the Work (and each
146 | Contributor provides its Contributions) on an "AS IS" BASIS,
147 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
148 | implied, including, without limitation, any warranties or conditions
149 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
150 | PARTICULAR PURPOSE. You are solely responsible for determining the
151 | appropriateness of using or redistributing the Work and assume any
152 | risks associated with Your exercise of permissions under this License.
153 |
154 | 8. Limitation of Liability. In no event and under no legal theory,
155 | whether in tort (including negligence), contract, or otherwise,
156 | unless required by applicable law (such as deliberate and grossly
157 | negligent acts) or agreed to in writing, shall any Contributor be
158 | liable to You for damages, including any direct, indirect, special,
159 | incidental, or consequential damages of any character arising as a
160 | result of this License or out of the use or inability to use the
161 | Work (including but not limited to damages for loss of goodwill,
162 | work stoppage, computer failure or malfunction, or any and all
163 | other commercial damages or losses), even if such Contributor
164 | has been advised of the possibility of such damages.
165 |
166 | 9. Accepting Warranty or Additional Liability. While redistributing
167 | the Work or Derivative Works thereof, You may choose to offer,
168 | and charge a fee for, acceptance of support, warranty, indemnity,
169 | or other liability obligations and/or rights consistent with this
170 | License. However, in accepting such obligations, You may act only
171 | on Your own behalf and on Your sole responsibility, not on behalf
172 | of any other Contributor, and only if You agree to indemnify,
173 | defend, and hold each Contributor harmless for any liability
174 | incurred by, or claims asserted against, such Contributor by reason
175 | of your accepting any such warranty or additional liability.
176 |
177 | END OF TERMS AND CONDITIONS
178 |
179 | APPENDIX: How to apply the Apache License to your work.
180 |
181 | To apply the Apache License to your work, attach the following
182 | boilerplate notice, with the fields enclosed by brackets "[]"
183 | replaced with your own identifying information. (Don't include
184 | the brackets!) The text should be enclosed in the appropriate
185 | comment syntax for the file format. We also recommend that a
186 | file or class name and description of purpose be included on the
187 | same "printed page" as the copyright notice for easier
188 | identification within third-party archives.
189 |
190 | Copyright [yyyy] [name of copyright owner]
191 |
192 | Licensed under the Apache License, Version 2.0 (the "License");
193 | you may not use this file except in compliance with the License.
194 | You may obtain a copy of the License at
195 |
196 | http://www.apache.org/licenses/LICENSE-2.0
197 |
198 | Unless required by applicable law or agreed to in writing, software
199 | distributed under the License is distributed on an "AS IS" BASIS,
200 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
201 | See the License for the specific language governing permissions and
202 | limitations under the License.
--------------------------------------------------------------------------------