f3

package
v0.0.0-...-39bbcdd Latest Latest
Warning

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

Go to latest
Published: May 9, 2024 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const (
	RepositoryNameDefault = "vcs"
	RepositoryNameWiki    = "vcs.wiki"
)
View Source
const (
	ResourceAsset          = "asset"
	ResourceAssets         = "assets"
	ResourceComment        = "comment"
	ResourceComments       = "comments"
	ResourceIssue          = "issue"
	ResourceIssues         = "issues"
	ResourceLabel          = "label"
	ResourceLabels         = "labels"
	ResourceMilestone      = "milestone"
	ResourceMilestones     = "milestones"
	ResourceOrganization   = "organization"
	ResourceOrganizations  = "organizations"
	ResourceProject        = "project"
	ResourceProjects       = "projects"
	ResourcePullRequest    = "pull_request"
	ResourcePullRequests   = "pull_requests"
	ResourceReaction       = "reaction"
	ResourceReactions      = "reactions"
	ResourceRelease        = "release"
	ResourceReleases       = "releases"
	ResourceRepository     = "repository"
	ResourceRepositories   = "repositories"
	ResourceReview         = "review"
	ResourceReviews        = "reviews"
	ResourceReviewComment  = "reviewcomment"
	ResourceReviewComments = "reviewcomments"
	ResourceTopic          = "topic"
	ResourceTopics         = "topics"
	ResourceUser           = "user"
	ResourceUsers          = "users"
	ResourceForge          = "forge"
)
View Source
const (
	ReviewStatePending          = "PENDING"
	ReviewStateApproved         = "APPROVED"
	ReviewStateChangesRequested = "CHANGES_REQUESTED"
	ReviewStateCommented        = "COMMENTED"
	ReviewStateRequestReview    = "REQUEST_REVIEW"
	ReviewStateUnknown          = ""
)

Variables

View Source
var Nil = &Common{}
View Source
var RepositoryNames = []string{RepositoryNameDefault}

Functions

func Load

func Load(filename string, data interface{}, validation bool) error

Load project data from file, with optional validation

func NewCmpCompareOptions

func NewCmpCompareOptions(f Interface) cmp.Options

func NewCmpOptions

func NewCmpOptions(f Interface) cmp.Options

func RepositoryDirname

func RepositoryDirname(name string) string

func Store

func Store(filename string, data interface{}) error

Types

type Comment

type Comment struct {
	Common
	PosterID *Reference `json:"poster_id"`
	Created  time.Time  `json:"created"`
	Updated  time.Time  `json:"updated"`
	Content  string     `json:"content"`
}

func (*Comment) Clone

func (o *Comment) Clone() Interface

func (Comment) GetCmpIgnoreFields

func (o Comment) GetCmpIgnoreFields() []string

func (*Comment) GetReferences

func (o *Comment) GetReferences() References

type Common

type Common struct {
	Index Reference `json:"index"`
}

func NewCommon

func NewCommon(id string) Common

func (*Common) Clone

func (c *Common) Clone() Interface

func (*Common) GetCmpIgnoreFields

func (c *Common) GetCmpIgnoreFields() []string

func (*Common) GetComparers

func (c *Common) GetComparers() []Comparer

func (*Common) GetID

func (c *Common) GetID() string

func (*Common) GetName

func (c *Common) GetName() string

func (*Common) GetReferences

func (c *Common) GetReferences() References

func (*Common) IsNil

func (c *Common) IsNil() bool

func (*Common) SetID

func (c *Common) SetID(id string)

func (*Common) ToReference

func (c *Common) ToReference() *Reference

type Comparer

type Comparer any

type DownloadFuncType

type DownloadFuncType func() io.ReadCloser

type Forge

type Forge struct {
	Common
	URL string `json:"url"`
}

func (*Forge) Clone

func (o *Forge) Clone() Interface

func (Forge) GetCmpIgnoreFields

func (o Forge) GetCmpIgnoreFields() []string

type Interface

type Interface interface {
	GetID() string
	GetName() string
	SetID(id string)
	IsNil() bool
	GetReferences() References
	ToReference() *Reference
	GetCmpIgnoreFields() []string
	GetComparers() []Comparer
	Clone() Interface
}

func New

func New(name string) Interface

type Issue

