pachyderm: github.com/pachyderm/pachyderm/src/server/pkg/ancestry Index | Files

package ancestry

import "github.com/pachyderm/pachyderm/src/server/pkg/ancestry"

Index

Package Files

ancestry.go

func Add Uses

func Add(s string, ancestors int) string

Add adds an ancestry reference to the given string.

func Parse Uses

func Parse(s string) (string, int, error)

Parse parses s for git ancestry references. It supports special characters ^ ~, both of which are supported by git. Note in git ^ and ~ have different meanings on commits that have multiple parent commits. In Pachyderm there's only 1 parent possible so they have identical meanings. We support both simply for familiarity sake. In addition we support referencing the beginning of the branch with the . character. ParseAncestry returns the base reference and how many ancestors back to go. For example: foo^ -> foo, 1 foo^^ -> foo, 2 foo^3 -> foo, 3 foo.1 -> foo, -1 foo.3 -> foo, -3 (all examples apply with ~ in place of ^ as well

func SanitizeName Uses

func SanitizeName(name string) string

SanitizeName forces a name to pass ValidateName, by replacing offending characters with _s

func ValidateName Uses

func ValidateName(name string) error

ValidateName validates a name to make sure that it can be used unambiguously with Ancestry syntax.

Package ancestry imports 4 packages (graph) and is imported by 5 packages. Updated 2019-05-16. Refresh now. Tools for package owners.