Skip to content
Merged
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
Original file line number Diff line number Diff line change
@@ -1,24 +1,14 @@
package io.roastedroot.proxywasm.impl;
package io.roastedroot.proxywasm;

import static io.roastedroot.proxywasm.v1.Helpers.replaceBytes;
import static io.roastedroot.proxywasm.v1.Helpers.string;
import static io.roastedroot.proxywasm.Helpers.replaceBytes;
import static io.roastedroot.proxywasm.Helpers.string;

import com.dylibso.chicory.experimental.hostmodule.annotations.HostModule;
import com.dylibso.chicory.experimental.hostmodule.annotations.WasmExport;
import com.dylibso.chicory.runtime.Instance;
import com.dylibso.chicory.runtime.Memory;
import com.dylibso.chicory.runtime.WasmRuntimeException;
import com.dylibso.chicory.wasm.InvalidException;
import io.roastedroot.proxywasm.v1.Action;
import io.roastedroot.proxywasm.v1.BufferType;
import io.roastedroot.proxywasm.v1.Handler;
import io.roastedroot.proxywasm.v1.LogLevel;
import io.roastedroot.proxywasm.v1.MapType;
import io.roastedroot.proxywasm.v1.MetricType;
import io.roastedroot.proxywasm.v1.QueueName;
import io.roastedroot.proxywasm.v1.StreamType;
import io.roastedroot.proxywasm.v1.WasmException;
import io.roastedroot.proxywasm.v1.WasmResult;
import java.nio.ByteBuffer;
import java.nio.charset.StandardCharsets;
import java.util.HashMap;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package io.roastedroot.proxywasm.v1;
package io.roastedroot.proxywasm;

