model

package
v0.0.0-...-4d3aaaa Latest Latest
Warning

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

Go to latest
Published: Feb 18, 2023 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	KeyAuthCookie     = "gantt_viewer_sid"
	KeyAuthorizedUser = "kau"
)
View Source
const (
	UserProject
	OrganizationProject
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Debug                   bool
	GitHubOauthClientID     string
	GitHubOauthClientSecret string
}

type Gantt

type Gantt struct {
	Id           string `json:"id,omitempty"`
	IssueUrl     string `json:"issue_url,omitempty"`
	Name         string `json:"name,omitempty"`
	Start        string `json:"start,omitempty"`
	End          string `json:"end,omitempty"`
	Progress     int    `json:"progress,omitempty"`
	Dependencies string `json:"dependencies,omitempty"`
	Milestone    string `json:"milestone,omitempty"`
	Assignees    []struct {
		AvatarUrl string `json:"avatar_url,omitempty"`
		Login     string `json:"login,omitempty"`
	} `json:"assignees,omitempty"`
}

type GetGitHubProjectExt

type GetGitHubProjectExt interface {
	GetProjectNext() GitHubProjectNext
}

type GitHubDraftIssue

type GitHubDraftIssue struct {
	Assignees GitHubIssueLikeAssignees `graphql:"assignees(first: 100)"`
}

type GitHubIssueLikeAssignees

type GitHubIssueLikeAssignees struct {
	Nodes []struct {
		Login     githubv4.String
		AvatarUrl githubv4.String
	}
}

type GitHubIssueLikeItem

type GitHubIssueLikeItem struct {
	Url       githubv4.String
	Milestone struct {
		Title githubv4.String
	}
	Assignees GitHubIssueLikeAssignees `graphql:"assignees(first: 100)"`
}

type GitHubProjectNext

type GitHubProjectNext struct {
	Owner           GitHubProjectsNextOwner
	Number          githubv4.Int
	Public          githubv4.Boolean
	Title           githubv4.String
	Url             githubv4.String
	ViewerCanUpdate githubv4.Boolean
	Fields          struct {
		Nodes []struct {
			ID         githubv4.ID
			Name       githubv4.String
			DatabaseId githubv4.Int
			DataType   githubv4.String
			Settings   githubv4.String
		}
	} `graphql:"fields(first: $projectFieldFirst)"`
	Items GitHubProjectNextItem `graphql:"items(first: $projectItemsFirst, after: $projectItemsAfter)"`
}

func (*GitHubProjectNext) GetType

func (gpn *GitHubProjectNext) GetType() uint8

type GitHubProjectNextItem

type GitHubProjectNextItem struct {
	Nodes []struct {
		FieldValues struct {
			Nodes []struct {
				Value        githubv4.String
				ProjectField struct {
					Name githubv4.String
				}
			}
		} `graphql:"fieldValues(first: $projectFieldValuesFirst)"`
		Content struct {
			DraftIssue  GitHubDraftIssue    `graphql:"... on DraftIssue"`
			Issue       GitHubIssueLikeItem `graphql:"... on Issue"`
			PullRequest GitHubIssueLikeItem `graphql:"... on PullRequest"`
		}
	}
	PageInfo struct {
		HasNextPage githubv4.Boolean
		EndCursor   githubv4.String
	}
}

func (GitHubProjectNextItem) ToGantts

func (pi GitHubProjectNextItem) ToGantts() []Gantt

type GitHubProjectsNext

type GitHubProjectsNext struct {
	Nodes []GitHubProjectNext
}

func (GitHubProjectsNext) ToProjects

func (gpn GitHubProjectsNext) ToProjects() []Project

type GitHubProjectsNextOwner

type GitHubProjectsNextOwner struct {
	Organization struct {
		Login githubv4.String
	} `graphql:"... on Organization"`
	User struct {
		Login githubv4.String
	} `graphql:"... on User"`
}

type Project

type Project struct {
	Number int
	Title  string
	Public bool
	Owner  string
	Type   uint8

	StartField        bool
	EndField          bool
	ProgressField     bool
	DependenciesField bool
}

func (*Project) GetURL

func (p *Project) GetURL() string

func (*Project) IsActionRequired

func (p *Project) IsActionRequired() bool

type QueryLoginUser

type QueryLoginUser struct {
	Viewer struct {
		Login     githubv4.String
		AvatarUrl githubv4.String
		CreatedAt githubv4.DateTime
	}
}

func (QueryLoginUser) GetId

func (u QueryLoginUser) GetId() (uint, error)

type QueryOrganizationProjectNext

type QueryOrganizationProjectNext struct {
	Organization struct {
		ProjectNext GitHubProjectNext `graphql:"projectNext(number: $projectNumber)"`
	} `graphql:"organization(login: $projectOwner)"`
}

func (QueryOrganizationProjectNext) GetProjectNext

type QueryOrganizationProjectsNext

type QueryOrganizationProjectsNext struct {
	Viewer struct {
		Organizations struct {
			Nodes []struct {
				ProjectsNext GitHubProjectsNext `graphql:"projectsNext(first: 100, query: \"status:open\")"`
				Login        githubv4.String
			}
		} `graphql:"organizations(first: 40)"`
	}
}

type QueryRepositoriesProjectsNext

type QueryRepositoriesProjectsNext struct {
	Viewer struct {
		Repositories struct {
			Nodes []struct {
				ProjectsNext GitHubProjectsNext `graphql:"projectsNext(first: 100, query: \"status:open\")"`
			}
		} `graphql:"repositories(first: 40)"`
	}
}

type QueryUserProjectNext

type QueryUserProjectNext struct {
	User struct {
		ProjectNext GitHubProjectNext `graphql:"projectNext(number: $projectNumber)"`
	} `graphql:"user(login: $projectOwner)"`
}

func (QueryUserProjectNext) GetProjectNext

func (q QueryUserProjectNext) GetProjectNext() GitHubProjectNext

type QueryViewerProjectsNext

type QueryViewerProjectsNext struct {
	Viewer struct {
		ProjectsNext GitHubProjectsNext `graphql:"projectsNext(first: 100, query: \"status:open\")"`
	}
}

type User

type User struct {
	gorm.Model
	GitHubLogin string
	GitHubToken string

	Sid string `gorm:"unique_index"`
}

func (*User) GetGitHubToken

func (u *User) GetGitHubToken() (*oauth2.Token, error)

func (*User) SetGitHubToken

func (u *User) SetGitHubToken(token *oauth2.Token) error

Jump to

Keyboard shortcuts

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