Skip to content
This repository has been archived by the owner on Apr 16, 2021. It is now read-only.

Commit

Permalink
Add connection options and re-generate docs
Browse files Browse the repository at this point in the history
  • Loading branch information
Marcin S committed Aug 5, 2020
1 parent c8153ac commit ce8a27d
Show file tree
Hide file tree
Showing 21 changed files with 291 additions and 27 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@ cover/
release/
skynet

# Git
# Git
.git
6 changes: 5 additions & 1 deletion cmd/skynet/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,9 @@ var (
// endpointPath is the relative URL path of the endpoint.
endpointPath string

// apiKey is the API password to use for authentication.
apiKey string

// customUserAgent is the custom user agent to use.
customUserAgent string

Expand Down Expand Up @@ -144,9 +147,10 @@ on top of Sia.`,
skynetSkykeyGetCmd.AddCommand(skynetSkykeyGetIDCmd, skynetSkykeyGetNameCmd)

// Add flags.
rootCmd.Flags().BoolVarP(&generateDocs, "", "d", false, "Generate the docs for skynet")
rootCmd.Flags().BoolVarP(&generateDocs, "generate-docs", "d", false, "Generate the docs for skynet")
rootCmd.PersistentFlags().StringVar(&skynetPortal, "portal", "", "Use a Skynet portal other than the default")
rootCmd.PersistentFlags().StringVar(&endpointPath, "endpoint-path", "", "Relative URL path of the endpoint to use")
rootCmd.PersistentFlags().StringVar(&apiKey, "api-key", "", "API password to use for authentication")
rootCmd.PersistentFlags().StringVar(&customUserAgent, "custom-user-agent", "", "Custom user agent to use")
// Upload flags.
skynetUploadCmd.Flags().StringVar(&portalFileFieldName, "file-field-name", "", "Defines the fieldName for the files on the portal")
Expand Down
3 changes: 3 additions & 0 deletions cmd/skynet/skynetcmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -362,6 +362,9 @@ func getCommonOptions(opts skynet.Options) skynet.Options {
if endpointPath != "" {
opts.EndpointPath = endpointPath
}
if apiKey != "" {
opts.APIKey = apiKey
}
if customUserAgent != "" {
opts.CustomUserAgent = customUserAgent
}
Expand Down
12 changes: 8 additions & 4 deletions doc/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,12 @@ skynet [flags]
### Options

```
-d, -- Generate the docs for skynet
-h, --help help for skynet
--portal string Use a Skynet portal other than the default
--api-key string API password to use for authentication
--custom-user-agent string Custom user agent to use
--endpoint-path string Relative URL path of the endpoint to use
-d, --generate-docs Generate the docs for skynet
-h, --help help for skynet
--portal string Use a Skynet portal other than the default
```

### SEE ALSO
Expand All @@ -26,7 +29,8 @@ skynet [flags]
* [skynet download](skynet_download.md) - Download a skylink from skynet.
* [skynet ls](skynet_ls.md) - Needs SDK Implementation
* [skynet pin](skynet_pin.md) - Needs SDK Implementation
* [skynet skykey](skynet_skykey.md) - Perform skykey operations.
* [skynet unpin](skynet_unpin.md) - Needs SDK Implementation
* [skynet upload](skynet_upload.md) - Upload a file or a directory to Skynet.

###### Auto generated by spf13/cobra on 18-Jun-2020
###### Auto generated by spf13/cobra on 5-Aug-2020
12 changes: 8 additions & 4 deletions doc/skynet.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,12 @@ skynet [flags]
### Options

```
-d, -- Generate the docs for skynet
-h, --help help for skynet
--portal string Use a Skynet portal other than the default
--api-key string API password to use for authentication
--custom-user-agent string Custom user agent to use
--endpoint-path string Relative URL path of the endpoint to use
-d, --generate-docs Generate the docs for skynet
-h, --help help for skynet
--portal string Use a Skynet portal other than the default
```

### SEE ALSO
Expand All @@ -26,7 +29,8 @@ skynet [flags]
* [skynet download](skynet_download.md) - Download a skylink from skynet.
* [skynet ls](skynet_ls.md) - Needs SDK Implementation
* [skynet pin](skynet_pin.md) - Needs SDK Implementation
* [skynet skykey](skynet_skykey.md) - Perform skykey operations.
* [skynet unpin](skynet_unpin.md) - Needs SDK Implementation
* [skynet upload](skynet_upload.md) - Upload a file or a directory to Skynet.

###### Auto generated by spf13/cobra on 18-Jun-2020
###### Auto generated by spf13/cobra on 5-Aug-2020
7 changes: 5 additions & 2 deletions doc/skynet_blacklist.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,14 @@ skynet blacklist [skylink] [flags]
### Options inherited from parent commands

```
--portal string Use a Skynet portal other than the default
--api-key string API password to use for authentication
--custom-user-agent string Custom user agent to use
--endpoint-path string Relative URL path of the endpoint to use
--portal string Use a Skynet portal other than the default
```

### SEE ALSO

* [skynet](skynet.md) - Perform actions related to Skynet

###### Auto generated by spf13/cobra on 18-Jun-2020
###### Auto generated by spf13/cobra on 5-Aug-2020
7 changes: 5 additions & 2 deletions doc/skynet_convert.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,14 @@ skynet convert [source siaPath] [destination siaPath] [flags]
### Options inherited from parent commands

```
--portal string Use a Skynet portal other than the default
--api-key string API password to use for authentication
--custom-user-agent string Custom user agent to use
--endpoint-path string Relative URL path of the endpoint to use
--portal string Use a Skynet portal other than the default
```

### SEE ALSO

* [skynet](skynet.md) - Perform actions related to Skynet

###### Auto generated by spf13/cobra on 18-Jun-2020
###### Auto generated by spf13/cobra on 5-Aug-2020
11 changes: 8 additions & 3 deletions doc/skynet_download.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,17 +14,22 @@ skynet download [skylink] [destination] [flags]
### Options

```
-h, --help help for download
-h, --help help for download
--skykey-id string ID of the skykey on the portal used to decrypt the download
--skykey-name string Name of the skykey on the portal used to decrypt the download
```

### Options inherited from parent commands

```
--portal string Use a Skynet portal other than the default
--api-key string API password to use for authentication
--custom-user-agent string Custom user agent to use
--endpoint-path string Relative URL path of the endpoint to use
--portal string Use a Skynet portal other than the default
```

### SEE ALSO

* [skynet](skynet.md) - Perform actions related to Skynet

###### Auto generated by spf13/cobra on 18-Jun-2020
###### Auto generated by spf13/cobra on 5-Aug-2020
7 changes: 5 additions & 2 deletions doc/skynet_ls.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,14 @@ skynet ls [flags]
### Options inherited from parent commands

```
--portal string Use a Skynet portal other than the default
--api-key string API password to use for authentication
--custom-user-agent string Custom user agent to use
--endpoint-path string Relative URL path of the endpoint to use
--portal string Use a Skynet portal other than the default
```

### SEE ALSO

* [skynet](skynet.md) - Perform actions related to Skynet

###### Auto generated by spf13/cobra on 18-Jun-2020
###### Auto generated by spf13/cobra on 5-Aug-2020
7 changes: 5 additions & 2 deletions doc/skynet_pin.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,14 @@ skynet pin [skylink] [destination siapath] [flags]
### Options inherited from parent commands

```
--portal string Use a Skynet portal other than the default
--api-key string API password to use for authentication
--custom-user-agent string Custom user agent to use
--endpoint-path string Relative URL path of the endpoint to use
--portal string Use a Skynet portal other than the default
```

### SEE ALSO

* [skynet](skynet.md) - Perform actions related to Skynet

###### Auto generated by spf13/cobra on 18-Jun-2020
###### Auto generated by spf13/cobra on 5-Aug-2020
32 changes: 32 additions & 0 deletions doc/skynet_skykey.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
## skynet skykey

Perform skykey operations.

### Synopsis

Perform skykey operations.

### Options

```
-h, --help help for skykey
```

### Options inherited from parent commands

```
--api-key string API password to use for authentication
--custom-user-agent string Custom user agent to use
--endpoint-path string Relative URL path of the endpoint to use
--portal string Use a Skynet portal other than the default
```

### SEE ALSO

* [skynet](skynet.md) - Perform actions related to Skynet
* [skynet skykey add](skynet_skykey_add.md) - Add a skykey to Skynet.
* [skynet skykey create](skynet_skykey_create.md) - Create a skykey on Skynet.
* [skynet skykey get](skynet_skykey_get.md) - Perform skykey get operations.
* [skynet skykey list](skynet_skykey_list.md) - Get a list of all skykeys on Skynet.

###### Auto generated by spf13/cobra on 5-Aug-2020
32 changes: 32 additions & 0 deletions doc/skynet_skykey_add.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
## skynet skykey add

Add a skykey to Skynet.

### Synopsis

Store the given base-64 encoded skykey with the skykey manager.

```
skynet skykey add [skykey] [flags]
```

### Options

```
-h, --help help for add
```

### Options inherited from parent commands

```
--api-key string API password to use for authentication
--custom-user-agent string Custom user agent to use
--endpoint-path string Relative URL path of the endpoint to use
--portal string Use a Skynet portal other than the default
```

### SEE ALSO

* [skynet skykey](skynet_skykey.md) - Perform skykey operations.

###### Auto generated by spf13/cobra on 5-Aug-2020
32 changes: 32 additions & 0 deletions doc/skynet_skykey_create.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
## skynet skykey create

Create a skykey on Skynet.

### Synopsis

Returns a new skykey created and stored under that name.

```
skynet skykey create [skykey name] [flags]
```

### Options

```
-h, --help help for create
```

### Options inherited from parent commands

```
--api-key string API password to use for authentication
--custom-user-agent string Custom user agent to use
--endpoint-path string Relative URL path of the endpoint to use
--portal string Use a Skynet portal other than the default
```

### SEE ALSO

* [skynet skykey](skynet_skykey.md) - Perform skykey operations.

###### Auto generated by spf13/cobra on 5-Aug-2020
30 changes: 30 additions & 0 deletions doc/skynet_skykey_get.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
## skynet skykey get

Perform skykey get operations.

### Synopsis

Perform skykey get operations.

### Options

```
-h, --help help for get
```

### Options inherited from parent commands

```
--api-key string API password to use for authentication
--custom-user-agent string Custom user agent to use
--endpoint-path string Relative URL path of the endpoint to use
--portal string Use a Skynet portal other than the default
```

### SEE ALSO

* [skynet skykey](skynet_skykey.md) - Perform skykey operations.
* [skynet skykey get id](skynet_skykey_get_id.md) - Get a skykey given its ID.
* [skynet skykey get name](skynet_skykey_get_name.md) - Get a skykey given its name.

###### Auto generated by spf13/cobra on 5-Aug-2020
32 changes: 32 additions & 0 deletions doc/skynet_skykey_get_id.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
## skynet skykey get id

Get a skykey given its ID.

### Synopsis

Get a skykey given its ID.

```
skynet skykey get id [skykey id] [flags]
```

### Options

```
-h, --help help for id
```

### Options inherited from parent commands

```
--api-key string API password to use for authentication
--custom-user-agent string Custom user agent to use
--endpoint-path string Relative URL path of the endpoint to use
--portal string Use a Skynet portal other than the default
```

### SEE ALSO

* [skynet skykey get](skynet_skykey_get.md) - Perform skykey get operations.

###### Auto generated by spf13/cobra on 5-Aug-2020
32 changes: 32 additions & 0 deletions doc/skynet_skykey_get_name.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
## skynet skykey get name

Get a skykey given its name.

### Synopsis

Get a skykey given its name.

```
skynet skykey get name [skykey name] [flags]
```

### Options

```
-h, --help help for name
```

### Options inherited from parent commands

```
--api-key string API password to use for authentication
--custom-user-agent string Custom user agent to use
--endpoint-path string Relative URL path of the endpoint to use
--portal string Use a Skynet portal other than the default
```

### SEE ALSO

* [skynet skykey get](skynet_skykey_get.md) - Perform skykey get operations.

###### Auto generated by spf13/cobra on 5-Aug-2020
Loading

0 comments on commit ce8a27d

Please sign in to comment.