Skip to content

Commit

Permalink
chore: add copyright headers
Browse files Browse the repository at this point in the history
  • Loading branch information
avtakkar committed Mar 8, 2024
1 parent 66f0ed2 commit 77365f8
Show file tree
Hide file tree
Showing 87 changed files with 171 additions and 0 deletions.
5 changes: 5 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,11 @@ swag: ## Generates the swagger documentation of the p2p server.
@echo "+ $@"
cd $(ROOT_DIR)/internal/handlers; swag init --ot go,yaml -o $(ROOT_DIR)/api -g ./root.go

.PHONY: add-copyright
add-copyright: ## Add the copyright header to all Go files.
@echo "+ $@"
find . -type f -name "*.go" -exec sh -c 'grep -q -F "// Copyright (c) Microsoft Corporation." "$0" || sed -i "1i\\// Copyright (c) Microsoft Corporation.\\n// Licensed under the Apache License, Version 2.0." "$0"' {} \;

define HEADER

_____ _
Expand Down
2 changes: 2 additions & 0 deletions api/docs.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the Apache License, Version 2.0.
// Package api Code generated by swaggo/swag. DO NOT EDIT
package api

Expand Down
Empty file modified build/ci/scripts/install-deps.sh
100644 → 100755
Empty file.
Empty file modified build/ci/scripts/kind.sh
100644 → 100755
Empty file.
2 changes: 2 additions & 0 deletions cmd/proxy/cmd.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the Apache License, Version 2.0.
package main

