issues2markdown

package module
v0.0.0-...-c00c92d Latest Latest
Warning

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

Go to latest
Published: Jun 10, 2018 License: Apache-2.0 Imports: 7 Imported by: 2

README

issues2markdown

License CircleCI Coverage Status Go Report Card

Package issues2markdown queries issues and renders the result to markdown following the Github flavored Markdown task lists format described at https://help.github.com/articles/about-task-lists/

License

Copyright (c) 2018 issues2markdown Authors.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Documentation

Overview

Package issues2markdown queries issues and renders the result to markdown following the Github flavored Markdown task lists format described at https://help.github.com/articles/about-task-lists/.

Index

Constants

View Source
const (
	// DefaultIssueTemplate is the default template to render a list of issues in Markdown
	DefaultIssueTemplate = `` /* 165-byte string literal not displayed */

)
View Source
const (
	// DefaultQuery is the default query to be used if none is provided on the
	// CLI arguments.
	DefaultQuery = `type:issue is:open author:{{ .Organization }} archived:false`
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Issue

type Issue struct {
	Number  int
	Title   string
	State   string
	URL     string
	HTMLURL string
}

Issue represents an Issue from the provider

func NewIssue

func NewIssue() *Issue

NewIssue creates an Issue instance with sensible defaults

func (*Issue) GetOrganization

func (i *Issue) GetOrganization() (string, error)

GetOrganization return the organization name for this Issue

func (*Issue) GetRepository

func (i *Issue) GetRepository() (string, error)

GetRepository return the repository name for this Issue

type IssuesToMarkdown

type IssuesToMarkdown struct {
	GithubToken string

	User *github.User
	// contains filtered or unexported fields
}

IssuesToMarkdown is the main type to interact, query and render issues to Markdown

func NewIssuesToMarkdown

func NewIssuesToMarkdown(provider *github.Client) (*IssuesToMarkdown, error)

NewIssuesToMarkdown creates an IssuesToMarkdown instance

func (*IssuesToMarkdown) Authorize

func (im *IssuesToMarkdown) Authorize() (*github.User, error)

Authorize gets authentication information

func (*IssuesToMarkdown) Query

func (im *IssuesToMarkdown) Query(options *QueryOptions, q string) ([]Issue, error)

Query queries the provider and returns the list of Issues that match the query

func (*IssuesToMarkdown) Render

func (im *IssuesToMarkdown) Render(issues []Issue, options *RenderOptions) (string, error)

Render renders a list of Issues to Markdown

type QueryOptions

type QueryOptions struct {
	Organization string
}

QueryOptions are the available options to modify the query of issues

func NewQueryOptions

func NewQueryOptions() *QueryOptions

NewQueryOptions creates a new QueryOptions instance with sensible defaults

func (*QueryOptions) BuildQuey

func (qo *QueryOptions) BuildQuey(q string) string

BuildQuey builds the query string to query issues

It modifies the default query according the proviced query options

type RenderOptions

type RenderOptions struct {
	TemplateSource string
}

RenderOptions are the available options to modify the rendering of issues

func NewRenderOptions

func NewRenderOptions() *RenderOptions

NewRenderOptions creates a new RenderOptions instance with sensible defaults

type User

type User struct {
	Login string
}

User represents the user credentials information to be used by the provider

Jump to

Keyboard shortcuts

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