types

package
v0.0.0-...-0cacca0 Latest Latest
Warning

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

Go to latest
Published: Dec 14, 2020 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Overview

Package types provides basic types to work with Conan items: references and packages.

Package types provides some abstraction over some data returned by JFrog Artifactory.

Index

Constants

View Source
const (
	ValidConanChars       = `[a-zA-Z0-9_][a-zA-Z0-9_\+\.-]` // Validates (regex) a part from a Conan reference
	FilesystemPlaceHolder = "_"                             // Filesystem representation of a null user or null channel in a Conan reference.
)

Constants to be used with Conan elements.

Variables

This section is empty.

Functions

This section is empty.

Types

type ByTime

type ByTime []RtRevisionsData

ByTime is a helper operator to order revisions by date.

func (ByTime) Len

func (a ByTime) Len() int

func (ByTime) Less

func (a ByTime) Less(i, j int) bool

func (ByTime) Swap

func (a ByTime) Swap(i, j int)

type Package

type Package struct {
	Ref       Reference
	PackageId string
	Revision  string
}

Package represents a Conan package with its `Reference`, the package ID and the package revision.

func (*Package) RtPath

func (pkg *Package) RtPath(withRevision bool) string

RtPath returns the path inside Artifactory to the `Package`. It can be considered with or without revisions (last element in the Artifactory path). However, not that the recipe will always contain the revision, as it is an element in the middle of the path.

func (*Package) String

func (pkg *Package) String() string

func (*Package) ToString

func (pkg *Package) ToString(withRevision bool) string

ToString returns the string representation of the Conan package. Use the argument `withRevision` to add or not the revisions to the output.

type Reference

type Reference struct {
	Name     string
	Version  string
	User     *string
	Channel  *string
	Revision string
}

Reference represents a Conan reference with its parts: name, version, user, channel and revision. Only the attributes `Channel` and `User` are optional in a valid reference.

func ParseStringReference

func ParseStringReference(reference string) (*Reference, error)

ParseStringReference parses a string and returns a Conan reference. The string can have any of these formats: name/version, name/version@user/channel, name/version#revision, name/version@user/channel#revision.

func (*Reference) RtPath

func (ref *Reference) RtPath(withRevision bool) string

RtPath returns the path inside Artifactory to the `Reference`. It can be considered with or without revisions (latest element in the Artifactory path).

func (*Reference) String

func (ref *Reference) String() string

String converts to string the reference (with revisions).

func (*Reference) ToString

func (ref *Reference) ToString(withRevision bool) string

ToString returns a string representation of the `Reference`. Use the argument `withRevision` to add or not the revision to the output.

type RtIndexJSON

type RtIndexJSON struct {
	//Reference string
	Revisions []RtRevisionsData
}

RtIndexJSON represents the JSON where Artifactory stores Conan revisions (using 'index.json' files).

type RtRevisionsData

type RtRevisionsData struct {
	Revision string
	Time     RtTimestamp
}

RtRevisionsData represents the data associated to a Conan revision in Artifactory.

type RtTimestamp

type RtTimestamp struct {
	time.Time
}

RtTimestamp represents a custom timestamp using format '2006-01-02T15:04:05.999+0000'. It allows serializing and deserializing using the representation used by Artifactory.

func (*RtTimestamp) UnmarshalJSON

func (ct *RtTimestamp) UnmarshalJSON(b []byte) (err error)

UnmarshalJSON overrides parsing from JSON a timestamp using the RtTimestamp type.

Jump to

Keyboard shortcuts

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