cmd

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Nov 6, 2019 License: Apache-2.0 Imports: 36 Imported by: 0

Documentation

Overview

Package cmd implements some basic examples of what can be achieved when combining the use of the Go SDK for Cells with the powerful Cobra framework to implement CLI client applications for Cells.

Index

Constants

This section is empty.

Variables

View Source
var RootCmd = &cobra.Command{
	Use:   os.Args[0],
	Short: "Connect to a Cells Server using the command line",
	Long: `
# This tool uses the REST API to connect a Cells Server.

Pydio Cells comes with a powerful REST API that exposes various endpoints and enable management of a running Cells instance.
As a convenience, the Pydio team also provide a ready to use SDK for the Go language that encapsulates the boiling code to wire things 
and provides a few chosen utilitary methods to ease implemantation when using the SDK in various Go programs.

The children commands defined here show some basic examples of what can be achieved when combining the use of this SDK with 
the powerful Cobra framework to easily implement small CLI client applications.
`,
	PersistentPreRun: func(cmd *cobra.Command, args []string) {

		if cmd.Use != "configure" && cmd.Use != "oauth" && cmd.Use != "clear" && cmd.Use != "doc" {
			e := rest.SetUpEnvironment(configFile)
			if e != nil {
				log.Fatalf("cannot read config file, please make sure to run %s configure first (error %s)", os.Args[0], e)
			}
		}

	},
	Run: func(cmd *cobra.Command, args []string) {
		cmd.Help()
	},
}

RootCmd is the parent of all example commands defined in this package. It takes care of the pre-configuration of the defaut connection to the SDK in its PersistentPreRun phase.

Functions

func RandString

func RandString(n int) string

Types

type PgReader added in v1.0.0

type PgReader struct {
	io.Reader
	io.Seeker
	// contains filtered or unexported fields
}

func (*PgReader) Read added in v1.0.0

func (r *PgReader) Read(p []byte) (n int, err error)

func (*PgReader) Seek added in v1.0.0

func (r *PgReader) Seek(offset int64, whence int) (int64, error)

Jump to

Keyboard shortcuts

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