Documentation ¶
Overview ¶
Package config is used to set up and manage the Scribe config file
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // DefaultName for the config file DefaultName = ".scribe.json" // DefaultLocation for the config file DefaultLocation = "" // DefaultType of file for the config file DefaultType = "json" // DefaultLicense for any file being created DefaultLicense = "MIT" // DefaultIpfsPath for storing IPFS files on this node DefaultIpfsPath = "" // DefaultStorageMax is the maximum storage available for the IPFS repo DefaultStorageMax = "1GB" // DefaultProject to operate on DefaultProject = "scribe-test-project" )
Functions ¶
func CheckConfig ¶
func CheckConfig() error
CheckConfig will check the fields of the in-memory Viper config it will attempt to make any directories that don't exist
func DumpConfig2JSON ¶
DumpConfig2JSON will unmarshall the config from Viper to a JSON string
func GenerateDefault ¶
func GenerateDefault() error
GenerateDefault will generate the default config on disk
func ResetConfig ¶
ResetConfig will remove any existing config and replace it with the default one NOTE: the caller must reload the config into viper
Types ¶
type ScribeConfig ¶
type ScribeConfig struct { FileName string `json:"fileName"` FileLocation string `json:"fileLocation"` FileType string `json:"fileType"` License string `json:"license"` Private bool `json:"private"` IpfsPath string `json:"ipfsPath"` StorageMax string `json:"storageMax"` Pinning bool `json:"pinning"` RemoteCID string `json:"remoteCID"` Project string `json:"project"` }
ScribeConfig is a struct to hold the config data
func DumpConfig2Mem ¶
func DumpConfig2Mem() (*ScribeConfig, error)
DumpConfig2Mem will unmarshall the config from Viper to a struct in memory
Click to show internal directories.
Click to hide internal directories.