type Issue struct {
	Common
	PosterID  *Reference   `json:"poster_id"`
	Assignees []*Reference `json:"assignees"`
	Labels    []*Reference `json:"labels"`
	Title     string       `json:"title"`
	Content   string       `json:"content"`
	Milestone *Reference   `json:"milestone"`
	State     string       `json:"state"` // closed, open
	IsLocked  bool         `json:"is_locked"`
	Created   time.Time    `json:"created"`
	Updated   time.Time    `json:"updated"`
	Closed    *time.Time   `json:"closed"`
	Ref       string       `json:"ref"`
}

func (*Issue) Clone

func (o *Issue) Clone() Interface

func (Issue) GetCmpIgnoreFields

func (o Issue) GetCmpIgnoreFields() []string

func (*Issue) GetReferences

func (o *Issue) GetReferences() References

type Label

type Label struct {
	Common
	Name        string `json:"name"`
	Color       string `json:"color"`
	Description string `json:"description"`
}

func (*Label) Clone

func (o *Label) Clone() Interface

type Milestone

type Milestone struct {
	Common
	Title       string     `json:"title"`
	Description string     `json:"description"`
	Deadline    *time.Time `json:"deadline"`
	Created     time.Time  `json:"created"`
	Updated     *time.Time `json:"updated"`
	Closed      *time.Time `json:"closed"`
	State       string     `json:"state"` // open, closed
}

func (*Milestone) Clone

func (o *Milestone) Clone() Interface

func (Milestone) GetCmpIgnoreFields

func (o Milestone) GetCmpIgnoreFields() []string

type Organization

type Organization struct {
	Common
	FullName string `json:"full_name"`
	Name     string `json:"name"`
}

func (*Organization) Clone

func (o *Organization) Clone() Interface

func (*Organization) GetName

func (o *Organization) GetName() string

type Project

type Project struct {
	Common
	Name          string       `json:"name"`
	IsPrivate     bool         `json:"is_private"`
	IsMirror      bool         `json:"is_mirror"`
	Description   string       `json:"description"`
	DefaultBranch string       `json:"default_branch"`
	Forked        *Reference   `json:"forked"`
	HasWiki       bool         `json:"has_wiki"`
	Topics        []*Reference `json:"topics"`
}

func (*Project) Clone

func (o *Project) Clone() Interface

func (*Project) GetName

func (o *Project) GetName() string

func (*Project) GetReferences

func (o *Project) GetReferences() References

type PullRequest

type PullRequest struct {
	Common
	PosterID       *Reference        `json:"poster_id"`
	Title          string            `json:"title"`
	Content        string            `json:"content"`
	Milestone      *Reference        `json:"milestone"`
	State          string            `json:"state"` // closed, open
	IsLocked       bool              `json:"is_locked"`
	Created        time.Time         `json:"created"`
	Updated        time.Time         `json:"updated"`
	Closed         *time.Time        `json:"closed"`
	Merged         bool              `json:"merged"`
	MergedTime     *time.Time        `json:"merged_time"`
	MergeCommitSHA string            `json:"merged_commit_sha"`
	Head           PullRequestBranch `json:"head"`
	Base           PullRequestBranch `json:"base"`

	FetchFunc PullRequestFetchFunc `json:"-"`
}

func (*PullRequest) Clone

func (o *PullRequest) Clone() Interface

func (PullRequest) GetCmpIgnoreFields

func (o PullRequest) GetCmpIgnoreFields() []string

func (PullRequest) GetComparers

func (o PullRequest) GetComparers() []Comparer

func (*PullRequest) GetReferences

func (o *PullRequest) GetReferences() References

func (*PullRequest) IsForkPullRequest

func (o *PullRequest) IsForkPullRequest() bool

type PullRequestBranch

type PullRequestBranch struct {
	Ref       string `json:"ref"`
	SHA       string `json:"sha"`
	OwnerName string `json:"owner_name"`
	RepoName  string `json:"repo_name"`
}

func (PullRequestBranch) RepoPath

func (o PullRequestBranch) RepoPath() string

type PullRequestFetchFunc

type PullRequestFetchFunc func(ctx context.Context, url, ref string)

type Reaction

type Reaction struct {
	Common
	UserID  *Reference `json:"user_id"`
	Content string     `json:"content"`
}

func (*Reaction) Clone

func (o *Reaction) Clone() Interface

func (*Reaction) GetReferences

func (o *Reaction) GetReferences() References

type Reference

type Reference struct {
	ID string
}

func NewReference

func NewReference(id string) *Reference

func (*Reference) Get

func (r *Reference) Get() string

func (*Reference) GetID

func (r *Reference) GetID() string

func (*Reference) GetIDAsInt

func (r *Reference) GetIDAsInt() int64

