Skip to content

Commit

Permalink
Spelling (#394)
Browse files Browse the repository at this point in the history
* spelling: conversions

Signed-off-by: Josh Soref <[email protected]>

* spelling: designed

Signed-off-by: Josh Soref <[email protected]>

* spelling: into

Signed-off-by: Josh Soref <[email protected]>

* spelling: multiple

Signed-off-by: Josh Soref <[email protected]>

---------

Signed-off-by: Josh Soref <[email protected]>
  • Loading branch information
jsoref authored Jan 11, 2025
1 parent 0177432 commit b9e4e45
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 10 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ for easy to use recipes and integration with sbt, visit [this project](https://g
## Getting started

This library is currently available for Scala binary versions 2.12, 2.13 and 3.2 on JVM/JS/Native.
This library is architecured in a microkernel fashion and all the main kubernetes stuff are implemented/generated in pure scala, and integration modules are provided separately.
This library is designed in a microkernel fashion and all the main kubernetes stuff are implemented/generated in pure scala, and integration modules are provided separately.
main modules are:

- `objects` raw kubernetes objects, which has no dependency
Expand Down
6 changes: 3 additions & 3 deletions docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
## Usage

This library is currently available for Scala binary versions 2.12, 2.13 and 3.2 on JVM/JS/Native.
This library is architecured in a microkernel fashion and all the main kubernetes stuff are implemented/generated in pure scala, and integration modules are provided separately.
This library is designed in a microkernel fashion and all the main kubernetes stuff are implemented/generated in pure scala, and integration modules are provided separately.
main modules are:

- `objects` raw kubernetes objects, which has no dependency
Expand Down Expand Up @@ -42,7 +42,7 @@ libraryDependencies ++= Seq(
first off, we'll import the following
```scala mdoc
import dev.hnaderi.k8s._ // base packages
import dev.hnaderi.k8s.implicits._ // implicit coversions and helpers
import dev.hnaderi.k8s.implicits._ // implicit conversions and helpers
import dev.hnaderi.k8s.manifest._ // manifest syntax
```
every other object definition is under kubernetes packages `io.k8s` as specified in the spec, you should rely on
Expand Down Expand Up @@ -140,7 +140,7 @@ val service = Service(

## Manifest example

Now you can merge all of your kubernetes resource definitions in to one manifest
Now you can merge all of your kubernetes resource definitions into one manifest
```scala mdoc:silent
val all : Seq[KObject] = Seq(service, config, deployment)
val manifest = all.asManifest
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,29 +24,31 @@ object JSONSchemaPropsOrArray {
final case class SingleValue(value: JSONSchemaProps)
extends AnyVal
with JSONSchemaPropsOrArray
final case class MutipleValues(value: Seq[JSONSchemaProps])
final case class MultipleValues(value: Seq[JSONSchemaProps])
extends AnyVal
with JSONSchemaPropsOrArray
def apply(value: JSONSchemaProps): SingleValue = SingleValue(value)
def apply(
v1: JSONSchemaProps,
v2: JSONSchemaProps,
others: JSONSchemaProps*
): MutipleValues = MutipleValues(Seq(v1, v2) ++ others)
def apply(values: Seq[JSONSchemaProps]): MutipleValues = MutipleValues(values)
): MultipleValues = MultipleValues(Seq(v1, v2) ++ others)
def apply(values: Seq[JSONSchemaProps]): MultipleValues = MultipleValues(
values
)

implicit val encoder: Encoder[JSONSchemaPropsOrArray] =
new Encoder[JSONSchemaPropsOrArray] {
def apply[T: Builder](r: JSONSchemaPropsOrArray): T = r match {
case MutipleValues(value) => value.encodeTo
case SingleValue(value) => value.encodeTo
case MultipleValues(value) => value.encodeTo
case SingleValue(value) => value.encodeTo
}
}

implicit val decoder: Decoder[JSONSchemaPropsOrArray] =
Decoder[JSONSchemaProps]
.map(SingleValue(_))
.orElse(
Decoder[Seq[JSONSchemaProps]].map(MutipleValues(_))
Decoder[Seq[JSONSchemaProps]].map(MultipleValues(_))
)
}

0 comments on commit b9e4e45

Please sign in to comment.