forum

package
v0.0.0-...-6b1ef15 Latest Latest
Warning

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

Go to latest
Published: Mar 9, 2020 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const IssueSort = "updated"
View Source
const MaxPageSize = 100

Variables

This section is empty.

Functions

This section is empty.

Types

type Action

type Action struct {
	ID        int
	Title     string
	Body      string
	User      string
	Labels    []string
	Comments  int
	Reactions map[string]int
}

type Builder

type Builder interface {
	Build() (*Forum, error)
}

type Comment

type Comment struct {
	Body      string
	User      string
	Reactions map[string]int
}

type Forum

type Forum interface {
	GetVotingResolution(comments []*Comment) (string, bool)
	GetCommentatingResolution(comments []*Comment, resolutions map[string]struct{}, moderators map[string]struct{}) (string, bool)
	CloseAction(number int) error
	CreateAction(action *Action) (int, error)
	GetActions(state string, prevTime time.Time) ([]*Action, error)
	GetNewComments(action *Action, prevTime time.Time) ([]*Comment, error)
	PostComment(body string, id int) error
}

type Github

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

func (*Github) CloseAction

func (g *Github) CloseAction(number int) error

func (*Github) CreateAction

func (g *Github) CreateAction(action *Action) (int, error)

func (*Github) GetActions

func (g *Github) GetActions(state string, timestamp time.Time) ([]*Action, error)

func (*Github) GetCommentatingResolution

func (g *Github) GetCommentatingResolution(comments []*Comment, resolutions map[string]struct{}, moderators map[string]struct{}) (string, bool)

func (*Github) GetNewComments

func (g *Github) GetNewComments(action *Action, prevTime time.Time) ([]*Comment, error)

func (*Github) GetVotingResolution

func (g *Github) GetVotingResolution(comments []*Comment) (string, bool)

func (*Github) PostComment

func (g *Github) PostComment(body string, id int) error

type GithubBuilder

type GithubBuilder struct {
	AccessToken     string
	AccountName     string
	RepositoryOwner string
	RepositoryName  string
	IssueLabels     *[]string
}

func InitializeGithubBuilderFromConfig

func InitializeGithubBuilderFromConfig(configPath string) (*GithubBuilder, error)

func NewGithubBuilder

func NewGithubBuilder() *GithubBuilder

func (*GithubBuilder) Build

func (g *GithubBuilder) Build() (*Forum, error)

Jump to

Keyboard shortcuts

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