• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

cinode / go / 4218690867

19 Feb 2023 11:31PM UTC coverage: 89.663%. Remained the same
4218690867

push

github

Bartłomiej Święcki
utils/httpserver: Fix tests due to lack of signals in windows

1570 of 1751 relevant lines covered (89.66%)

1.0 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

0.0
/pkg/cmd/static_datastore/root.go
1
/*
2
Copyright © 2022 Bartłomiej Święcki (byo)
3

4
Licensed under the Apache License, Version 2.0 (the "License");
5
you may not use this file except in compliance with the License.
6
You may obtain a copy of the License at
7

8
    http://www.apache.org/licenses/LICENSE-2.0
9

10
Unless required by applicable law or agreed to in writing, software
11
distributed under the License is distributed on an "AS IS" BASIS,
12
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
See the License for the specific language governing permissions and
14
limitations under the License.
15
*/
16

17
package static_datastore
18

19
import (
20
        "fmt"
21
        "os"
22

23
        "github.com/spf13/cobra"
24
)
25

26
// rootCmd represents the base command when called without any subcommands
27
func rootCmd() *cobra.Command {
×
28
        cmd := &cobra.Command{
×
29
                Use:   "static_datastore",
×
30
                Short: "Sample application to operate on static datastore",
×
31
                Long: `static_datastore can be used to create a simple http server serving
×
32
content from datastore served from encrypted datastore layer.
×
33

×
34
The first step is to generate datastore content with the 'compile'
×
35
command which can then be served using the 'server' command.
×
36

×
37
Note that this tool is supposed to be used for testing purposes only.
×
38
It does not guarantee secrecy since the encryption key for the root
×
39
node is stored in a plaintext in a file called 'entrypoint.txt'.
×
40
`,
×
41
                Run: func(cmd *cobra.Command, args []string) {
×
42
                        cmd.Help()
×
43
                },
×
44
        }
45

46
        cmd.AddCommand(compileCmd())
×
47

×
48
        return cmd
×
49
}
50

51
// Execute adds all child commands to the root command and sets flags appropriately.
52
// This is called by main.main(). It only needs to happen once to the rootCmd.
53
func Execute() {
×
54
        if err := rootCmd().Execute(); err != nil {
×
55
                fmt.Println(err)
×
56
                os.Exit(1)
×
57
        }
×
58
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc