types

package
v0.0.0-...-42e5483 Latest Latest
Warning

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

Go to latest
Published: Mar 14, 2019 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// FileTypeSource tags a file as being source code in a given language
	FileTypeSource FileType = "Source"
	// FileTypeGenerator tags a file as being part of a source file generator tool
	FileTypeGenerator FileType = "Generator"
	// FileTypeBuildSystem tags a file as being part of a build system tool
	FileTypeBuildSystem FileType = "BuildSystem"
	// FileTypeEnvConfig tags a file as being used to configure some development tools
	FileTypeEnvConfig FileType = "EnvConfig"
	// FileTypeLicense tags is used to tag license files
	FileTypeLicense FileType = "License"
	// FileTypeUnknown tags unrecognized files
	FileTypeUnknown FileType = ""
	// LanguageUnknown is used to identify unknown languages
	LanguageUnknown LanguageID = ""
)

Variables

This section is empty.

Functions

This section is empty.

Types

type ActivityInfo

type ActivityInfo struct {
	CommitID CommitID  `json:"commitID,omitempty"`
	Date     time.Time `json:"date,omitempty"`
}

ActivityInfo is used to know the date and id of a commit that impacted a file

type AuthorInfo

type AuthorInfo struct {
	Name  string `json:"name"`
	Email string `json:"email,omitempty"`
}

AuthorInfo contains details about the author of a commit

type CommitChanges

type CommitChanges struct {
	CommitID    CommitID      `json:"commitID"`
	FileChanges []FileChanges `json:"fileChanges"`
}

CommitChanges contains details of the changes done by a single commit

type CommitID

type CommitID string

CommitID identifies a single commit

func (*CommitID) String

func (id *CommitID) String() string

type CommitInfo

type CommitInfo struct {
	Number     int          `json:"number"`
	CommitID   CommitID     `json:"commitID"`
	Author     AuthorInfo   `json:"author"`
	DateTime   time.Time    `json:"date"`
	IsMerge    bool         `json:"isMerge,omitempty"`
	Message    string       `json:"message,omitempty"`
	Changes    []FileChange `json:"changes,omitempty"`
	MainParent string       `json:"mainParent,omitempty"`
	Parents    []string     `json:"parents,omitempty"`
}

CommitInfo contains details about a single commit

type FileActivity

type FileActivity struct {
	ModificationDates []ActivityInfo `json:"modificationDates,omitempty"`
	RenamingDates     []RenamingInfo `json:"renamingDates,omitempty"`
	RelocationDates   []ActivityInfo `json:"relocationDates,omitempty"`
	UndeletionDates   []ActivityInfo `json:"undeletionDates,omitempty"`
}

FileActivity contains details about all the events that happened to a file

type FileChange

type FileChange struct {
	Type        FileChangeType `json:"type"`
	FilePath    string         `json:"file"`
	RenamedFile string         `json:"renamedFile,omitempty"`
}

FileChange contains the details about a change done on a file

type FileChangeType

type FileChangeType string

FileChangeType identifies the kind of change done on a file

const (
	// FileChangeAdded identifies a change that added a new file
	FileChangeAdded FileChangeType = "Added"
	// FileChangeDeleted identifies a change that deleted an existing file
	FileChangeDeleted FileChangeType = "Deleted"
	// FileChangeModified identifies a change that modified an existing file
	FileChangeModified FileChangeType = "Modified"
	// FileChangeRenamed identifies a change that renamed an existing file
	FileChangeRenamed FileChangeType = "Renamed"
)

type FileChanges

type FileChanges struct {
	FileName    string      `json:"fileName"`
	LineChanges LineChanges `json:"lineChanges"`
}

FileChanges contains details of the changes done in a single file

type FileNameInfo

type FileNameInfo struct {
	FullPath      string    `json:"fullPath,omitempty"`
	EndOfValidity time.Time `json:"endOfValidity,omitempty"`
}

FileNameInfo contains details about the name and path that is or has been used for a file

type FileType

type FileType string

FileType identifies the type of a file in the repository

func (*FileType) String

func (id *FileType) String() string

type FileTypeInfo

type FileTypeInfo struct {
	Language   LanguageID `json:"language"`
	Type       FileType   `json:"type"`
	FileName   []string   `json:"fileNames"`
	FilePrefix []string   `json:"filePrefixes"`
	FileSuffix []string   `json:"fileSuffixes"`
}

FileTypeInfo is the struct used to extract FileType Information from a JSON

type LanguageID

type LanguageID string

LanguageID identifies the language used for a source file

func (*LanguageID) String

func (id *LanguageID) String() string

type LineChanges

type LineChanges struct {
	AddedCount   int `json:"addedCount,omitempty"`
	RemovedCount int `json:"removedCount,omitempty"`
	EditedCount  int `json:"editedCount,omitempty"`
}

LineChanges contains the details of the changes done in piece of code

func (*LineChanges) Merge

func (diff *LineChanges) Merge(other LineChanges)

Merge merges another change diff into the current one

type LocalFile

type LocalFile struct {
	ID            LocalFileID    `json:"id"`
	LatestPath    string         `json:"latestPath"`
	CreationDate  time.Time      `json:"creationDate"`
	DeletionDate  *time.Time     `json:"deletionDate,omitempty"` // if != nil : file is deleted!
	PreviousNames []FileNameInfo `json:"previousNames,omitempty"`
	FileType      FileType       `json:"fileType,omitempty"`
	Language      LanguageID     `json:"language,omitempty"`
	Activity      FileActivity   `json:"activity,omitempty"`
	AuthorCommits map[string]int `json:"authorCommits,omitempty"`
}

LocalFile contains details about a file that exists or has existed in the repository

type LocalFileID

type LocalFileID int

LocalFileID identifies a file belonging to the repository

func (LocalFileID) Next

func (id LocalFileID) Next() LocalFileID

Next generates a new file id from the given one

type ProjectReferential

type ProjectReferential []LocalFile

ProjectReferential details all the files that exist or have existed in a project

func (ProjectReferential) Len

func (r ProjectReferential) Len() int

functions used to make it sortable

func (ProjectReferential) Less

func (r ProjectReferential) Less(i, j int) bool

func (ProjectReferential) Swap

func (r ProjectReferential) Swap(i, j int)

type RenamingInfo

type RenamingInfo struct {
	ActivityInfo
	PreviousName string `json:"previousName,omitempty"`
}

RenamingInfo contains more details about a commit that renamed a file

type SampleID

type SampleID int

func (*SampleID) String

func (id *SampleID) String() string

type SampleInfo

type SampleInfo struct {
	Number   SampleID  `json:"number"`
	DateTime time.Time `json:"date"`
	CommitID CommitID  `json:"commitID"` // use a pointer to allow null value in JSON output
	AliasOf  SampleID  `json:"aliasOf,omitempty"`
}

Jump to

Keyboard shortcuts

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