model

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Dec 31, 2017 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Rand

func Rand() string

Rand generates a 32-bit random string.

Types

type Comment

type Comment struct {
	Author string
	Body   string
}

Comment represents a comment from the the remote API.

type Config

type Config struct {
	Approvals             int    `json:"approvals"         toml:"approvals"`
	Pattern               string `json:"pattern"           toml:"pattern"`
	Team                  string `json:"team"              toml:"team"`
	SelfApprovalOff       bool   `json:"self_approval_off" toml:"self_approval_off"`
	IgnoreMaintainersFile bool   `json:"ignore_maintainers_file" toml:"ignore_maintainers_file"`
	// contains filtered or unexported fields
}

Config represents a repo-specific configuration file.

func ParseConfig

func ParseConfig(data []byte) (*Config, error)

ParseConfig parses a projects .lgtm file

func ParseConfigStr

func ParseConfigStr(data string) (*Config, error)

ParseConfigStr parses a projects .lgtm file in string format.

func (*Config) IsMatch

func (c *Config) IsMatch(text string) bool

IsMatch returns true if the text matches the regular epxression pattern.

type Hook

type Hook struct {
	Repo    *Repo
	Issue   *Issue
	Comment *Comment
	Review  *Review
}

Hook represents a hook from the remote API.

type Issue

type Issue struct {
	Number int
	Title  string
	Author string
}

Issue represents an issue from the the remote API.

type Maintainer

type Maintainer struct {
	People map[string]*Person `json:"people"    toml:"people"`
	Org    map[string]*Org    `json:"org"       toml:"org"`
}

Maintainer represents a MAINTAINERS file.

func FromOrg

func FromOrg(from *Maintainer, name string) (*Maintainer, error)

FromOrg returns a new Maintainer file with a subset of people that are part of the specified org.

func ParseMaintainer

func ParseMaintainer(data []byte) (*Maintainer, error)

ParseMaintainer parses a projects MAINTAINERS file and returns the list of maintainers.

func ParseMaintainerStr

func ParseMaintainerStr(data string) (*Maintainer, error)

ParseMaintainerStr parses a projects MAINTAINERS file in string format and returns the list of maintainers.

type Member

type Member struct {
	Login string `json:"login"`
}

Member represents a member from the the remote API.

type Org

type Org struct {
	People []string `json:"people" toml:"people"`
}

Org represents a group, team or subset of users.

type Perm

type Perm struct {
	Pull  bool
	Push  bool
	Admin bool
}

Perm represents permissions from the the remote API.

type Person

type Person struct {
	Name  string `json:"name"  toml:"name"`
	Email string `json:"email" toml:"email"`
	Login string `json:"login" toml:"login"`
}

Person represets an individual in the MAINTAINERS file.

type Repo

type Repo struct {
	ID      int64  `json:"id,omitempty"       meddler:"repo_id,pk"`
	UserID  int64  `json:"-"                  meddler:"repo_user_id"`
	Owner   string `json:"owner"              meddler:"repo_owner"`
	Name    string `json:"name"               meddler:"repo_name"`
	Slug    string `json:"slug"               meddler:"repo_slug"`
	Link    string `json:"link_url"           meddler:"repo_link"`
	Private bool   `json:"private"            meddler:"repo_private"`
	Secret  string `json:"-"                  meddler:"repo_secret"`
}

Repo represents a repo from the the remote API.

type Review

type Review struct {
	Author string
	Body   string
	State  string
}

Review represents a pull request review comment from the the remote API.

func (*Review) IsApproved

func (r *Review) IsApproved() bool

IsApproved check review state

type Team

type Team struct {
	Login  string `json:"login"`
	Avatar string `json:"avatar"`
}

Team represents a team from the the remote API.

type User

type User struct {
	ID     int64  `json:"id"      meddler:"user_id,pk"`
	Login  string `json:"login"   meddler:"user_login"`
	Email  string `json:"email"   meddler:"user_email"`
	Token  string `json:"-"       meddler:"user_token"`
	Avatar string `json:"avatar"  meddler:"user_avatar"`
	Secret string `json:"-"       meddler:"user_secret"`
}

User represents an user from the the remote API.

Jump to

Keyboard shortcuts

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