type ServerCmd struct {
Expand Down
2 changes: 2 additions & 0 deletions cmd/proxy/main.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the Apache License, Version 2.0.
package main

import (
Expand Down
2 changes: 2 additions & 0 deletions internal/cache/syncmap.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the Apache License, Version 2.0.
package cache

import (
Expand Down
2 changes: 2 additions & 0 deletions internal/cache/syncmap_test.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the Apache License, Version 2.0.
package cache

import (
Expand Down
2 changes: 2 additions & 0 deletions internal/containerd/mirror.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the Apache License, Version 2.0.
package containerd

import (
Expand Down
2 changes: 2 additions & 0 deletions internal/containerd/mirror_test.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the Apache License, Version 2.0.
package containerd

import (
Expand Down
2 changes: 2 additions & 0 deletions internal/context/context.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the Apache License, Version 2.0.
package context

import (
Expand Down
2 changes: 2 additions & 0 deletions internal/context/context_test.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the Apache License, Version 2.0.
package context

import (
Expand Down
2 changes: 2 additions & 0 deletions internal/files/cache/cache.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the Apache License, Version 2.0.
package cache

import (
Expand Down
2 changes: 2 additions & 0 deletions internal/files/cache/cache_test.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the Apache License, Version 2.0.
package cache

import (
Expand Down
2 changes: 2 additions & 0 deletions internal/files/cache/interface.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the Apache License, Version 2.0.
package cache

// Cache describes the cache of files.
Expand Down
2 changes: 2 additions & 0 deletions internal/files/cache/item.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the Apache License, Version 2.0.
package cache

import (
Expand Down
2 changes: 2 additions & 0 deletions internal/files/cache/item_test.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the Apache License, Version 2.0.
package cache

import (
Expand Down
2 changes: 2 additions & 0 deletions internal/files/cache/main_test.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the Apache License, Version 2.0.
package cache

import (
Expand Down
2 changes: 2 additions & 0 deletions internal/files/files.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the Apache License, Version 2.0.
package files

import (
Expand Down
2 changes: 2 additions & 0 deletions internal/files/files_test.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the Apache License, Version 2.0.
package files

import (
Expand Down
2 changes: 2 additions & 0 deletions internal/files/store/file.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the Apache License, Version 2.0.
package store

import (
Expand Down
2 changes: 2 additions & 0 deletions internal/files/store/file_test.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the Apache License, Version 2.0.
package store

import (
Expand Down
2 changes: 2 additions & 0 deletions internal/files/store/interface.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the Apache License, Version 2.0.
package store

import (
Expand Down
2 changes: 2 additions & 0 deletions internal/files/store/main_test.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the Apache License, Version 2.0.
package store

import (
Expand Down
2 changes: 2 additions & 0 deletions internal/files/store/mockstore.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the Apache License, Version 2.0.
package store

import (
Expand Down
2 changes: 2 additions & 0 deletions internal/files/store/store.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the Apache License, Version 2.0.
package store

import (
Expand Down
2 changes: 2 additions & 0 deletions internal/files/store/store_test.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the Apache License, Version 2.0.
package store

import (
Expand Down
2 changes: 2 additions & 0 deletions internal/handlers/files/handler.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the Apache License, Version 2.0.
package handlers

import (
Expand Down
2 changes: 2 additions & 0 deletions internal/handlers/files/handler_test.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the Apache License, Version 2.0.
package handlers

import (
Expand Down
2 changes: 2 additions & 0 deletions internal/handlers/files/main_test.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the Apache License, Version 2.0.
package handlers

import (
Expand Down
2 changes: 2 additions & 0 deletions internal/handlers/root.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the Apache License, Version 2.0.
package handlers

import (
Expand Down
2 changes: 2 additions & 0 deletions internal/handlers/v2/handler.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the Apache License, Version 2.0.
package handlers

import (
Expand Down
2 changes: 2 additions & 0 deletions internal/k8s/events/events.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the Apache License, Version 2.0.
package events

import (
Expand Down
2 changes: 2 additions & 0 deletions internal/k8s/events/events_test.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the Apache License, Version 2.0.
package events

import (
Expand Down
2 changes: 2 additions & 0 deletions internal/k8s/events/interface.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the Apache License, Version 2.0.
package events

// EventRecorder can be used to record various event.
Expand Down
2 changes: 2 additions & 0 deletions internal/math/math.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the Apache License, Version 2.0.
package math

import (
Expand Down
2 changes: 2 additions & 0 deletions internal/math/math_test.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the Apache License, Version 2.0.
package math

import "testing"
Expand Down
2 changes: 2 additions & 0 deletions internal/math/reverse.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the Apache License, Version 2.0.
package math

import "sort"
Expand Down
2 changes: 2 additions & 0 deletions internal/math/reverse_test.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the Apache License, Version 2.0.
package math

import (
Expand Down
2 changes: 2 additions & 0 deletions internal/metrics/interface.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the Apache License, Version 2.0.
package metrics

// Metrics defines an interface to collect p2p metrics.
Expand Down
2 changes: 2 additions & 0 deletions internal/metrics/main_test.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the Apache License, Version 2.0.
package metrics

import (
Expand Down
2 changes: 2 additions & 0 deletions internal/metrics/memory.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the Apache License, Version 2.0.
package metrics

import (
Expand Down
2 changes: 2 additions & 0 deletions internal/metrics/memory_test.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the Apache License, Version 2.0.
package metrics

import (
Expand Down
2 changes: 2 additions & 0 deletions internal/oci/distribution/v2.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the Apache License, Version 2.0.
package distribution

import (
Expand Down
2 changes: 2 additions & 0 deletions internal/oci/distribution/v2_test.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the Apache License, Version 2.0.
package distribution

import (
Expand Down
2 changes: 2 additions & 0 deletions internal/oci/mirror.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the Apache License, Version 2.0.
package oci

import (
Expand Down
2 changes: 2 additions & 0 deletions internal/oci/mirror_test.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the Apache License, Version 2.0.
package oci

import (
Expand Down
2 changes: 2 additions & 0 deletions internal/oci/registry.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the Apache License, Version 2.0.
package oci

import (
Expand Down
2 changes: 2 additions & 0 deletions internal/oci/store/tests/mock.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the Apache License, Version 2.0.
package tests

import (
Expand Down
2 changes: 2 additions & 0 deletions internal/remote/interface.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the Apache License, Version 2.0.
package remote

import (
Expand Down
2 changes: 2 additions & 0 deletions internal/remote/reader.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the Apache License, Version 2.0.
package remote

import (
Expand Down
2 changes: 2 additions & 0 deletions internal/remote/reader_test.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the Apache License, Version 2.0.
package remote

import (
Expand Down
2 changes: 2 additions & 0 deletions internal/remote/tests/mockreader.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the Apache License, Version 2.0.
package tests

import (
Expand Down
2 changes: 2 additions & 0 deletions internal/routing/interface.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the Apache License, Version 2.0.
package routing

import (
Expand Down
2 changes: 2 additions & 0 deletions internal/routing/router.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the Apache License, Version 2.0.
package routing

import (
Expand Down
2 changes: 2 additions & 0 deletions internal/routing/router_test.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the Apache License, Version 2.0.
package routing

import (
Expand Down
2 changes: 2 additions & 0 deletions internal/routing/tests/mock.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the Apache License, Version 2.0.
package tests

import (
Expand Down
2 changes: 2 additions & 0 deletions internal/state/state.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the Apache License, Version 2.0.
package state

import (
Expand Down
2 changes: 2 additions & 0 deletions internal/state/state_test.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the Apache License, Version 2.0.
package state

import (
Expand Down
2 changes: 2 additions & 0 deletions pkg/containerd/reference.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the Apache License, Version 2.0.
package containerd

import (
Expand Down
2 changes: 2 additions & 0 deletions pkg/containerd/reference_test.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the Apache License, Version 2.0.
package containerd

import (
Expand Down
2 changes: 2 additions & 0 deletions pkg/containerd/store.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the Apache License, Version 2.0.
package containerd

import (
Expand Down
2 changes: 2 additions & 0 deletions pkg/containerd/store_test.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the Apache License, Version 2.0.
package containerd

import (
Expand Down
2 changes: 2 additions & 0 deletions pkg/k8s/election/election.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the Apache License, Version 2.0.
package election

import (
Expand Down
2 changes: 2 additions & 0 deletions pkg/k8s/election/election_test.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the Apache License, Version 2.0.
package election

import (
Expand Down
2 changes: 2 additions & 0 deletions pkg/k8s/k8s.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the Apache License, Version 2.0.
package k8s

import (
Expand Down
2 changes: 2 additions & 0 deletions pkg/k8s/k8s_test.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the Apache License, Version 2.0.
package k8s

import (
Expand Down
Loading

0 comments on commit 77365f8

Please sign in to comment.