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
fx.Run( | |
fx.Invoke(func(o *Obj) { | |
fmt.Println(“%s”, o.ToString()) | |
}), | |
fx.Provide(Foo(2)), | |
fx.Provide(New), | |
fx.Provide(Bar(“two”)), | |
) |
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
func main() { | |
log := logger.New(verbose) | |
if err != nil { … } | |
rawSchemata, err := os.ReadFile(SCHEMATA_LOCATION) | |
if err != nil { … } | |
schemata := schema.Schemata{} | |
if err = yaml.Unmarshal(rawSchemata, &schemata); err != nil { … } | |
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
func main() { | |
pdfx.Run(internal.Module()) | |
} |
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
package internal | |
import ( | |
"github.com/go-git/go-billy/v5/memfs" | |
"github.com/pipedrive/pdfx/diplomat" | |
"github.com/pipedrive/pdfx/echo" | |
"github.com/pipedrive/pdfx/logger" | |
"github.com/pipedrive/pdfx/prometheus" | |
"github.com/pipedrive/pdfx/runmode" | |
"github.com/pipedrive/schemer/internal/repository" |
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
func TestGetSchema(t *testing.T) { | |
ctrl := gomock.NewController(t) | |
schemataRepositoryMock := NewMockSchemataRepository(ctrl) | |
gitRepositoryMock := NewMockGitRepository(ctrl) | |
somePath := "some-api.json" | |
actualSchema := []byte(`{...}`) | |
gitRepositoryMock.EXPECT().Clone(gomock.Any(), gomock.Any(), gomock.Any()).DoAndReturn(func(s storage.Storer, worktree billy.Filesystem, o *git.CloneOptions) (*git.Repository, error) {...}) | |
someSchemaName := "some-api" |
OlderNewer