Shared utility classes and extensions
Dice |
Manage random things. object Dice |
Executor |
Manage async tasks. interface Executor |
FontLoader |
Load and register fonts. object FontLoader |
ImageFormat |
Supported generation format. enum class ImageFormat |
ImageGenerator |
Generates an image from a svg template. class ImageGenerator<T : Any> |
ImageParametersExtractor |
Provides a data instance from specified parameters. interface ImageParametersExtractor<T : Any> |
Level |
Http requests/response log level. enum class Level |
Loader |
Helper methods to deal with ServiceLoader. object Loader |
SvgGenerator |
Generates an image from a svg file. abstract class SvgGenerator<T : Any> |
SvgToPngConverter |
Convert a svg image to png image. class SvgToPngConverter |
ThreadSafe |
A class annotated with ThreadSafe is supposed to be thread safe (surprisingly). annotation class ThreadSafe |
DEFAULT_APP_NAMESPACE |
The default app namespace. const val DEFAULT_APP_NAMESPACE: String |
defaultLocale |
The default Tock Locale. Use property "tock_default_locale" and default value "en". val defaultLocale: Locale |
defaultNamespace |
The Tock app namespace. val defaultNamespace: String |
defaultZoneId |
The default ZoneId used by Tock. val defaultZoneId: ZoneId |
devEnvironment |
Return true is the current environment is a dev environment. Use "tock_env" property to know the environment - if not set or if the value is "dev", this is a dev environment. val devEnvironment: Boolean |
injector |
Main Tock injector. val injector: KodeinInjector |
internalDefaultZoneId |
The internal defaultZoneId for Tock - var only for tests. property "tock_default_zone" with default value UTC is used. var internalDefaultZoneId: ZoneId |
sharedModule |
IOC of shared module. val sharedModule: Module |
supportedLanguages |
The languages supported by Tock. val supportedLanguages: Map<String, Locale> |
TOCK_BOT_DATABASE |
Tock bot database name property const val TOCK_BOT_DATABASE: String |
TOCK_CACHE_DATABASE |
Tock cache database name property const val TOCK_CACHE_DATABASE: String |
TOCK_FRONT_DATABASE |
Tock front database name property const val TOCK_FRONT_DATABASE: String |
TOCK_MODEL_DATABASE |
Tock model database name property const val TOCK_MODEL_DATABASE: String |
TOCK_NAMESPACE |
The Tock namespace. const val TOCK_NAMESPACE: String |
tockAppDefaultNamespace |
The internal app namespace - var only for tests. Use property "tock_default_namespace" and as default value DEFAULT_APP_NAMESPACE. var tockAppDefaultNamespace: String |
tockInternalInjector |
Internal injector - reset only for tests. var tockInternalInjector: KodeinInjector |
basicAuthInterceptor |
Create a basic auth interceptor. fun basicAuthInterceptor(: String, : String): Interceptor |
basicCredentialsHeader |
Encode basic credential header. fun basicCredentialsHeader(: String, : String): String |
booleanProperty |
Return an env or system Boolean property. fun booleanProperty(: String, : Boolean): Boolean |
checkMaxLengthAllowed |
Checks that the text has no more than 50000 chars. Else cuts the String. fun checkMaxLengthAllowed(: String): String |
concat |
Concat two strings and manage intermediate punctuation. fun concat(: String?, : String?): String |
getAsyncDatabase |
Return the async database specified in the databaseNameProperty. if the env or system property is not found, use the databaseNameProperty as database name (remove "_mongo_db" string is present). fun getAsyncDatabase(: String): MongoDatabase |
getDatabase |
Return the sync database specified in the databaseNameProperty. if the env or system property is not found, use the databaseNameProperty as database name (remove "_mongo_db" string is present). fun getDatabase(: String): MongoDatabase |
intProperty |
Return an env or system Int property. fun intProperty(: String, : Int): Int |
isDocumentDB |
fun isDocumentDB(): Boolean |
listProperty |
Return an env or system List property. fun listProperty(: String, : List<String>, : String = ","): List<String> |
loadProperties |
Load a Properties for classpath. fun loadProperties(: String): Properties |
longProperty |
Return an env or system Long property. fun longProperty(: String, : Long): Long |
mapListProperty |
Return an env or system Map of List property. fun mapListProperty(: String, : Map<String, List<String>>, : String = "|", : String = "=", : String = ","): Map<String, List<String>> |
mapNotNullValues |
Return a map with only not null values. fun <K, V> mapNotNullValues(vararg : Pair<K, V?>): Map<K, V> |
mapProperty |
Return an env or system Map property. fun mapProperty(: String, : Map<String, String>, : String = "|", : String = "="): Map<String, String> |
pingMongoDatabase |
fun pingMongoDatabase(: String): Boolean |
property |
Return an env or system String property. fun property(: String, : String): String |
propertyExists |
Is this env or system property exists? fun propertyExists(: String): Boolean |
propertyOrNull |
Return an env or system String property or null if not found fun propertyOrNull(: String): String? |
resource |
Get a resource url from the classpath. fun resource(: String): URL |
resourceAsStream |
Get a resource InputStream from the classpath. fun resourceAsStream(: String): InputStream |
resourceAsString |
Get a text content of a resource from the classpath. fun resourceAsString(: String): String |
retrofitBuilderWithTimeoutAndLogger |
Init a Retrofit.Builder with specified timeout, logger and interceptors. fun retrofitBuilderWithTimeoutAndLogger(: Long, : KLogger = KotlinLogging.logger {}, : Level = Level.BODY, : List<Interceptor> = emptyList(), : Boolean = false, : Boolean = false, : Proxy? = null): Builder |
tokenAuthenticationInterceptor |
Create a token authentication interceptor. fun tokenAuthenticationInterceptor(: String): Interceptor |
tryToFindLocalIp |
Best attempt to guess local ip. fun tryToFindLocalIp(): String |