Skip to content

Commit

Permalink
added module structure to api
Browse files Browse the repository at this point in the history
  • Loading branch information
DinoMarlir committed May 24, 2024
1 parent da8aba9 commit f43f619
Show file tree
Hide file tree
Showing 4 changed files with 35 additions and 0 deletions.
3 changes: 3 additions & 0 deletions api/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
plugins {
kotlin("jvm") version "1.9.24"
kotlin("plugin.serialization") version "1.9.24"
`maven-publish`
}

Expand All @@ -13,6 +14,8 @@ repositories {
dependencies {
implementation(libs.guice)
implementation(libs.gson)
implementation(libs.kotlinxSerializationJson)
implementation(kotlin("reflect"))
}

kotlin {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
package me.blueamethyst.bluecloud.api.module

import me.blueamethyst.bluecloud.api.module.annontations.Module

abstract class AbstractModule {

abstract fun load()
abstract fun startup()
abstract fun shutdown()

fun getModuleInfo(): Module? {
return this::class.java.getAnnotation(Module::class.java)
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
package me.blueamethyst.bluecloud.api.module.annontations

annotation class Module(
val name: String,
val version: String,
val description: String,
val author: String,
val dependencies: Array<String> = [],
val reloadable: Boolean = false
)
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
package me.blueamethyst.bluecloud.api.module.models

import kotlinx.serialization.Serializable

@Serializable
data class ModuleConfiguration(
val entrypoint: String
)

0 comments on commit f43f619

Please sign in to comment.