From 2e2462fd381da58929c9c88e5c2e95fc469fb040 Mon Sep 17 00:00:00 2001 From: Guilherme Werner Date: Wed, 6 Mar 2024 19:01:54 -0300 Subject: [PATCH] Update main branch (#3) * New api from upstream * Create .clang-format * Update .clang-format * Remove mintaka submodule * Add premake-core submodule * Update premake-core * Fix includes --- .clang-format | 221 +++++++++++++++++++++++++++++++ .gitmodules | 6 +- Cargo.toml | 1 - examples/main.cpp | 15 --- include/tribufu.h | 1 + include/tribufu/api.h | 27 ++++ include/tribufu/client.h | 18 +-- include/tribufu/json.h | 11 ++ include/tribufu/oauth2.h | 14 +- include/tribufu/options.h | 24 ++++ include/tribufu/platform.h | 21 +++ include/tribufu/prelude.h | 9 +- include/tribufu/server.h | 20 +++ include/tribufu/servers/server.h | 1 + include/tribufu/std.h | 24 ++++ include/tribufu/users/profile.h | 1 + scripts/premake.bat | 2 +- scripts/premake.sh | 4 +- src/api.cpp | 51 +++++++ src/client.cpp | 14 +- src/oauth2.cpp | 16 ++- src/options.cpp | 32 +++++ src/server.cpp | 21 +++ vendor/Mintaka | 1 - vendor/premake-core | 1 + 25 files changed, 501 insertions(+), 55 deletions(-) create mode 100644 .clang-format create mode 100644 include/tribufu/api.h create mode 100644 include/tribufu/json.h create mode 100644 include/tribufu/options.h create mode 100644 include/tribufu/platform.h create mode 100644 include/tribufu/server.h create mode 100644 include/tribufu/std.h create mode 100644 src/api.cpp create mode 100644 src/options.cpp create mode 100644 src/server.cpp delete mode 160000 vendor/Mintaka create mode 160000 vendor/premake-core diff --git a/.clang-format b/.clang-format new file mode 100644 index 00000000..1532f320 --- /dev/null +++ b/.clang-format @@ -0,0 +1,221 @@ +--- +Language: Cpp +AccessModifierOffset: -4 +AlignAfterOpenBracket: Align +AlignArrayOfStructures: None +AlignConsecutiveAssignments: + Enabled: false + AcrossEmptyLines: false + AcrossComments: false + AlignCompound: false + PadOperators: true +AlignConsecutiveBitFields: + Enabled: false + AcrossEmptyLines: false + AcrossComments: false + AlignCompound: false + PadOperators: false +AlignConsecutiveDeclarations: + Enabled: false + AcrossEmptyLines: false + AcrossComments: false + AlignCompound: false + PadOperators: false +AlignConsecutiveMacros: + Enabled: false + AcrossEmptyLines: false + AcrossComments: false + AlignCompound: false + PadOperators: false +AlignEscapedNewlines: Right +AlignOperands: Align +AlignTrailingComments: + Kind: Always + OverEmptyLines: 0 +AllowAllArgumentsOnNextLine: true +AllowAllParametersOfDeclarationOnNextLine: true +AllowShortBlocksOnASingleLine: Never +AllowShortCaseLabelsOnASingleLine: false +AllowShortEnumsOnASingleLine: false +AllowShortFunctionsOnASingleLine: None +AllowShortIfStatementsOnASingleLine: Never +AllowShortLambdasOnASingleLine: All +AllowShortLoopsOnASingleLine: false +AlwaysBreakAfterDefinitionReturnType: None +AlwaysBreakAfterReturnType: None +AlwaysBreakBeforeMultilineStrings: false +AlwaysBreakTemplateDeclarations: MultiLine +AttributeMacros: + - __capability +BinPackArguments: true +BinPackParameters: true +BitFieldColonSpacing: Both +BraceWrapping: + AfterCaseLabel: false + AfterClass: true + AfterControlStatement: Always + AfterEnum: true + AfterExternBlock: true + AfterFunction: true + AfterNamespace: true + AfterObjCDeclaration: true + AfterStruct: true + AfterUnion: false + BeforeCatch: true + BeforeElse: true + BeforeLambdaBody: false + BeforeWhile: false + IndentBraces: false + SplitEmptyFunction: true + SplitEmptyRecord: true + SplitEmptyNamespace: true +BreakAfterAttributes: Never +BreakAfterJavaFieldAnnotations: false +BreakArrays: true +BreakBeforeBinaryOperators: None +BreakBeforeConceptDeclarations: Always +BreakBeforeBraces: Custom +BreakBeforeInlineASMColon: OnlyMultiline +BreakBeforeTernaryOperators: true +BreakConstructorInitializers: BeforeColon +BreakInheritanceList: BeforeColon +BreakStringLiterals: true +ColumnLimit: 120 +CommentPragmas: "^ IWYU pragma:" +CompactNamespaces: false +ConstructorInitializerIndentWidth: 4 +ContinuationIndentWidth: 4 +Cpp11BracedListStyle: true +DerivePointerAlignment: false +DisableFormat: false +EmptyLineAfterAccessModifier: Never +EmptyLineBeforeAccessModifier: LogicalBlock +ExperimentalAutoDetectBinPacking: false +FixNamespaceComments: false +ForEachMacros: + - foreach + - Q_FOREACH + - BOOST_FOREACH +IfMacros: + - KJ_IF_MAYBE +IncludeBlocks: Preserve +IncludeCategories: + - Regex: '^"(llvm|llvm-c|clang|clang-c)/' + Priority: 2 + SortPriority: 0 + CaseSensitive: false + - Regex: '^(<|"(gtest|gmock|isl|json)/)' + Priority: 3 + SortPriority: 0 + CaseSensitive: false + - Regex: ".*" + Priority: 1 + SortPriority: 0 + CaseSensitive: false +IncludeIsMainRegex: "(Test)?$" +IncludeIsMainSourceRegex: "" +IndentAccessModifiers: false +IndentCaseBlocks: false +IndentCaseLabels: false +IndentExternBlock: AfterExternBlock +IndentGotoLabels: true +IndentPPDirectives: None +IndentRequiresClause: true +IndentWidth: 4 +IndentWrappedFunctionNames: false +InsertBraces: false +InsertNewlineAtEOF: false +InsertTrailingCommas: None +IntegerLiteralSeparator: + Binary: 0 + Decimal: 0 + Hex: 0 +JavaScriptQuotes: Leave +JavaScriptWrapImports: true +KeepEmptyLinesAtTheStartOfBlocks: true +LambdaBodyIndentation: Signature +LineEnding: DeriveLF +MacroBlockBegin: "" +MacroBlockEnd: "" +MaxEmptyLinesToKeep: 1 +NamespaceIndentation: All +ObjCBinPackProtocolList: Auto +ObjCBlockIndentWidth: 2 +ObjCBreakBeforeNestedBlockParam: true +ObjCSpaceAfterProperty: false +ObjCSpaceBeforeProtocolList: true +PackConstructorInitializers: BinPack +PenaltyBreakAssignment: 2 +PenaltyBreakBeforeFirstCallParameter: 19 +PenaltyBreakComment: 300 +PenaltyBreakFirstLessLess: 120 +PenaltyBreakOpenParenthesis: 0 +PenaltyBreakString: 1000 +PenaltyBreakTemplateDeclaration: 10 +PenaltyExcessCharacter: 1000000 +PenaltyIndentedWhitespace: 0 +PenaltyReturnTypeOnItsOwnLine: 1000 +PointerAlignment: Right +PPIndentWidth: -1 +QualifierAlignment: Leave +ReferenceAlignment: Pointer +ReflowComments: true +RemoveBracesLLVM: false +RemoveSemicolon: false +RequiresClausePosition: OwnLine +RequiresExpressionIndentation: OuterScope +SeparateDefinitionBlocks: Leave +ShortNamespaceLines: 1 +SortIncludes: CaseSensitive +SortJavaStaticImport: Before +SortUsingDeclarations: LexicographicNumeric +SpaceAfterCStyleCast: false +SpaceAfterLogicalNot: false +SpaceAfterTemplateKeyword: true +SpaceAroundPointerQualifiers: Default +SpaceBeforeAssignmentOperators: true +SpaceBeforeCaseColon: false +SpaceBeforeCpp11BracedList: false +SpaceBeforeCtorInitializerColon: true +SpaceBeforeInheritanceColon: true +SpaceBeforeParens: ControlStatements +SpaceBeforeParensOptions: + AfterControlStatements: true + AfterForeachMacros: true + AfterFunctionDefinitionName: false + AfterFunctionDeclarationName: false + AfterIfMacros: true + AfterOverloadedOperator: false + AfterRequiresInClause: false + AfterRequiresInExpression: false + BeforeNonEmptyParentheses: false +SpaceBeforeRangeBasedForLoopColon: true +SpaceBeforeSquareBrackets: false +SpaceInEmptyBlock: false +SpaceInEmptyParentheses: false +SpacesBeforeTrailingComments: 1 +SpacesInAngles: Never +SpacesInConditionalStatement: false +SpacesInContainerLiterals: true +SpacesInCStyleCastParentheses: false +SpacesInLineCommentPrefix: + Minimum: 1 + Maximum: -1 +SpacesInParentheses: false +SpacesInSquareBrackets: false +Standard: Latest +StatementAttributeLikeMacros: + - Q_EMIT +StatementMacros: + - Q_UNUSED + - QT_REQUIRE_VERSION +TabWidth: 4 +UseTab: Never +WhitespaceSensitiveMacros: + - BOOST_PP_STRINGIZE + - CF_SWIFT_NAME + - NS_SWIFT_NAME + - PP_STRINGIZE + - STRINGIZE +--- + diff --git a/.gitmodules b/.gitmodules index 644d939f..1203a5a5 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,3 +1,3 @@ -[submodule "vendor/Mintaka"] - path = vendor/Mintaka - url = https://github.com/Tribufu/Mintaka +[submodule "vendor/premake-core"] + path = vendor/premake-core + url = https://github.com/TribufuForks/premake-core diff --git a/Cargo.toml b/Cargo.toml index a9d6fdb0..28a2c53e 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -14,4 +14,3 @@ crate-type = ["staticlib"] path = "src/lib.rs" [dependencies] -mintaka-native = { path = "./vendor/Mintaka/src/native" } diff --git a/examples/main.cpp b/examples/main.cpp index ac4926c3..0e72dd53 100644 --- a/examples/main.cpp +++ b/examples/main.cpp @@ -1,26 +1,11 @@ // Copyright (c) Tribufu. All Rights Reserved. #include - #include using namespace tribufu; int main(int argc, char **argv) { - auto client = new TribufuClient(0, "client_secret"); - std::cout << "client_id: " << client->get_id() << std::endl; - - json json_obj = { - {"nome", "John"}, - {"idade", 25}, - {"cidade", "Exemplo"}}; - - std::string json_str = json_obj.dump(4); - - std::cout << json_str << std::endl; - - client->get_token(); - return 0; } diff --git a/include/tribufu.h b/include/tribufu.h index 6e09a83e..70288c3a 100644 --- a/include/tribufu.h +++ b/include/tribufu.h @@ -3,3 +3,4 @@ #pragma once #include +#include diff --git a/include/tribufu/api.h b/include/tribufu/api.h new file mode 100644 index 00000000..e85e8560 --- /dev/null +++ b/include/tribufu/api.h @@ -0,0 +1,27 @@ +// Copyright (c) Tribufu. All Rights Reserved. + +#pragma once + +#include +#include + +namespace tribufu +{ + static const char *VERSION = "0.0.4"; + static const char *API_URL = "https://api.tribufu.com"; + + class TRIBUFU_API TribufuApi + { + private: + std::string base_url; + TribufuApiOptions options; + + public: + TribufuApi(); + TribufuApi(std::string api_key); + TribufuApi(TribufuApiOptions options); + ~TribufuApi(); + static TribufuApi from_env(); + static TribufuApi from_env(std::string prefix); + }; +} diff --git a/include/tribufu/client.h b/include/tribufu/client.h index 16bac735..3d773971 100644 --- a/include/tribufu/client.h +++ b/include/tribufu/client.h @@ -2,28 +2,20 @@ #pragma once +#include #include -const char *VERSION = "0.0.4"; - namespace tribufu { - class TRIBUFU_API TribufuClient + class TRIBUFU_API TribufuClient : public TribufuApi { private: - uint64_t id; - std::string secret; - HttpClient http; + uint64_t client_id; + std::string client_secret; public: TribufuClient(uint64_t id, const std::string &secret); ~TribufuClient(); - - uint64_t get_id() const - { - return this->id; - } - - void get_token(); + uint64_t &get_client_id(); }; } diff --git a/include/tribufu/json.h b/include/tribufu/json.h new file mode 100644 index 00000000..add3e3bb --- /dev/null +++ b/include/tribufu/json.h @@ -0,0 +1,11 @@ +// Copyright (c) Tribufu. All Rights Reserved. + +#pragma once + +#include +#include + +#ifdef TRIBUFU_CPP +#include +using json = nlohmann::json; +#endif diff --git a/include/tribufu/oauth2.h b/include/tribufu/oauth2.h index bc4510cd..a13003c7 100644 --- a/include/tribufu/oauth2.h +++ b/include/tribufu/oauth2.h @@ -61,7 +61,8 @@ namespace tribufu public: OAuth2AuthorizeRequest(); - OAuth2AuthorizeRequest(OAuth2ResponseType response_type, uint64_t client_id, const std::string &client_secret, const std::string &redirect_uri, const std::string &scope, const std::string &state); + OAuth2AuthorizeRequest(OAuth2ResponseType response_type, uint64_t client_id, const std::string &client_secret, + const std::string &redirect_uri, const std::string &scope, const std::string &state); ~OAuth2AuthorizeRequest(); }; @@ -87,7 +88,8 @@ namespace tribufu public: OAuth2ErrorResponse(); - OAuth2ErrorResponse(OAuth2AuthorizeError error, const std::string &error_description, const std::string &error_uri, const std::string &state); + OAuth2ErrorResponse(OAuth2AuthorizeError error, const std::string &error_description, + const std::string &error_uri, const std::string &state); ~OAuth2ErrorResponse(); }; @@ -105,7 +107,9 @@ namespace tribufu public: OAuth2TokenRequest(); - OAuth2TokenRequest(OAuth2GrantType grant_type, uint64_t client_id, const std::string &client_secret, const std::string &redirect_uri, const std::string &code, const std::string &refresh_token, const std::string &username, const std::string &password); + OAuth2TokenRequest(OAuth2GrantType grant_type, uint64_t client_id, const std::string &client_secret, + const std::string &redirect_uri, const std::string &code, const std::string &refresh_token, + const std::string &username, const std::string &password); ~OAuth2TokenRequest(); }; @@ -121,7 +125,9 @@ namespace tribufu public: OAuth2TokenResponse(); - OAuth2TokenResponse(OAuth2TokenType token_type, const std::string &access_token, const std::string &refresh_token, const std::string &scope, const std::string &state, uint64_t expires_in); + OAuth2TokenResponse(OAuth2TokenType token_type, const std::string &access_token, + const std::string &refresh_token, const std::string &scope, const std::string &state, + uint64_t expires_in); ~OAuth2TokenResponse(); }; } diff --git a/include/tribufu/options.h b/include/tribufu/options.h new file mode 100644 index 00000000..6ab72f63 --- /dev/null +++ b/include/tribufu/options.h @@ -0,0 +1,24 @@ +// Copyright (c) Tribufu. All Rights Reserved. + +#pragma once + +#include + +namespace tribufu +{ + class TRIBUFU_API TribufuApiOptions + { + public: + std::string api_key; + std::string access_token; + std::string refresh_token; + float expires_in; + + public: + TribufuApiOptions(); + TribufuApiOptions(std::string api_key); + TribufuApiOptions(std::string access_token, std::string refresh_token, float expires_in); + TribufuApiOptions(std::string api_key, std::string access_token, std::string refresh_token, float expires_in); + ~TribufuApiOptions(); + }; +} diff --git a/include/tribufu/platform.h b/include/tribufu/platform.h new file mode 100644 index 00000000..7aeeccce --- /dev/null +++ b/include/tribufu/platform.h @@ -0,0 +1,21 @@ +// Copyright (c) Tribufu. All Rights Reserved. + +#pragma once + +#ifdef _WIN32 +#ifndef DLLEXPORT +#define DLLEXPORT __declspec(dllexport) +#endif +#ifndef DLLIMPORT +#define DLLIMPORT __declspec(dllimport) +#endif +#endif + +#ifdef __MACH__ || __APPLE__ || __linux__ || __FreeBSD__ || __ANDROID__ +#ifndef DLLEXPORT +#define DLLEXPORT __attribute__((visibility("default"))) +#endif +#ifndef DLLIMPORT +#define DLLIMPORT __attribute__((visibility("default"))) +#endif +#endif diff --git a/include/tribufu/prelude.h b/include/tribufu/prelude.h index f0e5634e..2dcc44b4 100644 --- a/include/tribufu/prelude.h +++ b/include/tribufu/prelude.h @@ -2,12 +2,7 @@ #pragma once -#include #include #include - -#ifdef TRIBUFU_CPP - -using namespace mintaka; - -#endif +#include +#include diff --git a/include/tribufu/server.h b/include/tribufu/server.h new file mode 100644 index 00000000..d67e0cbd --- /dev/null +++ b/include/tribufu/server.h @@ -0,0 +1,20 @@ +// Copyright (c) Tribufu. All Rights Reserved. + +#pragma once + +#include +#include + +namespace tribufu +{ + class TRIBUFU_API TribufuServer : public TribufuClient + { + private: + uint64_t server_id; + + public: + TribufuServer(uint64_t server_id, uint64_t client_id, const std::string &client_secret); + ~TribufuServer(); + uint64_t &get_server_id(); + }; +} diff --git a/include/tribufu/servers/server.h b/include/tribufu/servers/server.h index f057f148..d44d3ae7 100644 --- a/include/tribufu/servers/server.h +++ b/include/tribufu/servers/server.h @@ -3,6 +3,7 @@ #pragma once #include +#include namespace tribufu { diff --git a/include/tribufu/std.h b/include/tribufu/std.h new file mode 100644 index 00000000..12fda2d6 --- /dev/null +++ b/include/tribufu/std.h @@ -0,0 +1,24 @@ +// Copyright (c) Tribufu. All Rights Reserved. + +#pragma once + +#include +#include +#include +#include +#include + +#ifdef TRIBUFU_CPP +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#endif diff --git a/include/tribufu/users/profile.h b/include/tribufu/users/profile.h index 4e150ef9..948e939f 100644 --- a/include/tribufu/users/profile.h +++ b/include/tribufu/users/profile.h @@ -3,6 +3,7 @@ #pragma once #include +#include namespace tribufu { diff --git a/scripts/premake.bat b/scripts/premake.bat index 0a16272f..5488708a 100644 --- a/scripts/premake.bat +++ b/scripts/premake.bat @@ -1,3 +1,3 @@ @echo off -call .\vendor\Mintaka\vendor\premake-core\windows\premake5.exe vs2022 +call .\vendor\premake-core\windows\premake5.exe vs2022 diff --git a/scripts/premake.sh b/scripts/premake.sh index f1e09cba..3fb5e5e4 100644 --- a/scripts/premake.sh +++ b/scripts/premake.sh @@ -2,9 +2,9 @@ if [ "$(expr substr $(uname -s) 1 5)" = "Linux" ] then - ./vendor/Mintaka/vendor/premake-core/linux/premake5 gmake2 + ./vendor/premake-core/linux/premake5 gmake2 elif [ "$(uname)" = "Darwin" ] then - ./vendor/Mintaka/vendor/premake-core/mac/premake5 xcode4 + ./vendor/premake-core/mac/premake5 xcode4 fi diff --git a/src/api.cpp b/src/api.cpp new file mode 100644 index 00000000..8aa3c226 --- /dev/null +++ b/src/api.cpp @@ -0,0 +1,51 @@ +// Copyright (c) Tribufu. All Rights Reserved. + +#include + +namespace tribufu +{ + TribufuApi::TribufuApi() + { + } + + TribufuApi::TribufuApi(std::string api_key) + { + this->options.api_key = api_key; + } + + TribufuApi::TribufuApi(TribufuApiOptions options) + { + this->options = options; + } + + TribufuApi::~TribufuApi() + { + } + + TribufuApi TribufuApi::from_env() + { + return TribufuApi::from_env(""); + } + + TribufuApi TribufuApi::from_env(std::string prefix) + { + std::string env_prefix = ""; + + if (prefix != "") + { + env_prefix = prefix + "_"; + } + + size_t required_size; + char api_key[64]; + + auto response = getenv_s(&required_size, api_key, sizeof(api_key), (env_prefix + "API_KEY").c_str()); + + if (response == 0 && required_size > 0) + { + return TribufuApi(api_key); + } + + return TribufuApi(); + } +} diff --git a/src/client.cpp b/src/client.cpp index 8c7b7255..87eb2304 100644 --- a/src/client.cpp +++ b/src/client.cpp @@ -4,17 +4,22 @@ namespace tribufu { - TribufuClient::TribufuClient(uint64_t id, const std::string &secret) + TribufuClient::TribufuClient(uint64_t client_id, const std::string &client_secret) : TribufuApi() { - this->id = id; - this->secret = secret; - this->http = HttpClient(); + this->client_id = client_id; + this->client_secret = client_secret; } TribufuClient::~TribufuClient() { } + uint64_t &TribufuClient::get_client_id() + { + return this->client_id; + } + + /* void TribufuClient::get_token() { try @@ -37,4 +42,5 @@ namespace tribufu std::cout << "exception: " << e.what() << std::endl; } } + */ } diff --git a/src/oauth2.cpp b/src/oauth2.cpp index 7bd0ed58..d40ca2c2 100644 --- a/src/oauth2.cpp +++ b/src/oauth2.cpp @@ -8,7 +8,9 @@ namespace tribufu { } - OAuth2AuthorizeRequest::OAuth2AuthorizeRequest(OAuth2ResponseType response_type, uint64_t client_id, const std::string &client_secret, const std::string &redirect_uri, const std::string &scope, const std::string &state) + OAuth2AuthorizeRequest::OAuth2AuthorizeRequest(OAuth2ResponseType response_type, uint64_t client_id, + const std::string &client_secret, const std::string &redirect_uri, + const std::string &scope, const std::string &state) { this->response_type = response_type; this->client_id = client_id; @@ -40,7 +42,8 @@ namespace tribufu { } - OAuth2ErrorResponse::OAuth2ErrorResponse(OAuth2AuthorizeError error, const std::string &error_description, const std::string &error_uri, const std::string &state) + OAuth2ErrorResponse::OAuth2ErrorResponse(OAuth2AuthorizeError error, const std::string &error_description, + const std::string &error_uri, const std::string &state) { this->error = error; this->error_description = error_description; @@ -56,7 +59,10 @@ namespace tribufu { } - OAuth2TokenRequest::OAuth2TokenRequest(OAuth2GrantType grant_type, uint64_t client_id, const std::string &client_secret, const std::string &redirect_uri, const std::string &code, const std::string &refresh_token, const std::string &username, const std::string &password) + OAuth2TokenRequest::OAuth2TokenRequest(OAuth2GrantType grant_type, uint64_t client_id, + const std::string &client_secret, const std::string &redirect_uri, + const std::string &code, const std::string &refresh_token, + const std::string &username, const std::string &password) { this->grant_type = grant_type; this->client_id = client_id; @@ -76,7 +82,9 @@ namespace tribufu { } - OAuth2TokenResponse::OAuth2TokenResponse(OAuth2TokenType token_type, const std::string &access_token, const std::string &refresh_token, const std::string &scope, const std::string &state, uint64_t expires_in) + OAuth2TokenResponse::OAuth2TokenResponse(OAuth2TokenType token_type, const std::string &access_token, + const std::string &refresh_token, const std::string &scope, + const std::string &state, uint64_t expires_in) { this->token_type = token_type; this->access_token = access_token; diff --git a/src/options.cpp b/src/options.cpp new file mode 100644 index 00000000..0b9e847d --- /dev/null +++ b/src/options.cpp @@ -0,0 +1,32 @@ +// Copyright (c) Tribufu. All Rights Reserved. + +#include + +namespace tribufu +{ + TribufuApiOptions::TribufuApiOptions() : TribufuApiOptions(nullptr, nullptr, nullptr, 0.0f) + { + } + + TribufuApiOptions::TribufuApiOptions(std::string api_key) : TribufuApiOptions(api_key, nullptr, nullptr, 0.0f) + { + } + + TribufuApiOptions::TribufuApiOptions(std::string access_token, std::string refresh_token, float expires_in) + : TribufuApiOptions(nullptr, access_token, refresh_token, expires_in) + { + } + + TribufuApiOptions::TribufuApiOptions(std::string api_key, std::string access_token, std::string refresh_token, + float expires_in) + { + this->api_key = api_key; + this->access_token = access_token; + this->refresh_token = refresh_token; + this->expires_in = expires_in; + } + + TribufuApiOptions::~TribufuApiOptions() + { + } +} diff --git a/src/server.cpp b/src/server.cpp new file mode 100644 index 00000000..9fb3e9a5 --- /dev/null +++ b/src/server.cpp @@ -0,0 +1,21 @@ +// Copyright (c) Tribufu. All Rights Reserved. + +#include + +namespace tribufu +{ + TribufuServer::TribufuServer(uint64_t server_id, uint64_t client_id, const std::string &client_secret) + : TribufuClient(client_id, client_secret) + { + this->server_id = server_id; + } + + TribufuServer::~TribufuServer() + { + } + + uint64_t &TribufuServer::get_server_id() + { + return this->server_id; + } +} diff --git a/vendor/Mintaka b/vendor/Mintaka deleted file mode 160000 index 6733b056..00000000 --- a/vendor/Mintaka +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 6733b056f633d02af586d881776e82363cdc9ca7 diff --git a/vendor/premake-core b/vendor/premake-core new file mode 160000 index 00000000..4bd56019 --- /dev/null +++ b/vendor/premake-core @@ -0,0 +1 @@ +Subproject commit 4bd56019c4a0f93009b73614f778e3f9e5fad373