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
package main | |
import ( | |
"fmt" | |
"testing" | |
"github.com/robertkrimen/otto" | |
) | |
type WorkItem struct { |
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
package main | |
import "database/sql" | |
type Application interface { | |
WorkItems() WorkItems | |
} | |
type GormApplication struct { | |
*gorm.DB |
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
package main | |
type CoreService interface { | |
} | |
func (c CoreService) RegisterService(service Service) { | |
// RegisterWorKitems | |
// Add to Service Register | |
} |
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
var order [][]func() | |
order = append(order, []func(db) {ExecSQLFile("add_customer.sql"), MigrateCustomerFieldName}) | |
order = append(order, []func(db) {ExecSQLFile("add_some_other")}) | |
// db.tx.begin // TODO: Make sure currentVersion is read inside TX | |
for verison := currentVersion() && version < size(order) { | |
for migrationFun := order[version] { | |
migrationFunc(db) | |
} |
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
require 'date' | |
require 'net/http' | |
require 'csv' | |
@DEBUG = false | |
def fetch_data(auth, download = true) | |
data_found = true | |
current_month = Time.new.to_date.prev_month | |
found_files = [] |
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
func TestGiHubIssueMapping(t *testing.T) { | |
content, err := LoadTestData("github_issue_mapping.json", func() ([]byte, error) { | |
url := "https://api.github.com/repos/almighty/almighty-core/issues/131" | |
response, err := http.Get(url) | |
if err != nil { | |
return nil, err | |
} | |
defer response.Body.Close() |
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
package main | |
import ( | |
"encoding/json" | |
"fmt" | |
"testing" | |
"github.com/almighty/almighty-core/models" | |
) |
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
package models | |
type State string | |
type Reason string | |
type Transision struct { | |
From State | |
To State | |
Reason Reason | |
} |
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
[aslak@localhost:~/types/tool/types-cli(master)]$ ./types-cli create array_prism --help | |
Resource array_prism contains artifical actions that showcase the use of the array type in the DSL. | |
Payload example: | |
{ | |
"any_array": [ | |
1481958210139591269 | |
], | |
"bool_array": [ |
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
{ | |
"version": "0.2.0", | |
"configurations": [ | |
{ | |
"name": "Test", | |
"type": "go", | |
"request": "launch", | |
"mode": "test", | |
"remotePath": "", | |
"port": 2345, |