Documentation ¶
Index ¶
- Variables
- type Info
- type List
- type Module
- func (m *Module) GetAddr() string
- func (m *Module) GetAddrWithVersion() string
- func (m *Module) GetDomain() string
- func (m *Module) GetInfoAddr(base string, isUpstream bool) (string, error)
- func (m *Module) GetLatestAddr(base string, isUpstream bool) (string, error)
- func (m *Module) GetListAddr(base string, isUpstream bool) (string, error)
- func (m *Module) GetModAddr(base string, isUpstream bool) (string, error)
- func (m *Module) GetStorageInfo(base string) (io.ReadCloser, error)
- func (m *Module) GetStorageMod(base string) (io.ReadCloser, error)
- func (m *Module) GetStorageZip(base string) (io.ReadCloser, error)
- func (m *Module) GetVersion() string
- func (m *Module) GetZipAddr(base string, isUpstream bool) (string, error)
- type Path
- type PathType
- type Versions
Constants ¶
This section is empty.
Variables ¶
var ( ErrUnknownPathType = errors.New("unknown path type") ErrInvalidPath = errors.New("invalid path") ErrInvalidPathType = errors.New("invalid path type") ErrUnknownVersion = errors.New("unknown version") )
Defined a common set of error types for Module Path
Functions ¶
This section is empty.
Types ¶
type List ¶
type List struct { Path string `json:"Path"` Version string `json:"Version"` Versions Versions `json:",omitempty"` Time time.Time `json:"time"` Dir string `json:"Dir"` GoMod string `json:"GoMod"` }
List is the standard return value, which corresponds to the go list -json command.
func (*List) GetVersions ¶
GetVersions is used to get all valid versions of package
type Module ¶
type Module struct {
// contains filtered or unexported fields
}
Module defines the structure of package module
func (*Module) GetAddrWithVersion ¶
GetAddrWithVersion is used to get the module name with version
func (*Module) GetInfoAddr ¶
GetInfoAddr is used to get info address
func (*Module) GetLatestAddr ¶
GetLatestAddr is used to get latest address
func (*Module) GetListAddr ¶
GetListAddr is used to get list address
func (*Module) GetModAddr ¶
GetModAddr is used to get mod address
func (*Module) GetStorageInfo ¶
func (m *Module) GetStorageInfo(base string) (io.ReadCloser, error)
GetStorageInfo is used to get the info of module from the local storage
func (*Module) GetStorageMod ¶
func (m *Module) GetStorageMod(base string) (io.ReadCloser, error)
GetStorageMod is used to get the mod of module from the local storage
func (*Module) GetStorageZip ¶
func (m *Module) GetStorageZip(base string) (io.ReadCloser, error)
GetStorageZip is used to get the zip file of module from the local storage
func (*Module) GetVersion ¶
GetVersion is used to get the module version
type Path ¶
type Path struct { Module // contains filtered or unexported fields }
Path is used to parse the request path and generate the module info.
func (*Path) GetModAddr ¶
GetModAddr is used to get the module address of specified module path
func (*Path) GetModVersion ¶
GetModVersion is used to get the module version of specified module path