This repository has been archived by the owner on Dec 21, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #118 from keptn/release-0.4.0
Release 0.4.0
- Loading branch information
Showing
22 changed files
with
747 additions
and
238 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
You can find our [contribution guide](https://github.com/keptn/keptn/blob/master/CONTRIBUTING.md) as well as our | ||
[code of conduct](https://github.com/keptn/keptn/blob/master/CODE_OF_CONDUCT.md) in the | ||
[keptn repo](https://github.com/keptn/keptn). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,65 @@ | ||
# Keptn go-utils | ||
[![Build Status](https://travis-ci.org/keptn/go-utils.svg?branch=master)](https://travis-ci.org/keptn/go-utils) | ||
![GitHub release (latest by date)](https://img.shields.io/github/v/release/keptn/go-utils) | ||
[![Go Report Card](https://goreportcard.com/badge/github.com/keptn/go-utils)](https://goreportcard.com/report/github.com/keptn/go-utils) | ||
|
||
This repo serves as a util package for common functionalities such as logging of the [Keptn Project](https://github.com/keptn). | ||
|
||
Please post any issues with this package to the [keptn/keptn repository](https://github.com/keptn/keptn/issues) and label them with `area:go-utils`. | ||
|
||
## Usage | ||
## Installation | ||
|
||
Get the latest version using | ||
```console | ||
go get github.com/keptn/go-utils | ||
``` | ||
Also consider browsing our [Releases Page](https://github.com/keptn/go-utils/releases) to find out about all releases. | ||
|
||
## Usage | ||
|
||
Below we have listed some basic examples. You can find more information about the usage within the [docs/](docs/) folder. | ||
|
||
### Utils | ||
If you need to access several utility functions: | ||
|
||
```go | ||
import { | ||
keptnutils "github.com/keptn/go-utils/pkg/utils" | ||
} | ||
``` | ||
|
||
## Logging | ||
|
||
``` | ||
Logging Example: | ||
```go | ||
keptnutils.Debug(keptncontext, message) | ||
keptnutils.Info(keptncontext, message) | ||
keptnutils.Error(keptncontext, message) | ||
``` | ||
|
||
### CloudEvent Data | ||
If you need to access data within CloudEvents: | ||
|
||
```go | ||
import { | ||
keptnevents "github.com/keptn/go-utils/pkg/events" | ||
) | ||
``` | ||
Example: | ||
```go | ||
func parseCloudEvent(event cloudevents.Event) (keptnevents.TestFinishedEventData, error) { | ||
eventData := &keptnevents.TestsFinishedEventData{} | ||
err := event.DataAs(eventData) | ||
|
||
return eventData, err | ||
} | ||
``` | ||
### Models | ||
If you need to access Models for YAML files: | ||
```go | ||
import { | ||
keptnmodels "github.com/keptn/go-utils/pkg/models" | ||
) | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Work in Progress |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.