Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Initial drop of generated types #2

Merged
merged 7 commits into from
Oct 29, 2021
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 31 additions & 0 deletions .github/workflows/build-and-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Build and test

on:
push:
branches:
- master
pull_request:
branches:
- master

jobs:
run-tests:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
with:
submodules: "recursive"

- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: "1.17.2"

- name: Install APT-based build dependencies
run: >
sudo apt-get update &&
sudo apt-get install make

- name: Build and test
run: make all check tidy check-dirty
20 changes: 20 additions & 0 deletions .github/workflows/refresh-documentation.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Makes sure that new releases are pulled into https://proxy.golang.org
# and that the documentation on https://pkg.go.dev/ is updated.
# See https://github.com/andrewslotin/go-proxy-pull-action for details.

name: Refresh documentation

on:
release:
types:
- created
tags:
- 'v[0-9]+.[0-9]+.[0-9]+'

jobs:
build:
name: Refresh documentation
runs-on: ubuntu-latest
steps:
- name: Pull new module version
uses: andrewslotin/go-proxy-pull-action@master
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
/.idea
/.vscode
/bin
/eventgen
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[submodule "protocol"]
path = protocol
url = https://github.com/eiffel-community/eiffel
25 changes: 25 additions & 0 deletions .golangci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
---
linters:
disable-all: true
enable:
- bodyclose
- deadcode
- errcheck
- exportloopref
- gocyclo
- godot
- gofmt
- gosec
- gosimple
- govet
- ineffassign
- misspell
- staticcheck
- typecheck
- unconvert
- unused
- varcheck
- whitespace
linters-settings:
misspell:
locale: US
148 changes: 148 additions & 0 deletions EiffelActivityCanceledEventV1.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,148 @@
// Copyright Axis Communications AB.
//
// For a full list of individual contributors, please see the commit history.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

// THIS FILE IS AUTOMATICALLY GENERATED AND MUST NOT BE EDITED BY HAND.

package eiffelevents

import (
"github.com/clarketm/json"
)

// MarshalJSON returns the JSON encoding of the event.
func (e *ActivityCanceledV1) MarshalJSON() ([]byte, error) {
// The standard encoding/json package doesn't honor omitempty for
// non-pointer structs (it doesn't recurse into values, only examines
// the immediate value). This is a not terribly elegant way of making
// sure that this struct is marshaled by github.com/clarketm/json
// without the infinite loop we'd get by just passing the struct to
// github.com/clarketm/json.Marshal.
//
// Make sure the links slice is non-null so that non-initialized slices
// get serialized as "[]" instead of "null".
links := e.Links
if links == nil {
links = make([]ActCV1Link, 0)
}
s := struct {
Data *ActCV1Data `json:"data"`
Links []ActCV1Link `json:"links"`
Meta *ActCV1Meta `json:"meta"`
}{
Data: &e.Data,
Links: links,
Meta: &e.Meta,
}
return json.Marshal(s)
}

// String returns the JSON encoding of the event.
func (e *ActivityCanceledV1) String() string {
b, err := e.MarshalJSON()
if err != nil {
// This should never happen, and if it does happen it's not clear that
// there's a reasonable way to recover. Returning an error message
// instead of the JSON string won't end well.
panic(err)
}
return string(b)
}

type ActivityCanceledV1 struct {
// Mandatory fields
Data ActCV1Data `json:"data"`
Links []ActCV1Link `json:"links"`
Meta ActCV1Meta `json:"meta"`

// Optional fields

}

type ActCV1Data struct {
// Mandatory fields

// Optional fields
CustomData []ActCV1DataCustomDatum `json:"customData,omitempty"`
Reason string `json:"reason,omitempty"`
}

type ActCV1DataCustomDatum struct {
// Mandatory fields
Key string `json:"key"`
Value interface{} `json:"value"`

// Optional fields

}

type ActCV1Link struct {
// Mandatory fields
Target string `json:"target"`
Type string `json:"type"`

// Optional fields

}

type ActCV1Meta struct {
// Mandatory fields
ID string `json:"id"`
Time int64 `json:"time"`
Type string `json:"type"`
Version string `json:"version"`

// Optional fields
Security ActCV1MetaSecurity `json:"security,omitempty"`
Source ActCV1MetaSource `json:"source,omitempty"`
Tags []string `json:"tags,omitempty"`
}

