config

package
Version: v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Jul 21, 2021 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	IssueTrackerInvalid  IssueTracker = ""
	IssueTrackerJira                  = "JIRA"
	IssueTrackerGithub                = "GITHUB"
	IssueTrackerGitlab                = "GITLAB"
	IssueTrackerPivotal               = "PIVOTAL_TRACKER"
	IssueTrackerRedmine               = "REDMINE"
	IssueTrackerYoutrack              = "YOUTRACK"
	IssueTrackerAzure                 = "AZURE"
)

Issue tracker types

View Source
const DefaultLocal = ".todocheck.yaml"

DefaultLocal contains the default filepath to the local todocheck config for the current repository

Variables

ValidAuthTypes is used for validation of auth type

Functions

func DefaultTokensCache

func DefaultTokensCache() string

DefaultTokensCache for storing auth tokens

Types

type Auth

type Auth struct {
	Type        AuthType `yaml:"type"`
	OfflineURL  string   `yaml:"offline_url"`
	TokensCache string   `yaml:"tokens_cache,omitempty"`
	Token       string   `yaml:"-"`
}

Auth configuration section for specifying issue tracker auth options

type AuthType

type AuthType string

AuthType specifies the type of the auth token in todocheck's config

const (
	AuthTypeNone     AuthType = "none"
	AuthTypeOffline  AuthType = "offline"
	AuthTypeAPIToken AuthType = "apitoken"
)

possible auth types

func (AuthType) IsValid added in v0.4.0

func (a AuthType) IsValid() bool

IsValid checks if the given AuthType is among the valid enum values

func (AuthType) String added in v0.4.0

func (a AuthType) String() string

type IssueTracker

type IssueTracker string

IssueTracker enum

func (IssueTracker) IsValid added in v0.4.0

func (it IssueTracker) IsValid() bool

IsValid checks if the given issue tracker is among the valid enum values

func (IssueTracker) IsValidAuthType added in v0.4.0

func (it IssueTracker) IsValidAuthType(authType AuthType) bool

IsValidAuthType checks if the given auth type is among the valid auth types for the given issue tracker

func (IssueTracker) IsValidOrigin added in v0.4.0

func (it IssueTracker) IsValidOrigin(origin string) bool

IsValidOrigin checks if the given origin is among the valid patterns for the given issue tracker

type Local

type Local struct {
	Origin       string       `yaml:"origin"`
	IssueTracker IssueTracker `yaml:"issue_tracker"`
	IgnoredPaths []string     `yaml:"ignored"`
	CustomTodos  []string     `yaml:"custom_todos"`
	Auth         *Auth        `yaml:"auth"`
}

Local todocheck configuration struct definition

func NewLocal

func NewLocal(cfgPath, basepath string) (*Local, error)

NewLocal configuration from a given file path

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
t or T : Toggle theme light dark auto
y or Y : Canonical URL