gsc_utils

package
v0.0.0-...-52f0297 Latest Latest
Warning

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

Go to latest
Published: Sep 21, 2020 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const CHLOG_SEP = "-------------------------------------------------------------------"

Variables

View Source
var GIT_PKG_REPO string = "_git_pkg_repo"

The _git_pkg_repo file structure.

<?xml version="1.0" encoding="UTF-8"?> <git>

<url>git@github.com:somebody/my_great_package.git</url>
<branch>release-1.2</branch>

</git>

Functions

func CallWithTTY

func CallWithTTY(name string, args ...string) error

Add to the sequence the whole changelog entry and reset WIP status

func RandomString

func RandomString() string

RandomString generates a... random string :)

Types

type ChangeLogEntry

type ChangeLogEntry struct {
	Date     time.Time
	Address  *mail.Address
	Messages []string
}

Operations with the changelog

type GSCChangeLog

type GSCChangeLog struct {
	wzlib_logger.WzLogger
	// contains filtered or unexported fields
}

func NewGSCChangeLog

func NewGSCChangeLog() *GSCChangeLog

func (*GSCChangeLog) AddEntry

func (cl *GSCChangeLog) AddEntry(entry *ChangeLogEntry)

func (*GSCChangeLog) GetAll

func (cl *GSCChangeLog) GetAll() []*ChangeLogEntry

GetAll changelog entries

func (*GSCChangeLog) GetFilename

func (cl *GSCChangeLog) GetFilename() string

GetFilename of the changelog

func (*GSCChangeLog) GetLatest

func (cl *GSCChangeLog) GetLatest() *ChangeLogEntry

GetLatest changelog entry

func (*GSCChangeLog) GetWIP

func (cl *GSCChangeLog) GetWIP() (*ChangeLogEntry, error)

GetWIP (work in progress) changelog entry. If none found, creates one and returns. WIP log entry has a marker "# WIP ENTRY" inside the messages.

func (*GSCChangeLog) Render

func (cl *GSCChangeLog) Render() string

Dump changelog back to the file

func (*GSCChangeLog) UpdateWIP

func (cl *GSCChangeLog) UpdateWIP(entry *ChangeLogEntry)

func (*GSCChangeLog) Write

func (cl *GSCChangeLog) Write() error

Write changelog

type GSCProjectInfo

type GSCProjectInfo struct {
	ProjectName string
	PackageName string
	Path        string
	ApiUrl      string
	SourceUrl   string
	Md5         string
	Revision    string
	LinkInfo    string
}

type GSCProjectStatus

type GSCProjectStatus struct {
	Modified  []string
	New       []string
	Deleted   []string
	Untracked []string
}

Definition of OSC status

func NewGSCProjectStatus

func NewGSCProjectStatus() *GSCProjectStatus

type GSCRevisionLog

type GSCRevisionLog struct {
	// contains filtered or unexported fields
}

func NewGSCRevisionLog

func NewGSCRevisionLog() *GSCRevisionLog

NewGSCRevisionLog constructor

func (*GSCRevisionLog) GetLatest

func (revlog *GSCRevisionLog) GetLatest() *LogEntry

GetLatest revision log entry

type GSCUtils

type GSCUtils struct {
	wzlib_logger.WzLogger
	// contains filtered or unexported fields
}

func NewGSCUtils

func NewGSCUtils() *GSCUtils

func (*GSCUtils) GetPackageName

func (utl *GSCUtils) GetPackageName() (string, error)

GetPackageName from the spec

func (*GSCUtils) GetPackageVersion

func (utl *GSCUtils) GetPackageVersion() (string, error)

GetPackageVersion from the spec

func (*GSCUtils) GetProjectInfo

func (utl *GSCUtils) GetProjectInfo() (*GSCProjectInfo, error)

GetProjectName returns current project name

func (*GSCUtils) GetStatus

func (utl *GSCUtils) GetStatus() (*GSCProjectStatus, error)

GetStatus about the OSC current project (list deleted, modified and added files)

type GitCaller

type GitCaller struct {
	wzlib_logger.WzLogger
}

func NewGitCaller

func NewGitCaller() *GitCaller

func (*GitCaller) Call

func (gitcall *GitCaller) Call(args ...string) error

Call git with specific params. All calls are blocking.

func (*GitCaller) GetCurrentBranch

func (gitcall *GitCaller) GetCurrentBranch() string

func (*GitCaller) GetDefaultBranch

func (gitcall *GitCaller) GetDefaultBranch() string

GetDefaultBranch from Git. Note, "default branch" is GitHub's terminology.

func (*GitCaller) GetProjectStatus

func (gitcall *GitCaller) GetProjectStatus() (*GSCProjectStatus, error)

GetProjectStatus is similar to what OSC does, but this returns status for the Git repo

type GitPkgRepo

type GitPkgRepo struct {
	XMLName xml.Name `xml:"git"`
	Url     string   `xml:"url"`
	Branch  string   `xml:"branch"`
	// contains filtered or unexported fields
}

func GetRepoFromFile

func GetRepoFromFile(repoUrl string) (*GitPkgRepo, error)

func (*GitPkgRepo) IsNew

func (gpr *GitPkgRepo) IsNew() bool

IsNew returns true if repo file was just created

func (*GitPkgRepo) SetIsNew

func (gpr *GitPkgRepo) SetIsNew()

SetIsNew to true if the repo XML file was just created

func (*GitPkgRepo) ToXML

func (gpr *GitPkgRepo) ToXML() string

ToXML serialisation

type LogEntry

type LogEntry struct {
	Revision string
	User     string
	Date     string
	Checksum string
	Message  string
}

func (*LogEntry) Parse

func (le *LogEntry) Parse(lines []string) *LogEntry

type OSCUser

type OSCUser struct {
	Uid   string
	Name  string
	Email string
}

func GetOSCUser

func GetOSCUser() (*OSCUser, error)

Jump to

Keyboard shortcuts

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