Help us shape the future of Go! Take the 2026 Go Developer Survey

config

package
v1.0.5 Latest Latest
Warning

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

Go to latest
Published: Jan 11, 2022 License: GPL-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Init

func Init(path string)

Types

type CodeTemplate

type CodeTemplate struct {
	Alias        string   `json:"alias"`
	Lang         string   `json:"lang"`
	Path         string   `json:"path"`
	Suffix       []string `json:"suffix"`
	BeforeScript string   `json:"before_script"`
	Script       string   `json:"script"`
	AfterScript  string   `json:"after_script"`
}

type Config

type Config struct {
	Template []CodeTemplate `json:"template"`
	Default  int            `json:"default"`
	// GenAfterParse bool           `json:"gen_after_parse"`
	Host string `json:"host"`
	// Proxy         string            `json:"proxy"`
	FolderName map[string]string `json:"folder_name"`
	// contains filtered or unexported fields
}
var (
	Instance *Config
)

func (*Config) AddTemplate

func (c *Config) AddTemplate() error

Add a template

func (*Config) RemoveTemplate

func (c *Config) RemoveTemplate() error

Remove a template

func (*Config) SetDefaultTemplate

func (c *Config) SetDefaultTemplate() error

SetDefaultTemplate set default template index

func (*Config) TemplateByAlias

func (c *Config) TemplateByAlias(alias string) []CodeTemplate

TemplateByAlias return all template which alias equals to alias

Jump to

Keyboard shortcuts

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