adrgo

package module
v0.0.0-...-1bd88ca Latest Latest
Warning

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

Go to latest
Published: Feb 2, 2022 License: MIT Imports: 26 Imported by: 0

README

adr-go

Go Report Card .github/workflows/gocover.yml Coverage Status

Architecture Decision Records with Go.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrAlreadyExists   = errors.New("already exists")
	ErrWriteFileFailed = errors.New("write file failed")
)

Functions

func CreateADRTemplate

func CreateADRTemplate(body Body) (out string)

func HeaderInfo

func HeaderInfo(title string) (id int, name string)

headerInfo formats the header information.

func Init

func Init(conf Config) (err error)

func IsInitedConfig

func IsInitedConfig() bool

func IsValidLanguage

func IsValidLanguage(lang string) bool

func List

func List(ctx context.Context, conf Config, w io.Writer) (err error)

func LoadLanguage

func LoadLanguage(lang string)

func MarshalConfig

func MarshalConfig(conf Config) []byte

func New

func New(ctx context.Context, conf Config, new ADRecord) (err error)

func T

func T(id string) string

Types

type ADRecord

type ADRecord struct {
	ID           int
	Title        string
	Path         string
	Status       string
	LastModified string
}

type Body

type Body struct {
	FileName   string
	Index      int
	Title      string
	LastUpdate string
	Status     []Status
	Heads      []Head
}

func ParserFile

func ParserFile(ctx context.Context, fp string) (body Body, err error)

type Config

type Config struct {
	Language string
	Path     string
	Digits   int
}

func ReadConfig

func ReadConfig() (conf Config, err error)
type Head struct {
	Head  string
	Start int
	End   int
}

type Status

type Status struct {
	Value string
	Date  string
}

Directories

Path Synopsis
cmd
adr

Jump to

Keyboard shortcuts

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