cmd

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Jul 12, 2023 License: MIT Imports: 25 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AppAction

func AppAction(c *cli.Context) error

func CreateApp

func CreateApp(actionFunc cli.ActionFunc) *cli.App

CreateApp creates and initializes CLI application with description, flags, version, etc.

Types

type AICommitBuilder

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

func (*AICommitBuilder) BuildCommit

func (a *AICommitBuilder) BuildCommit(ctx context.Context, mr *git.MergeRequest) string

type Answer

type Answer struct {
	RepositoryURL string   `survey:"repository_url"`
	Style         string   `survey:"style"`
	Template      string   `survey:"template"`
	ConfigDir     string   `survey:"config_dir"`
	Token         string   `survey:"token"`
	POEToken      string   `survey:"poe_token"`
	NeedRobot     bool     `survey:"need_robot"`
	AppID         string   `survey:"app_id"`
	AppSecret     string   `survey:"app_secret"`
	ChatID        []string `survey:"chat_id"`
	BotTitle      string   `survey:"bot_title"`
	SkipConfig    bool
	SkipTpl       bool
}

Answer ...

type Builder

type Builder interface {
	Build(*Answer) (string, error)
}

Builder ...

type CLI

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

func NewCLI

func NewCLI(
	ctx *CLIContext, fs FileSystem,
	configLoader ConfigLoader,
	generator Generator,
) *CLI

func (*CLI) Run

func (c *CLI) Run() int

type CLIContext

type CLIContext struct {
	WorkingDir       string
	Stdout           io.Writer
	Stderr           io.Writer
	ConfigPath       string
	Template         string
	OutputPath       string
	Silent           bool
	NoColor          bool
	NoEmoji          bool
	NoCaseSensitive  bool
	Query            string
	NextTag          string
	TagFilterPattern string
	RepositoryURL    string
	Token            string
	Sort             string
	AI               bool
	AIType           string
	PushBot          bool
	AppID            string
	AppSecret        string
	ChatID           []string
	BotTitle         string
}

type CommitBuilder

type CommitBuilder interface {
	BuildCommit(ctx context.Context, mr *git.MergeRequest) string
}

func NewAICommitBuilder

func NewAICommitBuilder(tp string, token string) CommitBuilder

type ConfigBuilder

type ConfigBuilder interface {
	Builder
}

ConfigBuilder ...

func NewConfigBuilder

func NewConfigBuilder() ConfigBuilder

NewConfigBuilder ...

type ConfigLoader

type ConfigLoader interface {
	Load(string) (*config.MRChLogConfig, error)
}

ConfigLoader ...

func NewConfigLoader

func NewConfigLoader() ConfigLoader

NewConfigLoader ...

type File

type File interface {
	io.Closer
	io.Reader
	io.ReaderAt
	io.Seeker
	io.Writer
	Stat() (os.FileInfo, error)
}

File ...

type FileSystem

type FileSystem interface {
	Exists(path string) bool
	MkdirP(path string) error
	Create(name string) (File, error)
	WriteFile(path string, content []byte) error
}

FileSystem ...

type Generator

type Generator interface {
	Generate(io.Writer, *CLIContext, *config.MRChLogConfig) error
}

Generator ...

func NewGenerator

func NewGenerator() Generator

NewGenerator ...

type InitContext

type InitContext struct {
	WorkingDir    string
	ProjectID     string
	Token         string
	RepositoryURL string
	Stdout        io.Writer
	Stderr        io.Writer
}

type Initializer

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

Initializer ...

func NewInitializer

func NewInitializer(
	ctx *InitContext,
	fs FileSystem,
	questioner Questioner,
	configBuilder ConfigBuilder,
	tplBuilderFactory TemplateBuilderFactory) *Initializer

NewInitializer ...

func (*Initializer) Run

func (init *Initializer) Run() int

Run ...

type Previewable

type Previewable interface {
	Display() string
	Preview() string
}

Previewable ...

type Questioner

type Questioner interface {
	Ask() (*Answer, error)
}

Questioner ...

func NewQuestioner

func NewQuestioner(client gitcmd.Client, fs FileSystem) Questioner

NewQuestioner ...

type RenderData

type RenderData struct {
	Title         string
	RepositoryURL string
	Unreleased    map[string][]*git.MergeRequest
	Version       []*Version
}

type TemplateBuilder

type TemplateBuilder interface {
	Builder
}

TemplateBuilder ...

func NewDefaultTemplateBuilder

func NewDefaultTemplateBuilder() TemplateBuilder

type TemplateBuilderFactory

type TemplateBuilderFactory = func(string) TemplateBuilder

TemplateBuilderFactory ...

type TemplateStyleFormat

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

TemplateStyleFormat ...

func (*TemplateStyleFormat) Display

func (t *TemplateStyleFormat) Display() string

Display ...

func (*TemplateStyleFormat) Preview

func (t *TemplateStyleFormat) Preview() string

Preview ...

type Version

type Version struct {
	Tag   *git.Tag
	MRs   map[string][]*git.MergeRequest
	SQL   string
	Break string
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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