config

package
v0.0.0-...-4aff868 Latest Latest
Warning

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

Go to latest
Published: Mar 1, 2020 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Init

func Init(path string)

Init initialize

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"`
}

CodeTemplate config parse code template

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
}

Config load and save configuration

var Instance *Config

Instance global configuration

func (*Config) AddTemplate

func (c *Config) AddTemplate() (err error)

AddTemplate add template

func (*Config) RemoveTemplate

func (c *Config) RemoveTemplate() (err error)

RemoveTemplate remove template

func (*Config) SetDefaultTemplate

func (c *Config) SetDefaultTemplate() error

SetDefaultTemplate set default template index

func (*Config) SetFolderName

func (c *Config) SetFolderName() (err error)

SetFolderName set folder name

func (*Config) SetGenAfterParse

func (c *Config) SetGenAfterParse() (err error)

SetGenAfterParse set it yes or no

func (*Config) SetHost

func (c *Config) SetHost() (err error)

SetHost set host for Codeforces

func (*Config) SetProxy

func (c *Config) SetProxy() (err error)

SetProxy set proxy for client

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