-
Notifications
You must be signed in to change notification settings - Fork 6
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
niko/go-sdk-docs #553
base: main
Are you sure you want to change the base?
niko/go-sdk-docs #553
Conversation
On branch niko/go-to-new-template Changes to be committed: new file: docs/sdks/server-sdks/go/_category_.json new file: docs/sdks/server-sdks/go/assignments.mdx new file: docs/sdks/server-sdks/go/bandits.mdx new file: docs/sdks/server-sdks/go/initialization.mdx new file: docs/sdks/server-sdks/go/intro.mdx new file: docs/sdks/server-sdks/go/quickstart.mdx
✅ Deploy Preview for eppo-data-docs ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
import ( | ||
"github.com/eppo-exp/eppo-go-sdk/eppo" | ||
) | ||
|
||
config := eppo.NewConfig("<SDK-KEY>") | ||
client, err := eppo.Init(config) | ||
if err != nil { | ||
log.Fatal("Failed to initialize Eppo client:", err) | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🐛 This example is off. The one in initialization section is correct
type MyLogger struct{} | ||
|
||
func (l *MyLogger) LogAssignment(assignment *eppo.Assignment) error { | ||
// Replace with your logging logic | ||
log.Printf("Logging assignment: %+v", assignment) | ||
return nil | ||
} | ||
|
||
config := eppo.NewConfig( | ||
"<SDK-KEY>", | ||
eppo.WithAssignmentLogger(&MyLogger{}), | ||
) | ||
client, err := eppo.Init(config) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🐛 same here. Go SDK doesn't have NewConfig
. See examples in initialization section
|
||
The `result` is an instance of `BanditResult`, which has two fields: | ||
- `Variation` (string): The variation that was assigned to the subject | ||
- `Action` (string): The action that was assigned to the subject (empty string if no action was assigned) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- `Action` (string): The action that was assigned to the subject (empty string if no action was assigned) | |
- `Action` (`*string`): The action that was assigned to the subject (`nil` if no action was assigned) |
|
||
The variation returns the feature flag variation, this can be the bandit itself, or the "status quo" variation if the user is not assigned to the bandit. | ||
If we are unable to generate a variation, for example when the flag is turned off, then the `default` variation is returned. | ||
In both of those cases, the `Action` is an empty string, and you should use the status-quo algorithm to select an action. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In both of those cases, the `Action` is an empty string, and you should use the status-quo algorithm to select an action. | |
In both of those cases, the `Action` is nil, and you should use the status-quo algorithm to select an action. |
Updating to most recent version for the install instructions. Co-authored-by: Oleksii Shmalko <[email protected]>
Updating typed assignment list to correct names. Co-authored-by: Oleksii Shmalko <[email protected]>
Co-authored-by: Oleksii Shmalko <[email protected]>
Co-authored-by: Oleksii Shmalko <[email protected]>
Co-authored-by: Oleksii Shmalko <[email protected]>
Co-authored-by: Oleksii Shmalko <[email protected]>
What?
Moving the Go docs into the format similar to what we have for node.
Why?
Review instructions
Todo before merge