Documentation ¶
Index ¶
- func ExitWithReport(v ...any)
- func Fatal(v ...any)
- func InitReporter()
- func Report(v ...any)
- func ReportEventTo(event *KpmEvent, w io.Writer)
- func ReportEventToStderr(event *KpmEvent)
- func ReportEventToStdout(event *KpmEvent)
- func ReportMsgTo(msg string, w io.Writer)
- type Event
- type EventType
- type KpmEvent
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ExitWithReport ¶
func ExitWithReport(v ...any)
ExitWithReport prints to the logger and exit with 0. Arguments are handled in the manner of fmt.Println.
func Fatal ¶
func Fatal(v ...any)
Fatal prints to the logger and exit with 1. Arguments are handled in the manner of fmt.Println.
func Report ¶
func Report(v ...any)
Report prints to the logger. Arguments are handled in the manner of fmt.Println.
func ReportEventTo ¶ added in v0.3.2
ReportEvent reports the event to users to stdout.
func ReportEventToStderr ¶ added in v0.3.4
func ReportEventToStderr(event *KpmEvent)
ReportEventToStderr reports the event to users to stderr.
func ReportEventToStdout ¶ added in v0.3.2
func ReportEventToStdout(event *KpmEvent)
ReportEventToStdout reports the event to users to stdout.
func ReportMsgTo ¶ added in v0.3.7
Types ¶
type Event ¶ added in v0.3.2
type Event interface {
Event() string
}
Event is the interface that specifies the event used to show logs to users.
type EventType ¶ added in v0.3.2
type EventType int
const ( Default EventType = iota // errors event type means the event is an error. InvalidRepo FailedNewOciClient RepoNotFound FailedLoadSettings FailedLoadCredential FailedCreateOciClient FailedSelectLatestVersion FailedGetPackageVersions FailedCreateStorePath FailedPush FailedGetPkg FailedVendor FailedAccessPkgPath UnKnownPullWhat UnknownEnv InvalidKclPkg FailedUntarKclPkg FailedLoadKclMod FailedLoadKclModLock FailedCreateFile FailedPackage FailedLogin FailedLogout FileExists CheckSumMismatch CalSumFailed InvalidKpmHomeInCurrentPkg InvalidCmd InvalidPkgRef InvalidGitUrl WithoutGitTag FailedCloneFromGit FailedHashPkg Bug // normal event type means the event is a normal event. PullingStarted PullingFinished Pulling InvalidFlag Adding WaitingLock IsNotUrl IsNotRef UrlSchemeNotOci UnsupportOciUrlScheme SelectLatestVersion DownloadingFromOCI DownloadingFromGit LocalPathNotExist PathIsEmpty ConflictPkgName AddItselfAsDep PkgTagExists DependencyNotFound CircularDependencyExist RemoveDep AddDep KclModNotFound CompileFailed FailedParseVersion )
type KpmEvent ¶ added in v0.3.2
type KpmEvent struct {
// contains filtered or unexported fields
}
KpmEvent is the event used to show kpm logs to users.
func NewErrorEvent ¶ added in v0.3.2
NewErrorEvent returns a new KpmEvent with error.
Click to show internal directories.
Click to hide internal directories.