cmd

package
v0.5.0-alpha Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 12, 2022 License: Apache-2.0 Imports: 41 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AmIManager

func AmIManager(token *types.TokenAuthentication) bool

AmIManager parses access token and checks if admin property is set to true

func AmIPlainUser

func AmIPlainUser(token *types.TokenAuthentication) bool

AmIPlainUser parses access token and checks if manager and/or readonly properties are set to true A plain user has both manager and readonly properties set to false

func AmIReadonly

func AmIReadonly(token *types.TokenAuthentication) bool

AmIReadonly parses access token and checks if readonly property is set to true

func AuthTokenPath

func AuthTokenPath() (string, error)

AuthTokenPath gets the path where Glim's JWT access token is stored Returns a string containing the file path inside user's home directory

func CsvCreateGroupsCmd

func CsvCreateGroupsCmd() *cobra.Command

func CsvCreateUsersCmd

func CsvCreateUsersCmd() *cobra.Command

func CsvDeleteGroupsCmd

func CsvDeleteGroupsCmd() *cobra.Command

func CsvDeleteUsersCmd

func CsvDeleteUsersCmd() *cobra.Command

func DeleteCredentials

func DeleteCredentials() error

func DeleteGroupCmd

func DeleteGroupCmd() *cobra.Command

func DeleteUserCmd

func DeleteUserCmd() *cobra.Command

DeleteUserCmd - TODO comment

func Execute

func Execute()

Execute adds all child commands to the root command and sets flags appropriately. This is called by main.main(). It only needs to happen once to the rootCmd.

func GetCredentials

func GetCredentials(url string) (*types.TokenAuthentication, error)

GetCredentials parses file with token and get new tokens if refresh is needed

func GetGroupInfo

func GetGroupInfo(cmd *cobra.Command) error

func GetUserInfo

func GetUserInfo(cmd *cobra.Command) error

func JPEGToBase64

func JPEGToBase64(path string) (*string, error)

func ListGroupCmd

func ListGroupCmd() *cobra.Command

ListGroupCmd - TODO comment

func ListUserCmd

func ListUserCmd() *cobra.Command

ListUserCmd - TODO comment

func LoginCmd

func LoginCmd() *cobra.Command

LoginCmd

func LogoutCmd

func LogoutCmd() *cobra.Command

func NeedsRefresh

func NeedsRefresh(token *types.TokenAuthentication) bool

NeedsRefresh check if token needs to be refreshed

func NewGroupCmd

func NewGroupCmd() *cobra.Command

func NewUserCmd

func NewUserCmd() *cobra.Command

NewUserCmd - TODO comment

func RestClient

func RestClient(token string) *resty.Client

func UpdateGroupCmd

func UpdateGroupCmd() *cobra.Command

func UpdateUserCmd

func UpdateUserCmd() *cobra.Command

func UserPasswdCmd

func UserPasswdCmd() *cobra.Command

NewUserCmd - TODO comment

func WhichIsMyTokenUID

func WhichIsMyTokenUID(token *types.TokenAuthentication) (uint, error)

WhichIsMyTokenUID parses access token and gets uid claim/property

Types

type JSONErrorOutput

type JSONErrorOutput struct {
	ErrorMessage string `json:"error"`
}

type JSONSuccessOutput

type JSONSuccessOutput struct {
	Message string `json:"message"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL