Giter Site home page Giter Site logo

ce-validator's Introduction

About

Validates a given structured and JSON-encoded CloudEvent against the latest CloudEvent SPEC (based on the Go SDK v2.14.0).

Installation

Download a released binary from the Github releases or build via go (see below).

Usage

./ce-validator -h
Usage of ce-validator:
  -f string
        Read event from file
  -i    Read event from standard input
flag: help requested

Example

Given this input event:

{
  "specversion": "1.0",
  "id": "8c00dd69-650c-1789-ccbb-7c3bc1ba76e0",
  "source": "some.source",
  "type": "test.event",
  "time": "2023-06-23T09:05:31Z",
  "awsregion": "eu-central-1",
  "account": "1234567890",
  "data": {
    "topic": "json-values-topic",
    "partition": 0,
    "offset": 0,
    "timestamp": 1684841916831,
    "timestampType": "CreateTime",
    "headers": [],
    "key": null,
    "value": {
      "orderItems": [
        "item-1",
        "item-2"
      ],
      "orderCreatedTime": "Tue May 23 13:38:46 CEST 2023"
    }
  }
}

When reading from Standard Input (stdin) e.g., using pbaste:

pbpaste | ./ce-validator -i
Event is a valid CloudEvent (spec version: 1.0)

Build

Note
Requires Go >=1.20

go install github.com/embano1/ce-validator@latest

ce-validator's People

Contributors

embano1 avatar

Watchers

 avatar  avatar

ce-validator's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.