Skip to content

Commit

Permalink
refactor!: clear json-schema based version of the Go library (#117)
Browse files Browse the repository at this point in the history
  • Loading branch information
grayside authored Oct 4, 2022
1 parent eabc4f9 commit ee45e63
Show file tree
Hide file tree
Showing 30 changed files with 9 additions and 4,563 deletions.
26 changes: 0 additions & 26 deletions .github/workflows/build.yml

This file was deleted.

85 changes: 0 additions & 85 deletions .github/workflows/gen.yml

This file was deleted.

26 changes: 0 additions & 26 deletions .github/workflows/test.yml

This file was deleted.

48 changes: 8 additions & 40 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@

# Under Heavy Development

This library has been unstable. We are working to make it production ready. For more details, see #113.

You can access the previous development version of this library at its [latest
commit](https://github.com/googleapis/google-cloudevents-go/tree/eabc4f975145db6a8a482109a9ec11ee8724dfb5/)

# Google CloudEvents - Go

[![GoDoc](https://img.shields.io/badge/go-documentation-blue.svg?style=flat-square)](https://pkg.go.dev/mod/github.com/googleapis/google-cloudevents-go) [![unstable](http://badges.github.io/stability-badges/dist/unstable.svg)](http://github.com/badges/stability-badges)
Expand All @@ -22,43 +30,3 @@ To install this package, run:
go get -u github.com/googleapis/google-cloudevents-go
```

## Example Usage

Example event of type `MessagePublishedData` from Cloud Pub/Sub.

```go
package main

import (
"encoding/json"
"fmt"

"github.com/googleapis/google-cloudevents-go/cloud/pubsub/v1"
)

func main() {
data := []byte(`{
"message": {
"attributes": {
"key": "value"
},
"data": "SGVsbG8sIFdvcmxkIQ==",
"messageId": "136969346945"
},
"subscription": "projects/myproject/subscriptions/mysubscription"
}`)

var e pubsub.MessagePublishedData
err := json.Unmarshal(data, &e)
if err != nil {
panic(err)
}
fmt.Printf("%+s\n", e.Message.Data) // Hello, World!
}
```

More detailed documentation about the usage of every type can be found in this library's reference.

## Reference

The [`reference.md`](reference.md) file has detailed examples for how to use every event data type.
Loading

0 comments on commit ee45e63

Please sign in to comment.