-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add docs on how to leverage lib for local extension development, impr…
…ove Godoc for existing fields (#10) Co-authored-by: Daniil <[email protected]>
- Loading branch information
1 parent
fad1ebf
commit 6bd07b5
Showing
5 changed files
with
70 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,51 @@ | ||
# service-extension | ||
# Service Extension Library | ||
|
||
## Local Setup | ||
To develop Service Extensions on your local machine, follow the instructions below. | ||
The steps listed below are only to aid in local development and are not required to run | ||
the Maverics platform. | ||
|
||
Download the latest version of Go. [Instructions](https://go.dev/doc/install) can be found on the Go website. | ||
|
||
After Go is downloaded, create a project directory. For organizational purpose, it is | ||
recommended to create this project alongside other Maverics configuration files. For | ||
example, in an `/etc/maverics/extensions` directory for Linux users. | ||
|
||
Next run `go mod init example.com/extensions` to initialize a Go module which will be | ||
used for tracking dependencies. You can replace `example.com` with the name of your | ||
company. Your directory structure look similar to the below. | ||
``` | ||
etc | ||
└── maveircs | ||
├── extensions | ||
│ ├── go.mod | ||
│ └── go.sum | ||
└── maverics.yaml | ||
``` | ||
|
||
After the `go.mod` file has been successfully created, next run | ||
`go get github.com/strata-io/service-extension` to add this library as a dependency | ||
to your Go project. Adding this library as a dependency to your Go project will enable | ||
the library to be imported in your Service Extensions. | ||
|
||
You are now able to import and use the Service Extension library! The code snippet | ||
below demonstrates how the library can be imported. | ||
|
||
`/etc/maverics/extensions/auth.go` | ||
```go | ||
package main | ||
|
||
import ( | ||
|
||
"github.com/strata-io/service-extension/orchestrator" | ||
) | ||
|
||
func IsAuthenticated(api orchestrator.Orchestrator, rw http.ResponseWriter, req *http.Request) bool { | ||
return false | ||
} | ||
``` | ||
|
||
## Documentation | ||
For library documentation, please visit the [Godoc site](https://pkg.go.dev/github.com/strata-io/service-extension). | ||
|
||
For Maverics specific documentation, please visit the [product doc site](https://docs.strata.io/). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,10 @@ | ||
package secret | ||
|
||
// Provider is used to retrieve secrets from the configured secret store. | ||
type Provider interface { | ||
// Get retrieves the key from the secret provider. | ||
Get(key string) any | ||
|
||
// GetString retrieves the key from the secret provider as a string value. | ||
GetString(key string) string | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters