buflock

package
v0.56.0 Latest Latest
Warning

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

Go to latest
Published: Sep 8, 2021 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Overview

Package buflock manages the buf.lock lock file.

Index

Constants

View Source
const (
	// ExternalConfigFilePath defines the path to the lock file, relative to the root of the module.
	ExternalConfigFilePath = "buf.lock"
	// V1Version is the string used to identify the v1 version of the lock file.
	V1Version = "v1"
	// V1Beta1Version is the string used to identify the v1beta1 version of the lock file.
	V1Beta1Version = "v1beta1"
	// Header is the header prepended to any lock files.
	Header = "# Generated by buf. DO NOT EDIT.\n"
)

Variables

This section is empty.

Functions

func WriteConfig

func WriteConfig(ctx context.Context, writeBucket storage.WriteBucket, config *Config) error

WriteConfig writes the lock file to the WriteBucket at ExternalConfigFilePath.

Types

type Config

type Config struct {
	Dependencies []Dependency
}

Config holds the parsed lock file information.

func ReadConfig

func ReadConfig(ctx context.Context, readBucket storage.ReadBucket) (*Config, error)

ReadConfig reads the lock file at ExternalConfigFilePath relative to the root of the bucket.

type Dependency

type Dependency struct {
	Remote     string
	Owner      string
	Repository string
	Branch     string
	Commit     string
	Digest     string
	CreateTime time.Time
}

Dependency describes a single pinned dependency.

type ExternalConfigDependencyV1

type ExternalConfigDependencyV1 struct {
	Remote     string    `json:"remote,omitempty" yaml:"remote,omitempty"`
	Owner      string    `json:"owner,omitempty" yaml:"owner,omitempty"`
	Repository string    `json:"repository,omitempty" yaml:"repository,omitempty"`
	Branch     string    `json:"branch,omitempty" yaml:"branch,omitempty"`
	Commit     string    `json:"commit,omitempty" yaml:"commit,omitempty"`
	Digest     string    `json:"digest,omitempty" yaml:"digest,omitempty"`
	CreateTime time.Time `json:"create_time,omitempty" yaml:"create_time,omitempty"`
}

ExternalConfigDependencyV1 represents a single dependency within the v1 lock file.

type ExternalConfigDependencyV1Beta1

type ExternalConfigDependencyV1Beta1 struct {
	Remote     string    `json:"remote,omitempty" yaml:"remote,omitempty"`
	Owner      string    `json:"owner,omitempty" yaml:"owner,omitempty"`
	Repository string    `json:"repository,omitempty" yaml:"repository,omitempty"`
	Branch     string    `json:"branch,omitempty" yaml:"branch,omitempty"`
	Commit     string    `json:"commit,omitempty" yaml:"commit,omitempty"`
	Digest     string    `json:"digest,omitempty" yaml:"digest,omitempty"`
	CreateTime time.Time `json:"create_time,omitempty" yaml:"create_time,omitempty"`
}

ExternalConfigDependencyV1Beta1 represents a single dependency within the v1beta1 lock file.

type ExternalConfigV1

type ExternalConfigV1 struct {
	Version string                       `json:"version,omitempty" yaml:"version,omitempty"`
	Deps    []ExternalConfigDependencyV1 `json:"deps,omitempty" yaml:"deps,omitempty"`
}

ExternalConfigV1 represents the v1 lock file.

type ExternalConfigV1Beta1

type ExternalConfigV1Beta1 struct {
	Version string                            `json:"version,omitempty" yaml:"version,omitempty"`
	Deps    []ExternalConfigDependencyV1Beta1 `json:"deps,omitempty" yaml:"deps,omitempty"`
}

ExternalConfigV1Beta1 represents the v1beta1 lock file.

type ExternalConfigVersion

type ExternalConfigVersion struct {
	Version string `json:"version,omitempty" yaml:"version,omitempty"`
}

ExternalConfigVersion defines the subset of all lock file versions that is used to determine the version.

Jump to

Keyboard shortcuts

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