package com.ccnet.acc.native

interface NativeCallback {
    enum class ErrorCode(val code: Int) {
        AuthFailed(1001),
        NetworkBindSocketFailed(1002),
        NetworkError(1003),
        UnknownError(1004),
        ;

        companion object {
            private val VALUES = values().associateBy { it.code }

            fun from(code: Int): ErrorCode {
                return VALUES[code] ?: UnknownError
            }
        }
    }

    fun onStart()

    fun onError(code: ErrorCode, error: String)

    fun onFatal(code: ErrorCode, error: String)
}