apis

package
v0.0.24 Latest Latest
Warning

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

Go to latest
Published: Feb 20, 2023 License: Apache-2.0 Imports: 6 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

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