forked from vitessio/vitess
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #12 from vinted/vinted/zygis/is-boosted-checks
boost: load query filters configs and check for boost
- Loading branch information
Showing
10 changed files
with
177 additions
and
60 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
package boost | ||
|
||
import ( | ||
"fmt" | ||
"gopkg.in/yaml.v2" | ||
"io/ioutil" | ||
) | ||
|
||
func Load(configPath *string) (*QueryFilterConfigs, error) { | ||
data, err := ioutil.ReadFile(*configPath) | ||
fmt.Printf("Reading Boost Configs from: %s\n", *configPath) | ||
if err != nil { | ||
fmt.Printf("Error reading file: %v\n", err) | ||
return nil, err | ||
} | ||
|
||
var configs QueryFilterConfigs | ||
err = yaml.Unmarshal(data, &configs) | ||
if err != nil { | ||
return nil, err | ||
} | ||
|
||
fmt.Printf("Parsed Configs: %+v\n", configs) | ||
|
||
rocket := ` | ||
| | ||
/ \ | ||
/ _ \ | ||
|.'''.| | ||
|'._.'| | ||
|BOOST| | ||
,'| | |\. | ||
/ | | | \ | ||
|,-'--|--'-.| | ||
|| || || | ||
` | ||
|
||
fmt.Println(rocket) | ||
|
||
fmt.Println("Boost enabled.") | ||
|
||
return &configs, nil | ||
} |
This file contains 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
This file contains 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
This file contains 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
Oops, something went wrong.