config

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Feb 1, 2026 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const ConfigFileName = "tagger.config.json"
View Source
const SchemaURL = "https://raw.githubusercontent.com/AkaraChen/tagger/main/tagger.schema.json"

Variables

This section is empty.

Functions

func CreateDefault

func CreateDefault() error

CreateDefault 创建默认配置文件

Types

type Config

type Config struct {
	Schema             string             `json:"$schema,omitempty"`
	GitHostingProvider GitHostingProvider `json:"gitHostingProvider"`
	GitHub             *GitHubConfig      `json:"github,omitempty"`
}

Config 工具的配置文件结构

func Load

func Load() (*Config, error)

Load 从当前目录加载配置文件

func (*Config) IsGitHub

func (c *Config) IsGitHub() bool

IsGitHub 判断配置中的托管平台是否为 GitHub

func (*Config) ShouldOpenActionPage

func (c *Config) ShouldOpenActionPage() bool

ShouldOpenActionPage 判断是否应该打开 Action 页面 如果配置中没有指定,默认返回 true

type GitHostingProvider

type GitHostingProvider string

GitHostingProvider 表示 Git 托管平台类型

const (
	GitHub GitHostingProvider = "GitHub"
	Other  GitHostingProvider = "Other"
)

type GitHubConfig

type GitHubConfig struct {
	// 使用指针类型可以区分"未设置"和"false"
	OpenActionPage *bool `json:"openActionPage,omitempty"`
}

GitHubConfig GitHub 平台的配置

Jump to

Keyboard shortcuts

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