cli

package
v0.0.0-...-5dd6c5c Latest Latest
Warning

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

Go to latest
Published: Jan 28, 2022 License: MIT Imports: 25 Imported by: 0

Documentation

Overview

Package cli contains the commands and helper utilities for the rokka CLI.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

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 ListContains

func ListContains(l []string, s string) bool

ListContains check if s is in list l.

func SaveConfig

func SaveConfig(c Config) error

SaveConfig stores the current configuration in configPath.

func SetConfigPath

func SetConfigPath(p string)

SetConfigPath adjusts the global variable configPath which tells where to look for the configuration file.

func TitleCamelCase

func TitleCamelCase(s string) string

TitleCamelCase converts a string to `camelCase`, then uses strings.Title to convert it to `CamelCase`.

func ToStringSlice

func ToStringSlice(list []interface{}) []string

ToStringSlice is an internally used function to convert a slice of interfaces to a slice of strings

Types

type Config

type Config struct {
	APIKey    string `json:"apiKey"`
	ImageHost string `json:"imageHost"`
}

Config stores the APIKey and ImageHost in a file to be used later for authenticating against rokka without having to pass an APIKey/ImageHost as a flag.

func GetConfig

func GetConfig() (Config, error)

GetConfig returns the stored config if set. If not it will return an empty configuration object.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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