cmd

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Apr 18, 2025 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Run

func Run(ctx context.Context, stdout io.Writer, args []string) error

Types

type Delete

type Delete struct {
	ID []int64 `arg:"" required:"" help:"ID of event to delete."`
}

func (Delete) Run

func (cmd Delete) Run(ctx context.Context, stdout io.Writer, verbose bool, queries *db.Queries) error

type Edit

type Edit struct {
	ID          int64     `arg:"" required:"" help:"ID of event to edit"`
	Name        *string   `help:"Name of event."`
	Start       time.Time `short:"s" optional:"" format:"2006-01-02 15:04" help:"Date event starts."`
	End         time.Time `short:"e" optional:"" format:"2006-01-02 15:04" help:"Date event ends."`
	Description *string   `short:"d" default:"" help:"Description for event."`
}

func (Edit) Run

func (cmd Edit) Run(ctx context.Context, stdout io.Writer, queries *db.Queries, location *time.Location) error

type New

type New struct {
	Name        string    `arg:"" help:"Name of event."`
	StartDate   time.Time `arg:"" format:"2006-01-02" help:"Date event starts."`
	StartTime   time.Time `arg:"" optional:"" format:"15:04" help:"Time event starts."`
	Description string    `short:"d" default:"" help:"Description for event."`
	Recurrence  string    `short:"r" default:"" help:"RRULE for event."`
}

func (New) Run

func (cmd New) Run(ctx context.Context, stdout io.Writer, queries *db.Queries, location *time.Location) error

type Root

type Root struct {
	Driver     string  `default:"sqlite" env:"DRIVER" help:"Driver to use as for backed"`
	DataSource string  `default:"schedule.db" env:"DATA_SOURCE" help:"Connection string for driver"`
	Verbose    bool    `short:"v" help:"Print more information to screen."`
	New        New     `cmd:"" help:"Create a new event."`
	Get        get.CMD `cmd:"" help:"Get events"`
	Delete     Delete  `cmd:"" help:"Delete events by ID"`
	Edit       Edit    `cmd:"" help:"Edit an event by ID"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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