Skip to content

Commit

Permalink
Add example library and samples
Browse files Browse the repository at this point in the history
  • Loading branch information
Ethan committed Nov 3, 2023
1 parent ddd6234 commit dcc5102
Show file tree
Hide file tree
Showing 5 changed files with 30 additions and 1 deletion.
8 changes: 8 additions & 0 deletions docs/ORGANIZATION.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,12 @@ The AIO toolbox is a collection of several tools for customers of AIO. To keep t
│ ├── library1
│ ├── ...
│ ├── libraryN
├── samples
│ ├── tool1
│ │ ├── config.yml
│ │ ├── config.json
│ ├── ...
│ ├── toolN
├── tools
│ ├── tool1
│ │ ├── cmd
Expand All @@ -30,6 +36,8 @@ The AIO toolbox is a collection of several tools for customers of AIO. To keep t

__Libraries__ which are shared between multiple tools should be stored in the lib directory. This library can be incorporated into projects beyond AIO tools and such documentation will be available on the _go.dev_ documentation site.

__Samples__ are configuration files which have been created for specific sample usages of a tool. Multiple configuration files can live in each sample folder for different samples which utilize the same tool.

__Tools__ are AIO specific tools which may have their own internal packages stored within the pkg folder. Other top-level folders in each tool are allowed, though it is recommended to minimize the number of top-level folders. Each tool must also have its own cmd directory where the entrypoint is located.

__Dockerfiles__ for relavent docker images are stored for each tool under the docker directory. They are siloed into their own directories for each tool.
Expand Down
11 changes: 11 additions & 0 deletions lib/example/example.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
package example

import "fmt"

// Example shows that all exported symbols must have a comment like this.
type Example struct {}

// Print shows that the exported symbol comments applies to functions as well.
func (*Example) Print() {
fmt.Println("Example library")
}
8 changes: 8 additions & 0 deletions lib/example/example_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
package example

import "testing"

// Every library must have a test file and must meet a minimum test coverage to be merged into the toolbox.
func TestMain(m *testing.M) {
m.Run()
}
2 changes: 2 additions & 0 deletions samples/example /config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# This is an example configuration which would be used with the example project.
# Multiple configuration files can live within the samples/example directory.
2 changes: 1 addition & 1 deletion tools/example/pkg/example/example.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,5 @@ type Example struct {}

// Print shows that the exported symbol comments applies to functions as well.
func (*Example) Print() {
fmt.Println("Example")
fmt.Println("Example package")
}

0 comments on commit dcc5102

Please sign in to comment.