This file contains hidden or 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
sealed trait ValidatorTypeClass[A] { | |
def validate(a: A): Boolean | |
} | |
object ValidatorTypeClass { | |
def validateElement[A](a: A)(implicit v: ValidatorTypeClass[A]) = v.validate(a) | |
implicit def stringElementValidator = new ValidatorTypeClass[String] { | |
override def validate(a: String): Boolean = ??? //validation logic for strings | |
} | |
implicit def numberElementValidator = new ValidatorTypeClass[Double] { |
This file contains hidden or 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
sealed trait Element | |
sealed trait SimpleElement[A] extends Element { | |
def value: A | |
} | |
case class ComplexElement (value: List[Element]) extends Element | |
case class TextElement (value: String) extends SimpleElement[String] | |
case class NumberElement (value: Double) extends SimpleElement[Double] | |
case class BooleanElement (value: Boolean) extends SimpleElement[Boolean] |
This file contains hidden or 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
kubelet: | |
serviceMonitor: | |
https: true |
This file contains hidden or 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
{{- if .Values.kubelet.serviceMonitor.https }} | |
- port: https-metrics | |
scheme: https | |
interval: 15s | |
tlsConfig: | |
caFile: /var/run/secrets/kubernetes.io/serviceaccount/ca.crt | |
insecureSkipVerify: true | |
bearerTokenFile: /var/run/secrets/kubernetes.io/serviceaccount/token | |
honorLabels: true | |
- port: https-metrics |
This file contains hidden or 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
{ | |
Name: "https-metrics", | |
Port: 10250, | |
}, | |
{ | |
Name: "http-metrics", | |
Port: 10255, | |
}, | |
{ | |
Name: "cadvisor", |
This file contains hidden or 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
kubelet: | |
serviceMonitor: | |
https: true | |
prometheus: | |
rbac: | |
roleNamespaces: | |
- kube-system | |
- dev-apps |
This file contains hidden or 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
apiVersion: v1 | |
kind: ServiceAccount | |
metadata: | |
name: tiller | |
namespace: kube-system | |
--- | |
apiVersion: rbac.authorization.k8s.io/v1beta1 | |
kind: ClusterRoleBinding | |
metadata: |
This file contains hidden or 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
trait DocumentRoute[F[_]] extends DocumentRepository[F]{ | |
def F: Monad[F] | |
def M: MarshallableMonad[F] | |
val getDocuments: Route = (get & path("documents")) { | |
complete( | |
documents() | |
) | |
} |
This file contains hidden or 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
object MarshallableMonad { | |
implicit def marshaller[F[_], A: ToResponseMarshaller](implicit m: MarshallableMonad[F]): ToResponseMarshaller[F[A]] = m.marshaller | |
implicit val futureMarshaller: MarshallableMonad[Future] = new MarshallableMonad[Future] { | |
def marshaller[A: ToResponseMarshaller]: Marshaller[Future[A], HttpResponse] = implicitly | |
} | |
implicit val idMarshaller: MarshallableMonad[Id] = new MarshallableMonad[Id] { | |
def marshaller[A: ToResponseMarshaller]: Marshaller[Id[A], HttpResponse] = implicitly | |
} | |
} |
This file contains hidden or 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
trait MarshallableMonad[F[_]] { | |
def marshaller[A: ToResponseMarshaller]: ToResponseMarshaller[F[A]] | |
} |