Documentation ¶
Overview ¶
Copyright © 2021 Loft Orbital
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Copyright © 2021 Loft Orbital ¶
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Copyright © 2021 Loft Orbital ¶
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Copyright © 2021 Loft Orbital ¶
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Copyright © 2021 Loft Orbital ¶
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Index ¶
- Variables
- func BillyCopy(dstFS, srcFS billy.Filesystem) error
- func CacheDir() (billy.Filesystem, error)
- func CacheLoad(m module.Version) (billy.Filesystem, error)
- func CacheStore(m module.Version, fs billy.Filesystem) (billy.Filesystem, error)
- func CredentialsFor(host string) (usr, pwd string)
- func Download(mod module.Version, fs billy.Filesystem) error
- func GetFS(mod module.Version) (billy.Filesystem, error)
- func GetReqs(fs billy.Filesystem) ([]module.Version, error)
- func IsPrivate(mod string) bool
- func MatchPrefixPatterns(globs, target string) bool
- func NetrcMachines() map[string]NetrcMachine
- type Credentials
- type Meta
- type ModReqs
- type Module
- type NetrcMachine
Constants ¶
This section is empty.
Variables ¶
var CuePrivatePattern string = os.Getenv("CUEPRIVATE")
CuePrivatePattern extracts the pattern to find private module from CUEPRIVATE environment variable.
Functions ¶
func BillyCopy ¶
func BillyCopy(dstFS, srcFS billy.Filesystem) error
BillyCopy copy srcFS into dstFS billy filesystems.
func CacheDir ¶
func CacheDir() (billy.Filesystem, error)
CacheDir returns the cuebe cache directory (~/.cache/cuebe).
func CacheLoad ¶
CacheLoad retrieve the module's filesystem from the cache. This filesystem can be empty (os.ErrNotExist).
func CacheStore ¶
CacheStore store a module filesystem to the global cache. It returns the cached filesystem.
func CredentialsFor ¶
CredentialsFor gets the user and password credentials for host. First looking at <HOST_DOMAIN>_TOKEN and <HOST_DOMAIN>_USER env var and fallbacking to netrc if they are not set.
func GetFS ¶
GetFS returns the cached filesystem for mod. If the module is not yet cached, it will be first downloaded and then cached.
func MatchPrefixPatterns ¶
MatchPrefixPatterns reports whether any path prefix of target matches one of the glob patterns (as defined by path.Match) in the comma-separated globs list. This implements the algorithm used when matching a module path to the GOPRIVATE environment variable, as described by 'go help module-private'.
It ignores any empty or malformed patterns in the list.
func NetrcMachines ¶
func NetrcMachines() map[string]NetrcMachine
Types ¶
type Credentials ¶
Credentials represents the credentials required to get a module.
type Meta ¶
type Meta struct { // VCS represents the VCS type of a module (git, svn, etc..) VCS string // RepoURL represents the clone url of a module. RepoURL string RootPath string Credentials *Credentials }
Meta represents a module meta
type ModReqs ¶
type ModReqs struct { // Root module path Root string // Root module requirements RootReqs []module.Version }
ModReqs implements the Reqs interface. The Compare function uses semver.Compare.
type Module ¶
type Module struct {
// contains filtered or unexported fields
}
Module represents a CUE module
type NetrcMachine ¶
func NetrcCredentials ¶
func NetrcCredentials(machine string) (NetrcMachine, error)