vanity

package module
Version: v0.0.0-...-2d644e2 Latest Latest
Warning

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

Go to latest
Published: May 9, 2021 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultServer = "https://go.jolheiser.com"
	TokenHeader   = "X-Vanity-Token"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

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

func New

func New(token string, opts ...ClientOption) *Client

func (*Client) Add

func (c *Client) Add(ctx context.Context, pkg Package) error

Add adds a new Package to a vanity server

func (*Client) Info

func (c *Client) Info(ctx context.Context) (Info, error)

Info gets Info from a vanity server

func (*Client) Remove

func (c *Client) Remove(ctx context.Context, pkg Package) error

Remove removes a Package from a vanity server

func (*Client) Update

func (c *Client) Update(ctx context.Context, pkg Package) error

Update updates a Package on a vanity server

type ClientOption

type ClientOption func(*Client)

func WithHTTP

func WithHTTP(client *http.Client) ClientOption

func WithServer

func WithServer(server string) ClientOption

type Info

type Info struct {
	Version     string    `json:"version"`
	NumPackages int       `json:"num_packages"`
	Packages    []Package `json:"packages"`
}

type Package

type Package struct {
	Name        string `json:"name"`
	Description string `json:"description"`
	Branch      string `json:"branch"`
	WebURL      string `json:"web_url"`
	CloneHTTP   string `json:"clone_http"`
	CloneSSH    string `json:"clone_ssh"`
}

func (Package) Module

func (p Package) Module(domain string) string

type SourceDirFile

type SourceDirFile struct {
	Dir  string
	File string
}

func AnalyzeSDF

func AnalyzeSDF(pkg Package) (SourceDirFile, error)

func GitHubSDF

func GitHubSDF(pkg Package) SourceDirFile

func GitLabSDF

func GitLabSDF(pkg Package) SourceDirFile

func GiteaSDF

func GiteaSDF(pkg Package) SourceDirFile

Jump to

Keyboard shortcuts

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