This repository was archived by the owner on Dec 21, 2019. It is now read-only.
Filebased backend#36
Open
trusch wants to merge 2 commits into
Open
Conversation
Added backend based on json file
|
Changes Unknown when pulling 9f2057e on trusch:master into ** on apexskier:master**. |
Owner
apexskier
suggested changes
Dec 12, 2016
| @@ -0,0 +1,92 @@ | |||
| package httpauth | |||
Owner
There was a problem hiding this comment.
Add a docstring describing why this backend is useful
Owner
There was a problem hiding this comment.
Human readable, file based backend
| } | ||
| file.Write(data) | ||
| file.Close() | ||
| // |
| return b.save() | ||
| } | ||
|
|
||
| func (b FileAuthBackend) Close() { |
Owner
There was a problem hiding this comment.
add a comment explaining why this is a no-op
| file, err := os.OpenFile(b.filepath,os.O_RDWR|os.O_CREATE|os.O_TRUNC, 0666) | ||
| defer file.Close() | ||
| if err != nil { | ||
| fmt.Printf("==>%v",err) |
| func (b FileAuthBackend) SaveUser(user UserData) error { | ||
| b.users[user.Username] = user | ||
| err := b.save() | ||
| return err |
Owner
There was a problem hiding this comment.
Can this just be return b.save()?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Someone pullrequested this to my fork. I reviewed and accepted it, so here it goes upstream.