Module org.github.gestalt.core
Package org.github.gestalt.config.source
Class KubernetesSecretConfigSource
- java.lang.Object
-
- org.github.gestalt.config.source.KubernetesSecretConfigSource
-
- All Implemented Interfaces:
ConfigSource
public final class KubernetesSecretConfigSource extends java.lang.Object implements ConfigSource
Load a config source as kubernetes files secrets. ... Where the name of the file is the path for the configuration and the value in the file is the value of the configuration.
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringK8_SECRET_CONFIG
-
Constructor Summary
Constructors Constructor Description KubernetesSecretConfigSource(java.io.File file)Constructor for a Kubernetes Files Config Source.KubernetesSecretConfigSource(java.io.File file, Tags tags)Constructor for a Kubernetes Files Config Source.KubernetesSecretConfigSource(java.nio.file.Path path)Constructor for a Kubernetes Files Config Source.KubernetesSecretConfigSource(java.nio.file.Path path, Tags tags)Constructor for a Kubernetes Files Config Source.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(java.lang.Object o)java.lang.Stringformat()The format of the config source, for example this can be envVars, the extension of a file (properties, json, ect).java.nio.file.PathgetPath()The path to the file.TagsgetTags()A source can have a set of tags that apply to all nodes in the source.inthashCode()booleanhasList()If this config source provides a list of config values.booleanhasStream()If this config source has a stream to load from.java.util.UUIDid()Id that represents this source as unique.java.util.List<Pair<java.lang.String,java.lang.String>>loadList()provides a list of config values.java.io.InputStreamloadStream()If this config source has a stream, this will return the stream of data.java.lang.Stringname()human-readable name for logging.-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.github.gestalt.config.source.ConfigSource
failOnErrors
-
-
-
-
Field Detail
-
K8_SECRET_CONFIG
public static final java.lang.String K8_SECRET_CONFIG
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
KubernetesSecretConfigSource
public KubernetesSecretConfigSource(java.io.File file) throws GestaltExceptionConstructor for a Kubernetes Files Config Source.- Parameters:
file- where to load the directory with the configuration- Throws:
GestaltException- any exceptions.
-
KubernetesSecretConfigSource
public KubernetesSecretConfigSource(java.io.File file, Tags tags) throws GestaltExceptionConstructor for a Kubernetes Files Config Source.- Parameters:
file- where to load the directory with the configurationtags- tags associated with the source- Throws:
GestaltException- any exceptions.
-
KubernetesSecretConfigSource
public KubernetesSecretConfigSource(java.nio.file.Path path) throws GestaltExceptionConstructor for a Kubernetes Files Config Source.- Parameters:
path- where to load the directory with the configuration- Throws:
GestaltException- any exceptions.
-
KubernetesSecretConfigSource
public KubernetesSecretConfigSource(java.nio.file.Path path, Tags tags) throws GestaltExceptionConstructor for a Kubernetes Files Config Source.- Parameters:
path- where to load the directory with the configurationtags- tags associated with the source- Throws:
GestaltException- any exceptions.
-
-
Method Detail
-
getPath
public java.nio.file.Path getPath()
The path to the file.- Returns:
- path to the file
-
hasStream
public boolean hasStream()
Description copied from interface:ConfigSourceIf this config source has a stream to load from.- Specified by:
hasStreamin interfaceConfigSource- Returns:
- if this config source has a stream to load from
-
loadStream
public java.io.InputStream loadStream() throws GestaltExceptionDescription copied from interface:ConfigSourceIf this config source has a stream, this will return the stream of data. Or if not supported it will throw an exception.- Specified by:
loadStreamin interfaceConfigSource- Returns:
- input stream of data
- Throws:
GestaltException- if there are any IO or if this is an unsupported operation
-
hasList
public boolean hasList()
Description copied from interface:ConfigSourceIf this config source provides a list of config values.- Specified by:
hasListin interfaceConfigSource- Returns:
- if this config source provides a list of config values
-
loadList
public java.util.List<Pair<java.lang.String,java.lang.String>> loadList() throws GestaltException
Description copied from interface:ConfigSourceprovides a list of config values.- Specified by:
loadListin interfaceConfigSource- Returns:
- provides a list of config values
- Throws:
GestaltException- if there are any IO or if this is an unsupported operation
-
format
public java.lang.String format()
Description copied from interface:ConfigSourceThe format of the config source, for example this can be envVars, the extension of a file (properties, json, ect).- Specified by:
formatin interfaceConfigSource- Returns:
- The format of the config source
-
name
public java.lang.String name()
Description copied from interface:ConfigSourcehuman-readable name for logging.- Specified by:
namein interfaceConfigSource- Returns:
- human-readable name for logging.
-
id
public java.util.UUID id()
Description copied from interface:ConfigSourceId that represents this source as unique.- Specified by:
idin interfaceConfigSource- Returns:
- id
-
getTags
public Tags getTags()
Description copied from interface:ConfigSourceA source can have a set of tags that apply to all nodes in the source.- Specified by:
getTagsin interfaceConfigSource- Returns:
- tags assigned to the source
-
equals
public boolean equals(java.lang.Object o)
- Overrides:
equalsin classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
-