repo_name stringlengths 1 52 | repo_creator stringclasses 6
values | programming_language stringclasses 4
values | code stringlengths 0 9.68M | num_lines int64 1 234k |
|---|---|---|---|---|
go-kafka-event-source | aws | Go | // Copyright 2022 Amazon.com, Inc. or its affiliates. All Rights Reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unles... | 74 |
go-kafka-event-source | aws | Go | // Copyright 2022 Amazon.com, Inc. or its affiliates. All Rights Reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unles... | 118 |
go-kafka-event-source | aws | Go | // Copyright 2022 Amazon.com, Inc. or its affiliates. All Rights Reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unles... | 68 |
go-kafka-event-source | aws | Go | // Copyright 2022 Amazon.com, Inc. or its affiliates. All Rights Reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unles... | 185 |
go-kafka-event-source | aws | Go | // Copyright 2009 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package sak
// yadll - Yet Another Doubly Linked List copied from the Go source.
// When will they provide a Generic version of container/list so we can stop c... | 232 |
go-kafka-event-source | aws | Go | // Copyright 2009 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package sak
import "testing"
func checkListLen[T any](t *testing.T, l *List[T], len int) bool {
if n := l.Len(); n != len {
t.Errorf("l.Len() = %d, want %d... | 347 |
go-kafka-event-source | aws | Go | // Copyright 2022 Amazon.com, Inc. or its affiliates. All Rights Reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unles... | 72 |
go-kafka-event-source | aws | Go | // Copyright 2022 Amazon.com, Inc. or its affiliates. All Rights Reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unles... | 330 |
go-kafka-event-source | aws | Go | // Copyright 2022 Amazon.com, Inc. or its affiliates. All Rights Reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unles... | 108 |
go-kafka-event-source | aws | Go | // Copyright 2022 Amazon.com, Inc. or its affiliates. All Rights Reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unles... | 100 |
iot-atlas | aws | Go | // Copyright 2019 The Hugo Authors. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable ... | 98 |
iot-atlas | aws | Go | // Copyright 2019 The Hugo Authors. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable ... | 364 |
jsii | aws | Go | package jsii
import (
"fmt"
"reflect"
"github.com/aws/jsii-runtime-go/internal/kernel"
)
// UnsafeCast converts the given interface value to the desired target interface
// pointer. Panics if the from value is not a jsii proxy object, or if the to
// value is not a pointer to an interface type.
func UnsafeCast(fr... | 60 |
jsii | aws | Go | package jsii
import (
"reflect"
"testing"
"github.com/aws/jsii-runtime-go/internal/api"
"github.com/aws/jsii-runtime-go/internal/kernel"
)
type MockInterfaceABase interface {
MockMethodABase(_ float64)
}
type mockABase struct {
_ int // padding
}
func (m *mockABase) MockMethodABase(_ float64) {}
type MockIn... | 102 |
jsii | aws | Go | package jsii
import (
"reflect"
"github.com/aws/jsii-runtime-go/internal/api"
"github.com/aws/jsii-runtime-go/runtime"
)
// Deprecated: FQN represents a fully-qualified type name in the jsii type system.
type FQN api.FQN
// Deprecated: Member is a runtime descriptor for a class or interface member
type Member in... | 132 |
jsii | aws | Go | //go:build (go1.16 || go1.17) && !go1.18
// +build go1.16 go1.17
// +build !go1.18
package jsii
import (
"fmt"
"os"
"github.com/aws/jsii-runtime-go/internal/compiler"
"github.com/mattn/go-isatty"
)
// / Emits a deprecation warning message when
func init() {
tty := isatty.IsTerminal(os.Stderr.Fd()) || isatty.Is... | 38 |
jsii | aws | Go | // Package jsii provides utilities that user code can leverage to facilitate
// working with libraries generated by the `jsii-pacmak` tool. This includes
// type conversion helpers as well as utilities to manage the runtime process'
// lifecycle.
package jsii
| 6 |
jsii | aws | Go | package jsii
import "time"
type basicType interface {
bool | string | float64 | time.Time
}
// Ptr returns a pointer to the provided value.
func Ptr[T basicType](v T) *T {
return &v
}
// PtrSlice returns a pointer to a slice of pointers to all of the provided values.
func PtrSlice[T basicType](v ...T) *[]*T {
sl... | 66 |
jsii | aws | Go | package jsii
import (
"testing"
"time"
"github.com/stretchr/testify/assert"
)
func TestV(t *testing.T) {
// Bool
assert.Equal(t, true, *Ptr(true))
assert.Equal(t, false, *Ptr(false))
// Bools
assert.Equal(t, []*bool{Bool(true), Bool(false), Bool(false), Bool(true)}, *PtrSlice(true, false, false, true))
// F... | 80 |
jsii | aws | Go | package jsii
import "github.com/aws/jsii-runtime-go/internal/kernel"
// Close finalizes the runtime process, signalling the end of the execution to
// the jsii kernel process, and waiting for graceful termination. The best
// practice is to defer call thins at the beginning of the "main" function.
func Close() {
ker... | 11 |
jsii | aws | Go | //go:build tools
// +build tools
// Package tools contains the necessary statements to ensure tool dependencies
// are not "cleaned up" by "go mod tidy" despite being used... The "// +"
// comment above makes sure the file is never included in an actual compiled
// unit (unless someone manually specifies the "build to... | 16 |
jsii | aws | Go | package api
import (
"fmt"
"regexp"
)
// FQN represents a fully-qualified type name in the jsii type system.
type FQN string
// Override is a public interface implementing a private method `isOverride`
// implemented by the private custom type `override`. This is embedded by
// MethodOverride and PropertyOverride ... | 102 |
jsii | aws | Go | // Package api contains shared type definisions used by several modules part of
// the jsii runtime for go. It helps avoid creating circular dependencies
// between the other modules.
package api
| 5 |
jsii | aws | Go | //go:build go1.16 && !go1.17
// +build go1.16,!go1.17
package compiler
// Version denotes the version of the go compiler that was used for building
// this binary. It is intended for use only in the compiler deprecation warning
// message.
const Version = "go1.16"
// EndOfLifeDate is the date at which this compiler ... | 13 |
jsii | aws | Go | //go:build go1.17 && !go1.18
// +build go1.17,!go1.18
package compiler
// Version denotes the version of the go compiler that was used for building
// this binary. It is intended for use only in the compiler deprecation warning
// message.
const Version = "go1.17"
// EndOfLifeDate is the date at which this compiler ... | 13 |
jsii | aws | Go | // Package embedded contains the embedded @jsii/kernel code, which is used
// unless the JSII_RUNTIME environment variable is set to a different program.
package embedded
| 4 |
jsii | aws | Go | package embedded
import (
"embed"
"os"
"path"
)
// embeddedRootDir is the name of the root directory for the embeddedFS variable.
const embeddedRootDir string = "resources"
//go:embed resources/*
var embeddedFS embed.FS
// entrypointName is the path to the entry point relative to the embeddedRootDir.
var entrypo... | 58 |
jsii | aws | Go | package embedded
import (
"path"
"testing"
)
func TestEntryPointExists(t *testing.T) {
if bytes, err := embeddedFS.ReadFile(path.Join(embeddedRootDir, entrypointName)); err != nil {
t.Errorf("unable to read entry point data: %v", err)
} else if len(bytes) == 0 {
t.Error("entry point file is empty")
}
}
| 16 |
jsii | aws | Go | package kernel
import (
"github.com/aws/jsii-runtime-go/internal/api"
)
type BeginProps struct {
Method *string `json:"method"`
Arguments []interface{} `json:"args"`
ObjRef api.ObjectRef `json:"objref"`
}
type BeginResponse struct {
kernelResponse
PromiseID *string `json:"promise_id"`
}
func (c *C... | 26 |
jsii | aws | Go | package kernel
import (
"fmt"
"reflect"
"strings"
"github.com/aws/jsii-runtime-go/internal/api"
)
type callback struct {
CallbackID string `json:"cbid"`
Cookie string `json:"cookie"`
Invoke *invokeCallback `json:"invoke"`
Get *getCallback `json:"get"`
Set *setCallb... | 258 |
jsii | aws | Go | package kernel
import (
"fmt"
"reflect"
"runtime"
"sync"
"github.com/aws/jsii-runtime-go/internal/api"
"github.com/aws/jsii-runtime-go/internal/kernel/process"
"github.com/aws/jsii-runtime-go/internal/objectstore"
"github.com/aws/jsii-runtime-go/internal/typeregistry"
)
var (
clientInstance *Client
cl... | 143 |
jsii | aws | Go | package kernel
import (
"reflect"
"testing"
"github.com/aws/jsii-runtime-go/internal/typeregistry"
)
func TestClient(t *testing.T) {
client, err := newClient()
if err != nil {
t.Fatalf("client init failed: %v", err.Error())
}
defer client.close()
t.Run("Client Load Error", func(t *testing.T) {
request :... | 63 |
jsii | aws | Go | package kernel
type CompleteProps struct {
CallbackID *string `json:"cbid"`
Error *string `json:"err"`
Result interface{} `json:"result"`
}
type CompleteResponse struct {
kernelResponse
CallbackID *string `json:"cbid"`
}
func (c *Client) Complete(props CompleteProps) (response CompleteResponse,... | 22 |
jsii | aws | Go | package kernel
import (
"fmt"
"reflect"
"time"
"github.com/aws/jsii-runtime-go/internal/api"
)
var (
anyType = reflect.TypeOf((*interface{})(nil)).Elem()
)
// CastAndSetToPtr accepts a pointer to any type and attempts to cast the value
// argument to be the same type. Then it sets the value of the pointer elem... | 371 |
jsii | aws | Go | package kernel
import "github.com/aws/jsii-runtime-go/internal/api"
type CreateProps struct {
FQN api.FQN `json:"fqn"`
Interfaces []api.FQN `json:"interfaces,omitempty"`
Arguments []interface{} `json:"args,omitempty"`
Overrides []api.Override `json:"overrides,omitempty"`
}
// TODO extends A... | 33 |
jsii | aws | Go | package kernel
import "github.com/aws/jsii-runtime-go/internal/api"
type DelProps struct {
ObjRef api.ObjectRef `json:"objref"`
}
type DelResponse struct {
kernelResponse
}
func (c *Client) Del(props DelProps) (response DelResponse, err error) {
type request struct {
kernelRequest
DelProps
}
err = c.reques... | 21 |
jsii | aws | Go | // Package kernel defines the interface for go programs to interact with the
// @jsii/kernel node process. This module completely abstracts managament of the
// child process.
package kernel
| 5 |
jsii | aws | Go | package kernel
type EndProps struct {
PromiseID *string `json:"promise_id"`
}
type EndResponse struct {
kernelResponse
Result interface{} `json:"result"`
}
func (c *Client) End(props EndProps) (response EndResponse, err error) {
type request struct {
kernelRequest
EndProps
}
err = c.request(request{kernelR... | 20 |
jsii | aws | Go | package kernel
import "github.com/aws/jsii-runtime-go/internal/api"
type GetProps struct {
Property string `json:"property"`
ObjRef api.ObjectRef `json:"objref"`
}
type StaticGetProps struct {
FQN api.FQN `json:"fqn"`
Property string `json:"property"`
}
type GetResponse struct {
kernelResponse
... | 44 |
jsii | aws | Go | package kernel
import "github.com/aws/jsii-runtime-go/internal/api"
type InvokeProps struct {
Method string `json:"method"`
Arguments []interface{} `json:"args"`
ObjRef api.ObjectRef `json:"objref"`
}
type StaticInvokeProps struct {
FQN api.FQN `json:"fqn"`
Method string `json... | 46 |
jsii | aws | Go | package kernel
import (
"encoding/json"
"errors"
)
// unmarshalKernelResponse performs custom unmarshaling for kernel responses, checks for presence of `error` key on json
// and returns if present.
//
// The uresult parameter may be passed to json.Unmarshal so if unmarshalKernelResponse is called within a custom
/... | 41 |
jsii | aws | Go | package kernel
import (
"fmt"
"io/ioutil"
"os"
"regexp"
)
// LoadProps holds the necessary information to load a library into the
// @jsii/kernel process through the Load method.
type LoadProps struct {
Name string `json:"name"`
Version string `json:"version"`
}
// LoadResponse contains the data returned by... | 67 |
jsii | aws | Go | package kernel
import (
"fmt"
"reflect"
"strings"
"github.com/aws/jsii-runtime-go/internal/api"
)
const objectFQN = "Object"
func (c *Client) ManageObject(v reflect.Value) (ref api.ObjectRef, err error) {
// Ensuring we use a pointer, so we can see pointer-receiver methods, too.
var vt reflect.Type
if v.Kind... | 92 |
jsii | aws | Go | package kernel
type NamingProps struct {
Assembly string `json:"assembly"`
}
type NamingResponse struct {
kernelResponse
// readonly naming: {
// readonly [language: string]: { readonly [key: string]: any } | undefined;
// };
}
func (c *Client) Naming(props NamingProps) (response NamingResponse, err error) {
... | 22 |
jsii | aws | Go | package kernel
// kernelRequester allows creating a union of kernelRequester and kernelResponder
// types by defining private method implemented by a private custom type, which
// is embedded in all relevant types.
type kernelRequester interface {
// isRequest is a marker method that is intended to ensure no external... | 41 |
jsii | aws | Go | package kernel
import "github.com/aws/jsii-runtime-go/internal/api"
type SetProps struct {
Property string `json:"property"`
Value interface{} `json:"value"`
ObjRef api.ObjectRef `json:"objref"`
}
type StaticSetProps struct {
FQN api.FQN `json:"fqn"`
Property string `json:"property"`... | 45 |
jsii | aws | Go | package kernel
type StatsResponse struct {
kernelResponse
ObjectCount float64 `json:"object_count"`
}
func (c *Client) Stats() (response StatsResponse, err error) {
err = c.request(kernelRequest{"stats"}, &response)
return
}
| 12 |
jsii | aws | Go | package process
import (
"bufio"
"encoding/json"
"io"
"os"
)
type consoleMessage struct {
Stderr []byte `json:"stderr"`
Stdout []byte `json:"stdout"`
}
// consumeStderr is intended to be used as a goroutine, and will consume this
// process' stderr stream until it reaches EOF. It reads the stream line-by-line
... | 43 |
jsii | aws | Go | package process
import (
"fmt"
"regexp"
"github.com/Masterminds/semver/v3"
)
type handshakeResponse struct {
Hello string `json:"hello"`
}
func (h *handshakeResponse) runtimeVersion() (*semver.Version, error) {
re := regexp.MustCompile("@")
parts := re.Split(h.Hello, 3)
switch len(parts) {
case 2:
return ... | 26 |
jsii | aws | Go | package process
import (
"encoding/json"
"errors"
"fmt"
"io"
"io/ioutil"
"os"
"os/exec"
"runtime"
"strings"
"sync"
"github.com/Masterminds/semver/v3"
"github.com/aws/jsii-runtime-go/internal/embedded"
)
const JSII_NODE string = "JSII_NODE"
const JSII_RUNTIME string = "JSII_RUNTIME"
type ErrorResponse st... | 301 |
jsii | aws | Go | package process
import (
_ "embed"
"fmt"
"io/ioutil"
"os"
"os/exec"
"runtime"
"strings"
"testing"
)
//go:embed jsii-mock-runtime.js
var mockRuntimeSource []byte
var mockRuntime string
func TestMain(m *testing.M) {
file, _ := ioutil.TempFile("", "jsii-mock-runtime.*.js")
if _, err := file.Write(mockRuntimeS... | 188 |
jsii | aws | Go | // Package objectstore implements support for tracking a mapping of object
// references to and from their instance ID. It tracks objects by proxy of their
// memory address (i.e: pointer value), in order to avoid the pitfalls of go's
// standard object equality mechanism (which is also reflect.Value's equality
// mech... | 8 |
jsii | aws | Go | package objectstore
import (
"fmt"
"reflect"
"github.com/aws/jsii-runtime-go/internal/api"
)
// stringSet is a set of strings, implemented as a map from string to an
// arbitrary 0-width value.
type stringSet map[string]struct{}
// ObjectStore tracks object instances for which an identifier has been
// associate... | 266 |
jsii | aws | Go | package typeregistry
import (
"reflect"
"strings"
"github.com/aws/jsii-runtime-go/internal/api"
)
// DiscoverImplementation determines the list of registered interfaces that are
// implemented by the provided type, and returns the list of their FQNs and
// overrides for all their combined methods and properties.
... | 72 |
jsii | aws | Go | // Package typeregistry offers features useful to manage the registration and
// operation of types in the context of the jsii runtime. These are used to
// support type conversion for values exchanged between the child node process
// and the go application.
package typeregistry
| 6 |
jsii | aws | Go | package typeregistry
import (
"github.com/aws/jsii-runtime-go/internal/api"
)
func (t *TypeRegistry) GetOverride(fqn api.FQN, n string) (api.Override, bool) {
if members, ok := t.typeMembers[fqn]; ok {
for _, member := range members {
if member.GoName() == n {
return member, true
}
}
}
return nil, ... | 18 |
jsii | aws | Go | package typeregistry
import (
"fmt"
"reflect"
"github.com/aws/jsii-runtime-go/internal/api"
)
type typeKind uint8
const (
_ = iota
classType typeKind = iota
enumType typeKind = iota
interfaceType typeKind = iota
structType typeKind = iota
)
type registeredType struct {
Typ... | 171 |
jsii | aws | Go | package typeregistry
import (
"fmt"
"reflect"
"github.com/aws/jsii-runtime-go/internal/api"
)
// TypeRegistry is used to record runtime type information about the loaded
// modules, which is later used to correctly convert objects received from the
// JavaScript process into native go values.
type TypeRegistry st... | 176 |
jsii | aws | Go | package typeregistry
import (
"fmt"
"reflect"
)
// ValidateStruct runs validations on the supplied struct to determine whether
// it is valid. In particular, it checks union-typed properties to ensure the
// provided value is of one of the allowed types.
//
// May panic if v is not a pointer to a struct value.
func... | 28 |
jsii | aws | Go | // Package runtime provides the APIs used by code generated by the `jsii-pacmak`
// tool to interact with the `@jsii/kernel` process. It is not intended for
// users to directly interact with, and doing so could result in incorrect
// behavior.
package runtime
| 6 |
jsii | aws | Go | package runtime
import (
"reflect"
"sort"
"testing"
)
type IFace interface {
M1()
M2()
M3()
}
type Base struct {
X, Y int
}
func (b *Base) M1() {}
func (b *Base) M2() {}
func (b *Base) M3() {}
type D1 struct {
*Base
}
func (d *D1) M1() {}
func (d *D1) X1() {}
type D2 struct {
Name string
IFace
}
func... | 66 |
jsii | aws | Go | package runtime
import (
"fmt"
"reflect"
"strings"
"github.com/aws/jsii-runtime-go/internal/api"
"github.com/aws/jsii-runtime-go/internal/kernel"
)
// FQN represents a fully-qualified type name in the jsii type system.
type FQN api.FQN
// Member is a runtime descriptor for a class or interface member
type Memb... | 445 |
jsii | aws | Go | package runtime
import "github.com/aws/jsii-runtime-go/internal/kernel"
// ValidateStruct runs validations on the supplied struct to determine whether
// it is valid. In particular, it checks union-typed properties to ensure the
// provided value is of one of the allowed types.
func ValidateStruct(v interface{}, d fu... | 12 |
jsii | aws | Go | package tests
import (
"testing"
"github.com/aws/jsii-runtime-go"
calc "github.com/aws/jsii/jsii-calc/go/jsiicalc/v3"
)
func TestPureInterfacesCanBeUsedTransparently(t *testing.T) {
requiredstring := "It's Britney b**ch!"
expected := calc.StructB{RequiredString: &requiredstring}
delegate := &StructReturningDel... | 46 |
jsii | aws | Go | package tests
import (
"encoding/json"
"io/ioutil"
"strings"
"github.com/stretchr/testify/require"
"github.com/stretchr/testify/suite"
)
type ComplianceSuite struct {
suite.Suite
_report map[string]map[string]string
}
func (suite *ComplianceSuite) SetupSuite() {
suite._report = map[string]map[string]string{... | 82 |
jsii | aws | Go | package tests
import (
"encoding/json"
"fmt"
"math"
"runtime"
"testing"
"time"
"github.com/aws/jsii-runtime-go"
"github.com/aws/jsii/go-runtime-test/internal/addTen"
"github.com/aws/jsii/go-runtime-test/internal/bellRinger"
"github.com/aws/jsii/go-runtime-test/internal/cdk16625"
"github.com/aws/jsii/go-run... | 1,680 |
jsii | aws | Go | package tests
import (
"fmt"
"math"
"os"
"reflect"
"strings"
"testing"
"github.com/aws/jsii-runtime-go"
calc "github.com/aws/jsii/jsii-calc/go/jsiicalc/v3"
"github.com/aws/jsii/jsii-calc/go/jsiicalc/v3/submodule/param"
returnsParam "github.com/aws/jsii/jsii-calc/go/jsiicalc/v3/submodule/returnsparam"
calcl... | 242 |
jsii | aws | Go | package tests
import (
"github.com/aws/jsii-runtime-go"
"github.com/aws/jsii/jsii-calc/go/scopejsiicalclib"
)
type pureNativeFriendlyRandom struct {
_nextNumber float64
}
func newPureNativeFriendlyRandom() *pureNativeFriendlyRandom {
return &pureNativeFriendlyRandom{
_nextNumber: 1000,
}
}
func (p *pureNativ... | 47 |
jsii | aws | Go | package tests
import (
"fmt"
"testing"
"github.com/aws/jsii-runtime-go"
"github.com/aws/jsii/jsii-calc/go/jsiicalc/v3"
"github.com/aws/jsii/jsii-calc/go/jsiicalc/v3/anonymous"
)
func TestConstructor(t *testing.T) {
defer expectPanic(t, "parameter unionProperty[0][\"bad\"] must be one of the allowed types: *Str... | 102 |
jsii | aws | Go | //go:build tools
// +build tools
// Package tools contains the necessary statements to ensure tool dependencies
// are not "cleaned up" by "go mod tidy" despite being used... The "// +"
// comment above makes sure the file is never included in an actual compiled
// unit (unless someone manually specifies the "build to... | 15 |
jsii | aws | Go | package addTen
import (
"github.com/aws/jsii-runtime-go"
calc "github.com/aws/jsii/jsii-calc/go/jsiicalc/v3"
"github.com/aws/jsii/jsii-calc/go/scopejsiicalclib"
)
func New(val *float64) calc.Add {
return calc.NewAdd(scopejsiicalclib.NewNumber(val), scopejsiicalclib.NewNumber(jsii.Number(10)))
}
| 12 |
jsii | aws | Go | package bellRinger
import "github.com/aws/jsii/jsii-calc/go/jsiicalc/v3"
func New() jsiicalc.IBellRinger {
return &ringer{}
}
type ringer struct{}
func (r *ringer) YourTurn(bell jsiicalc.IBell) {
bell.Ring()
}
| 14 |
jsii | aws | Go | package cdk16625
import (
"github.com/aws/jsii/jsii-calc/go/jsiicalc/v3"
abc "github.com/aws/jsii/jsii-calc/go/jsiicalc/v3/cdk16625"
)
func New() abc.Cdk16625 {
c := &cdk16625{}
abc.NewCdk16625_Override(c)
return c
}
type cdk16625 struct {
abc.Cdk16625
}
func (c *cdk16625) Unwrap(rng jsiicalc.IRandomNumberGen... | 21 |
jsii | aws | Go | package doNotOverridePrivates
import calc "github.com/aws/jsii/jsii-calc/go/jsiicalc/v3"
type DoNotOverridePrivates struct {
calc.DoNotOverridePrivates
}
func New() *DoNotOverridePrivates {
d := &DoNotOverridePrivates{}
calc.NewDoNotOverridePrivates_Override(d)
return d
}
func (d *DoNotOverridePrivates) Private... | 26 |
jsii | aws | Go | package friendlyRandom
import (
"github.com/aws/jsii-runtime-go"
"github.com/aws/jsii/jsii-calc/go/scopejsiicalclib"
)
type SubclassFriendlyRandom struct {
scopejsiicalclib.Number
next float64
}
func NewSubclass() *SubclassFriendlyRandom {
s := &SubclassFriendlyRandom{next: 100}
scopejsiicalclib.NewNumber_Over... | 44 |
jsii | aws | Go | package overrideAsyncMethods
import (
"github.com/aws/jsii-runtime-go"
"github.com/aws/jsii/jsii-calc/go/jsiicalc/v3"
)
type OverrideAsyncMethods struct {
jsiicalc.AsyncVirtualMethods
}
func New() *OverrideAsyncMethods {
o := &OverrideAsyncMethods{}
jsiicalc.NewAsyncVirtualMethods_Override(o)
return o
}
func ... | 35 |
jsii | aws | Go | package syncOverrides
import (
"github.com/aws/jsii-runtime-go"
"github.com/aws/jsii/go-runtime-test/internal/overrideAsyncMethods"
"github.com/aws/jsii/jsii-calc/go/jsiicalc/v3"
)
type SyncOverrides struct {
jsiicalc.SyncVirtualMethods
AnotherTheProperty *string
Multiplier int
ReturnSuper bool
... | 41 |
jsii | aws | Go | package twoOverrides
import (
"github.com/aws/jsii-runtime-go"
"github.com/aws/jsii/jsii-calc/go/jsiicalc/v3"
)
type TwoOverrides struct {
jsiicalc.AsyncVirtualMethods
}
func New() *TwoOverrides {
t := &TwoOverrides{}
jsiicalc.NewAsyncVirtualMethods_Override(t)
return t
}
func (t *TwoOverrides) OverrideMe(*fl... | 25 |
jsii | aws | Go | package wallClock
import (
"github.com/aws/jsii-runtime-go"
"github.com/aws/jsii/jsii-calc/go/jsiicalc/v3"
)
type WallClock struct {
nowAsISO string
}
func NewWallClock(nowAsISO string) *WallClock {
return &WallClock{nowAsISO}
}
func (w *WallClock) Iso8601Now() *string {
return jsii.String(w.nowAsISO)
}
type ... | 33 |
jsii | aws | Go | func foo(x *string, y *string, z *string) {
if y == nil {
y = jsii.String("hello")
}
fmt.Println(*x, *y, *z)
}
| 7 |
jsii | aws | Go | type struct_ struct {
x *string
y *string
}
func foo(s *struct_) {
fmt.Println(*s.x, *s.y)
}
| 8 |
jsii | aws | Go | callSomeFunction(jsii.Number(1), jsii.Number(2), jsii.Number(3))
| 2 |
jsii | aws | Go | foo(map[string][]map[string]*f64{
"list": []map[string]*f64{
map[string]*f64{
"a": jsii.Number(1),
"b": jsii.Number(2),
},
map[string]*f64{
"a": jsii.Number(3),
"b": jsii.Number(4),
},
},
})
| 13 |
jsii | aws | Go | func foo(xs map[string]*string) {
}
foo(map[string]*string{
"foo": jsii.String("bar"),
"schmoo": jsii.String("schmar"),
})
| 8 |
jsii | aws | Go | someObject.callSomeFunction(jsii.Number(1), jsii.Number(2), jsii.Number(3))
| 2 |
jsii | aws | Go | this.callSomeFunction(jsii.Number(25))
| 2 |
jsii | aws | Go | foo := "hello"
callFunction(map[string]*string{
"foo": jsii.String(foo),
})
| 5 |
jsii | aws | Go | someObject_CallSomeFunction(jsii.Number(1), jsii.Number(2), jsii.Number(3))
| 2 |
jsii | aws | Go | callSomeFunction(this, jsii.Number(25))
| 2 |
jsii | aws | Go | foo(jsii.Number(25), map[string]interface{}{
"foo": jsii.Number(3),
"banana": jsii.String("hello"),
})
| 5 |
jsii | aws | Go | foo(jsii.Number(25), map[string]interface{}{
"foo": jsii.Number(3),
"deeper": map[string]*f64{
"a": jsii.Number(1),
"b": jsii.Number(2),
},
})
| 8 |
jsii | aws | Go | foo(jsii.Number(25), map[string]interface{}{
"foo": jsii.Number(3),
"deeper": map[string]*f64{
"a": jsii.Number(1),
"b": jsii.Number(2),
},
})
| 8 |
jsii | aws | Go | foo(jsii.Number(25), map[string]interface{}{
"foo": jsii.Number(3),
"banana": jsii.String("hello"),
})
| 6 |
jsii | aws | Go | foo(jsii.Number(25), map[string]interface{}{
"foo": jsii.Number(3),
"banana": jsii.String("hello"),
})
| 5 |
jsii | aws | Go | type baseDeeperStruct struct {
a *f64
}
type deeperStruct struct {
baseDeeperStruct
b *f64
}
type outerStruct struct {
foo *f64
deeper *deeperStruct
}
func foo(x *f64, outer *outerStruct) {
}
foo(jsii.Number(25), &outerStruct{
Foo: jsii.Number(3),
Deeper: &deeperStruct{
A: jsii.Number(1),
B: jsii.Number(... | 25 |
jsii | aws | Go | type myClass struct {
x *string
}
func newMyClass(y *string) *myClass {
this := &myClass{}
this.x = y
return this
}
| 10 |
jsii | aws | Go | type myClass struct {
x *string
}
func newMyClass(y *string) *myClass {
this := &myClass{}
this.x = y
return this
}
| 10 |
jsii | aws | Go | type myClass struct {
}
func (this *myClass) resolve() interface{} {
return jsii.Number(42)
}
| 7 |
jsii | aws | Go | type otherName struct {
}
func newOtherName() *otherName {
this := &otherName{}
return this
}
| 8 |
jsii | aws | Go | type myClass struct {
SomeOtherClass
}
| 4 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.