Skip to content

Commit c49958a

Browse files
Initial release (#1)
* Initial release
1 parent 7ce4f1a commit c49958a

55 files changed

Lines changed: 8610 additions & 31 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/ci.yaml

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
name: CI
2+
3+
on: push
4+
5+
jobs:
6+
verify:
7+
name: Verify Code
8+
runs-on: ubuntu-latest
9+
10+
env:
11+
COVERITY: coverity_tool
12+
13+
steps:
14+
- uses: actions/checkout@v2
15+
16+
- name: Setup Maven Central
17+
uses: actions/setup-java@v2
18+
with:
19+
java-version: 8.0.292+10
20+
distribution: 'adopt'
21+
22+
- name: Cache Local Maven Repository
23+
uses: actions/cache@v2
24+
with:
25+
path: ~/.m2/repository
26+
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
27+
28+
- name: Compile Test and Verify
29+
run: mvn --batch-mode clean verify
30+
31+
- name: Cache Coverity
32+
id: cache_coverity
33+
uses: actions/cache@v2
34+
with:
35+
path: ${{ env.COVERITY }}
36+
key: coverity
37+
38+
- name: Download Coverity
39+
if: steps.cache_coverity.outputs.cache-hit != 'true'
40+
run: |
41+
wget --quiet https://scan.coverity.com/download/linux64 --post-data "token=${{ secrets.COVERITY_TOKEN }}&project=rlo_11" -O ${{ env.COVERITY }}.tgz
42+
mkdir -p ${{ env.COVERITY }}
43+
tar zxvf ${{ env.COVERITY }}.tgz -C ${{ env.COVERITY }} --strip-components 1
44+
45+
- name: Compile Coverity
46+
run: |
47+
${{ env.COVERITY }}/bin/cov-build --dir cov-int mvn -DskipTests=true --batch-mode clean compile
48+
tar czvf rlo_11.tgz cov-int
49+
50+
- name: Upload to Coverity
51+
run: curl --silent --form token=${{ secrets.COVERITY_TOKEN }} --form email=${{ secrets.COVERITY_EMAIL }} --form file=@rlo_11.tgz --form version="${GITHUB_REF##*/}" --form description="automated upload" https://scan.coverity.com/builds?project=rlo_11
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
name: Upload Release
2+
3+
on:
4+
release:
5+
types: published
6+
7+
jobs:
8+
upload:
9+
name: Upload
10+
runs-on: ubuntu-latest
11+
12+
steps:
13+
- uses: actions/checkout@v2
14+
15+
- name: Cache Local Maven Repository
16+
uses: actions/cache@v2
17+
with:
18+
path: ~/.m2/repository
19+
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
20+
21+
- name: Setup Maven Central
22+
uses: actions/setup-java@v2
23+
with:
24+
java-version: 8.0.292+10
25+
distribution: 'adopt'
26+
27+
server-id: ossrh
28+
server-username: MAVEN_CENTRAL_USERNAME
29+
server-password: MAVEN_CENTRAL_TOKEN
30+
31+
gpg-private-key: ${{ secrets.MAVEN_GPG_PRIVATE_KEY }}
32+
gpg-passphrase: MAVEN_GPG_PASSPHRASE
33+
34+
- name: Publish to Maven Central
35+
run: mvn --batch-mode -Drevision=${{ github.event.release.tag_name }} -Dsha1= -Dchangelist= clean deploy -Ppublish-maven-central
36+
env:
37+
MAVEN_CENTRAL_USERNAME: ${{ secrets.MAVEN_CENTRAL_USERNAME }}
38+
MAVEN_CENTRAL_TOKEN: ${{ secrets.MAVEN_CENTRAL_TOKEN }}
39+
40+
MAVEN_GPG_PASSPHRASE: ${{ secrets.MAVEN_GPG_PASSPHRASE }}
41+
42+
- name: Setup GitHub Packages
43+
uses: actions/setup-java@v2
44+
with:
45+
java-version: 8.0.292+10
46+
distribution: 'adopt'
47+
48+
- name: Publish to GitHub Packages
49+
run: mvn --batch-mode -Drevision=${{ github.event.release.tag_name }} -Dsha1= -Dchangelist= clean deploy -Ppublish-github-packages
50+
env:
51+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.gitignore

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
target/*
2+
/target/
3+
.settings/*
4+
.vscode/*
5+
.classpath
6+
.factorypath
7+
.project
8+
/dependency-reduced-pom.xml
9+
.idea/**
10+
*.iml
11+
.flattened-pom.xml

LICENSE

Lines changed: 28 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -633,8 +633,8 @@ the "copyright" line and a pointer to where the full notice is found.
633633
Copyright (C) <year> <name of author>
634634

635635
This program is free software: you can redistribute it and/or modify
636-
it under the terms of the GNU Affero General Public License as published
637-
by the Free Software Foundation, either version 3 of the License, or
636+
it under the terms of the GNU Affero General Public License as published by
637+
the Free Software Foundation, either version 3 of the License, or
638638
(at your option) any later version.
639639

640640
This program is distributed in the hope that it will be useful,
@@ -659,3 +659,29 @@ specific requirements.
659659
if any, to sign a "copyright disclaimer" for the program, if necessary.
660660
For more information on this, and how to apply and follow the GNU AGPL, see
661661
<https://www.gnu.org/licenses/>.
662+
663+
Additional permission under GNU Affero General Public License version 3
664+
section 7
665+
666+
If you modify this Program, or any covered work, by linking or combining it with
667+
other code, such other code is not for that reason alone subject to any of the
668+
requirements of the GNU Affero GPL version 3 as long as this Program is the same
669+
Program as licensed from Suomen Kanuuna Oy without any additional modifications.
670+
671+
Supplemented terms under GNU Affero General Public License version 3
672+
section 7
673+
674+
Origin of the software must be attributed to Suomen Kanuuna Oy. Any modified
675+
versions must be marked as "Modified version of" The Program.
676+
677+
Names of the licensors and authors may not be used for publicity purposes.
678+
679+
No rights are granted for use of trade names, trademarks, or service marks
680+
which are in The Program if any.
681+
682+
Licensee must indemnify licensors and authors for any liability that these
683+
contractual assumptions impose on licensors and authors.
684+
685+
To the extent this program is licensed as part of the Commercial versions of
686+
Teragrep, the applicable Commercial License may apply to this file if you as
687+
a licensee so wish it.

README.adoc

Lines changed: 46 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,47 +1,64 @@
1-
// Before publishing your new repository:
2-
// 1. Write the readme file
3-
// 2. Update the issues link in Contributing section in the readme file
4-
// 3. Update the discussion link in config.yml file in .github/ISSUE_TEMPLATE directory
5-
6-
= repo-template
7-
8-
// Add a short description of your project. Tell what your project does and what it's used for.
9-
10-
This is a template repository for Teragrep organization.
1+
= Java Record Routing Library
112

123
== Features
134

14-
// List your project's features
5+
- Host+Tag based routing: CFE07Routing
6+
- Host+Tag based index and sourcetype enrichment: CFE12Routing
7+
- Authentication Token based Host+Tag information enrichment: CFE16Routing
8+
- Account ID + LogGroup based Host+Tag information enrichment: KIN02Routing
9+
10+
== Examples
1511

16-
== Documentation
12+
=== CFE07Routing
1713

18-
See the official documentation on https://docs.teragrep.com[docs.teragrep.com].
14+
[source, java]
15+
--
16+
CFE07Routing cfe07Routing = new CFE07Routing("src/test/resources/cfe_07");
1917

20-
== Limitations
18+
RoutingKey key = new RoutingKey("group-one-host-one", "group-one-tag-two");
2119

22-
// If your project has limitations, please list them. Otherwise remove this section.
20+
for (String target : cfe07Routing.getTargets(key)) {
21+
// spool target
22+
if ("spool".equals(target)) {
23+
// do spool stuff
24+
}
25+
}
2326

24-
== How to [compile/use/implement]
27+
--
2528

26-
// add instructions how people can start to use your project
29+
=== CFE12Routing
2730

28-
== Contributing
31+
[source, java]
32+
--
33+
CFE12Routing cfe12Routing = new CFE12Routing("src/test/resources/cfe_12");
2934

30-
// Change the repository name in the issues link to match with your project's name
35+
RoutingKey key = new RoutingKey("example-host", "124f76f0-net");
3136

32-
You can involve yourself with our project by https://github.com/teragrep/repo-template/issues/new/choose[opening an issue] or submitting a pull request.
37+
for (String index : cfe12Routing.getIndexes(key)) {
38+
for (String sourcetype : cfe12Routing.getSourcetypes(key)) {
39+
// do stuff for each index and for each sourcetype
40+
}
41+
}
42+
--
3343

34-
Contribution requirements:
44+
=== CFE16Routing
3545

36-
. *All changes must be accompanied by a new or changed test.* If you think testing is not required in your pull request, include a sufficient explanation as why you think so.
37-
. Security checks must pass
38-
. Pull requests must align with the principles and http://www.extremeprogramming.org/values.html[values] of extreme programming.
39-
. Pull requests must follow the principles of Object Thinking and Elegant Objects (EO).
46+
[source, java]
47+
--
48+
CFE16Routing cfe16Routing = new CFE16Routing("src/test/resources/cfe_16");
49+
RoutingKey key = cfe16Routing.getRoutingKey("My RoutingKey having token");
4050

41-
Read more in our https://github.com/teragrep/teragrep/blob/main/contributing.adoc[Contributing Guideline].
51+
String hostname = key.getHostname();
52+
String appName = key.getAppName();
53+
--
4254

43-
=== Contributor License Agreement
55+
=== KIN02Routing
4456

45-
Contributors must sign https://github.com/teragrep/teragrep/blob/main/cla.adoc[Teragrep Contributor License Agreement] before a pull request is accepted to organization's repositories.
57+
[source, java]
58+
--
59+
KIN02Routing kin02Routing = new KIN02Routing("src/test/resources/kin_02");
60+
RoutingKey key = kin02Routing.getRoutingKey("1234567890","/example/logGroupName/ThatExists");
4661

47-
You need to submit the CLA only once. After submitting the CLA you can contribute to all Teragrep's repositories.
62+
String hostname key.getHostname();
63+
String appName = key.getAppName();
64+
--

0 commit comments

Comments
 (0)