d2m

package module
v0.0.0-...-557b426 Latest Latest
Warning

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

Go to latest
Published: May 12, 2022 License: MIT Imports: 16 Imported by: 0

README

d2m

GoDoc reference example

Given a directory or URL with a Maven2 component, create an effective manifest.

Install

$ go install github.com/jswank/d2m/d2m@latest

Usage

$ d2m maven2-component-dir
$ d2m https://repo1.maven.org/maven2/com/github/120011676/cipher/0.0.7
{
    "timestamp": "",
    "version": "",
    "coordinates": {
      "group": "com.github.120011676",
      "artifact": "cipher",
      "version": "0.0.7"
    },
    "files": [
      {
        "size": 117461,
        "filename": "cipher-0.0.7-javadoc.jar",
        "mime_type": "application/x-java-archive",
        "hashes": {
          "md5": "5fbeea7da1a003f588ce66d84139304c",
        }
      }
    ]
    }
... 

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Coordinates

type Coordinates struct {
	Group    string `json:"group"`
	Artifact string `json:"artifact"`
	Version  string `json:"version"`
}

type File

type File struct {
	Hashes   map[string]string `json:"hashes"`
	Size     int64             `json:"size"`
	Filename string            `json:"filename"`
	MimeType string            `json:"mime_type"`
}

func NewFile

func NewFile(filename string, size int64) File

func (*File) AddHash

func (e *File) AddHash(alg, value string)

type Manifest

type Manifest struct {
	Timestamp   string      `json:"timestamp"`
	Version     int64       `json:"version"`
	Coordinates Coordinates `json:"coordinates"`
	Files       []File      `json:"files"`
}

func NewManifest

func NewManifest(group, artifact, version string) *Manifest

func NewManifestFromDir

func NewManifestFromDir(dir string) (manifest *Manifest, err error)

func NewManifestFromURL

func NewManifestFromURL(url string) (manifest *Manifest, err error)

func (*Manifest) AddFile

func (m *Manifest) AddFile(entry File)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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