deps

package
v0.0.0-...-4d61859 Latest Latest
Warning

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

Go to latest
Published: Dec 16, 2023 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Overview

Copyright 2018 jsonnet-bundler authors

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.

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

Constants

View Source
const (
	GitSchemeSSH   = "ssh://git@"
	GitSchemeHTTPS = "https://"
)

Variables

View Source
var (
	VersionRegex        = `@(?P<version>.*)`
	PathRegex           = `/(?P<subdir>.*)`
	PathAndVersionRegex = `/(?P<subdir>.*)@(?P<version>.*)`
)

Functions

This section is empty.

Types

type Dependency

type Dependency struct {
	Source  Source `json:"source"`
	Version string `json:"version"`
	Sum     string `json:"sum,omitempty"`
	Single  bool   `json:"single,omitempty"`

	// older schema used to have `name`. We still need that data for
	// `LegacyName`
	LegacyNameCompat string `json:"name,omitempty"`
}

func Parse

func Parse(dir, uri string) *Dependency

func (Dependency) LegacyName

func (d Dependency) LegacyName() string

func (Dependency) Name

func (d Dependency) Name() string

type Git

type Git struct {
	// Scheme (Protocol) used (https, git+ssh)
	Scheme string

	// Hostname the repo is located at
	Host string
	// User (example.com/<user>)
	User string
	// Repo (example.com/<user>/<repo>)
	Repo string
	// Subdir (example.com/<user>/<repo>/<subdir>)
	Subdir string
}

Git holds all required information for cloning a package from git

func (*Git) LegacyName

func (gs *Git) LegacyName() string

LegacyName returns the last element of the packages path example: github.com/ksonnet/ksonnet-lib/ksonnet.beta.4 becomes ksonnet.beta.4

func (*Git) MarshalJSON

func (gs *Git) MarshalJSON() ([]byte, error)

MarshalJSON takes care of translating between Git and jsonGit

func (*Git) Name

func (gs *Git) Name() string

Name returns the repository in a go-like format (example.com/user/repo/subdir)

func (*Git) Remote

func (gs *Git) Remote() string

Remote returns a remote string that can be passed to git

func (*Git) UnmarshalJSON

func (gs *Git) UnmarshalJSON(data []byte) error

UnmarshalJSON takes care of translating between Git and jsonGit

type Local

type Local struct {
	Directory string `json:"directory"`
}

type Source

type Source struct {
	GitSource   *Git   `json:"git,omitempty"`
	LocalSource *Local `json:"local,omitempty"`
}

func (Source) LegacyName

func (s Source) LegacyName() string

func (Source) Name

func (s Source) Name() string

Jump to

Keyboard shortcuts

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