-
-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Basic "wand" API #16
Labels
Milestone
Comments
svengreb
added a commit
that referenced
this issue
Nov 17, 2020
In GH-15 [1] some parts of the "wand" API have been implemented in form of spell "incantations", "kinds" and "casters", inspired by the fantasy novel "Harry Potter" [2] as an abstract view to define interfaces. In GH-9 [3] and GH-11 [4] the API implementations for an application configuration store as well as project and VCS repository metadata were introduced. These implementations are now usable in a combined form via the basic "wand" API that consists of the following types: - <I> `wand.Wand` - A `interface` type that manages a project and its applications and stores their metadata. Applications are registered using a unique name and the stored metadata can be received based on this name: - `GetAppConfig(appName string) (app.Config, error)` - returns an application configuration. - `GetProjectMetadata() project.Metadata` - returns the project metadata. - `RegisterApp(name, displayName, pathRel string) error` - registers a new application. - <T> `wand.ctxKey` - A `struct` type that serves as context key used to wrap a `wand.Wand`. - <F> `wand.GetCtxKey() interface{}` - A `func` type that returns the key used to wrap a `wand.Wand`. - <F> `wand.WrapCtx(context.Context,Wand) context.Context` - A `func` type that wraps the given `wand.Wand` into the parent context. Use `wand.GetCtxKey() interface{}` to receive the key used to wrap the `wand.Wand`. [1]: #15 [2]: https://en.wikipedia.org/wiki/Harry_Potter [3]: #9 [4]: #11 GH-16
svengreb
added a commit
that referenced
this issue
Nov 17, 2020
In GH-15 [1] some parts of the "wand" API have been implemented in form of spell "incantations", "kinds" and "casters", inspired by the fantasy novel "Harry Potter" [2] as an abstract view to define interfaces. In GH-9 [3] and GH-11 [4] the API implementations for an application configuration store as well as project and VCS repository metadata were introduced. These implementations are now usable in a combined form via the basic "wand" API that consists of the following types: - <I> `wand.Wand` - A `interface` type that manages a project and its applications and stores their metadata. Applications are registered using a unique name and the stored metadata can be received based on this name: - `GetAppConfig(appName string) (app.Config, error)` - returns an application configuration. - `GetProjectMetadata() project.Metadata` - returns the project metadata. - `RegisterApp(name, displayName, pathRel string) error` - registers a new application. - <T> `wand.ctxKey` - A `struct` type that serves as context key used to wrap a `wand.Wand`. - <F> `wand.GetCtxKey() interface{}` - A `func` type that returns the key used to wrap a `wand.Wand`. - <F> `wand.WrapCtx(context.Context,Wand) context.Context` - A `func` type that wraps the given `wand.Wand` into the parent context. Use `wand.GetCtxKey() interface{}` to receive the key used to wrap the `wand.Wand`. [1]: #15 [2]: https://en.wikipedia.org/wiki/Harry_Potter [3]: #9 [4]: #11 GH-16
Merged
svengreb
added a commit
that referenced
this issue
Nov 17, 2020
In GH-15 [1] some parts of the "wand" API have been implemented in form of spell "incantations", "kinds" and "casters", inspired by the fantasy novel "Harry Potter" [2] as an abstract view to define interfaces. In GH-9 [3] and GH-11 [4] the API implementations for an application configuration store as well as project and VCS repository metadata were introduced. These implementations are now usable in a combined form via the basic "wand" API that consists of the following types: - <I> `wand.Wand` - A `interface` type that manages a project and its applications and stores their metadata. Applications are registered using a unique name and the stored metadata can be received based on this name: - `GetAppConfig(appName string) (app.Config, error)` - returns an application configuration. - `GetProjectMetadata() project.Metadata` - returns the project metadata. - `RegisterApp(name, displayName, pathRel string) error` - registers a new application. - <T> `wand.ctxKey` - A `struct` type that serves as context key used to wrap a `wand.Wand`. - <F> `wand.GetCtxKey() interface{}` - A `func` type that returns the key used to wrap a `wand.Wand`. - <F> `wand.WrapCtx(context.Context,Wand) context.Context` - A `func` type that wraps the given `wand.Wand` into the parent context. Use `wand.GetCtxKey() interface{}` to receive the key used to wrap the `wand.Wand`. [1]: #15 [2]: https://en.wikipedia.org/wiki/Harry_Potter [3]: #9 [4]: #11 Closes GH-16
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
In #15 some parts of the wand API have been implemented in form of spell incantations, kinds and casters, inspired by the fantasy novel “Harry Potter“ as an abstract view to define interfaces. In #9 and #11 the API implementations for an application configuration store as well as project and VCS repository metadata were introduced.
These implementations will be usable in a combined form via the main wand API that will consist of the following types:
wand.Wand
— Ainterface
type that manages a project and its applications and stores their metadata. Applications are registered using a unique name and the stored metadata can be received based on this name:GetAppConfig(appName string) (app.Config, error)
— returns an application configuration.GetProjectMetadata() project.Metadata
— returns the project metadata.RegisterApp(name, displayName, pathRel string) error
— registers a new application.wand.ctxKey
— Astruct
type that serves as context key used to wrap awand.Wand
.wand.GetCtxKey() interface{}
— Afunc
type that returns the key used to wrap awand.Wand
.wand.WrapCtx(parentCtx context.Context, wand Wand) context.Context
— Afunc
type that wraps the givenwand.Wand
into the parent context. Usewand.GetCtxKey() interface{}
to receive the key used to wrap thewand.Wand
.The text was updated successfully, but these errors were encountered: