cli

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Apr 24, 2023 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrWriteWithoutFile = errors.New("cannot specify --write without --file")
	ErrCreateWithID     = errors.New("cannot set id when creating a new item")
	ErrIDRequired       = errors.New("id must be specified")
	ErrIDsRequired      = errors.New("ids must be specified")
	ErrIDsWithAll       = errors.New("cannot specify ids when --all is specified")
)

Functions

func Configure

func Configure(params *ConfigureParameters) error

Types

type CLI

type CLI struct {
	// contains filtered or unexported fields
}

func New

func New(cfg *Config) (*CLI, error)

func (*CLI) ItemsCreate

func (c *CLI) ItemsCreate(params *ItemsCreateParameters) error

$ qiita items create

func (*CLI) ItemsDelete

func (c *CLI) ItemsDelete(params *ItemsDeleteParameters) error

func (*CLI) ItemsGet

func (c *CLI) ItemsGet(params *ItemsGetParameters) error

$ qiita items get

func (*CLI) ItemsList

func (c *CLI) ItemsList(params *ItemsListParameters) error

$ qiita items list

func (*CLI) ItemsNew

func (c *CLI) ItemsNew(params *ItemsNewParameters) error

func (*CLI) ItemsPull

func (c *CLI) ItemsPull(params *ItemsPullParameters) error

func (*CLI) ItemsPush added in v0.2.0

func (c *CLI) ItemsPush(params *ItemsPushParameters) error

func (*CLI) ItemsSearch

func (c *CLI) ItemsSearch(params *ItemsSearchParameters) error

$ qiita items search

func (*CLI) ItemsUpdate

func (c *CLI) ItemsUpdate(params *ItemsUpdateParameters) error

type Config

type Config struct {
	Command *cobra.Command

	Writer    io.Writer
	ErrWriter io.Writer

	FlagFormat  *flags.String      // --format
	FlagColumns *flags.StringSlice // --columns
}

type ConfigureParameters

type ConfigureParameters struct {
	Command         *cobra.Command
	Writer          io.Writer
	FlagAccessToken *flags.String // --access-token
	FlagFormat      *flags.String // --format
}

type ItemsCreateParameters

type ItemsCreateParameters struct {
	FlagTitle   *flags.String      // --title
	FlagTags    *flags.StringSlice // --tags
	FlagBody    *flags.String      // --body
	FlagPrivate *flags.Bool        // --private
	FlagTweet   *flags.Bool        // --tweet
}

type ItemsDeleteParameters

type ItemsDeleteParameters struct {
	Args []string
}

type ItemsGetParameters

type ItemsGetParameters struct {
	Args []string
}

type ItemsListParameters

type ItemsListParameters struct {
	FlagPage    *flags.Int // --page
	FlagPerPage *flags.Int // --per-page
}

type ItemsNewParameters

type ItemsNewParameters struct {
	Args        []string
	FlagTitle   *flags.String      // --title
	FlagTags    *flags.StringSlice // --tags
	FlagPrivate *flags.Bool        // --private
}

type ItemsPullParameters

type ItemsPullParameters struct {
	Args    []string
	FlagAll *flags.Bool   // --all
	FlagOut *flags.String // --out
}

type ItemsPushParameters added in v0.2.0

type ItemsPushParameters struct {
	Args      []string
	FlagWrite *flags.Bool // --write
}

type ItemsSearchParameters

type ItemsSearchParameters struct {
	FlagPage    *flags.Int    // --page
	FlagPerPage *flags.Int    // --per-page
	FlagQuery   *flags.String // --query
}

type ItemsUpdateParameters

type ItemsUpdateParameters struct {
	Args        []string
	FlagTitle   *flags.String      // --title
	FlagTags    *flags.StringSlice // --tags
	FlagBody    *flags.String      // --body
	FlagPrivate *flags.Bool        // --private
}

Jump to

Keyboard shortcuts

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