Documentation
¶
Overview ¶
package writer
Index ¶
- Constants
- func AssignBranchPrefix(branch string) string
- func EnsureGitHubAccessToken(ctx context.Context, writer_uri string, token_uri string) (string, error)
- func NewGitHubAPIBranchWriter(ctx context.Context, uri string) (wof_writer.Writer, error)
- func NewGitHubAPIPullRequestWriter(ctx context.Context, uri string) (wof_writer.Writer, error)
- func NewGitHubAPITreeWriter(ctx context.Context, uri string) (wof_writer.Writer, error)
- func NewGitHubAPIWriter(ctx context.Context, uri string) (wof_writer.Writer, error)
- type GitHubAPIBranchWriter
- func (wr *GitHubAPIBranchWriter) Close(ctx context.Context) error
- func (wr *GitHubAPIBranchWriter) Flush(ctx context.Context) error
- func (wr *GitHubAPIBranchWriter) SetLogger(ctx context.Context, logger *log.Logger) error
- func (wr *GitHubAPIBranchWriter) Write(ctx context.Context, uri string, r io.ReadSeeker) (int64, error)
- func (wr *GitHubAPIBranchWriter) WriterURI(ctx context.Context, key string) string
- type GitHubAPIPullRequestWriter
- func (wr *GitHubAPIPullRequestWriter) Close(ctx context.Context) error
- func (wr *GitHubAPIPullRequestWriter) Flush(ctx context.Context) error
- func (wr *GitHubAPIPullRequestWriter) SetLogger(ctx context.Context, logger *log.Logger) error
- func (wr *GitHubAPIPullRequestWriter) Write(ctx context.Context, uri string, r io.ReadSeeker) (int64, error)
- func (wr *GitHubAPIPullRequestWriter) WriterURI(ctx context.Context, key string) string
- type GitHubAPITreeWriter
- func (wr *GitHubAPITreeWriter) Close(ctx context.Context) error
- func (wr *GitHubAPITreeWriter) Flush(ctx context.Context) error
- func (wr *GitHubAPITreeWriter) SetLogger(ctx context.Context, logger *log.Logger) error
- func (wr *GitHubAPITreeWriter) Write(ctx context.Context, uri string, r io.ReadSeeker) (int64, error)
- func (wr *GitHubAPITreeWriter) WriterURI(ctx context.Context, key string) string
- type GitHubAPIWriter
- func (wr *GitHubAPIWriter) Close(ctx context.Context) error
- func (wr *GitHubAPIWriter) Flush(ctx context.Context) error
- func (wr *GitHubAPIWriter) SetLogger(ctx context.Context, logger *log.Logger) error
- func (wr *GitHubAPIWriter) Write(ctx context.Context, uri string, fh io.ReadSeeker) (int64, error)
- func (wr *GitHubAPIWriter) WriterURI(ctx context.Context, key string) string
- type GitHubAPIWriterCommitTemplates
Constants ¶
const BRANCH_UUID_PREFIX string = "{prefix}-"
const DEFAULT_BRANCH string = "main"
const GITHUBAPI_BRANCH_SCHEME string = "githubapi-branch"
const GITHUBAPI_PR_SCHEME string = "githubapi-pr"
const GITHUBAPI_SCHEME string = "githubapi"
const GITHUBAPI_TREE_SCHEME string = "githubapi-tree"
Variables ¶
This section is empty.
Functions ¶
func AssignBranchPrefix ¶ added in v3.1.0
AssignBranchPrefix tests 'branch' to see if it starts with the value of the `BRANCH_UUID_PREFIX` constant. If true it will replace that string with the value of the current Unix timestamp followed by "-" followed by a new UUID (v4) string. For example if 'branch' is "{prefix}-test" it would become "{TIMESTAMP}-{UUID}-test".
func EnsureGitHubAccessToken ¶
func EnsureGitHubAccessToken(ctx context.Context, writer_uri string, token_uri string) (string, error)
EnsureGitHubAccessToken ensures that 'writer_uri' contains a '?access_token=VALUE' parameter. This only applies if the scheme is `githubapi://`. If not the method returns the original 'writer_uri' value. If the 'writer_uri' contains an empty `access_token` parameter or the value is "{access_token}" then the method will replace parameter with the value derived from 'token_uri' which is expected to be a valid `gocloud.dev/runtimevar` URI.
func NewGitHubAPITreeWriter ¶
func NewGitHubAPIWriter ¶
Types ¶
type GitHubAPIBranchWriter ¶
type GitHubAPIBranchWriter struct {
wof_writer.Writer
// contains filtered or unexported fields
}
func (*GitHubAPIBranchWriter) Close ¶
func (wr *GitHubAPIBranchWriter) Close(ctx context.Context) error
func (*GitHubAPIBranchWriter) Flush ¶
func (wr *GitHubAPIBranchWriter) Flush(ctx context.Context) error
func (*GitHubAPIBranchWriter) Write ¶
func (wr *GitHubAPIBranchWriter) Write(ctx context.Context, uri string, r io.ReadSeeker) (int64, error)
type GitHubAPIPullRequestWriter ¶
type GitHubAPIPullRequestWriter struct {
wof_writer.Writer
// contains filtered or unexported fields
}
func (*GitHubAPIPullRequestWriter) Close ¶
func (wr *GitHubAPIPullRequestWriter) Close(ctx context.Context) error
func (*GitHubAPIPullRequestWriter) Flush ¶
func (wr *GitHubAPIPullRequestWriter) Flush(ctx context.Context) error
func (*GitHubAPIPullRequestWriter) Write ¶
func (wr *GitHubAPIPullRequestWriter) Write(ctx context.Context, uri string, r io.ReadSeeker) (int64, error)
type GitHubAPITreeWriter ¶
type GitHubAPITreeWriter struct {
wof_writer.Writer
// contains filtered or unexported fields
}
func (*GitHubAPITreeWriter) Write ¶
func (wr *GitHubAPITreeWriter) Write(ctx context.Context, uri string, r io.ReadSeeker) (int64, error)
type GitHubAPIWriter ¶
type GitHubAPIWriter struct {
wof_writer.Writer
// contains filtered or unexported fields
}
func (*GitHubAPIWriter) Write ¶
func (wr *GitHubAPIWriter) Write(ctx context.Context, uri string, fh io.ReadSeeker) (int64, error)
