noteutil

package
v1.6.7 Latest Latest
Warning

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

Go to latest
Published: Apr 5, 2023 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConfigAPIHub added in v1.4.3

func ConfigAPIHub() (hub string)

ConfigAPIHub returns the configured notehub, for use by the HTTP API. If none is configured it returns the default Blues API service. Regardless, it always makes sure that the host has "api." as a prefix. This enables flexibility in what's configured.

func ConfigAuthenticationHeader added in v1.4.3

func ConfigAuthenticationHeader(httpReq *http.Request) (err error)

ConfigAuthenticationHeader sets the authorization field in the header as appropriate

func ConfigDir

func ConfigDir() string

ConfigDir returns the config directory

func ConfigFlagsProcess

func ConfigFlagsProcess() (err error)

ConfigFlagsProcess processes the registered config flags

func ConfigFlagsRegister

func ConfigFlagsRegister(notecardFlags bool, notehubFlags bool)

ConfigFlagsRegister registers the config-related flags

func ConfigNotecardHub added in v1.4.3

func ConfigNotecardHub() (hub string)

ConfigNotecardHub returns the configured notehub, for use as the Notecard host. If none is configured it returns "". Regardless, it always makes sure that the host does NOT have "api." as a prefix.

func ConfigRead

func ConfigRead() error

ConfigRead reads the current info from config file

func ConfigReset

func ConfigReset()

ConfigReset updates the file with the default info

func ConfigSetHub added in v1.4.3

func ConfigSetHub(hub string)

ConfigSetHub clears the hub

func ConfigShow

func ConfigShow() error

ConfigShow displays all current config parameters

func ConfigSignedIn added in v1.4.3

func ConfigSignedIn() (username string, token string, authenticated bool)

ConfigSignedIn returns info about whether or not we're signed in

func ConfigWrite

func ConfigWrite() error

ConfigWrite updates the file with the current config info

func FlagParse

func FlagParse(notecardFlags bool, notehubFlags bool) (err error)

FlagParse is a wrapper around flag.Parse that handles our config flags

Types

type ConfigCreds added in v1.4.6

type ConfigCreds struct {
	User  string `json:"user,omitempty"`
	Token string `json:"token,omitempty"`
}

ConfigCreds are the credentials for a given notehub

type ConfigSettings

type ConfigSettings struct {
	When       string                 `json:"when,omitempty"`
	Hub        string                 `json:"hub,omitempty"`
	HubCreds   map[string]ConfigCreds `json:"creds,omitempty"`
	Interface  string                 `json:"interface,omitempty"`
	Port       string                 `json:"port,omitempty"`
	PortConfig int                    `json:"port_config,omitempty"`
}

ConfigSettings defines the config file that maintains the command processor's state

var Config ConfigSettings

Config are the master config settings

Jump to

Keyboard shortcuts

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