context

package
v0.22.0 Latest Latest
Warning

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

Go to latest
Published: Mar 23, 2024 License: GPL-3.0 Imports: 6 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 {
	GitHubMirrorURL  string `json:"github_mirror_url"`
	GoModuleProxyURL string `json:"go_module_proxy_url"`
	ProxyURL         string `json:"proxy_url"`
}

type Context

type Context struct {
	// contains filtered or unexported fields
}

Context is the context of the application.

func New

func New(config Config, version semver.Version) *Context

New creates a new context.

func (*Context) CacheDir

func (ctx *Context) CacheDir() (path.Path, error)

CacheDir returns the cache directory.

func (*Context) Config

func (ctx *Context) Config() *Config

Config returns the config.

func (*Context) CreateDirStructure

func (ctx *Context) CreateDirStructure() error

CreateDirStructure creates the directory structure.

func (*Context) GitHubMirrorURL

func (ctx *Context) GitHubMirrorURL() (*url.URL, error)

GitHubMirrorURL returns the GitHub mirror URL.

func (*Context) GlobalDotLipDir

func (ctx *Context) GlobalDotLipDir() (path.Path, error)

GlobalDotLipDir returns the global .lip directory.

func (*Context) GoModuleProxyURL

func (ctx *Context) GoModuleProxyURL() (*url.URL, error)

GoModuleProxyURL returns the go module proxy URL.

func (*Context) LipVersion

func (ctx *Context) LipVersion() semver.Version

LipVersion returns the lip version.

func (*Context) LoadOrCreateConfigFile

func (ctx *Context) LoadOrCreateConfigFile() error

LoadOrCreateConfigFile loads or creates the config file.

func (*Context) LocalDotLipDir

func (ctx *Context) LocalDotLipDir() (path.Path, error)

LocalDotLipDir returns the local .lip directory.

func (*Context) MetadataDir

func (ctx *Context) MetadataDir() (path.Path, error)

MetadataDir returns the metadata directory.

func (*Context) ProxyURL added in v0.21.0

func (ctx *Context) ProxyURL() (*url.URL, error)

ProxyURL returns the proxy URL.

func (*Context) SaveConfigFile

func (ctx *Context) SaveConfigFile() error

SaveConfigFile saves the config file.

Jump to

Keyboard shortcuts

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