public enum ABIVersion {
// The values follow the same order as in the Go code using iota (0-based incrementing)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package io.roastedroot.proxywasm.v1;
package io.roastedroot.proxywasm;

/**
* Action represents the action which Wasm contexts expects hosts to take.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package io.roastedroot.proxywasm.v1;
package io.roastedroot.proxywasm;

/**
* Represents the type of buffer in proxy WASM.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package io.roastedroot.proxywasm.v1;
package io.roastedroot.proxywasm;

import java.util.HashMap;
import java.util.Map;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package io.roastedroot.proxywasm.v1;
package io.roastedroot.proxywasm;

import java.io.Closeable;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package io.roastedroot.proxywasm.v1;
package io.roastedroot.proxywasm;

public interface ForeignFunction {
byte[] apply(byte[] data);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package io.roastedroot.proxywasm.v1;
package io.roastedroot.proxywasm;

import java.util.HashMap;
import java.util.Map;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package io.roastedroot.proxywasm.v1;
package io.roastedroot.proxywasm;

import com.dylibso.chicory.runtime.HostFunction;
import java.nio.charset.StandardCharsets;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package io.roastedroot.proxywasm.v1;
package io.roastedroot.proxywasm;

import static io.roastedroot.proxywasm.v1.Helpers.len;
import static io.roastedroot.proxywasm.Helpers.len;

public class HttpContext extends Context {

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package io.roastedroot.proxywasm.v1;
package io.roastedroot.proxywasm;

/**
* Represents log levels for proxy WASM.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package io.roastedroot.proxywasm.v1;
package io.roastedroot.proxywasm;

/**
* Represents the type of map in proxy WASM.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package io.roastedroot.proxywasm.v1;
package io.roastedroot.proxywasm;

/**
* Represents the type of metric in proxy WASM.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package io.roastedroot.proxywasm.v1;
package io.roastedroot.proxywasm;

import static io.roastedroot.proxywasm.v1.Helpers.len;
import static io.roastedroot.proxywasm.Helpers.len;

public class NetworkContext extends Context {

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package io.roastedroot.proxywasm.v1;
package io.roastedroot.proxywasm;

/**
* Represents the type of peer in proxy WASM.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package io.roastedroot.proxywasm.v1;
package io.roastedroot.proxywasm;

public class PluginContext extends Context {

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package io.roastedroot.proxywasm.v1;
package io.roastedroot.proxywasm;

import static io.roastedroot.proxywasm.v1.Helpers.len;
import static io.roastedroot.proxywasm.Helpers.len;

import com.dylibso.chicory.runtime.ByteBufferMemory;
import com.dylibso.chicory.runtime.HostFunction;
Expand All @@ -12,8 +12,6 @@
import com.dylibso.chicory.wasm.WasmModule;
import com.dylibso.chicory.wasm.types.MemoryLimits;
import com.dylibso.chicory.wasm.types.ValueType;
import io.roastedroot.proxywasm.impl.ABI;
import io.roastedroot.proxywasm.impl.ABI_ModuleFactory;
import java.io.Closeable;
import java.nio.charset.StandardCharsets;
import java.util.HashMap;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package io.roastedroot.proxywasm.v1;
package io.roastedroot.proxywasm;

import java.util.Objects;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package io.roastedroot.proxywasm.v1;
package io.roastedroot.proxywasm;

public class StartException extends Exception {
public StartException(String message) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package io.roastedroot.proxywasm.v1;
package io.roastedroot.proxywasm;

/**
* Represents the type of map in proxy WASM.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package io.roastedroot.proxywasm.v1;
package io.roastedroot.proxywasm;

/**
* Represents WebAssembly result codes.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package io.roastedroot.proxywasm.v1;
package io.roastedroot.proxywasm;

/**
* Represents WebAssembly result codes.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@
import static org.junit.jupiter.api.Assertions.assertEquals;

import com.dylibso.chicory.wasm.Parser;
import io.roastedroot.proxywasm.v1.ProxyWasm;
import io.roastedroot.proxywasm.v1.StartException;
import java.nio.file.Path;
import java.util.Map;
import org.junit.jupiter.api.Test;
Expand Down
8 changes: 2 additions & 6 deletions src/test/java/io/roastedroot/proxywasm/EchoHttpBodyTest.java
Original file line number Diff line number Diff line change
@@ -1,15 +1,11 @@
package io.roastedroot.proxywasm;

import static io.roastedroot.proxywasm.v1.Helpers.bytes;
import static io.roastedroot.proxywasm.v1.Helpers.string;
import static io.roastedroot.proxywasm.Helpers.bytes;
import static io.roastedroot.proxywasm.Helpers.string;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertNotNull;

import com.dylibso.chicory.wasm.Parser;
import io.roastedroot.proxywasm.v1.Action;
import io.roastedroot.proxywasm.v1.HttpContext;
import io.roastedroot.proxywasm.v1.ProxyWasm;
import io.roastedroot.proxywasm.v1.StartException;
import java.nio.file.Path;
import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.BeforeEach;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@
import static org.junit.jupiter.api.Assertions.assertEquals;

import com.dylibso.chicory.wasm.Parser;
import io.roastedroot.proxywasm.v1.ProxyWasm;
import io.roastedroot.proxywasm.v1.StartException;
import java.nio.file.Path;
import org.junit.jupiter.api.Test;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,12 @@
package io.roastedroot.proxywasm;

import static io.roastedroot.proxywasm.v1.Helpers.bytes;
import static io.roastedroot.proxywasm.v1.Helpers.string;
import static io.roastedroot.proxywasm.Helpers.bytes;
import static io.roastedroot.proxywasm.Helpers.string;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertNotNull;
import static org.junit.jupiter.api.Assertions.assertNull;

import com.dylibso.chicory.wasm.Parser;
import io.roastedroot.proxywasm.v1.Action;
import io.roastedroot.proxywasm.v1.ProxyWasm;
import io.roastedroot.proxywasm.v1.StartException;
import java.nio.file.Path;
import java.util.Map;
import org.junit.jupiter.api.AfterEach;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,10 @@
package io.roastedroot.proxywasm;

import static io.roastedroot.proxywasm.v1.Helpers.bytes;
import static io.roastedroot.proxywasm.Helpers.bytes;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertNotNull;

import com.dylibso.chicory.wasm.Parser;
import io.roastedroot.proxywasm.v1.Action;
import io.roastedroot.proxywasm.v1.HttpContext;
import io.roastedroot.proxywasm.v1.ProxyWasm;
import io.roastedroot.proxywasm.v1.StartException;
import java.nio.file.Path;
import java.util.Map;
import org.junit.jupiter.api.AfterEach;
Expand Down
8 changes: 2 additions & 6 deletions src/test/java/io/roastedroot/proxywasm/HttpBodyTest.java
Original file line number Diff line number Diff line change
@@ -1,15 +1,11 @@
package io.roastedroot.proxywasm;

import static io.roastedroot.proxywasm.v1.Helpers.bytes;
import static io.roastedroot.proxywasm.v1.Helpers.string;
import static io.roastedroot.proxywasm.Helpers.bytes;
import static io.roastedroot.proxywasm.Helpers.string;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertNotNull;

import com.dylibso.chicory.wasm.Parser;
import io.roastedroot.proxywasm.v1.Action;
import io.roastedroot.proxywasm.v1.HttpContext;
import io.roastedroot.proxywasm.v1.ProxyWasm;
import io.roastedroot.proxywasm.v1.StartException;
import java.nio.charset.StandardCharsets;
import java.nio.file.Path;
import java.util.Map;
Expand Down
3 changes: 0 additions & 3 deletions src/test/java/io/roastedroot/proxywasm/HttpHeadersTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,6 @@
import static org.junit.jupiter.api.Assertions.assertNotNull;

import com.dylibso.chicory.wasm.Parser;
import io.roastedroot.proxywasm.v1.Action;
import io.roastedroot.proxywasm.v1.ProxyWasm;
import io.roastedroot.proxywasm.v1.StartException;
import java.nio.file.Path;
import java.util.Map;
import org.junit.jupiter.api.Test;
Expand Down
3 changes: 0 additions & 3 deletions src/test/java/io/roastedroot/proxywasm/HttpRoutingTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,6 @@
import static org.junit.jupiter.api.Assertions.assertEquals;

import com.dylibso.chicory.wasm.Parser;
import io.roastedroot.proxywasm.v1.Action;
import io.roastedroot.proxywasm.v1.ProxyWasm;
import io.roastedroot.proxywasm.v1.StartException;
import java.nio.file.Path;
import java.util.Map;
import org.junit.jupiter.api.Test;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,9 @@
package io.roastedroot.proxywasm;

import static io.roastedroot.proxywasm.v1.Helpers.bytes;
import static io.roastedroot.proxywasm.Helpers.bytes;
import static org.junit.jupiter.api.Assertions.assertEquals;

import com.dylibso.chicory.wasm.Parser;
import io.roastedroot.proxywasm.v1.Action;
import io.roastedroot.proxywasm.v1.HttpContext;
import io.roastedroot.proxywasm.v1.ProxyWasm;
import io.roastedroot.proxywasm.v1.StartException;
import java.nio.file.Path;
import java.util.Map;
import org.junit.jupiter.api.AfterEach;
Expand Down
4 changes: 0 additions & 4 deletions src/test/java/io/roastedroot/proxywasm/MetricsTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,6 @@
import static org.junit.jupiter.api.Assertions.assertNotNull;

import com.dylibso.chicory.wasm.Parser;
import io.roastedroot.proxywasm.v1.Action;
import io.roastedroot.proxywasm.v1.MetricType;
import io.roastedroot.proxywasm.v1.ProxyWasm;
import io.roastedroot.proxywasm.v1.StartException;
import java.nio.file.Path;
import java.util.Map;
import org.junit.jupiter.api.Test;
Expand Down
9 changes: 0 additions & 9 deletions src/test/java/io/roastedroot/proxywasm/MockHandler.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,6 @@
import static org.junit.jupiter.api.Assertions.assertFalse;
import static org.junit.jupiter.api.Assertions.assertTrue;

import io.roastedroot.proxywasm.v1.Action;
import io.roastedroot.proxywasm.v1.ChainedHandler;
import io.roastedroot.proxywasm.v1.Handler;
import io.roastedroot.proxywasm.v1.Helpers;
import io.roastedroot.proxywasm.v1.LogLevel;
import io.roastedroot.proxywasm.v1.MetricType;
import io.roastedroot.proxywasm.v1.StreamType;
import io.roastedroot.proxywasm.v1.WasmException;
import io.roastedroot.proxywasm.v1.WasmResult;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
Expand Down
4 changes: 0 additions & 4 deletions src/test/java/io/roastedroot/proxywasm/MockSharedHandler.java
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
package io.roastedroot.proxywasm;

import io.roastedroot.proxywasm.v1.Handler;
import io.roastedroot.proxywasm.v1.QueueName;
import io.roastedroot.proxywasm.v1.WasmException;
import io.roastedroot.proxywasm.v1.WasmResult;
import java.util.HashMap;
import java.util.LinkedList;
import java.util.concurrent.atomic.AtomicInteger;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,6 @@
import static org.junit.jupiter.api.Assertions.assertEquals;

import com.dylibso.chicory.wasm.Parser;
import io.roastedroot.proxywasm.v1.Action;
import io.roastedroot.proxywasm.v1.ProxyWasm;
import io.roastedroot.proxywasm.v1.StartException;
import java.nio.file.Path;
import java.util.HashMap;
import java.util.Map;
Expand Down
7 changes: 1 addition & 6 deletions src/test/java/io/roastedroot/proxywasm/NetworkTest.java
Original file line number Diff line number Diff line change
@@ -1,14 +1,9 @@
package io.roastedroot.proxywasm;

import static io.roastedroot.proxywasm.v1.Helpers.bytes;
import static io.roastedroot.proxywasm.Helpers.bytes;
import static org.junit.jupiter.api.Assertions.assertEquals;

import com.dylibso.chicory.wasm.Parser;
import io.roastedroot.proxywasm.v1.Action;
import io.roastedroot.proxywasm.v1.MetricType;
import io.roastedroot.proxywasm.v1.NetworkContext;
import io.roastedroot.proxywasm.v1.ProxyWasm;
import io.roastedroot.proxywasm.v1.StartException;
import java.nio.file.Path;
import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.BeforeEach;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@
import static org.junit.jupiter.api.Assertions.assertEquals;

import com.dylibso.chicory.wasm.Parser;
import io.roastedroot.proxywasm.v1.ProxyWasm;
import io.roastedroot.proxywasm.v1.StartException;
import java.nio.file.Path;
import java.util.List;
import java.util.Map;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,6 @@
import static org.junit.jupiter.api.Assertions.assertEquals;

import com.dylibso.chicory.wasm.Parser;
import io.roastedroot.proxywasm.v1.Action;
import io.roastedroot.proxywasm.v1.ProxyWasm;
import io.roastedroot.proxywasm.v1.StartException;
import java.nio.file.Path;
import org.junit.jupiter.api.Test;

Expand Down
5 changes: 1 addition & 4 deletions src/test/java/io/roastedroot/proxywasm/PropertiesTest.java
Original file line number Diff line number Diff line change
@@ -1,14 +1,11 @@
package io.roastedroot.proxywasm;

import static io.roastedroot.proxywasm.v1.Helpers.append;
import static io.roastedroot.proxywasm.Helpers.append;
import static org.junit.jupiter.api.Assertions.assertArrayEquals;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertNotNull;

import com.dylibso.chicory.wasm.Parser;
import io.roastedroot.proxywasm.v1.Action;
import io.roastedroot.proxywasm.v1.ProxyWasm;
import io.roastedroot.proxywasm.v1.StartException;
import java.nio.file.Path;
import java.util.Map;
import org.junit.jupiter.api.AfterEach;
Expand Down
Loading