api

package
v0.0.0-...-d6ec084 Latest Latest
Warning

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

Go to latest
Published: Feb 27, 2023 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var AvailableAdapters = []ApiAdapter{
	GitlabAdapter{},
	GitHubAdapter{},
	BitbucketAdapter{},
}

Functions

func GetAdapterNames

func GetAdapterNames() []string

Types

type AdapterInfo

type AdapterInfo struct {
	Name           string
	RequiresHost   bool
	ProvidesSearch bool
	ProvidesScope  bool
}

type ApiAdapter

type ApiAdapter interface {
	Info() AdapterInfo
	GetProjects(globals.Profile, string, string) ([]Project, error)
	CreateProject(globals.Profile) error
}

func GetAdapterByName

func GetAdapterByName(name string) (ApiAdapter, error)

type BitbucketAdapter

type BitbucketAdapter struct{}

func (BitbucketAdapter) CreateProject

func (BitbucketAdapter) CreateProject(profile globals.Profile) error

func (BitbucketAdapter) GetProjects

func (bitbucket BitbucketAdapter) GetProjects(profile globals.Profile, search string, scope string) ([]Project, error)

func (BitbucketAdapter) Info

type BitbucketProject

type BitbucketProject struct {
	Name     string `json:"name"`
	SshUrl   string `json:"ssh_url"`
	CloneUrl string `json:"clone_url"`
}

type GitHubAdapter

type GitHubAdapter struct{}

func (GitHubAdapter) CreateProject

func (GitHubAdapter) CreateProject(profile globals.Profile) error

func (GitHubAdapter) GetName

func (GitHubAdapter) GetName() string

func (GitHubAdapter) GetProjects

func (github GitHubAdapter) GetProjects(profile globals.Profile, _ string, _ string) ([]Project, error)

func (GitHubAdapter) Info

func (GitHubAdapter) Info() AdapterInfo

type GithubProject

type GithubProject struct {
	Name     string `json:"name"`
	SshUrl   string `json:"ssh_url"`
	CloneUrl string `json:"clone_url"`
}

type GitlabAdapter

type GitlabAdapter struct{}

func (GitlabAdapter) CreateProject

func (GitlabAdapter) CreateProject(profile globals.Profile) error

func (GitlabAdapter) GetProjects

func (gitlab GitlabAdapter) GetProjects(profile globals.Profile, search string, _ string) ([]Project, error)

func (GitlabAdapter) Info

func (GitlabAdapter) Info() AdapterInfo

type GitlabProject

type GitlabProject struct {
	Name          string `json:"name"`
	SshUrlToRepo  string `json:"ssh_url_to_repo"`
	HttpUrlToRepo string `json:"http_url_to_repo"`
}

type Project

type Project struct {
	HttpUrl     string
	SshUrl      string
	DisplayName string
}

Jump to

Keyboard shortcuts

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