Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
137 changes: 0 additions & 137 deletions checkstyle/checkstyle.xml

This file was deleted.

4 changes: 3 additions & 1 deletion envoy/src/main/kotlin/ayansen/playground/envoy/App.kt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@ package ayansen.playground.envoy

import org.springframework.boot.autoconfigure.SpringBootApplication
import org.springframework.boot.runApplication

/**
* This is the main entry point for the application
*/
@SpringBootApplication
open class App

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ import io.envoyproxy.controlplane.cache.v3.SimpleCache
import org.springframework.context.annotation.Bean
import org.springframework.context.annotation.Configuration

/**
* This class is responsible for configuring the spring beans
*/
@Configuration
open class SpringConfiguration {
@Bean
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,12 @@ import org.springframework.web.bind.annotation.GetMapping
import org.springframework.web.bind.annotation.RequestMapping
import org.springframework.web.bind.annotation.RestController


@RestController
@RequestMapping("/proxy")
class EnvoyConfigurationsController(private val proxyProvider: ProxyProvider) {

@Operation(summary = "Get All Proxies", description = "Returns a list of Proxies configured in Envoy")
@GetMapping("/all")
suspend fun getProxies(): List<Proxy> {
return proxyProvider.getProxies()
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,10 @@ import io.envoyproxy.envoy.config.endpoint.v3.Endpoint
import io.envoyproxy.envoy.config.endpoint.v3.LbEndpoint
import io.envoyproxy.envoy.config.endpoint.v3.LocalityLbEndpoints


/**
* This class represents a proxy configuration. It contains nested data classes for defining routes, clusters, hosts, and socket addresses.
* The class provides methods for converting the proxy configuration to protobuf messages for use with Envoy.
*/
data class Proxy(
val name: String,
val domains: List<String>,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,12 @@ import java.nio.file.Path
import java.nio.file.StandardWatchEventKinds
import java.nio.file.WatchKey

/**
* This class is responsible for providing the proxy configuration from a folder of yaml files
* @property proxyFolderPath
* @property simpleCache
* @property listenersConfiguration
*/
class FileProxyProvider(
private val proxyFolderPath: String,
simpleCache: SimpleCache<Any>,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import org.slf4j.LoggerFactory


/**
* TODOThe DiscoveryServer class is responsible for starting a gRPC server and initializing the necessary services for Envoy proxy configuration discovery.
* The DiscoveryServer class is responsible for starting a gRPC server and initializing the necessary services for Envoy proxy configuration discovery.
Example Usage
val simpleCache = SimpleCache<Any>()
val discoveryServer = DiscoveryServer(simpleCache)
Expand Down
1 change: 0 additions & 1 deletion envoy/src/test/kotlin/ayansen/playground/envoy/Fixtures.kt
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ object Fixtures {
val mapper: ObjectMapper = ObjectMapper(YAMLFactory()).apply {
registerModule(KotlinModule.Builder().build())
}

inline fun <reified T> parseYamlFile(file: File): T {
return mapper.readValue(file, T::class.java)
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
package ayansen.playground.envoy.server

import io.envoyproxy.envoy.config.core.v3.Node
import io.envoyproxy.envoy.service.discovery.v3.DiscoveryRequest
import io.envoyproxy.envoy.service.discovery.v3.DiscoveryResponse
import io.envoyproxy.envoy.service.endpoint.v3.EndpointDiscoveryServiceGrpc
import io.grpc.ManagedChannelBuilder
import io.grpc.stub.StreamObserver
import org.junit.jupiter.api.Test
import org.springframework.boot.test.context.SpringBootTest
import kotlin.test.assertNotNull
Expand All @@ -18,8 +21,8 @@ class DiscoveryServerTests {
)

client.streamEndpoints(object :
io.grpc.stub.StreamObserver<io.envoyproxy.envoy.service.discovery.v3.DiscoveryResponse> {
override fun onNext(value: io.envoyproxy.envoy.service.discovery.v3.DiscoveryResponse?) {
StreamObserver<DiscoveryResponse> {
override fun onNext(value: DiscoveryResponse?) {
assertNotNull(value)
}

Expand All @@ -35,7 +38,7 @@ class DiscoveryServerTests {
DiscoveryRequest.newBuilder().setTypeUrl(
"type.googleapis.com/envoy.config.endpoint.v3.ClusterLoadAssignment"
).setNode(
io.envoyproxy.envoy.config.core.v3.Node.newBuilder().setId("key").build(
Node.newBuilder().setId("key").build(
)
).build()
)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
package ayansen.playground.openapi.exemplar.server.provider

class FileConfigProviderTest {

}
class FileConfigProviderTest