func (*Reference) GetIDAsString

func (r *Reference) GetIDAsString() string

func (*Reference) IsNil

func (r *Reference) IsNil() bool

func (Reference) MarshalJSON

func (r Reference) MarshalJSON() ([]byte, error)

func (*Reference) Set

func (r *Reference) Set(reference string)

func (*Reference) SetID

func (r *Reference) SetID(id string)

func (*Reference) UnmarshalJSON

func (r *Reference) UnmarshalJSON(b []byte) error

type ReferenceInterface

type ReferenceInterface interface {
	Get() string
	Set(reference string)
	GetIDAsString() string
	GetIDAsInt() int64
}

type References

type References []ReferenceInterface

func NewReferences

func NewReferences() References

type Release

type Release struct {
	Common
	TagName         string          `json:"tag_name"`
	TargetCommitish string          `json:"target_commitish"`
	Name            string          `json:"name"`
	Body            string          `json:"body"`
	Draft           bool            `json:"draft"`
	Prerelease      bool            `json:"prerelease"`
	PublisherID     *Reference      `json:"publisher_id"`
	Assets          []*ReleaseAsset `json:"assets"`
	Created         time.Time       `json:"created"`
}

func (*Release) Clone

func (o *Release) Clone() Interface

func (Release) GetCmpIgnoreFields

func (o Release) GetCmpIgnoreFields() []string

func (*Release) GetReferences

func (o *Release) GetReferences() References

type ReleaseAsset

type ReleaseAsset struct {
	Common
	Name          string           `json:"name"`
	ContentType   string           `json:"content_type"`
	Size          int64            `json:"size"`
	DownloadCount int64            `json:"download_count"`
	Created       time.Time        `json:"created"`
	SHA256        string           `json:"sha256"`
	DownloadURL   string           `json:"download_url"`
	DownloadFunc  DownloadFuncType `json:"-"`
}

func (*ReleaseAsset) Clone

func (o *ReleaseAsset) Clone() Interface

func (ReleaseAsset) GetCmpIgnoreFields

func (o ReleaseAsset) GetCmpIgnoreFields() []string

func (ReleaseAsset) GetComparers

func (o ReleaseAsset) GetComparers() []Comparer

type Repository

type Repository struct {
	Common

	Name      string
	FetchFunc func(ctx context.Context, destination string) `json:"-"`
}

func (*Repository) Clone

func (r *Repository) Clone() Interface

func (*Repository) GetCmpIgnoreFields

func (r *Repository) GetCmpIgnoreFields() []string

type Review

type Review struct {
	Common
	ReviewerID *Reference `json:"reviewer_id"`
	Official   bool       `json:"official"`
	CommitID   string     `json:"commit_id"`
	Content    string     `json:"content"`
	CreatedAt  time.Time  `json:"created_at"`
	State      string     `json:"state"`
}

func (*Review) Clone

func (o *Review) Clone() Interface

func (Review) GetCmpIgnoreFields

func (o Review) GetCmpIgnoreFields() []string

func (*Review) GetReferences

func (o *Review) GetReferences() References

type ReviewComment

type ReviewComment struct {
	Common
	InReplyTo *Reference `json:"in_reply_to"`
	Content   string     `json:"content"`
	TreePath  string     `json:"tree_path"`
	DiffHunk  string     `json:"diff_hunk"`
	Position  int        `json:"position"`
	Line      int        `json:"line"`
	CommitID  string     `json:"commit_id"`
	PosterID  *Reference `json:"poster_id"`
	CreatedAt time.Time  `json:"created_at"`
	UpdatedAt time.Time  `json:"updated_at"`
}

func (*ReviewComment) Clone

func (o *ReviewComment) Clone() Interface

func (ReviewComment) GetCmpIgnoreFields

func (o ReviewComment) GetCmpIgnoreFields() []string

func (*ReviewComment) GetReferences

func (o *ReviewComment) GetReferences() References

type Topic

type Topic struct {
	Common
	Name string `json:"name"`
}

func (*Topic) Clone

func (o *Topic) Clone() Interface

type User

type User struct {
	Common
	Name     string `json:"name"`
	Email    string `json:"email"`
	UserName string `json:"username"`
	Password string `json:"password"`
	IsAdmin  bool   `json:"admin"`
}

func (*User) Clone

func (o *User) Clone() Interface

func (User) GetCmpIgnoreFields

func (o User) GetCmpIgnoreFields() []string

func (*User) GetName

func (o *User) GetName() string

Jump to

Keyboard shortcuts

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