Skip to content

Commit

Permalink
chore: add spdx license identifier to all go source code
Browse files Browse the repository at this point in the history
  • Loading branch information
yesudeep committed Feb 1, 2025
1 parent 1bc34d9 commit d85fb14
Show file tree
Hide file tree
Showing 120 changed files with 271 additions and 139 deletions.
2 changes: 2 additions & 0 deletions go/ai/document.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
// SPDX-License-Identifier: Apache-2.0

package ai

Expand Down
3 changes: 2 additions & 1 deletion go/ai/document_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

//
// SPDX-License-Identifier: Apache-2.0
package ai

import (
Expand Down
3 changes: 2 additions & 1 deletion go/ai/embedder.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

//
// SPDX-License-Identifier: Apache-2.0
package ai

import (
Expand Down
3 changes: 2 additions & 1 deletion go/ai/gen.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

//
// SPDX-License-Identifier: Apache-2.0
// This file was generated by jsonschemagen. DO NOT EDIT.

package ai
Expand Down
3 changes: 2 additions & 1 deletion go/ai/generate.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

//
// SPDX-License-Identifier: Apache-2.0
package ai

import (
Expand Down
3 changes: 2 additions & 1 deletion go/ai/generator_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

//
// SPDX-License-Identifier: Apache-2.0
package ai

import (
Expand Down
3 changes: 2 additions & 1 deletion go/ai/prompt.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

//
// SPDX-License-Identifier: Apache-2.0
package ai

import (
Expand Down
3 changes: 2 additions & 1 deletion go/ai/request_helpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

//
// SPDX-License-Identifier: Apache-2.0
package ai

// NewModelRequest create a new ModelRequest with provided config and
Expand Down
3 changes: 2 additions & 1 deletion go/ai/retriever.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

//
// SPDX-License-Identifier: Apache-2.0
package ai

import (
Expand Down
3 changes: 2 additions & 1 deletion go/ai/tools.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

//
// SPDX-License-Identifier: Apache-2.0
package ai

import (
Expand Down
3 changes: 2 additions & 1 deletion go/core/action.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

//
// SPDX-License-Identifier: Apache-2.0
package core

import (
Expand Down
3 changes: 2 additions & 1 deletion go/core/action_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

//
// SPDX-License-Identifier: Apache-2.0
package core

import (
Expand Down
4 changes: 3 additions & 1 deletion go/core/core.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,9 @@
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

//
// SPDX-License-Identifier: Apache-2.0
//
// Run the npm script that generates JSON Schemas from the zod types
// in the *.ts files. It writes the result to genkit-tools/genkit-schema.json
//go:generate npm --prefix ../../genkit-tools run export:schemas
Expand Down
3 changes: 2 additions & 1 deletion go/core/file_flow_state_store.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

//
// SPDX-License-Identifier: Apache-2.0
package core

import (
Expand Down
3 changes: 2 additions & 1 deletion go/core/flow_state_store.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

//
// SPDX-License-Identifier: Apache-2.0
package core

import (
Expand Down
28 changes: 15 additions & 13 deletions go/core/logger/logger.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,16 @@
// 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
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

//
// SPDX-License-Identifier: Apache-2.0
//
// Package logger provides a context-scoped slog.Logger.
package logger

Expand All @@ -25,27 +27,27 @@ import (
)

var (
logLevel = slog.LevelDebug
mu sync.RWMutex
logLevel = slog.LevelDebug
mu sync.RWMutex
loggerKey = base.NewContextKey[*slog.Logger]()
)

// SetLevel sets the global log level
func SetLevel(level slog.Level) {
mu.Lock()
defer mu.Unlock()
logLevel = level
mu.Lock()
defer mu.Unlock()
logLevel = level
h := slog.New(slog.NewTextHandler(os.Stderr, &slog.HandlerOptions{
Level: logLevel,
}))
slog.SetDefault(h)
Level: logLevel,
}))
slog.SetDefault(h)
}

// GetLevel gets the current global log level
func GetLevel() slog.Level {
mu.RLock()
defer mu.RUnlock()
return logLevel
mu.RLock()
defer mu.RUnlock()
return logLevel
}

// FromContext returns the Logger in ctx, or the default Logger
Expand Down
6 changes: 4 additions & 2 deletions go/core/tracing/milliseconds.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,16 @@
// 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
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

//
// SPDX-License-Identifier: Apache-2.0
//
// Package gtime provides time functionality for Go Genkit.
package tracing

Expand Down
3 changes: 2 additions & 1 deletion go/core/tracing/milliseconds_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

//
// SPDX-License-Identifier: Apache-2.0
package tracing

import (
Expand Down
3 changes: 2 additions & 1 deletion go/core/tracing/store.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

//
// SPDX-License-Identifier: Apache-2.0
package tracing

// Data is information about a trace.
Expand Down
3 changes: 2 additions & 1 deletion go/core/tracing/store_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

//
// SPDX-License-Identifier: Apache-2.0
package tracing

import (
Expand Down
3 changes: 2 additions & 1 deletion go/core/tracing/telemetry.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

//
// SPDX-License-Identifier: Apache-2.0
package tracing

import (
Expand Down
3 changes: 2 additions & 1 deletion go/core/tracing/trace_server_exporter.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

//
// SPDX-License-Identifier: Apache-2.0
package tracing

import (
Expand Down
3 changes: 2 additions & 1 deletion go/core/tracing/trace_server_exporter_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

//
// SPDX-License-Identifier: Apache-2.0
package tracing

import (
Expand Down
6 changes: 4 additions & 2 deletions go/core/tracing/tracing.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,16 @@
// 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
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

//
// SPDX-License-Identifier: Apache-2.0
//
// The tracing package provides support for execution traces.
package tracing

Expand Down
3 changes: 2 additions & 1 deletion go/core/tracing/tracing_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

//
// SPDX-License-Identifier: Apache-2.0
package tracing

import (
Expand Down
3 changes: 2 additions & 1 deletion go/genkit/conformance_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

//
// SPDX-License-Identifier: Apache-2.0
package genkit

import (
Expand Down
3 changes: 2 additions & 1 deletion go/genkit/flow.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

//
// SPDX-License-Identifier: Apache-2.0
package genkit

import (
Expand Down
3 changes: 2 additions & 1 deletion go/genkit/flow_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

//
// SPDX-License-Identifier: Apache-2.0
package genkit

import (
Expand Down
3 changes: 2 additions & 1 deletion go/genkit/gen.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

//
// SPDX-License-Identifier: Apache-2.0
// This file was generated by jsonschemagen. DO NOT EDIT.

package genkit
Expand Down
6 changes: 4 additions & 2 deletions go/genkit/genkit.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,16 @@
// 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
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

//
// SPDX-License-Identifier: Apache-2.0
//
// Package genkit provides Genkit functionality for application developers.
package genkit

Expand Down
3 changes: 2 additions & 1 deletion go/genkit/genkit_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

//
// SPDX-License-Identifier: Apache-2.0
package genkit

import (
Expand Down
4 changes: 3 additions & 1 deletion go/genkit/servers.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,9 @@
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

//
// SPDX-License-Identifier: Apache-2.0
//
// This file implements production and development servers.
//
// The genkit CLI sends requests to the development server.
Expand Down
Loading

0 comments on commit d85fb14

Please sign in to comment.