Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CLI ¶
type CLI struct { Init Init `kong:"cmd,help='Initialize the data stores and generate the encryption key.'"` Get Get `kong:"cmd,help='Get the value of a key.'"` Set Set `kong:"cmd,help='Set the value of a key.'"` Rm Rm `kong:"cmd,help='Delete a key.'"` Ls Ls `kong:"cmd,help='List keys.'"` Role Role `kong:"cmd,help='Manage roles.'"` Serve Serve `kong:"cmd,help='Start the web server.'"` User User `kong:"cmd,help='Manage users.'"` Invite Invite `kong:"cmd,help='Manage invitations for remote users.'"` Remote Remote `kong:"cmd,help='Manage remote Disco nodes.'"` Version kong.VersionFlag `kong:"help='Output Disco version and exit.'"` DataDir string `kong:"default='${dataDir}',help='Directory to store Disco data in.'"` //nolint:lll EncryptionKey string `` /* 153-byte string literal not displayed */ Log struct { Level slog.Level `enum:"DEBUG,INFO,WARN,ERROR" default:"INFO" help:"Set the app logging level."` } `embed:"" prefix:"log-"` // contains filtered or unexported fields }
CLI is the command line interface of disco.
type Get ¶
type Get struct { Key string `arg:"" help:"The unique key associated with the value."` Namespace string `default:"default" help:"The namespace to retrieve the value from."` Remote string `help:"The remote Disco node to retrieve the value from."` }
The Get command retrieves and prints the value of a key.
type Init ¶
type Init struct{}
The Init command initializes the Disco data stores and generates a new encryption key.
type Invite ¶
type Invite struct { User struct { Name string `arg:"" help:"The name of the user to invite."` TTL time.Duration `default:"1h" help:"Time duration the invite is valid for."` } `kong:"cmd,help='Create a new invitation token for an existing user to access this Disco node remotely.'"` Ls struct { All bool `help:"Also include expired invites."` } `kong:"cmd,help='List invites.'"` Rm struct { UUID []string `arg:"" help:"Unique invite IDs. A short prefix can be specified as long as it's unique."` } `kong:"cmd,help='Delete one or more invites.'"` Update struct { UUID string `arg:"" help:"The unique invite ID. A short prefix can be specified as long as it's unique."` TTL *time.Duration `help:"Time duration the invite is valid for."` } `kong:"cmd,help='Update an invite to extend its validity period.'"` }
The Invite command manages invitations for remote users.
type Ls ¶
type Ls struct { KeyPrefix string `arg:"" optional:"" help:"An optional key prefix."` Namespace string `default:"default" help:"The namespace to retrieve the keys from.\n If '*' is specified, keys in all namespaces are listed. "` Remote string `help:"The remote Disco node to retrieve key data from."` }
The Ls command prints keys.
type Remote ¶
type Remote struct { Add struct { Name string `arg:"" help:"The unique name of the remote."` Address string `arg:"" help:"The remote address in 'host[:port]' format, where 'host' can be a DNS hostname or an IP address."` Token string `arg:"" help:"The invitation token used for authentication, generated by the remote node."` } `kong:"cmd,help='Add a new remote node.'"` Ls struct { } `kong:"cmd,help='List remote nodes.'"` Rm struct { Name string `arg:"" help:"The unique name of the remote."` } `kong:"cmd,help='Delete a remote node.'"` Update struct { Name string `arg:"" help:"The unique name of the remote."` Address string `arg:"" help:"The remote address in 'host[:port]' format, where 'host' can be a DNS hostname or an IP address."` } `kong:"cmd,help='Update a remote node.'"` }
The Remote command manages remote Disco nodes.
type Rm ¶
type Rm struct { Key string `arg:"" help:"The key to delete."` Namespace string `default:"default" help:"The namespace to key exists in."` }
The Rm command deletes a key.
type Role ¶
type Role struct { Add struct { Name string `arg:"" help:"The unique name of the role."` Permissions []models.Permission `` /* 160-byte string literal not displayed */ } `kong:"cmd,help='Add a new role.'"` Rm struct { Name string `arg:"" help:"The unique name of the role."` Force bool `help:"Remove role even if it's assigned to existing users."` } `kong:"cmd,help='Remove a role.'"` Update struct { Name string `arg:"" help:"The unique name of the role."` Permissions []models.Permission `` /* 232-byte string literal not displayed */ } `kong:"cmd,help='Change the settings of a role.'"` Ls struct { } `kong:"cmd,help='List roles.'"` }
The Role command manages roles.
type Serve ¶
type Serve struct {
Address string `help:"[host]:port to listen on" default:":2020"`
}
Serve starts the web server.
type Set ¶
type Set struct { Key string `arg:"" help:"The unique key that identifies the value."` Value string `arg:"" help:"The value."` Namespace string `default:"default" help:"The namespace to store the value in."` Remote string `help:"The remote Disco node to store the value in."` }
The Set command stores the value of a key.
type User ¶
type User struct { Add struct { Name string `arg:"" help:"The unique name of the user."` Roles []string `help:"Names of roles to assign to this user."` } `kong:"cmd,help='Add a new user.'"` Rm struct { Name string `arg:"" help:"The unique name of the user."` } `kong:"cmd,help='Remove a user.'"` Update struct { Name string `arg:"" help:"The unique name of the user."` Roles []string `help:"Names of roles to assign to this user. \n Any existing roles will be removed and replaced with this set."` } `kong:"cmd,help='Update the configuration of a user.'"` Ls struct { } `kong:"cmd,help='List users.'"` }
The User command manages users.
Click to show internal directories.
Click to hide internal directories.