ghsync

package module
v0.0.8 Latest Latest
Warning

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

Go to latest
Published: May 5, 2020 License: MIT Imports: 11 Imported by: ? modules, 0 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.

README

ghsync

CircleCI latest license

Installation

  • macOS (for Homebrew users)
    • brew install izumin5210/tools/ghsync
  • macOS, Linux
    • curl -Lo grapi https://github.com/izumin5210/ghsync/releases/download/v0.0.1/ghsync_linux_amd64.zip
      unzip ghsync_linux_amd64.zip
      sudo mv ghsync_linux_amd64/ghsync /usr/local/bin
      rm ghsync_linux_amd64.zip
      
  • others
    • go get github.com/izumin5210/ghsync/cmd/ghsync

Documentation

Index

Constants

View Source
const TracebackLimit = 100
View Source
const (
	// Version represents a version of ghsync package.
	Version = "0.0.8"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Content

type Content interface {
	GetPath() string
	Update(Content) (updated bool, err error)
}

type ContentRepository

type ContentRepository interface {
	Get(ctx context.Context, path string) (Content, error)
	Update(ctx context.Context, cont Content) error
}

type ContentRepositoryFactory

type ContentRepositoryFactory interface {
	Create(ctx context.Context, slug, base, head string, md *OriginMetadata) (ContentRepository, error)
}

func NewGithubContentRepositoryFactory

func NewGithubContentRepositoryFactory(
	cli *github.Client,
) ContentRepositoryFactory

type GithubContentSubmodule

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

func (*GithubContentSubmodule) GetPath

func (c *GithubContentSubmodule) GetPath() string

func (*GithubContentSubmodule) GetSHA

func (c *GithubContentSubmodule) GetSHA() string

func (*GithubContentSubmodule) Update

func (c *GithubContentSubmodule) Update(other Content) (bool, error)

type LocalSubmodule

type LocalSubmodule struct {
	SHA string
}

func (*LocalSubmodule) GetPath

func (c *LocalSubmodule) GetPath() string

func (*LocalSubmodule) GetSHA

func (c *LocalSubmodule) GetSHA() string

func (*LocalSubmodule) Update

func (c *LocalSubmodule) Update(other Content) (bool, error)

type OriginMetadata

type OriginMetadata struct {
	Owner  string
	Repo   string
	Branch string
	SHA    string
	URL    string
	PR     int
	// contains filtered or unexported fields
}

OriginMetadata contains the current repository metadata.

func BuildMetadata

func BuildMetadata(ctx context.Context) (*OriginMetadata, error)

BuildMetadata collects data from a current environment.

func (*OriginMetadata) GetCommitURL

func (m *OriginMetadata) GetCommitURL() string

func (*OriginMetadata) GetPRURL

func (m *OriginMetadata) GetPRURL() string

func (*OriginMetadata) GetSlug

func (m *OriginMetadata) GetSlug() string

func (*OriginMetadata) IsPR

func (m *OriginMetadata) IsPR() bool

type Submodule

type Submodule interface {
	Content
	GetSHA() string
}

type User added in v0.0.2

type User struct {
	Name, Email string
}

func GetUser added in v0.0.2

func GetUser(ctx context.Context) (*User, error)

Directories

Path Synopsis
cmd
ghsync command

Jump to

Keyboard shortcuts

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