Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
2d31ac0
[ch66649] initial copy from moonshot (and minor template fill in)
hroederld Feb 20, 2020
b41bd5a
[ch66755] Add variationDetail variation handlers (#2)
hroederld Feb 28, 2020
4a001eb
[ch68367] prefix functions with local
hroederld Mar 9, 2020
c66ed75
[ch68610] Basic generated doc (#4)
hroederld Mar 10, 2020
e69359c
[ch70062] rename to launchdarkly-server-sdk.lua
hroederld Mar 19, 2020
24b9487
[ch70700] prepare 1.0.0-beta.1
hroederld Mar 24, 2020
6ed903a
Update CONTRIBUTING.md (#8)
bwoskow-ld Mar 24, 2020
17a35ef
Update README.md (#7)
bwoskow-ld Mar 24, 2020
f2bb53c
Merge github.com:launchdarkly/lua-server-sdk
hroederld Mar 25, 2020
791dd2e
remove circle badge (#9)
hroederld Mar 25, 2020
0e9db0d
Merge github.com:launchdarkly/lua-server-sdk
hroederld Mar 25, 2020
b1f585c
[ch70699] releaser support (#11)
hroederld Apr 1, 2020
3ab1ee2
[ch73979] document version constraints (#12)
hroederld Apr 17, 2020
f2ed7f1
[ch76282] add wrapper meta config (#13)
hroederld May 12, 2020
57517c1
prepare 1.0.0-beta.2 (content approved in previous failed release PR)
hroederld May 12, 2020
153dd3f
Merge github.com:launchdarkly/lua-server-sdk
hroederld May 12, 2020
bf8fd31
[ch80640] logging handler (#14)
hroederld Jun 23, 2020
77e52a1
[ch80816] basic unit tests (#15)
hroederld Jun 23, 2020
89806d4
[ch80958] remove beta warning
hroederld Jun 24, 2020
6b6a4c5
fix timeout (#17)
hroederld Jun 25, 2020
39da875
[ch70870] redis module (#18)
hroederld Jul 7, 2020
cbc133f
[ch70870] ldoc releaser redis (#19)
hroederld Jul 9, 2020
ad96c4e
[ch82399] document c server-side sdk version requirement (#20)
hroederld Jul 9, 2020
5eb0fdc
[ch82565] collect between tests (#21)
hroederld Jul 10, 2020
c5ab6f2
[ch82639] rewrite for lua 5.1 5.2 5.3 (#22)
hroederld Jul 20, 2020
8a76638
[ch83425] prepare beta 3 (#23)
hroederld Jul 20, 2020
d5ac988
merge public
hroederld Jul 20, 2020
368253a
remove beta warning (#24)
hroederld Jul 27, 2020
fd7e7e3
set source in rockspec (#25)
hroederld Jul 27, 2020
7d20fcc
merge from public after release
LaunchDarklyCI Jul 27, 2020
772a103
[ch87476] Always use custom `luaL_setfuncs` (#26)
hroederld Aug 28, 2020
9b8af72
merge from public after release
LaunchDarklyCI Aug 28, 2020
d248b20
adding circleci badge and issue/PR templates (#27)
bwoskow-ld Nov 20, 2020
6243cfb
[ch99754] add alias method (#28)
hroederld Feb 3, 2021
4b43131
Removed the guides link
bwoskow-ld Feb 3, 2021
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
37 changes: 37 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
---
name: Bug report
about: Create a report to help us improve
title: ''
labels: ''
assignees: ''

---

**Is this a support request?**
This issue tracker is maintained by LaunchDarkly SDK developers and is intended for feedback on the SDK code. If you're not sure whether the problem you are having is specifically related to the SDK, or to the LaunchDarkly service overall, it may be more appropriate to contact the LaunchDarkly support team; they can help to investigate the problem and will consult the SDK team if necessary. You can submit a support request by going [here](https://support.launchdarkly.com/) and clicking "submit a request", or by emailing support@launchdarkly.com.

Note that issues filed on this issue tracker are publicly accessible. Do not provide any private account information on your issues. If your problem is specific to your account, you should submit a support request as described above.

**Describe the bug**
A clear and concise description of what the bug is.

**To reproduce**
Steps to reproduce the behavior.

**Expected behavior**
A clear and concise description of what you expected to happen.

**Logs**
If applicable, add any log output related to your problem.

**SDK version**
The version of this SDK that you are using.

**Language version, developer tools**
For instance, Go 1.11 or Ruby 2.5.3. If you are using a language that requires a separate compiler, such as C, please include the name and version of the compiler too.

**OS/platform**
For instance, Ubuntu 16.04, Windows 10, or Android 4.0.3. If your code is running in a browser, please also include the browser type and version.

**Additional context**
Add any other context about the problem here.
20 changes: 20 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
---
name: Feature request
about: Suggest an idea for this project
title: ''
labels: ''
assignees: ''

---

**Is your feature request related to a problem? Please describe.**
A clear and concise description of what the problem is. Ex. I would love to see the SDK [...does something new...]

**Describe the solution you'd like**
A clear and concise description of what you want to happen.

**Describe alternatives you've considered**
A clear and concise description of any alternative solutions or features you've considered.

**Additional context**
Add any other context about the feature request here.
21 changes: 21 additions & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
**Requirements**

- [ ] I have added test coverage for new or changed functionality
- [ ] I have followed the repository's [pull request submission guidelines](../blob/master/CONTRIBUTING.md#submitting-pull-requests)
- [ ] I have validated my changes against all supported platform versions

**Related issues**

Provide links to any issues in this repository or elsewhere relating to this pull request.

**Describe the solution you've provided**

Provide a clear and concise description of what you expect to happen.

**Describe alternatives you've considered**

Provide a clear and concise description of any alternative solutions or features you've considered.

**Additional context**

Add any other context about the pull request here.
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
LaunchDarkly Server-Side SDK for Lua
===========================

[![CircleCI](https://circleci.com/gh/launchdarkly/lua-server-sdk.svg?style=svg)](https://circleci.com/gh/launchdarkly/lua-server-sdk)

LaunchDarkly overview
-------------------------

[LaunchDarkly](https://www.launchdarkly.com) is a feature management platform that serves over 100 billion feature flags daily to help teams build better software, faster. [Get started](https://docs.launchdarkly.com/docs/getting-started) using LaunchDarkly today!

[![Twitter Follow](https://img.shields.io/twitter/follow/launchdarkly.svg?style=social&label=Follow&maxAge=2592000)](https://twitter.com/intent/follow?screen_name=launchdarkly)


Supported Lua versions
-----------

Expand Down Expand Up @@ -52,4 +54,3 @@ About LaunchDarkly
* [docs.launchdarkly.com](https://docs.launchdarkly.com/ "LaunchDarkly Documentation") for our documentation and SDK reference guides
* [apidocs.launchdarkly.com](https://apidocs.launchdarkly.com/ "LaunchDarkly API Documentation") for our API documentation
* [blog.launchdarkly.com](https://blog.launchdarkly.com/ "LaunchDarkly Blog Documentation") for the latest product updates
* [Feature Flagging Guide](https://github.com/launchdarkly/featureflags/ "Feature Flagging Guide") for best practices and strategies
30 changes: 30 additions & 0 deletions launchdarkly-server-sdk.c
Original file line number Diff line number Diff line change
Expand Up @@ -1061,6 +1061,35 @@ LuaLDClientTrack(lua_State *const l)
return 0;
}

/***
Associates two users for analytics purposes by generating an alias event.
@function alias
@tparam user currentUser An opaque user object from @{makeUser}
@tparam user previousUser An opaque user object from @{makeUser}
@treturn nil
*/
static int
LuaLDClientAlias(lua_State *const l)
{
struct LDClient **client;
struct LDUser **currentUser, **previousUser;
struct LDJSON *value;

if (lua_gettop(l) != 3) {
return luaL_error(l, "expected exactly three arguments");
}

client = (struct LDClient **)luaL_checkudata(l, 1, "LaunchDarklyClient");
currentUser = (struct LDUser **)luaL_checkudata(l, 2, "LaunchDarklyUser");
previousUser = (struct LDUser **)luaL_checkudata(l, 3, "LaunchDarklyUser");

if (!LDClientAlias(*client, *currentUser, *previousUser)) {
return luaL_error(l, "LDClientAlias failed");
}

return 0;
}

/***
Check if a client has been fully initialized. This may be useful if the
initialization timeout was reached.
Expand Down Expand Up @@ -1156,6 +1185,7 @@ static const struct luaL_Reg launchdarkly_client_methods[] = {
{ "jsonVariationDetail", LuaLDClientJSONVariationDetail },
{ "flush", LuaLDClientFlush },
{ "track", LuaLDClientTrack },
{ "alias", LuaLDClientAlias },
{ "allFlags", LuaLDClientAllFlags },
{ "isInitialized", LuaLDClientIsInitialized },
{ "identify", LuaLDClientIdentify },
Expand Down
4 changes: 4 additions & 0 deletions test.lua
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,10 @@ function TestAll:testIdentify()
makeTestClient():identify(user)
end

function TestAll:testAlias()
makeTestClient():alias(user, l.makeUser({ key = "bob" }))
end

function TestAll:testRedisBasic()
local c = l.clientInit({
key = "sdk-test",
Expand Down