Skip to content

Commit

Permalink
multi support
Browse files Browse the repository at this point in the history
  • Loading branch information
RangelReale committed Oct 30, 2024
1 parent aa188e2 commit 2e6e379
Show file tree
Hide file tree
Showing 5 changed files with 213 additions and 86 deletions.
203 changes: 149 additions & 54 deletions sample/complex/myinterface_qdii.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion sample/complex/sample_complex.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ type SI struct {
type XI = SI

type MyInterface[T any, X II] interface {
Get(ctx context.Context, name string) (T, error)
Get(ctx context.Context, name string) (x1 T, err error)
Set(ctx context.Context, name string, value T) error
Other(si SecondInterface) int
Other2(ti ThirdInterface[T]) int
Expand Down
4 changes: 4 additions & 0 deletions sample/datatype/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@ import (
func main() {
d := NewQDSampleData(
WithQDData(&idata.IData{Name: "xname", Value: "xvalue"}),
WithQDGet(func(qdCtx *QDSampleDataContext, name string) (any, error) {
qdCtx.NotSupported() // will ignore return values and call the next handler
return nil, nil
}),
WithQDGet(func(qdCtx *QDSampleDataContext, name string) (any, error) {
if name == qdCtx.Data.Name {
return qdCtx.Data.Value, nil
Expand Down
Loading

0 comments on commit 2e6e379

Please sign in to comment.