type ActCV1MetaSecurity struct {
// Mandatory fields

// Optional fields
SDM ActCV1MetaSecuritySDM `json:"sdm,omitempty"`
}

type ActCV1MetaSecuritySDM struct {
// Mandatory fields
AuthorIdentity string `json:"authorIdentity"`
EncryptedDigest string `json:"encryptedDigest"`

// Optional fields

}

type ActCV1MetaSource struct {
// Mandatory fields

// Optional fields
DomainID string `json:"domainId,omitempty"`
Host string `json:"host,omitempty"`
Name string `json:"name,omitempty"`
Serializer ActCV1MetaSourceSerializer `json:"serializer,omitempty"`
URI string `json:"uri,omitempty"`
}

type ActCV1MetaSourceSerializer struct {
// Mandatory fields
ArtifactID string `json:"artifactId"`
GroupID string `json:"groupId"`
Version string `json:"version"`

// Optional fields

}
138 changes: 138 additions & 0 deletions EiffelActivityCanceledEventV2.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,138 @@
// Copyright Axis Communications AB.
//
// For a full list of individual contributors, please see the commit history.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

// THIS FILE IS AUTOMATICALLY GENERATED AND MUST NOT BE EDITED BY HAND.

package eiffelevents

import (
"github.com/clarketm/json"
)

// MarshalJSON returns the JSON encoding of the event.
func (e *ActivityCanceledV2) MarshalJSON() ([]byte, error) {
// The standard encoding/json package doesn't honor omitempty for
// non-pointer structs (it doesn't recurse into values, only examines
// the immediate value). This is a not terribly elegant way of making
// sure that this struct is marshaled by github.com/clarketm/json
// without the infinite loop we'd get by just passing the struct to
// github.com/clarketm/json.Marshal.
//
// Make sure the links slice is non-null so that non-initialized slices
// get serialized as "[]" instead of "null".
links := e.Links
if links == nil {
links = make([]ActCV2Link, 0)
}
s := struct {
Data *ActCV2Data `json:"data"`
Links []ActCV2Link `json:"links"`
Meta *ActCV2Meta `json:"meta"`
}{
Data: &e.Data,
Links: links,
Meta: &e.Meta,
}
return json.Marshal(s)
}

// String returns the JSON encoding of the event.
func (e *ActivityCanceledV2) String() string {
b, err := e.MarshalJSON()
if err != nil {
// This should never happen, and if it does happen it's not clear that
// there's a reasonable way to recover. Returning an error message
// instead of the JSON string won't end well.
panic(err)
}
return string(b)
}

type ActivityCanceledV2 struct {
// Mandatory fields
Data ActCV2Data `json:"data"`
Links []ActCV2Link `json:"links"`
Meta ActCV2Meta `json:"meta"`

// Optional fields

}

type ActCV2Data struct {
// Mandatory fields

// Optional fields
CustomData []ActCV2DataCustomDatum `json:"customData,omitempty"`
Reason string `json:"reason,omitempty"`
}

type ActCV2DataCustomDatum struct {
// Mandatory fields
Key string `json:"key"`
Value interface{} `json:"value"`

// Optional fields

}

type ActCV2Link struct {
// Mandatory fields
Target string `json:"target"`
Type string `json:"type"`

// Optional fields

}

type ActCV2Meta struct {
// Mandatory fields
ID string `json:"id"`
Time int64 `json:"time"`
Type string `json:"type"`
Version string `json:"version"`

// Optional fields
Security ActCV2MetaSecurity `json:"security,omitempty"`
Source ActCV2MetaSource `json:"source,omitempty"`
Tags []string `json:"tags,omitempty"`
}

type ActCV2MetaSecurity struct {
// Mandatory fields

// Optional fields
SDM ActCV2MetaSecuritySDM `json:"sdm,omitempty"`
}

type ActCV2MetaSecuritySDM struct {
// Mandatory fields
AuthorIdentity string `json:"authorIdentity"`
EncryptedDigest string `json:"encryptedDigest"`

// Optional fields

}

type ActCV2MetaSource struct {
// Mandatory fields

// Optional fields
DomainID string `json:"domainId,omitempty"`
Host string `json:"host,omitempty"`
Name string `json:"name,omitempty"`
Serializer string `json:"serializer,omitempty"`
URI string `json:"uri,omitempty"`
}
Loading