new_version_resource

package module
v0.0.0-...-8dd87e7 Latest Latest
Warning

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

Go to latest
Published: Mar 24, 2022 License: BSD-2-Clause Imports: 8 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

README

new_version_resource

Version tracking based on JQuery CSS Paths

For when you are trying to track versioned releases on websites.

Building Binaries

./scripts/build

Building docker image

sudo docker build -t your-dockerhub-username/new_version_resource .
sudo docker push your-dockerhub-username/new_version_resource

For deploying as the Buildpacks team:

./scripts/publish

Usage

You will need to setup the new resource type, and specify a url, and csspath to the versions strings on that page. An example is below:

---
resource_types:
- name: new_version_resource
  type: docker-image
  source:
    repository: cfbuildpacks/new_version_resource

resources:
  - name: pecl-igbinary
    type: new_version_resource
    source:
      url: https://pecl.php.net/package/igbinary
      csspath: table[cellpadding="2"][cellspacing="1"] tr:has(td:contains("stable")) th
      use_semver: true

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CheckCommand

type CheckCommand struct {
}

func NewCheckCommand

func NewCheckCommand() *CheckCommand

func (*CheckCommand) Run

func (c *CheckCommand) Run(request CheckRequest) ([]Version, error)

type CheckRequest

type CheckRequest struct {
	Source  Source  `json:"source"`
	Version Version `json:"version"`
}

type GitSource

type GitSource struct {
	Organization string `json:"organization"`
	Repo         string `json:"repo"`
	AccessToken  string `json:"access_token",omitempty`
}

type HTTPSource

type HTTPSource struct {
	URL     string `json:"url"`
	CSSPath string `json:"csspath"`
}

type InRequest

type InRequest struct {
	Source          Source  `json:"source"`
	Version         Version `json:"version"`
	FirstOccurrence bool    `json:"first_occurrence"`
}

type InResponse

type InResponse struct {
	Version  Version        `json:"version"`
	Metadata []MetadataPair `json:"metadata"`
}

type MetadataPair

type MetadataPair struct {
	Name     string `json:"name"`
	Value    string `json:"value"`
	URL      string `json:"url"`
	Markdown bool   `json:"markdown"`
}

type SortVersion

type SortVersion struct {
	Version string
	Semver  *semver.Version
}

type Source

type Source struct {
	Type  string     `json:"type"`
	Regex string     `json:"regex"`
	Git   GitSource  `json:"git",omitempty`
	HTTP  HTTPSource `json:"http",omitempty`
}

type Version

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

type VersionSorter

type VersionSorter struct {
	// contains filtered or unexported fields
}

func (*VersionSorter) Len

func (v *VersionSorter) Len() int

func (*VersionSorter) Less

func (v *VersionSorter) Less(i, j int) bool

func (*VersionSorter) Swap

func (v *VersionSorter) Swap(i, j int)

Directories

Path Synopsis
cmd
check command
in command
out command

Jump to

Keyboard shortcuts

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