Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: add base implementation for native target #77

Merged
merged 11 commits into from
Oct 20, 2023
11 changes: 11 additions & 0 deletions aws-crt-kotlin/api/android/aws-crt-kotlin.api
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ public final class aws/sdk/kotlin/crt/LogDestination : java/lang/Enum {
public static final field None Laws/sdk/kotlin/crt/LogDestination;
public static final field Stderr Laws/sdk/kotlin/crt/LogDestination;
public static final field Stdout Laws/sdk/kotlin/crt/LogDestination;
public static fun getEntries ()Lkotlin/enums/EnumEntries;
public static fun valueOf (Ljava/lang/String;)Laws/sdk/kotlin/crt/LogDestination;
public static fun values ()[Laws/sdk/kotlin/crt/LogDestination;
}
Expand All @@ -54,6 +55,7 @@ public final class aws/sdk/kotlin/crt/LogLevel : java/lang/Enum {
public static final field None Laws/sdk/kotlin/crt/LogLevel;
public static final field Trace Laws/sdk/kotlin/crt/LogLevel;
public static final field Warn Laws/sdk/kotlin/crt/LogLevel;
public static fun getEntries ()Lkotlin/enums/EnumEntries;
public final fun getValue ()I
public static fun valueOf (Ljava/lang/String;)Laws/sdk/kotlin/crt/LogLevel;
public static fun values ()[Laws/sdk/kotlin/crt/LogLevel;
Expand Down Expand Up @@ -282,6 +284,7 @@ public final class aws/sdk/kotlin/crt/auth/signing/AwsSignatureType : java/lang/
public static final field HTTP_REQUEST_TRAILING_HEADERS Laws/sdk/kotlin/crt/auth/signing/AwsSignatureType;
public static final field HTTP_REQUEST_VIA_HEADERS Laws/sdk/kotlin/crt/auth/signing/AwsSignatureType;
public static final field HTTP_REQUEST_VIA_QUERY_PARAMS Laws/sdk/kotlin/crt/auth/signing/AwsSignatureType;
public static fun getEntries ()Lkotlin/enums/EnumEntries;
public final fun getValue ()I
public static fun valueOf (Ljava/lang/String;)Laws/sdk/kotlin/crt/auth/signing/AwsSignatureType;
public static fun values ()[Laws/sdk/kotlin/crt/auth/signing/AwsSignatureType;
Expand All @@ -290,6 +293,7 @@ public final class aws/sdk/kotlin/crt/auth/signing/AwsSignatureType : java/lang/
public final class aws/sdk/kotlin/crt/auth/signing/AwsSignedBodyHeaderType : java/lang/Enum {
public static final field NONE Laws/sdk/kotlin/crt/auth/signing/AwsSignedBodyHeaderType;
public static final field X_AMZ_CONTENT_SHA256 Laws/sdk/kotlin/crt/auth/signing/AwsSignedBodyHeaderType;
public static fun getEntries ()Lkotlin/enums/EnumEntries;
public final fun getValue ()I
public static fun valueOf (Ljava/lang/String;)Laws/sdk/kotlin/crt/auth/signing/AwsSignedBodyHeaderType;
public static fun values ()[Laws/sdk/kotlin/crt/auth/signing/AwsSignedBodyHeaderType;
Expand All @@ -314,6 +318,7 @@ public final class aws/sdk/kotlin/crt/auth/signing/AwsSigner {
public final class aws/sdk/kotlin/crt/auth/signing/AwsSigningAlgorithm : java/lang/Enum {
public static final field SIGV4 Laws/sdk/kotlin/crt/auth/signing/AwsSigningAlgorithm;
public static final field SIGV4_ASYMMETRIC Laws/sdk/kotlin/crt/auth/signing/AwsSigningAlgorithm;
public static fun getEntries ()Lkotlin/enums/EnumEntries;
public final fun getValue ()I
public static fun valueOf (Ljava/lang/String;)Laws/sdk/kotlin/crt/auth/signing/AwsSigningAlgorithm;
public static fun values ()[Laws/sdk/kotlin/crt/auth/signing/AwsSigningAlgorithm;
Expand Down Expand Up @@ -516,6 +521,7 @@ public final class aws/sdk/kotlin/crt/http/HttpHeaderBlock : java/lang/Enum {
public static final field MAIN Laws/sdk/kotlin/crt/http/HttpHeaderBlock;
public static final field TRAILING Laws/sdk/kotlin/crt/http/HttpHeaderBlock;
public final fun getBlockType ()I
public static fun getEntries ()Lkotlin/enums/EnumEntries;
public static fun valueOf (Ljava/lang/String;)Laws/sdk/kotlin/crt/http/HttpHeaderBlock;
public static fun values ()[Laws/sdk/kotlin/crt/http/HttpHeaderBlock;
}
Expand All @@ -538,6 +544,7 @@ public final class aws/sdk/kotlin/crt/http/HttpMonitoringOptions {
public final class aws/sdk/kotlin/crt/http/HttpProxyAuthorizationType : java/lang/Enum {
public static final field Basic Laws/sdk/kotlin/crt/http/HttpProxyAuthorizationType;
public static final field None Laws/sdk/kotlin/crt/http/HttpProxyAuthorizationType;
public static fun getEntries ()Lkotlin/enums/EnumEntries;
public final fun getValue ()I
public static fun valueOf (Ljava/lang/String;)Laws/sdk/kotlin/crt/http/HttpProxyAuthorizationType;
public static fun values ()[Laws/sdk/kotlin/crt/http/HttpProxyAuthorizationType;
Expand Down Expand Up @@ -718,6 +725,7 @@ public final class aws/sdk/kotlin/crt/io/SocketDomain : java/lang/Enum {
public static final field IPv4 Laws/sdk/kotlin/crt/io/SocketDomain;
public static final field IPv6 Laws/sdk/kotlin/crt/io/SocketDomain;
public static final field LOCAL Laws/sdk/kotlin/crt/io/SocketDomain;
public static fun getEntries ()Lkotlin/enums/EnumEntries;
public final fun getValue ()I
public static fun valueOf (Ljava/lang/String;)Laws/sdk/kotlin/crt/io/SocketDomain;
public static fun values ()[Laws/sdk/kotlin/crt/io/SocketDomain;
Expand Down Expand Up @@ -747,6 +755,7 @@ public final class aws/sdk/kotlin/crt/io/SocketOptions {
public final class aws/sdk/kotlin/crt/io/SocketType : java/lang/Enum {
public static final field DGRAM Laws/sdk/kotlin/crt/io/SocketType;
public static final field STREAM Laws/sdk/kotlin/crt/io/SocketType;
public static fun getEntries ()Lkotlin/enums/EnumEntries;
public final fun getValue ()I
public static fun valueOf (Ljava/lang/String;)Laws/sdk/kotlin/crt/io/SocketType;
public static fun values ()[Laws/sdk/kotlin/crt/io/SocketType;
Expand All @@ -760,6 +769,7 @@ public final class aws/sdk/kotlin/crt/io/TlsCipherPreference : java/lang/Enum {
public static final field KMS_PQ_TLS_V1_0_2020_07 Laws/sdk/kotlin/crt/io/TlsCipherPreference;
public static final field PQ_TLS_V1_0_2021_05 Laws/sdk/kotlin/crt/io/TlsCipherPreference;
public static final field SYSTEM_DEFAULT Laws/sdk/kotlin/crt/io/TlsCipherPreference;
public static fun getEntries ()Lkotlin/enums/EnumEntries;
public final fun getValue ()I
public final fun isSupported ()Z
public static fun valueOf (Ljava/lang/String;)Laws/sdk/kotlin/crt/io/TlsCipherPreference;
Expand Down Expand Up @@ -844,6 +854,7 @@ public final class aws/sdk/kotlin/crt/io/TlsVersion : java/lang/Enum {
public static final field TLS_V1_2 Laws/sdk/kotlin/crt/io/TlsVersion;
public static final field TLS_V1_3 Laws/sdk/kotlin/crt/io/TlsVersion;
public static final field TLSv1 Laws/sdk/kotlin/crt/io/TlsVersion;
public static fun getEntries ()Lkotlin/enums/EnumEntries;
public final fun getValue ()I
public static fun valueOf (Ljava/lang/String;)Laws/sdk/kotlin/crt/io/TlsVersion;
public static fun values ()[Laws/sdk/kotlin/crt/io/TlsVersion;
Expand Down
11 changes: 11 additions & 0 deletions aws-crt-kotlin/api/jvm/aws-crt-kotlin.api
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ public final class aws/sdk/kotlin/crt/LogDestination : java/lang/Enum {
public static final field None Laws/sdk/kotlin/crt/LogDestination;
public static final field Stderr Laws/sdk/kotlin/crt/LogDestination;
public static final field Stdout Laws/sdk/kotlin/crt/LogDestination;
public static fun getEntries ()Lkotlin/enums/EnumEntries;
public static fun valueOf (Ljava/lang/String;)Laws/sdk/kotlin/crt/LogDestination;
public static fun values ()[Laws/sdk/kotlin/crt/LogDestination;
}
Expand All @@ -54,6 +55,7 @@ public final class aws/sdk/kotlin/crt/LogLevel : java/lang/Enum {
public static final field None Laws/sdk/kotlin/crt/LogLevel;
public static final field Trace Laws/sdk/kotlin/crt/LogLevel;
public static final field Warn Laws/sdk/kotlin/crt/LogLevel;
public static fun getEntries ()Lkotlin/enums/EnumEntries;
public final fun getValue ()I
public static fun valueOf (Ljava/lang/String;)Laws/sdk/kotlin/crt/LogLevel;
public static fun values ()[Laws/sdk/kotlin/crt/LogLevel;
Expand Down Expand Up @@ -282,6 +284,7 @@ public final class aws/sdk/kotlin/crt/auth/signing/AwsSignatureType : java/lang/
public static final field HTTP_REQUEST_TRAILING_HEADERS Laws/sdk/kotlin/crt/auth/signing/AwsSignatureType;
public static final field HTTP_REQUEST_VIA_HEADERS Laws/sdk/kotlin/crt/auth/signing/AwsSignatureType;
public static final field HTTP_REQUEST_VIA_QUERY_PARAMS Laws/sdk/kotlin/crt/auth/signing/AwsSignatureType;
public static fun getEntries ()Lkotlin/enums/EnumEntries;
public final fun getValue ()I
public static fun valueOf (Ljava/lang/String;)Laws/sdk/kotlin/crt/auth/signing/AwsSignatureType;
public static fun values ()[Laws/sdk/kotlin/crt/auth/signing/AwsSignatureType;
Expand All @@ -290,6 +293,7 @@ public final class aws/sdk/kotlin/crt/auth/signing/AwsSignatureType : java/lang/
public final class aws/sdk/kotlin/crt/auth/signing/AwsSignedBodyHeaderType : java/lang/Enum {
public static final field NONE Laws/sdk/kotlin/crt/auth/signing/AwsSignedBodyHeaderType;
public static final field X_AMZ_CONTENT_SHA256 Laws/sdk/kotlin/crt/auth/signing/AwsSignedBodyHeaderType;
public static fun getEntries ()Lkotlin/enums/EnumEntries;
public final fun getValue ()I
public static fun valueOf (Ljava/lang/String;)Laws/sdk/kotlin/crt/auth/signing/AwsSignedBodyHeaderType;
public static fun values ()[Laws/sdk/kotlin/crt/auth/signing/AwsSignedBodyHeaderType;
Expand All @@ -314,6 +318,7 @@ public final class aws/sdk/kotlin/crt/auth/signing/AwsSigner {
public final class aws/sdk/kotlin/crt/auth/signing/AwsSigningAlgorithm : java/lang/Enum {
public static final field SIGV4 Laws/sdk/kotlin/crt/auth/signing/AwsSigningAlgorithm;
public static final field SIGV4_ASYMMETRIC Laws/sdk/kotlin/crt/auth/signing/AwsSigningAlgorithm;
public static fun getEntries ()Lkotlin/enums/EnumEntries;
public final fun getValue ()I
public static fun valueOf (Ljava/lang/String;)Laws/sdk/kotlin/crt/auth/signing/AwsSigningAlgorithm;
public static fun values ()[Laws/sdk/kotlin/crt/auth/signing/AwsSigningAlgorithm;
Expand Down Expand Up @@ -516,6 +521,7 @@ public final class aws/sdk/kotlin/crt/http/HttpHeaderBlock : java/lang/Enum {
public static final field MAIN Laws/sdk/kotlin/crt/http/HttpHeaderBlock;
public static final field TRAILING Laws/sdk/kotlin/crt/http/HttpHeaderBlock;
public final fun getBlockType ()I
public static fun getEntries ()Lkotlin/enums/EnumEntries;
public static fun valueOf (Ljava/lang/String;)Laws/sdk/kotlin/crt/http/HttpHeaderBlock;
public static fun values ()[Laws/sdk/kotlin/crt/http/HttpHeaderBlock;
}
Expand All @@ -538,6 +544,7 @@ public final class aws/sdk/kotlin/crt/http/HttpMonitoringOptions {
public final class aws/sdk/kotlin/crt/http/HttpProxyAuthorizationType : java/lang/Enum {
public static final field Basic Laws/sdk/kotlin/crt/http/HttpProxyAuthorizationType;
public static final field None Laws/sdk/kotlin/crt/http/HttpProxyAuthorizationType;
public static fun getEntries ()Lkotlin/enums/EnumEntries;
public final fun getValue ()I
public static fun valueOf (Ljava/lang/String;)Laws/sdk/kotlin/crt/http/HttpProxyAuthorizationType;
public static fun values ()[Laws/sdk/kotlin/crt/http/HttpProxyAuthorizationType;
Expand Down Expand Up @@ -718,6 +725,7 @@ public final class aws/sdk/kotlin/crt/io/SocketDomain : java/lang/Enum {
public static final field IPv4 Laws/sdk/kotlin/crt/io/SocketDomain;
public static final field IPv6 Laws/sdk/kotlin/crt/io/SocketDomain;
public static final field LOCAL Laws/sdk/kotlin/crt/io/SocketDomain;
public static fun getEntries ()Lkotlin/enums/EnumEntries;
public final fun getValue ()I
public static fun valueOf (Ljava/lang/String;)Laws/sdk/kotlin/crt/io/SocketDomain;
public static fun values ()[Laws/sdk/kotlin/crt/io/SocketDomain;
Expand Down Expand Up @@ -747,6 +755,7 @@ public final class aws/sdk/kotlin/crt/io/SocketOptions {
public final class aws/sdk/kotlin/crt/io/SocketType : java/lang/Enum {
public static final field DGRAM Laws/sdk/kotlin/crt/io/SocketType;
public static final field STREAM Laws/sdk/kotlin/crt/io/SocketType;
public static fun getEntries ()Lkotlin/enums/EnumEntries;
public final fun getValue ()I
public static fun valueOf (Ljava/lang/String;)Laws/sdk/kotlin/crt/io/SocketType;
public static fun values ()[Laws/sdk/kotlin/crt/io/SocketType;
Expand All @@ -760,6 +769,7 @@ public final class aws/sdk/kotlin/crt/io/TlsCipherPreference : java/lang/Enum {
public static final field KMS_PQ_TLS_V1_0_2020_07 Laws/sdk/kotlin/crt/io/TlsCipherPreference;
public static final field PQ_TLS_V1_0_2021_05 Laws/sdk/kotlin/crt/io/TlsCipherPreference;
public static final field SYSTEM_DEFAULT Laws/sdk/kotlin/crt/io/TlsCipherPreference;
public static fun getEntries ()Lkotlin/enums/EnumEntries;
public final fun getValue ()I
public final fun isSupported ()Z
public static fun valueOf (Ljava/lang/String;)Laws/sdk/kotlin/crt/io/TlsCipherPreference;
Expand Down Expand Up @@ -844,6 +854,7 @@ public final class aws/sdk/kotlin/crt/io/TlsVersion : java/lang/Enum {
public static final field TLS_V1_2 Laws/sdk/kotlin/crt/io/TlsVersion;
public static final field TLS_V1_3 Laws/sdk/kotlin/crt/io/TlsVersion;
public static final field TLSv1 Laws/sdk/kotlin/crt/io/TlsVersion;
public static fun getEntries ()Lkotlin/enums/EnumEntries;
public final fun getValue ()I
public static fun valueOf (Ljava/lang/String;)Laws/sdk/kotlin/crt/io/TlsVersion;
public static fun values ()[Laws/sdk/kotlin/crt/io/TlsVersion;
Expand Down
44 changes: 44 additions & 0 deletions aws-crt-kotlin/native/src/aws/sdk/kotlin/crt/CRTNative.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
package aws.sdk.kotlin.crt

public actual object CRT {
/**
* Initialize the CRT libraries if needed
*/
public actual fun initRuntime(block: Config.() -> Unit) { }

/**
* Returns the last error on the current thread.
* @return Last error code recorded in this thread
*/
public actual fun lastError(): Int {
TODO("Not yet implemented")
}

/**
* Given an integer error code from an internal operation
* @param errorCode An error code returned from an exception or other native function call
* @return A user-friendly description of the error
*/
public actual fun errorString(errorCode: Int): String? {
TODO("Not yet implemented")
}

/**
* Given an integer error code from an internal operation
*
* @param errorCode An error code returned from an exception or other native
* function call
* @return A string identifier for the error
*/
public actual fun errorName(errorCode: Int): String? {
TODO("Not yet implemented")
}

/**
* @return The number of bytes allocated in native resources. If aws.crt.memory.tracing is 1 or 2, this will
* be a non-zero value. Otherwise, no tracing will be done, and the value will always be 0
*/
public actual fun nativeMemory(): Long {
TODO("Not yet implemented")
}
}
21 changes: 21 additions & 0 deletions aws-crt-kotlin/native/src/aws/sdk/kotlin/crt/PlatformNative.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
/*
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0
*/
package aws.sdk.kotlin.crt

internal actual object Platform {
/**
* Get an environment variable by name
*/
internal actual fun getenv(name: String): String? {
TODO("Not yet implemented")
}

/**
* Get the current time in epoch milliseconds
*/
internal actual fun epochMilliNow(): Long {
TODO("Not yet implemented")
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
/*
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0
*/

package aws.sdk.kotlin.crt.auth.credentials


public actual class CachedCredentialsProvider internal actual constructor(builder: CachedCredentialsProviderBuilder) :
CredentialsProvider {
public actual companion object {}

override suspend fun getCredentials(): Credentials {
TODO("Not yet implemented")
}

override fun close() {
TODO("Not yet implemented")
}

override suspend fun waitForShutdown() {
TODO("Not yet implemented")
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
/*
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0
*/

package aws.sdk.kotlin.crt.auth.credentials

public actual class DefaultChainCredentialsProvider internal actual constructor(builder: DefaultChainCredentialsProviderBuilder) :
CredentialsProvider {
public actual companion object {}

override suspend fun getCredentials(): Credentials {
TODO("Not yet implemented")
}

override fun close() {
TODO("Not yet implemented")
}

override suspend fun waitForShutdown() {
TODO("Not yet implemented")
}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
/*
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0
*/

package aws.sdk.kotlin.crt.auth.credentials

public actual class EcsCredentialsProvider
internal actual constructor(builder: EcsCredentialsProviderBuilder) :
CredentialsProvider {
public actual companion object {}

override suspend fun getCredentials(): Credentials {
TODO("Not yet implemented")
}

override fun close() {
TODO("Not yet implemented")
}

override suspend fun waitForShutdown() {
TODO("Not yet implemented")
}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
/*
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0
*/

package aws.sdk.kotlin.crt.auth.credentials

public actual class ProfileCredentialsProvider
internal actual constructor(builder: ProfileCredentialsProviderBuilder) :
CredentialsProvider {
public actual companion object {}

override suspend fun getCredentials(): Credentials {
TODO("Not yet implemented")
}

override fun close() {
TODO("Not yet implemented")
}

override suspend fun waitForShutdown() {
TODO("Not yet implemented")
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
/*
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0
*/

package aws.sdk.kotlin.crt.auth.credentials

/**
* A credentials provider for a fixed set of credentials
*/
public actual class StaticCredentialsProvider internal actual constructor(builder: StaticCredentialsProviderBuilder) :
CredentialsProvider {
public actual companion object {}

override suspend fun getCredentials(): Credentials {
TODO("Not yet implemented")
}

override fun close() {
TODO("Not yet implemented")
}

override suspend fun waitForShutdown() {
TODO("Not yet implemented")
}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
/*
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0
*/

package aws.sdk.kotlin.crt.auth.credentials

public actual class StsAssumeRoleCredentialsProvider
internal actual constructor(builder: StsAssumeRoleCredentialsProviderBuilder) :
CredentialsProvider {
public actual companion object {}

override suspend fun getCredentials(): Credentials {
TODO("Not yet implemented")
}

override fun close() {
TODO("Not yet implemented")
}

override suspend fun waitForShutdown() {
TODO("Not yet implemented")
}
}
Loading
Loading