cmd

package
v0.0.0-...-09387af Latest Latest
Warning

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

Go to latest
Published: Aug 12, 2024 License: GPL-3.0 Imports: 20 Imported by: 0

Documentation

Overview

Copyright © 2023 Folderr <[email protected]>

Copyright © 2023 Folderr <[email protected]>

Copyright © 2023 Folderr <[email protected]>

Copyright © 2023 Folderr <[email protected]>

Index

Constants

This section is empty.

Variables

View Source
var FolderrDbInsertedId *mongo.InsertOneResult
View Source
var RootCmd = &cobra.Command{
	Use:   rootCmdName,
	Short: "A CLI to manage Folderr installations",
	Long: `A CLI to setup and manage your Folderr instance. Get started with:
` + rootCmdName + ` init`,
	Version: "0.0.13",
	CompletionOptions: cobra.CompletionOptions{
		DisableDefaultCmd: true,
	},

	PersistentPostRun: func(cmd *cobra.Command, args []string) {
		dir, err := utilities.GetConfigDir(dry)
		if err != nil {
			panic(err)
		}
		_, config, _, err := utilities.ReadConfig(dir, dry)
		if err != nil {
			panic(err)
		}
		if dry && strings.Contains(config.Directory, os.TempDir()) {

			err := os.RemoveAll(config.Directory)
			if err != nil {
				panic(err)
			}
		}
		if dry && strings.Contains(dir, os.TempDir()) {
			err := os.RemoveAll(dir)
			if err != nil {
				panic(err)
			}
		}
	},
}

RootCmd represents the base command when called without any subcommands

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.

Types

type Notification

type Notification struct {
	Id        string    `bson:"id"`
	Title     string    `bson:"title"`
	Notify    string    `bson:"notify"`
	CreatedAt time.Time `bson:"createdAt"`
}

type User

type User struct {
	Id                string         `bson:"id"`
	Password          string         `bson:"password"`
	Email             string         `bson:"email"`
	Username          string         `bson:"username"`
	Admin             bool           `bson:"admin"`
	Owner             bool           `bson:"owner"`
	CURLs             []string       `bson:"cURLs"`
	Files             int            `bson:"files"`
	Links             int            `bson:"links"`
	Notifs            []Notification `bson:"notifs"`
	CreatedAt         time.Time      `bson:"createdAt"`
	Privacy           UserPrivacy    `bson:"privacy"`
	MarkedForDeletion bool           `bson:"markedForDeletion"`
}

type UserPrivacy

type UserPrivacy struct {
	DataCollection bool `bson:"dataCollection"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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