Skip to content

Commit 588028d

Browse files
committed
chore: follow sprout conventions internally
1 parent 5047910 commit 588028d

File tree

23 files changed

+40
-27
lines changed

23 files changed

+40
-27
lines changed

docs/advanced/how-to-create-a-registry.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ func NewRegistry() *OwnRegistry {
4444

4545
// Uid provides a unique identifier for your registry.
4646
func (or *OwnRegistry) Uid() string {
47-
return "organization.ownRegistry" // Ensure this identifier is unique and uses camelCase, prefixed by your handler separated with a dot.
47+
return "organization/repo.ownregistry" // Ensure this identifier is unique and uses lowercase, prefixed by your handler/repo separated with a dot.
4848
}
4949

5050
// LinkHandler connects the Handler to your registry, enabling runtime functionalities.

registry.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,7 @@ type FunctionMap = template.FuncMap
1515
// It also allows for easy extension of the template functions by adding a new one.
1616
type Registry interface {
1717
// Uid returns the unique name of the registry. This name is used to identify
18-
// the registry and in future prevent duplicate registry registration.
19-
// TODO: Consider implement a solution for duplicate registry registration.
18+
// the registry author and name and prevent duplicate registry registration.
2019
Uid() string
2120
// LinkHandler links the given Handler to the registry.
2221
// * This method help you to have access to the main handler and its

registry/_example/_example.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ func NewRegistry() *ExampleRegistry {
1515

1616
// Uid returns the unique identifier of the registry.
1717
func (or *ExampleRegistry) Uid() string {
18-
return "example" // ! Must be unique and in camel case
18+
return "go-sprout/sprout.exampleofregistry" // ! Must be unique and in lowercase, replace `exampleofregistry` with your registry name and `go-sprout/sprout` with your handle name
1919
}
2020

2121
// LinkHandler links the handler to the registry at runtime.

registry/backward/backward.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ func NewRegistry() *BackwardCompatibilityRegistry {
3636

3737
// Uid returns the unique identifier of the registry.
3838
func (bcr *BackwardCompatibilityRegistry) Uid() string {
39-
return "backwardCompatibilityWithSprig" // ! Must be unique and in camel case
39+
return "go-sprout/sprout.backwardcompatibilitywithsprig"
4040
}
4141

4242
// LinkHandler links the handler to the registry at runtime.

registry/checksum/checksum.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ func NewRegistry() *ChecksumRegistry {
1313

1414
// Uid returns the unique identifier of the registry.
1515
func (cr *ChecksumRegistry) Uid() string {
16-
return "checksum"
16+
return "go-sprout/sprout.checksum"
1717
}
1818

1919
// LinkHandler links the handler to the registry at runtime.

registry/conversion/conversion.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ func NewRegistry() *ConversionRegistry {
1313

1414
// Uid returns the unique identifier of the registry.
1515
func (or *ConversionRegistry) Uid() string {
16-
return "conversion"
16+
return "go-sprout/sprout.conversion"
1717
}
1818

1919
// LinkHandler links the handler to the registry at runtime.

registry/crypto/crypto.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ func NewRegistry() *CryptoRegistry {
5858

5959
// Uid returns the unique identifier of the crypto handler.
6060
func (ch *CryptoRegistry) Uid() string {
61-
return "crypto"
61+
return "go-sprout/sprout.crypto"
6262
}
6363

6464
func (ch *CryptoRegistry) LinkHandler(fh sprout.Handler) error {

registry/encoding/encoding.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ func NewRegistry() *EncodingRegistry {
1313

1414
// Uid returns the unique identifier of the registry.
1515
func (or *EncodingRegistry) Uid() string {
16-
return "encoding"
16+
return "go-sprout/sprout.encoding"
1717
}
1818

1919
// LinkHandler links the handler to the registry at runtime.

registry/env/env.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ func NewRegistry() *EnvironmentRegistry {
1313

1414
// Uid returns the unique identifier of the registry.
1515
func (or *EnvironmentRegistry) Uid() string {
16-
return "env"
16+
return "go-sprout/sprout.env"
1717
}
1818

1919
// LinkHandler links the handler to the registry at runtime.

registry/filesystem/filesystem.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ func NewRegistry() *FileSystemRegistry {
1313

1414
// Uid returns the unique identifier of the registry.
1515
func (fsr *FileSystemRegistry) Uid() string {
16-
return "filesystem"
16+
return "go-sprout/sprout.filesystem"
1717
}
1818

1919
// LinkHandler links the handler to the registry at runtime.

0 commit comments

Comments
 (0)