Refactor service documentation to standardize naming conventions and improve clarity
Signed-off-by: Snider <snider@lt.hn>
This commit is contained in:
parent
89721834ee
commit
3a40c83017
9 changed files with 92 additions and 67 deletions
|
|
@ -1,4 +1,4 @@
|
|||
// package config provides the public API for the Config service.
|
||||
// package config provides the public API for the config service.
|
||||
package config
|
||||
|
||||
import (
|
||||
|
|
@ -9,19 +9,19 @@ import (
|
|||
"github.com/Snider/Core/pkg/core"
|
||||
)
|
||||
|
||||
// Service is the public type for the Config service. It is a type alias
|
||||
// New is a public function that points to the real function in the implementation package.
|
||||
var New = impl.New
|
||||
|
||||
// Register is a public function that points to the real function in the implementation package.
|
||||
var Register = impl.Register
|
||||
|
||||
// Options is the public type for the Options service. It is a type alias
|
||||
// to the underlying implementation, making it transparent to the user.
|
||||
type Options = impl.Options
|
||||
|
||||
// Service is the public type for the Service service. It is a type alias
|
||||
// to the underlying implementation, making it transparent to the user.
|
||||
type Service = impl.Service
|
||||
|
||||
// Options is the public type for the Config service options.
|
||||
type Options = impl.Options
|
||||
|
||||
// New is the public constructor for the Config service. It is a variable
|
||||
// that points to the real constructor in the implementation package.
|
||||
var New = impl.New
|
||||
|
||||
// Register is the public factory for the dynamic core.WithService pattern.
|
||||
var Register = impl.Register
|
||||
|
||||
// Config is the public interface for the Config service.
|
||||
// Config is the public interface for the config service.
|
||||
type Config = core.Config
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
// package crypt provides the public API for the Crypt service.
|
||||
// package crypt provides the public API for the crypt service.
|
||||
package crypt
|
||||
|
||||
import (
|
||||
|
|
@ -9,14 +9,38 @@ import (
|
|||
"github.com/Snider/Core/pkg/core"
|
||||
)
|
||||
|
||||
// Service is the public type for the Crypt service.
|
||||
// Service is the public type for the Service service. It is a type alias
|
||||
// to the underlying implementation, making it transparent to the user.
|
||||
type Service = impl.Service
|
||||
|
||||
// New is the public constructor for the Crypt service.
|
||||
// Options is the public type for the Options service. It is a type alias
|
||||
// to the underlying implementation, making it transparent to the user.
|
||||
type Options = impl.Options
|
||||
|
||||
// HashType is the public type for the HashType service. It is a type alias
|
||||
// to the underlying implementation, making it transparent to the user.
|
||||
type HashType = impl.HashType
|
||||
|
||||
// LTHN is a public constant that points to the real constant in the implementation package.
|
||||
const LTHN = impl.LTHN
|
||||
|
||||
// SHA512 is a public constant that points to the real constant in the implementation package.
|
||||
const SHA512 = impl.SHA512
|
||||
|
||||
// SHA256 is a public constant that points to the real constant in the implementation package.
|
||||
const SHA256 = impl.SHA256
|
||||
|
||||
// SHA1 is a public constant that points to the real constant in the implementation package.
|
||||
const SHA1 = impl.SHA1
|
||||
|
||||
// MD5 is a public constant that points to the real constant in the implementation package.
|
||||
const MD5 = impl.MD5
|
||||
|
||||
// New is a public function that points to the real function in the implementation package.
|
||||
var New = impl.New
|
||||
|
||||
// Register is the public factory for the dynamic core.WithService pattern.
|
||||
// Register is a public function that points to the real function in the implementation package.
|
||||
var Register = impl.Register
|
||||
|
||||
// Crypt is the public interface for the Crypt service.
|
||||
// Crypt is the public interface for the crypt service.
|
||||
type Crypt = core.Crypt
|
||||
|
|
|
|||
|
|
@ -1,23 +1,27 @@
|
|||
// Package display provides the public API for the Display service.
|
||||
// package display provides the public API for the display service.
|
||||
package display
|
||||
|
||||
import (
|
||||
// Import the internal implementation with an alias.
|
||||
impl "github.com/Snider/Core/pkg/display"
|
||||
|
||||
// Import the core contracts to re-export the interface.
|
||||
"github.com/Snider/Core/pkg/core"
|
||||
)
|
||||
|
||||
// Service is the public type for the Display service. It is a type alias
|
||||
// Options is the public type for the Options service. It is a type alias
|
||||
// to the underlying implementation, making it transparent to the user.
|
||||
type Options = impl.Options
|
||||
|
||||
// Service is the public type for the Service service. It is a type alias
|
||||
// to the underlying implementation, making it transparent to the user.
|
||||
type Service = impl.Service
|
||||
|
||||
// New is the public constructor for the Display service. It is a variable
|
||||
// that points to the real constructor in the implementation package.
|
||||
// New is a public function that points to the real function in the implementation package.
|
||||
var New = impl.New
|
||||
|
||||
// Register is the public factory for the dynamic core.WithService pattern.
|
||||
// Register is a public function that points to the real function in the implementation package.
|
||||
var Register = impl.Register
|
||||
|
||||
// Display is the public interface for the Display service.
|
||||
// Display is the public interface for the display service.
|
||||
type Display = core.Display
|
||||
|
|
|
|||
2
go.work
2
go.work
|
|
@ -4,5 +4,5 @@ use (
|
|||
.
|
||||
./cmd/core
|
||||
./cmd/core-gui
|
||||
./cmd/core-static-di
|
||||
./cmd/examples/core-static-di
|
||||
)
|
||||
|
|
|
|||
14
help/help.go
14
help/help.go
|
|
@ -1,4 +1,4 @@
|
|||
// package help provides the public API for the Help service.
|
||||
// package help provides the public API for the help service.
|
||||
package help
|
||||
|
||||
import (
|
||||
|
|
@ -9,15 +9,19 @@ import (
|
|||
"github.com/Snider/Core/pkg/core"
|
||||
)
|
||||
|
||||
// Service is the public type for the Help service. It is a type alias
|
||||
// Options is the public type for the Options service. It is a type alias
|
||||
// to the underlying implementation, making it transparent to the user.
|
||||
type Options = impl.Options
|
||||
|
||||
// Service is the public type for the Service service. It is a type alias
|
||||
// to the underlying implementation, making it transparent to the user.
|
||||
type Service = impl.Service
|
||||
|
||||
// New is the public constructor for the Help service.
|
||||
// New is a public function that points to the real function in the implementation package.
|
||||
var New = impl.New
|
||||
|
||||
// Register is the public factory for the dynamic core.WithService pattern.
|
||||
// Register is a public function that points to the real function in the implementation package.
|
||||
var Register = impl.Register
|
||||
|
||||
// Help is the public interface for the Help service.
|
||||
// Help is the public interface for the help service.
|
||||
type Help = core.Help
|
||||
|
|
|
|||
19
i18n/i18n.go
19
i18n/i18n.go
|
|
@ -1,4 +1,4 @@
|
|||
// package i18n provides the public API for the I18n service.
|
||||
// package i18n provides the public API for the i18n service.
|
||||
package i18n
|
||||
|
||||
import (
|
||||
|
|
@ -9,14 +9,19 @@ import (
|
|||
"github.com/Snider/Core/pkg/core"
|
||||
)
|
||||
|
||||
// Service is the public type for the I18n service.
|
||||
type Service = impl.Service
|
||||
|
||||
// New is the public factory for the core.WithService pattern.
|
||||
// New is a public function that points to the real function in the implementation package.
|
||||
var New = impl.New
|
||||
|
||||
// Register is the public factory for the dynamic core.WithService pattern.
|
||||
// Register is a public function that points to the real function in the implementation package.
|
||||
var Register = impl.Register
|
||||
|
||||
// I18n is the public interface for the I18n service.
|
||||
// Options is the public type for the Options service. It is a type alias
|
||||
// to the underlying implementation, making it transparent to the user.
|
||||
type Options = impl.Options
|
||||
|
||||
// Service is the public type for the Service service. It is a type alias
|
||||
// to the underlying implementation, making it transparent to the user.
|
||||
type Service = impl.Service
|
||||
|
||||
// I18n is the public interface for the i18n service.
|
||||
type I18n = core.I18n
|
||||
|
|
|
|||
24
io/io.go
24
io/io.go
|
|
@ -1,24 +0,0 @@
|
|||
// package io provides a unified interface for interacting with different filesystems.
|
||||
package io
|
||||
|
||||
import (
|
||||
// Import the internal implementation with an alias.
|
||||
impl "github.com/Snider/Core/pkg/io"
|
||||
"github.com/Snider/Core/pkg/io/sftp"
|
||||
"github.com/Snider/Core/pkg/io/webdav"
|
||||
)
|
||||
|
||||
// Medium is the standard interface for a storage backend.
|
||||
type Medium = impl.Medium
|
||||
|
||||
// Expose the factory functions for creating different media.
|
||||
var (
|
||||
NewSFTPMedium = impl.NewSFTPMedium
|
||||
NewWebDAVMedium = impl.NewWebDAVMedium
|
||||
)
|
||||
|
||||
// Expose the connection config structs for convenience.
|
||||
type (
|
||||
SFTPConnectionConfig = sftp.ConnectionConfig
|
||||
WebDAVConnectionConfig = webdav.ConnectionConfig
|
||||
)
|
||||
|
|
@ -1,19 +1,31 @@
|
|||
// Package workspace package workspace provides the public API for the Workspace service.
|
||||
// package workspace provides the public API for the workspace service.
|
||||
package workspace
|
||||
|
||||
import (
|
||||
// Import the internal implementation with an alias.
|
||||
impl "github.com/Snider/Core/pkg/workspace"
|
||||
|
||||
// Import the core contracts to re-export the interface.
|
||||
"github.com/Snider/Core/pkg/core"
|
||||
)
|
||||
|
||||
// Service is the public type for the Workspace service.
|
||||
// Options is the public type for the Options service. It is a type alias
|
||||
// to the underlying implementation, making it transparent to the user.
|
||||
type Options = impl.Options
|
||||
|
||||
// Workspace is the public type for the Workspace service. It is a type alias
|
||||
// to the underlying implementation, making it transparent to the user.
|
||||
type Workspace = impl.Workspace
|
||||
|
||||
// Service is the public type for the Service service. It is a type alias
|
||||
// to the underlying implementation, making it transparent to the user.
|
||||
type Service = impl.Service
|
||||
|
||||
// New is the public factory for the core.WithService pattern.
|
||||
// New is a public function that points to the real function in the implementation package.
|
||||
var New = impl.New
|
||||
|
||||
// Register is the public factory for the dynamic core.WithService pattern.
|
||||
// Register is a public function that points to the real function in the implementation package.
|
||||
var Register = impl.Register
|
||||
|
||||
// Workspace is the public interface for the Workspace service.
|
||||
type Workspace = impl.Workspace
|
||||
// Workspace is the public interface for the workspace service.
|
||||
type Workspace = core.Workspace
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue