configs

package
v0.13.1 Latest Latest
Warning

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

Go to latest
Published: Nov 9, 2023 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	// 引擎
	*gin.Engine `yaml:"-"`
	// 测试
	Debug bool `yaml:"debug"`
	// 端口 0~65535
	Port int64 `yaml:"port" default:"9000"`
	// 动态
	Oid string `yaml:"oid" default:"643451139714449427"`
	// 资源文件夹路径
	Path Path `yaml:"path" default:"initial.Default;MkdirAll"`
	// Github 主页
	Github Github `yaml:"github" default:"initial.Default"`
	// 管理员
	Administrators []string `yaml:"administrators"`
}

webhook 配置

func Get added in v0.7.0

func Get() *Config

func Set added in v0.7.0

func Set(c *Config) *Config

func (*Config) Init

func (c *Config) Init()

自动填充

func (*Config) UpdateIndex

func (c *Config) UpdateIndex() error

更新主页

type Github

type Github struct {
	Username   string `yaml:"username" default:"Drelf2018"`
	Repository string `yaml:"repository" default:"gin.nana7mi.link"`
	Branche    string `yaml:"branche" default:"gh-pages"`

	Commit struct {
		Sha string `json:"sha"`
	} `json:"commit" yaml:"-"`
}

func (*Github) API added in v0.7.0

func (g *Github) API() string

func (*Github) Clone

func (g *Github) Clone(folder string) error

克隆到文件夹

func (*Github) GIT added in v0.7.0

func (g *Github) GIT() string

func (*Github) GetLatestCommit

func (g *Github) GetLatestCommit() error

获取最新提交

func (*Github) Sha added in v0.8.0

func (g *Github) Sha() []byte

func (*Github) UpdateIndex added in v0.9.0

func (g *Github) UpdateIndex(views, index, version string) error

更新主页

type Path

type Path struct {
	Root    string `yaml:"root" default:"resource"`
	Views   string `yaml:"views" default:"views" abs:"Root"`
	Public  string `yaml:"public" default:"public" abs:"Root"`
	Posts   string `yaml:"posts" default:"posts.db" abs:"Public"`
	Users   string `yaml:"users" default:"users.db" abs:"Root"`
	Log     string `yaml:"log" default:".log" abs:"Root"`
	Index   string `yaml:"index" default:"index.html" abs:"Views"`
	Version string `yaml:"version" default:".version" abs:"Views"`

	Full *Path `yaml:"-" default:"initial.Abs"`
}

资源文件夹路径

func (*Path) MkdirAll added in v0.9.0

func (p *Path) MkdirAll(_ *Config)

Jump to

Keyboard shortcuts

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