model

package
v0.0.17 Latest Latest
Warning

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

Go to latest
Published: Apr 2, 2021 License: MIT Imports: 4 Imported by: 2

Documentation

Index

Constants

View Source
const GroupKind = "groups"
View Source
const InstallationKind = "installations"
View Source
const RepoKind = "repos"
View Source
const TaskKind = "tasks"
View Source
const TeamKind = "teams"
View Source
const UserKind = "users"

Variables

This section is empty.

Functions

This section is empty.

Types

type GithubID

type GithubID string

func (GithubID) String

func (g GithubID) String() string

func (GithubID) WithAt

func (g GithubID) WithAt() string

type Group

type Group struct {
	ID        int64     `json:"id" datastore:"id"`
	Name      string    `json:"name" datastore:"name"`
	UserIDs   []string  `json:"userIds" datastore:"userIds"`
	CreatedAt time.Time `datastore:"createdAt,noindex"`
	UpdatedAt time.Time `datastore:"updatedAt,noindex"`
}

func (Group) IsNode added in v0.0.8

func (Group) IsNode()

type Installation

type Installation struct {
	Key  *datastore.Key `datastore:"__key__"`
	ID   int64          `json:"id"`
	Name string         `json:"name" datastore:"name"`
	// TODO AddedBy的なのいる?
	CreatedAt time.Time `datastore:"createdAt,noindex"`
	UpdatedAt time.Time `datastore:"updatedAt,noindex"`
}

func (Installation) IsNode added in v0.0.8

func (Installation) IsNode()

type Repo

type Repo struct {
	Key       *datastore.Key `datastore:"__key__"`
	ID        int64          `json:"id"`
	Owner     string         `json:"owner" datastore:"owner"`
	Name      string         `json:"name" datastore:"name"`
	FullName  string         `json:"fullname" datastore:"fullname"`
	CreatedAt time.Time      `datastore:"createdAt,noindex"`
	UpdatedAt time.Time      `datastore:"updatedAt,noindex"`
}

TODO: json, datastore

func (Repo) IsNode added in v0.0.8

func (Repo) IsNode()

type Reviewer

type Reviewer struct {
	SlackID string
}

type Reviewers

type Reviewers []GithubID

func (Reviewers) String

func (rs Reviewers) String() []string

type Task

type Task struct {
	Key            *datastore.Key `datastore:"__key__"`
	ID             int64          `json:"id"`
	Repo           Repo           `json:"repo" datastore:"repo"`
	RepoID         int64          `json:"repoId" datastore:"repoId"`
	Channel        string         `json:"channel" datastore:"channel"`
	Users          []*User        `json:"users" datastore:"users"`
	UserIDs        []string       `json:"userIds" datastore:"userIds"`
	TeamID         int64          `json:"teamId" datastore:"teamId"`
	Team           *Team          `json:"team" datastore:"team"`
	InstallationID int64          `json:"installationId" datastore:"installationId"`
}

func (*Task) GetUserByGithubID

func (t *Task) GetUserByGithubID(githubID string) (*User, bool)

func (Task) IsNode added in v0.0.8

func (Task) IsNode()

func (*Task) SetUsers

func (t *Task) SetUsers(users []*User)

type Team

type Team struct {
	Key         *datastore.Key `datastore:"__key__"`
	ID          int64          `json:"id"`
	SlackTeamID string         `json:"slackTeamId" datastore:"slackTeamId"`
	Name        string         `json:"name" datastore:"name"`
	Token       string         `json:"token" datastore:"token"`
	Tasks       []Task
	// TODO: Authorized github organizations がほしい
	CreatedAt time.Time `datastore:"createdAt,noindex"`
	UpdatedAt time.Time `datastore:"updatedAt,noindex"`
}

func (Team) IsNode added in v0.0.8

func (Team) IsNode()

type User

type User struct {
	Key          *datastore.Key `datastore:"__key__"`
	ID           int64          `json:"id"`
	Name         string         `json:"name" datastore:"name"`
	Email        string         `json:"email" datastore:"email"`
	GoogleID     string         `json:"googleId" datastore:"googleId"`
	Avatar       string         `json:"avatar" datastore:"avatar"`
	Token        string         `json:"token" datastore:"token"`
	SlackID      string         `json:"slackId" datastore:"slackId"`
	SlackIsOwner string         `json:"slackIsOwner" datastore:"slackIsOwner"`
	SlackIsAdmin string         `json:"slackIsAdmin" datastore:"slackIsAdmin"`
	GithubID     GithubID       `json:"githubId" datastore:"githubId"`
	Reviewers    Reviewers      `json:"reviewers" datastore:"reviewers"`
	GroupID      int64          `json:"groupId" datastore:"groupId"`
	TeamID       string         `json:"teamId" datastore:"teamId"`
	CreatedAt    time.Time      `datastore:"createdAt,noindex"`
	UpdatedAt    time.Time      `datastore:"updatedAt,noindex"`
}

func (User) GithubWithAt

func (u User) GithubWithAt() string

func (User) IsNode added in v0.0.7

func (User) IsNode()

func (User) ReviewersWithAt

func (u User) ReviewersWithAt() []string

func (User) SetGithubID

func (u User) SetGithubID(ghID string)

func (User) SetSlackID

func (u User) SetSlackID(slackID string)

func (User) SlackWithBracketAt

func (u User) SlackWithBracketAt() string

type UserID

type UserID int64

Jump to

Keyboard shortcuts

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