cmd

package
v0.0.0-...-89ae335 Latest Latest
Warning

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

Go to latest
Published: Sep 5, 2017 License: Apache-2.0, Apache-2.0 Imports: 9 Imported by: 0

Documentation

Overview

The publish/cmd package implement command line interface for publish. It use config file for each publisher.

Index

Constants

This section is empty.

Variables

View Source
var RootCmd = &cobra.Command{
	Use:   "publish",
	Short: "Publish document to web services.",
	Long: `Publish is a document publisher for multible web services in Golang.

This application is a tool for a working document to set on web services.
Project is available at http://github.com/ynishi/publish`,
	Run: func(cmd *cobra.Command, args []string) {
		log.Print("start root command")

		r, err := os.Open(content)
		if err != nil {
			fmt.Println(err)
		}

		publish.SetReader(r)
		publish.SetTimeout(time.Duration(timeout) * time.Second)

		pas3 := &publish.PublishAwsS3{}
		pgh := &publish.PublishGitHub{}

		err = publish.InitConfAwsS3(pas3, aS3Conf)
		if err != nil {
			fmt.Println(err)
		}
		err = publish.InitConfGitHub(pgh, ghConf)
		if err != nil {
			fmt.Println(err)
		}
		publishers := []publish.Publisher{
			pgh,
			pas3,
		}
		err = publish.Publish(publishers)
		if err != nil {
			fmt.Println(err)
		}
		log.Print("end root command")
	},
}

RootCmd is root command.

Functions

This section is empty.

Types

This section is empty.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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