Feat: add example config
This commit is contained in:
		| @@ -56,10 +56,6 @@ func removeRoom(roomID string) { | ||||
| } | ||||
|  | ||||
| // context | ||||
| func getRoomIDFromCtx(ctx context.Context) string { | ||||
| 	id, _ := ctx.Value(models.CtxRoomIDKey).(string) | ||||
| 	return id | ||||
| } | ||||
|  | ||||
| func getStateByCtx(ctx context.Context) (*models.UserState, error) { | ||||
| 	username, ok := ctx.Value(models.CtxUsernameKey).(string) | ||||
| @@ -74,15 +70,6 @@ func getStateByCtx(ctx context.Context) (*models.UserState, error) { | ||||
| 	return us, nil | ||||
| } | ||||
|  | ||||
| func saveStateByCtx(ctx context.Context, state *models.UserState) error { | ||||
| 	username, ok := ctx.Value(models.CtxUsernameKey).(string) | ||||
| 	if !ok { | ||||
| 		log.Debug("no username in ctx") | ||||
| 		return errors.New("no username in ctx") | ||||
| 	} | ||||
| 	return saveState(username, state) | ||||
| } | ||||
|  | ||||
| func saveFullInfo(fi *models.FullInfo) error { | ||||
| 	// INFO: unfortunately working no transactions; so case are possible where first object is updated but the second is not | ||||
| 	if err := saveState(fi.State.Username, fi.State); err != nil { | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 Grail Finder
					Grail Finder