Documentation
¶
Index ¶
- Variables
- type Option
- func WithContext(ctx context.Context) Option
- func WithGitAuthorSignature(username, email string) Option
- func WithGitCommitMessage(fn func(owner, repo, branch, name, path string) string) Option
- func WithGitCommitOptions(fn func(owner, repo, branch, name, path string) (opt *gogit.CommitOptions)) Option
- func WithHTTPClient(fun func(cli *http.Client) *http.Client) Option
- func WithHost(host string) Option
- func WithOutput(out io.Writer) Option
- func WithPerPage(perPage int) Option
- func WithTmpDir(dir string) Option
- type PutInGH
- func (s *PutInGH) GetFrom(ctx context.Context, uri string) (io.Reader, error)
- func (s *PutInGH) GetFromGist(ctx context.Context, owner, gistId, name string) (io.Reader, error)
- func (s *PutInGH) GetFromGit(ctx context.Context, owner, repo, branch, name string) (io.Reader, error)
- func (s *PutInGH) GetFromReleasesAsset(ctx context.Context, owner, repo, release, name string) (io.Reader, error)
- func (s *PutInGH) PutIn(ctx context.Context, uri string, r io.Reader) (string, error)
- func (s *PutInGH) PutInWithFile(ctx context.Context, uri, filename string) (string, error)
Constants ¶
This section is empty.
Variables ¶
View Source
var ( DefaultOptions = []Option{ WithHost("https://github.com"), WithGitAuthorSignature("bot", ""), WithTmpDir("./tmp/"), WithOutput(io.Discard), WithPerPage(100), WithContext(context.Background()), WithGitCommitMessage(func(owner, repo, branch, name, path string) string { return fmt.Sprintf("Automatic update %s", name) }), } ErrNotFound = fmt.Errorf("not found") )
Functions ¶
This section is empty.
Types ¶
type Option ¶ added in v0.5.0
type Option func(p *PutInGH)
func WithContext ¶ added in v0.5.0
func WithGitAuthorSignature ¶ added in v0.5.0
func WithGitCommitMessage ¶ added in v0.5.0
func WithGitCommitOptions ¶ added in v0.5.0
func WithGitCommitOptions(fn func(owner, repo, branch, name, path string) (opt *gogit.CommitOptions)) Option
func WithHTTPClient ¶ added in v0.5.1
func WithOutput ¶ added in v0.5.0
func WithPerPage ¶ added in v0.5.0
func WithTmpDir ¶ added in v0.5.0
type PutInGH ¶
type PutInGH struct {
// contains filtered or unexported fields
}
func NewPutInGH ¶
func (*PutInGH) GetFromGist ¶ added in v0.4.0
func (*PutInGH) GetFromGit ¶ added in v0.4.0
func (*PutInGH) GetFromReleasesAsset ¶ added in v0.4.0
Click to show internal directories.
Click to hide internal directories.