golang

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Mar 1, 2024 License: Apache-2.0 Imports: 45 Imported by: 0

Documentation

Overview

Package golang provides a concrete Cataloger implementation relating to packages within the Go language ecosystem.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewGoModuleBinaryCataloger

func NewGoModuleBinaryCataloger(opts CatalogerConfig) pkg.Cataloger

NewGoModuleBinaryCataloger returns a new cataloger object that searches within binaries built by the go compiler.

func NewGoModuleFileCataloger

func NewGoModuleFileCataloger(opts CatalogerConfig) pkg.Cataloger

NewGoModuleFileCataloger returns a new cataloger object that searches within go.mod files.

Types

type CatalogerConfig

type CatalogerConfig struct {
	SearchLocalModCacheLicenses bool                    `yaml:"search-local-mod-cache-licenses" json:"search-local-mod-cache-licenses" mapstructure:"search-local-mod-cache-licenses"`
	LocalModCacheDir            string                  `yaml:"local-mod-cache-dir" json:"local-mod-cache-dir" mapstructure:"local-mod-cache-dir"`
	SearchRemoteLicenses        bool                    `yaml:"search-remote-licenses" json:"search-remote-licenses" mapstructure:"search-remote-licenses"`
	Proxies                     []string                `yaml:"proxies,omitempty" json:"proxies,omitempty" mapstructure:"proxies"`
	NoProxy                     []string                `yaml:"no-proxy,omitempty" json:"no-proxy,omitempty" mapstructure:"no-proxy"`
	MainModuleVersion           MainModuleVersionConfig `yaml:"main-module-version" json:"main-module-version" mapstructure:"main-module-version"`
}

func DefaultCatalogerConfig

func DefaultCatalogerConfig() CatalogerConfig

DefaultCatalogerConfig create a CatalogerConfig with default options, which includes: - setting the default remote proxy if none is provided - setting the default no proxy if none is provided - setting the default local module cache dir if none is provided

func (CatalogerConfig) WithLocalModCacheDir

func (g CatalogerConfig) WithLocalModCacheDir(input string) CatalogerConfig

func (CatalogerConfig) WithMainModuleVersion

func (g CatalogerConfig) WithMainModuleVersion(input MainModuleVersionConfig) CatalogerConfig

func (CatalogerConfig) WithNoProxy

func (g CatalogerConfig) WithNoProxy(input string) CatalogerConfig

func (CatalogerConfig) WithProxy

func (g CatalogerConfig) WithProxy(input string) CatalogerConfig

func (CatalogerConfig) WithSearchLocalModCacheLicenses

func (g CatalogerConfig) WithSearchLocalModCacheLicenses(input bool) CatalogerConfig

func (CatalogerConfig) WithSearchRemoteLicenses

func (g CatalogerConfig) WithSearchRemoteLicenses(input bool) CatalogerConfig

type MainModuleVersionConfig

type MainModuleVersionConfig struct {
	FromLDFlags       bool `yaml:"from-ld-flags" json:"from-ld-flags" mapstructure:"from-ld-flags"`
	FromContents      bool `yaml:"from-contents" json:"from-contents" mapstructure:"from-contents"`
	FromBuildSettings bool `yaml:"from-build-settings" json:"from-build-settings" mapstructure:"from-build-settings"`
}

func DefaultMainModuleVersionConfig

func DefaultMainModuleVersionConfig() MainModuleVersionConfig

func (MainModuleVersionConfig) WithFromBuildSettings

func (g MainModuleVersionConfig) WithFromBuildSettings(input bool) MainModuleVersionConfig

func (MainModuleVersionConfig) WithFromContents

func (g MainModuleVersionConfig) WithFromContents(input bool) MainModuleVersionConfig

func (MainModuleVersionConfig) WithFromLDFlags

func (g MainModuleVersionConfig) WithFromLDFlags(input bool) MainModuleVersionConfig

Directories

Path Synopsis
internal

Jump to

Keyboard shortcuts

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