types

package
v0.3.2 Latest Latest
Warning

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

Go to latest
Published: Feb 20, 2024 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	AuthTypeToken     = "token"
	AuthTypeGithubApp = "github-app"
)

Variables

Functions

This section is empty.

Types

type Config

type Config struct {
	Version string   `mapstructure:"version"`
	Presets []string `mapstructure:"presets"`
	Rules   []Rule   `mapstructure:"rules"`
}

type DataConfig

type DataConfig struct {
	TempDir string `yaml:"tempDir"`
	// Timeout for accessing files and running commands
	Timeout int64 `yaml:"timeout"` // in seconds
}

func (DataConfig) GetTimeout

func (d DataConfig) GetTimeout() time.Duration

type Dependency

type Dependency struct {
	File           string // file path of go.mod
	Name           string
	Version        string
	Indirect       bool
	PackageManager PackageManager
	Position       Position // position is only used for some package managers
	Extra          map[string]interface{}
}

func (Dependency) Hash

func (d Dependency) Hash() string

type GitHubConfig

type GitHubConfig struct {
	AuthType string `yaml:"authType"` // token, github-app
	// if auth-type is token
	Token string `yaml:"token"`

	// if auth-type is github-app
	AppID          int64  `yaml:"appID"`
	PEMFile        string `yaml:"pemFile"`
	ClientID       string `yaml:"clientID"`
	InstallationID int64  `yaml:"installationID"`
	AppName        string `yaml:"appName"`
	AppUserID      int64  `yaml:"appUserID"`
}

type GiteaConfig

type GiteaConfig struct {
	Host     string `yaml:"host"`
	AuthType string `yaml:"authType"` // token

	// if auth-type is token
	Token string `yaml:"token"`
}

func (*GiteaConfig) GetHost

func (c *GiteaConfig) GetHost() string

type HostingConfig

type HostingConfig struct {
	Data    DataConfig    `yaml:"data"`
	Network NetworkConfig `yaml:"network"`
	GitHub  GitHubConfig  `yaml:"github"`
	Gitea   []GiteaConfig `yaml:"gitea"`
}

type Match

type Match struct {
	File           string
	PackageManager PackageManager
}

type NetworkConfig

type NetworkConfig struct {
	Timeout int64 `yaml:"timeout"` // in seconds
}

func (NetworkConfig) GetTimeout

func (n NetworkConfig) GetTimeout() time.Duration

type PackageManager

type PackageManager string
const (
	PackageManagerDocker        PackageManager = "docker"
	PackageManagerGitHubActions PackageManager = "github-actions"
	PackageManagerGoMod         PackageManager = "go-mod"
	PackageManagerPip           PackageManager = "pip"
)

type PackageType

type PackageType string
const (
	PackageTypeDirect   PackageType = "direct"
	PackageTypeIndirect PackageType = "indirect"
	PackageTypeAll      PackageType = "all"
)

type Position

type Position struct {
	Line      int
	ColStart  int
	ColEnd    int
	ByteStart int
	ByteEnd   int
}

type RequestFailedError added in v0.3.0

type RequestFailedError struct {
	For        string
	StatusCode int
	Body       string
}

func (*RequestFailedError) Error added in v0.3.0

func (e *RequestFailedError) Error() string

type Rule

type Rule struct {
	Name            string           `mapstructure:"name"`
	PackageManagers []PackageManager `mapstructure:"package-managers"`
	PackageNames    []string         `mapstructure:"package-names"`
	PackageTypes    []PackageType    `mapstructure:"package-types"` // direct, indirect, all
	Labels          []string         `mapstructure:"labels"`        // github labels
}

type UpgradeInfo

type UpgradeInfo struct {
	Dependency Dependency
	Upgradable bool
	ToVersion  string
}

Jump to

Keyboard shortcuts

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