apis

package
v0.0.35 Latest Latest
Warning

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

Go to latest
Published: Dec 2, 2026 License: Apache-2.0 Imports: 7 Imported by: 7 modules, 3 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.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func HostWithPort added in v0.0.32

func HostWithPort(parsedURL *url.URL) string

HostWithPort returns the URL host, stripping the port if it is the default for the scheme (so detection-friendly hostnames are used for canonical URLs) while preserving non-default ports for self-hosted instances where the port is load-bearing for API calls.

func HttpGet

func HttpGet(httpClient *http.Client, fullURL string, headers map[string]string) (string, error)

httpGet run http get command and return response as string

Types

type AzureUrlComposer

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

func (*AzureUrlComposer) FileUrlByBranch

func (r *AzureUrlComposer) FileUrlByBranch(branch string) string

func (*AzureUrlComposer) FileUrlByCommit

func (r *AzureUrlComposer) FileUrlByCommit(commit string) string

func (*AzureUrlComposer) FileUrlByTag

func (r *AzureUrlComposer) FileUrlByTag(tag string) string

type Commit

type Commit struct {
	SHA       string    `json:"sha"`
	Author    Committer `json:"author"`
	Committer Committer `json:"committer"`
	Message   string    `json:"message"`
	Files     []Files   `json:"files"`
}

type Committer

type Committer struct {
	Name  string    `json:"name"`
	Email string    `json:"email"`
	Date  time.Time `json:"date"`
}

type Files

type Files struct {
	FileSHA  string `json:"sha"`
	Filename string `json:"filename"`
}

type GitHubUrlComposer

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

func (*GitHubUrlComposer) FileUrlByBranch

func (r *GitHubUrlComposer) FileUrlByBranch(branch string) string

func (*GitHubUrlComposer) FileUrlByCommit

func (r *GitHubUrlComposer) FileUrlByCommit(commit string) string

func (*GitHubUrlComposer) FileUrlByTag

func (r *GitHubUrlComposer) FileUrlByTag(tag string) string

type ProviderType

type ProviderType string
const (
	ProviderGitHub    ProviderType = "github"
	ProviderAzure     ProviderType = "azure"
	ProviderBitBucket ProviderType = "bitbucket"
	ProviderGitLab    ProviderType = "gitlab"
)

func (ProviderType) IsSupported

func (pt ProviderType) IsSupported() error

func (ProviderType) String

func (pt ProviderType) String() string

type UrlComposer

type UrlComposer interface {
	FileUrlByCommit(commit string) string
	FileUrlByBranch(branch string) string
	FileUrlByTag(tag string) string
}

func NewUrlComposer

func NewUrlComposer(provider ProviderType, remoteUrl, path string) (UrlComposer, error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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