Skip to content
Open

Dev #15

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
205 commits
Select commit Hold shift + click to select a range
b808821
Merge pull request #11 from sdoque/main
EndeavourGo May 20, 2025
82fcd41
redo configuration to have configurable services
vanDeventer May 27, 2025
a8c026a
cleaning up DName and preparing for naming convention
vanDeventer May 27, 2025
7a3bf8f
Added Makefile, Github Actions and test template
Pake-TU Jun 5, 2025
1a0bf9e
Making sure tests run
Pake-TU Jun 5, 2025
9bac8c3
Fixed linter errors by adding error handlers, MinVersion for tls and …
Pake-TU Jun 5, 2025
18b5e07
Added error handling for Close() and Write() function calls in certif…
gabaxh Jun 5, 2025
c71e7a3
Removed pointer part of linter, it's a later problem
Pake-TU Jun 5, 2025
f7c3096
adding local ontologies
vanDeventer Jun 7, 2025
90bdc49
Fixed test name and test function name for workflow
Pake-TU Jun 9, 2025
5ba705f
Removed old sample test file
Pake-TU Jun 9, 2025
7815ac9
Fixed some spellchecks
Pake-TU Jun 9, 2025
10562ee
Fixed spellchecking errors, ser -> serv, occured -> occurred
Pake-TU Jun 9, 2025
216ef0e
Fixed spellchecking error, relpy -> reply
Pake-TU Jun 9, 2025
6b9903f
Added test for ServQuestForms()
Pake-TU Jun 9, 2025
12d1d65
Added test for FillQuestForm()
Pake-TU Jun 9, 2025
d1563c3
Added test for ExtractQuestForm()
Pake-TU Jun 9, 2025
b287027
Tests for Search4Service(), work in progress
Pake-TU Jun 9, 2025
bb51a3d
Removed sample_test.go, made test for the beginning part of registerS…
gabaxh Jun 9, 2025
d972543
Finished test for Search4Service
Pake-TU Jun 10, 2025
edd538a
redo configuration to have configurable services
vanDeventer May 27, 2025
ba1486a
cleaning up DName and preparing for naming convention
vanDeventer May 27, 2025
3b07419
adding local ontologies
vanDeventer Jun 7, 2025
c7e7046
removes executable file flags on some source files
lmas Jun 10, 2025
0abb25a
Fixes spelling errors, unhandled errors, and a variable url
lmas Jun 10, 2025
678057a
Continued working on tests in registration.go, making commit to pull …
gabaxh Jun 10, 2025
3787a3d
ignores cover files and json
lmas Jun 10, 2025
14b6df4
Merge branch 'tests' into test_registration
gabaxh Jun 10, 2025
dc43051
Work in progress
Pake-TU Jun 10, 2025
29e268d
Merge branch 'tests' into test_serviceDiscovery
Pake-TU Jun 10, 2025
279d4bf
Continued with testing of registration.go, specifically the registerS…
gabaxh Jun 10, 2025
cce999b
Added tests for sendHttpReq(), FillDiscoveredServices(), ExtractDisco…
Pake-TU Jun 10, 2025
b6d69df
Fixed spelling error
Pake-TU Jun 10, 2025
f24b87d
Continued testing of registration.go, ServiceRegistrationFormsList, D…
gabaxh Jun 11, 2025
c73628d
Made generalization of test of ServiceRegistrationForm to work on all…
gabaxh Jun 12, 2025
fd7b37d
Added tests for Search4Service() and Search4Services()
Pake-TU Jun 12, 2025
53148f8
Simplified test for ExtractQuestForm()
Pake-TU Jun 12, 2025
b4b6619
Fixed typo
Pake-TU Jun 12, 2025
092ae66
Added all tests and made comments in the test file for the different …
gabaxh Jun 12, 2025
6dfb415
Changed function names
gabaxh Jun 13, 2025
e865e5e
Optimised GH workflow to minimise spent time
lmas Jun 13, 2025
fea8222
Fix missing tool
lmas Jun 13, 2025
a682f9e
Refactors service registration to make it easier to test
lmas Jun 13, 2025
7b8a0b4
Adds makefile helper to run all checks
lmas Jun 13, 2025
feab5b8
Simplified the sendHttpReq() test
Pake-TU Jun 13, 2025
c038baf
Added an error for wrong statuscode of response
Pake-TU Jun 16, 2025
85ce2e0
Added test for wrong statuscode of response from sendHttpReq()
Pake-TU Jun 16, 2025
1b4edda
Changed back statuscode for tests following 'Non-2xx status code' tes…
Pake-TU Jun 16, 2025
b5fc921
Made table driven tests for confirmLeadingRegistrar and findLeadingRe…
gabaxh Jun 16, 2025
8a95cc1
Merge branch 'tests' into test_registration
gabaxh Jun 16, 2025
b31dce2
Added a file containing test functions and removed sample_test.go
Pake-TU Jun 16, 2025
0fd194f
Added the test help functions in utils_test.go and changed the test c…
gabaxh Jun 16, 2025
bd95772
Fixed broken tests
Pake-TU Jun 16, 2025
350ccab
Fixed the stuff commented on in the review of the pull request
gabaxh Jun 16, 2025
1b90f5d
Fixed comments from code review
Pake-TU Jun 17, 2025
49dd0a6
Merge pull request #2 from lmas/test_registration
lmas Jun 17, 2025
4dbebf6
Fixed last comment of codereview, changed name of test utils file
Pake-TU Jun 17, 2025
4750e91
changed a parameter for a test
Pake-TU Jun 17, 2025
1e07a50
Changed the struct to take a general func() instead of a specific type
Pake-TU Jun 17, 2025
cc41816
Merge pull request #3 from lmas/test_serviceDiscovery
lmas Jun 17, 2025
1a94aaa
Fixed test conflict
gabaxh Jun 17, 2025
f49b783
Fixes go build caching in the workflow
lmas Jun 19, 2025
52804ac
Merges lint/test jobs so they can share the cache properly
lmas Jun 19, 2025
ddfa245
updating the Telegrapher with new configuration
vanDeventer Jun 23, 2025
c28ce5d
Started working on tests for consumption.go
gabaxh Jun 17, 2025
2100ea9
Added test cases for SetState function
gabaxh Jun 18, 2025
8802b7e
Refactored consumption.go so there is a general stateHandler which bo…
gabaxh Jun 18, 2025
4214a82
Made changes according to the requested changes in pull request
gabaxh Jun 23, 2025
7eb96d9
Fixed table driven test to be more readable
gabaxh Jun 23, 2025
5ae2230
Renames all files to have consistent names (snake_case)
lmas Jun 23, 2025
6624d49
Adds tests for components/system
lmas Jun 22, 2025
cc2b752
Refactors GetRunningCoreSystemURL
lmas Jun 22, 2025
73e7edf
Lets usecases/authentication use new get core func
lmas Jun 22, 2025
e88eb53
Fixes returning preserved core URL
lmas Jun 22, 2025
f5d70af
Refactors usecases/registration
lmas Jun 22, 2025
37d929a
Fixes a linter error for URL string
lmas Jun 22, 2025
950c3f2
Slight changes to Configure()
Pake-TU Jun 18, 2025
92c5dd6
Added tests for getServiceList() and MakeServiceMap(), started creati…
Pake-TU Jun 18, 2025
7dab096
WIP, tests for Configure()
Pake-TU Jun 19, 2025
b9a303a
Finished tests for Configure(), moved/refactored some code, added err…
Pake-TU Jun 23, 2025
11550c6
removed an unnecessary log.printf() in test file
Pake-TU Jun 23, 2025
9746c77
Fixed some things from pull request reviews
Pake-TU Jun 24, 2025
118aeb9
Added help function setupDefaultConfig()
Pake-TU Jun 24, 2025
c06e42a
Fixed some PR comments, added help func setupDefaultConfig()
Pake-TU Jun 24, 2025
c8e519b
Big changes to test structure, added test for setupDefaultConfig()
Pake-TU Jun 25, 2025
b5ee846
added an error to return in createConfigNoTraits() & createConfigHasT…
Pake-TU Jun 25, 2025
3f61cb1
Added error to return, if error occurs while encoding default config …
Pake-TU Jun 25, 2025
b6bad99
fixed PR comments
Pake-TU Jun 25, 2025
0f93479
Added back makeServiceMap() and its tests, and finished PR comments
Pake-TU Jun 26, 2025
c164933
Made tests for components/service.go
gabaxh Jun 25, 2025
aeee240
Updated the tests for components/service.go to not use reflect
gabaxh Jun 25, 2025
b68a1c1
Added tests for components/host.go and components/husk.go also
gabaxh Jun 26, 2025
f2109b7
Fixed PR comments
gabaxh Jun 27, 2025
f41b469
Added test for Pack()
Pake-TU Jun 25, 2025
e0aed63
Added tests for Unpack() and naming convention tools. Moved prints in…
Pake-TU Jun 26, 2025
b006232
Removed commented out code
Pake-TU Jun 26, 2025
0b1d699
Fixed changes requested during PR
Pake-TU Jun 27, 2025
0d9448c
After live PR, removed help functions and simplified data assurance c…
Pake-TU Jun 27, 2025
5ff2115
Moved/changed comments in TestUnpack() to not cause misunderstandings…
Pake-TU Jun 27, 2025
ef19ad1
Adds new linter to catch even more common mistakes
lmas Jun 29, 2025
94793cd
Fixes warnings from staticcheck
lmas Jun 29, 2025
80e6e97
Started making tests for usecases/provision.go
gabaxh Jun 26, 2025
43e66f9
Started working on tests for usecases/provision.go
gabaxh Jun 27, 2025
1d2c2d1
Made tests for HTTPProcessSetRequest and getBestContentType
gabaxh Jun 30, 2025
242f25f
Made tests for HTTPProcessGetRequest
gabaxh Jun 30, 2025
6747d5e
Completed tests for usecases/provision.go
gabaxh Jul 1, 2025
54e4363
Added one more test as it was discovered one branch was not tested
gabaxh Jul 1, 2025
73fdf54
Cleaned up some unused code, fixed PR comment and fixed a small miss …
gabaxh Jul 3, 2025
72c4f4d
Fixed some PR comments
gabaxh Jul 3, 2025
c111e42
Fixed PR comment about leftover code
gabaxh Jul 3, 2025
3089f4e
Quick fix for a linter error about capitalised err strings
lmas Jul 3, 2025
2229ba9
Show cyclomatic complexity for the tests too
lmas Jul 4, 2025
311c778
Adds initial system and unit asset for integration test
lmas Jun 25, 2025
6a8adc4
Fixes data race and cleans up error handling
lmas Jun 26, 2025
4ad1bc0
Fixes second data race
lmas Jun 26, 2025
5eb1da2
Enabling by default the data race detection for tests
lmas Jun 26, 2025
9db0107
Improves use of delays and sharing registrar URL
lmas Jun 26, 2025
8b2f6f2
Cleans up error handling and var names
lmas Jun 26, 2025
c0e94a8
Adds tests for service registration
lmas Jun 26, 2025
60ca78f
Cleans up http server shutdown
lmas Jun 29, 2025
0084ad2
Detect leaking goroutines
lmas Jun 29, 2025
a4cde2c
Fixes misspelled json tag
lmas Jun 29, 2025
5af9501
Fixes some error messages
lmas Jun 29, 2025
210028c
Adds orchestrator mocks and cleanups
lmas Jun 29, 2025
f7e789a
Refactors the mock and adds extra data checks
lmas Jul 1, 2025
fa6f875
Splits up test file, adds more comments and cleaning up small things
lmas Jul 4, 2025
cddc78b
Checks for ErrNewConfig during integration test
lmas Jul 4, 2025
02cb4a9
Replaces the last fmt.Print with log
lmas Jul 5, 2025
4749f51
Cleans up error handling in components/host and usecases/provision
lmas Jul 5, 2025
cc890b2
Cleans up error handling in usecases/service_discovery
lmas Jul 5, 2025
fdf32c8
First version of test for forms/file_forms.go
gabaxh Jul 4, 2025
8db5044
Fixed lint error
gabaxh Jul 4, 2025
ae0eb3d
Fixed PR comments
gabaxh Jul 4, 2025
af31ad2
Fixed some small stuff with the tests
gabaxh Jul 7, 2025
18cabb0
Added a test for file escape (reading a file you are not allowed to r…
gabaxh Jul 7, 2025
1f8cd64
Added test for GetActivitiesCost()
Pake-TU Jun 30, 2025
a7e87de
First iteration of tests for SetActivitiesCost(...)
Pake-TU Jun 30, 2025
b1d1236
Forgot to add changes to cost.go file
Pake-TU Jun 30, 2025
2d9c7c2
Simplified SetActivitiesCost() test
Pake-TU Jun 30, 2025
c82624a
Removed commented out code and prints
Pake-TU Jun 30, 2025
872d883
Removed commented out code, and sends error message instead
Pake-TU Jun 30, 2025
d80bd98
Created help func, added first tests of ACServices()
Pake-TU Jun 30, 2025
3f10766
fixed spellcheck errors
Pake-TU Jun 30, 2025
f17a38a
Finished tests for usecases/cost.go
Pake-TU Jul 1, 2025
e9a0a3d
Fixed typo
Pake-TU Jul 1, 2025
20f93fb
Fixed error string in cost.go, and simplified error handler in TestSe…
Pake-TU Jul 1, 2025
2d4ef06
Simplified TestACServices() slightly, reduced line lengths & fixed mo…
Pake-TU Jul 3, 2025
cae51cc
refactored code, and added last testcase for SetActivitiesCost()
Pake-TU Jul 4, 2025
fc702b4
Added comment explaining the use of (*ua)
Pake-TU Jul 7, 2025
8a712fa
Adds govulncheck scanner
lmas Jul 5, 2025
93cef25
Upgrades module version and fixes linter warnings
lmas Jul 5, 2025
a911656
Adds new system message form for the new messenger system
lmas Jul 8, 2025
7ce238a
Moves sendHttpReq to utilities file
lmas Jul 9, 2025
0ee16d0
Adds messenger registration form
lmas Jul 9, 2025
5f0d0e3
Adds messenger registration endpoint to systems
lmas Jul 9, 2025
bee3f89
Refactored registration and add extra error return
lmas Jul 5, 2025
c20d68c
Started refactoring tests for usecases/registration.go
gabaxh Jul 8, 2025
ab88d5a
Refactored old tests to be table driven and cleaned up some code
gabaxh Jul 9, 2025
8b4ee5b
Fixed PR comments
gabaxh Jul 9, 2025
6783136
Moved around some code in components/service_test.go to make it more …
gabaxh Jul 10, 2025
569c23b
Fixes linter error about copying sync.Map
lmas Jul 9, 2025
cd76780
converted Search4Service() and Search4Services() to table driven tests
Pake-TU Jul 9, 2025
b3b88ce
service_discovery_test.go converted to table driven tests
Pake-TU Jul 9, 2025
d068cdd
Removed unnecessary comments and tests
Pake-TU Jul 9, 2025
b2d0e40
Removed unnecessary code & comments
Pake-TU Jul 10, 2025
7a702ce
Simplified logic, removed unnecessary tests and slightly changed para…
Pake-TU Jul 10, 2025
a161b3c
gofmt'ed the code
Pake-TU Jul 10, 2025
654db20
Fixed PR comment, 2 error checks simplified
Pake-TU Jul 10, 2025
48dbcf0
Added comment explaining a helpfunction in test
Pake-TU Jul 10, 2025
0b3b26b
fixes faulty test cases causing linter errors
lmas Jul 10, 2025
fdf79cd
Avoids re-registering the messenger
lmas Jul 9, 2025
1590c13
Adds initial Log func for sending msgs to the messenger
lmas Jul 9, 2025
31655f4
Ignores network errors from unregisterService()
lmas Jul 11, 2025
c9208cf
Fixes test that expected network error from unregisterService
lmas Jul 11, 2025
2135f08
Fixes defaulting to a too large delay during reregistration
lmas Jul 11, 2025
4dd48a2
Merges in test branch and fixes conflict in service_discovery_test.go
lmas Jul 11, 2025
f282dba
Simplifies logging
lmas Jul 11, 2025
c2dd214
Redo registration upon bad responses from the registrar
lmas Jul 14, 2025
0108a56
Refactors logging to not use the sync.Map and improve readability
lmas Jul 14, 2025
732c465
Only verify status of registrars in GetRunningCoreSystemURL
lmas Jul 15, 2025
0fef178
Fixes broken tests after previous commit
lmas Jul 15, 2025
a6fb49c
Started working on making functions that return a list of services in…
gabaxh Jul 15, 2025
b85f77b
Adds helper to translate message levels
lmas Jul 15, 2025
cdb7425
Cleans up error handling for the messenger
lmas Jul 23, 2025
4bea4e7
Adds tests for RegisterMessenger
lmas Jul 23, 2025
bd81adf
Adds first test cases for Log()
lmas Jul 23, 2025
52845e6
Finishes Log testing
lmas Jul 24, 2025
ce75412
Merges in tests branch and hopefully fixes merge conflict
lmas Jul 24, 2025
beb8ddf
Skip logging error that we can't do anything about anyway
lmas Jul 24, 2025
30a3461
Continued working on the GetStates function and tests for it
gabaxh Jul 25, 2025
c5c587d
Replaces single letter variables for readability
lmas Jul 25, 2025
188b38c
Motivates reason for not using timestamps in message form
lmas Jul 25, 2025
02c0016
Merge pull request #18 from lmas/messenger
lmas Jul 25, 2025
ea4c7c4
Added an arbitrary timeout for the http.DefaultClient
Pake-TU Jul 28, 2025
f478347
Added comment while setting the http.DefaultClient.Timeout
Pake-TU Jul 28, 2025
6a3ffab
Completed tests for GetStates in usecases/consumption.go
gabaxh Jul 28, 2025
d6cf788
Finished the GetStates function
gabaxh Jul 29, 2025
6f8c03c
Merge branch 'tests' into states_refactor
gabaxh Jul 30, 2025
cfb37a1
Cleaned up the test for search4MultipleServices in usecases/service_d…
gabaxh Jul 30, 2025
a12d86d
Merge pull request #19 from lmas/states_refactor
lmas Jul 31, 2025
3a9f19c
Fix mistyped json tag
lmas Aug 6, 2025
f8204b3
Merge branch 'sec' into dev
vanDeventer Aug 11, 2025
c1c0338
Adds a global http.DefaultClient
lmas Aug 11, 2025
5f8f4b5
Summer merge 1
vanDeventer Oct 2, 2025
7e88862
Summer Merge
vanDeventer Oct 7, 2025
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/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Linters, Spellcheck, and Tests

on:
push:
paths:
- '**.go'
workflow_dispatch:

jobs:
LintnTest:
runs-on: ubuntu-latest
timeout-minutes: 2
steps:
- uses: actions/checkout@v4
- name: Setup go
uses: actions/setup-go@v5
with:
go-version-file: go.mod
- name: Install dependencies
run: make installpkgs
- name: Run linters
run: make lint
- name: Run tests
run: make test

Spellcheck:
runs-on: ubuntu-latest
timeout-minutes: 1
steps:
- uses: actions/checkout@v4
- uses: crate-ci/[email protected]
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
*.dll
*.so
*.dylib
*.html
*.json

# Test binary, built with `go test -c`
*.test
Expand Down
43 changes: 43 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
# Run tests and log the test coverage
test:
go test -v -race -coverprofile=".cover.out" $$(go list ./... | grep -v /tmp)

# Runs source code linters and catches common errors
lint:
test -z $$(gofmt -l .) || (echo "Code isn't gofmt'ed!" && exit 1)
go vet $$(go list ./... | grep -v /tmp)
gosec -quiet -fmt=golint -exclude-dir="tmp" ./...
staticcheck ./...
govulncheck -test ./...
# pointerinterface ./...

# Runs spellchecker on the code and comments
# This requires this tool to be installed from https://github.com/crate-ci/typos?tab=readme-ov-file
# Example installation (if you have rust installed): cargo install typos-cli
spellcheck:
typos .

# All in one check
runchecks: test lint spellcheck

# Generate pretty coverage report
analyse:
go tool cover -html=".cover.out" -o="cover.html"
@echo -e "\nCOVERAGE\n===================="
go tool cover -func=.cover.out
@echo -e "\nCYCLOMATIC COMPLEXITY\n===================="
gocyclo -avg -top 10 .

# Updates 3rd party packages and tools
installpkgs:
go mod download
go install github.com/fzipp/gocyclo/cmd/gocyclo@latest
go install github.com/securego/gosec/v2/cmd/gosec@latest
go install honnef.co/go/tools/cmd/staticcheck@latest
go install golang.org/x/vuln/cmd/govulncheck@latest
# go install code.larus.se/lmas/pointerinterface@latest

# Clean up built binary and other temporary files (ignores errors from rm)
clean:
go clean
rm .cover.out cover.html
1 change: 0 additions & 1 deletion components/device.go → components/host.go
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,6 @@ func NewDevice() *HostingDevice {
func Hostname() (string, error) {
name, err := os.Hostname()
if err != nil {
log.Println(err.Error())
return "", err
}
return name, nil
Expand Down
41 changes: 41 additions & 0 deletions components/host_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
package components

import (
"testing"
)

func TestHostname(t *testing.T) {
res, err := Hostname()

if res == "" || err != nil {
t.Errorf("Expected a host name and no error, got: %s and %v", res, err)
}
}

func TestIpAddresses(t *testing.T) {
res, err := IpAddresses()

if len(res) == 0 || err != nil {
t.Errorf("Expected IP addresses and no error, got: %s and %v", res, err)
}
}

func TestMacAddresses(t *testing.T) {
ip, err := IpAddresses()
if err != nil {
t.Fatalf("An error occurred in getting IP Addresses for the Mac Address test")
}
res, err := MacAddresses(ip)

if len(res) == 0 || err != nil {
t.Errorf("Expected no error, got: %s and %v", res, err)
}
}

func TestNewDevice(t *testing.T) {
res := NewDevice()

if res == nil {
t.Errorf("Expected a new device, got: %v", res)
}
}
4 changes: 2 additions & 2 deletions components/husk.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2024 Synecdoque
* Copyright (c) 2025 Synecdoque
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
Expand Down Expand Up @@ -35,7 +35,7 @@ type Husk struct {
Certificate string `json:"-"`
CA_cert string `json:"-"`
TlsConfig *tls.Config `json:"-"` // client side mutual TLS configuration
DName pkix.Name `json:"distinguishedName"`
DName pkix.Name `json:"-"`
Details map[string][]string `json:"details"`
ProtoPort map[string]int `json:"protoPort"`
InfoLink string `json:"onlineDocumentation"`
Expand Down
38 changes: 38 additions & 0 deletions components/husk_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
package components

import (
"testing"
)

type sProtocolsTestStruct struct {
input map[string]int
expectedOutput []string
}

var sProtocolsTestParams = []sProtocolsTestStruct{
{makeEmptyProtoPortMap(), nil},
{makeProtoPortMapWithPortZero(), nil},
{makeFullProtoPortMap(), []string{"Port1", "Port2"}},
}

func makeEmptyProtoPortMap() map[string]int {
return make(map[string]int)
}

func makeProtoPortMapWithPortZero() map[string]int {
return map[string]int{"Port": 0}
}

func makeFullProtoPortMap() map[string]int {
return map[string]int{"Port1": 123, "Port2": 404, "Port3": 0}
}

func TestSProtocols(t *testing.T) {
for _, testCase := range sProtocolsTestParams {
res := SProtocols(testCase.input)

if len(res) != len(testCase.expectedOutput) {
t.Errorf("Expected %v, got: %v", testCase.expectedOutput, res)
}
}
}
13 changes: 7 additions & 6 deletions components/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ package components
type Service struct {
ID int `json:"-"` // Id assigned by the Service Registrar
Definition string `json:"definition"` // Service definition or purpose
SubPath string `json:"-"` // The URL subpath after the resource's
SubPath string `json:"subpath"` // The URL subpath after the resource's
Details map[string][]string `json:"details"` // Metadata or details about the service
RegPeriod int `json:"registrationPeriod"` // The period until the registrar is expecting a sign of life
RegTimestamp string `json:"-"` // the creation date in the Service Registry to ensure that reRegistration is with the same record
Expand All @@ -37,7 +37,7 @@ type Service struct {
CUnit string `json:"costUnit"` // cost unit
}

// type Services is a collection of service stucts
// type Services is a collection of service structs
type Services map[string]*Service

// Merge method is used in the configuration use case to prevent the subpath or description to be changed or "configured"
Expand Down Expand Up @@ -113,10 +113,11 @@ func MergeDetails(map1, map2 map[string][]string) map[string][]string {

// A Cervice is a consumed service
type Cervice struct {
Definition string
Details map[string][]string
Nodes map[string][]string
Protos []string
IReferentce string // Internal reference when consuming more than one service of the same type
Definition string // Service definition or purpose
Details map[string][]string
Nodes map[string][]string
Protos []string
}

// Cervises is a collection of "Cervice" structs
Expand Down
Loading
Loading