Skip to content

Instantly share code, notes, and snippets.

View brurucy's full-sized avatar
🎯
Focusing

Rucy brurucy

🎯
Focusing
View GitHub Profile
@brurucy
brurucy / example_4.go
Created February 9, 2023 21:21
memoir
fx.Run(
fx.Invoke(func(o *Obj) {
fmt.Println(“%s”, o.ToString())
}),
fx.Provide(Foo(2)),
fx.Provide(New),
fx.Provide(Bar(“two”)),
)
@brurucy
brurucy / example_5.go
Last active February 9, 2023 21:31
memoir
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 { … }
@brurucy
brurucy / example_6.go
Last active February 9, 2023 21:24
memoir
func main() {
pdfx.Run(internal.Module())
}
@brurucy
brurucy / example_7.go
Created February 9, 2023 21:25
memoir
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"
@brurucy
brurucy / example_8.go
Last active March 28, 2023 22:22
memoir
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"