Skip to content

Commit

Permalink
Rename packages into xebia org
Browse files Browse the repository at this point in the history
  • Loading branch information
kubilaykarpat committed May 14, 2024
1 parent 235fb81 commit b4d46c8
Show file tree
Hide file tree
Showing 47 changed files with 99 additions and 91 deletions.
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
This training on the go programming language describes go the from ground up using lots of examples.
Most examples can be run and edited from within the presentation.

The interactive presentation can be viewed using the "present"-tool. Find more instruction [here](https://github.com/MarcGrol/go-training/blob/master/goPresent.md).
The interactive presentation can be viewed using the "present"-tool.
Find more instruction [here](https://github.com/xebia/go-training/blob/master/goPresent.md).

## Preparation

Expand All @@ -17,7 +18,7 @@ Have golang installed

## Getting the training material on your laptop

git clone https://github.com/MarcGrol/go-training.git
git clone https://github.com/xebia/go-training.git


Source-code of all the examples, exercises and solutions will end up in the just cloned directory tree:
Expand Down
8 changes: 4 additions & 4 deletions examples/debugging/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@ To run:

goos: darwin
goarch: amd64
pkg: github.com/MarcGrol/go-training/examples/debugging
pkg: github.com/xebia/go-training/examples/debugging
BenchmarkMyHandler-8 100000 13946 ns/op
PASS
ok github.com/MarcGrol/go-training/examples/debugging 1.557s
ok github.com/xebia/go-training/examples/debugging 1.557s

## Make your fix

Expand All @@ -26,10 +26,10 @@ Do not recreate regexp upon each request

goos: darwin
goarch: amd64
pkg: github.com/MarcGrol/go-training/examples/debugging
pkg: github.com/xebia/go-training/examples/debugging
BenchmarkMyHandler-8 500000 2699 ns/op
PASS
ok github.com/MarcGrol/go-training/examples/debugging 1.394s
ok github.com/xebia/go-training/examples/debugging 1.394s

# Has improved enough?

Expand Down
2 changes: 1 addition & 1 deletion examples/functionsAsParams/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package main
import (
"log"

"github.com/MarcGrol/go-training/examples/functionsAsParams/rigidFramework"
"github.com/xebia/go-training/examples/functionsAsParams/rigidFramework"
)

// START OMIT
Expand Down
2 changes: 1 addition & 1 deletion examples/gomodexperiment/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ see also https://blog.golang.org/using-go-modules

## Create a go module

go mod init github.com/MarcGrol/gomodexperiment # Outside GOPATH so need to tell complete import path
go mod init github.com/xebia/gomodexperiment # Outside GOPATH so need to tell complete import path

We encounter a new file: go.mod
This file should be committed together with your source-code
Expand Down
2 changes: 1 addition & 1 deletion examples/grpc/notification/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ explained here: https://github.com/grpc-ecosystem/grpc-gateway

go get -u github.com/golang/protobuf/protoc-gen-go

cd ${GOPATH}/github.com/MarcGrol/go-training/examples/grpc
cd ${GOPATH}/github.com/xebia/go-training/examples/grpc
go generate ./...
go install ./...

Expand Down
2 changes: 1 addition & 1 deletion examples/grpc/notification/notificationclient/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
"log"
"time"

"github.com/MarcGrol/go-training/examples/grpc/notification/notificationapi"
"github.com/xebia/go-training/examples/grpc/notification/notificationapi"
)

const (
Expand Down
2 changes: 1 addition & 1 deletion examples/grpc/notification/notificationserver/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ import (
"net"
"strings"

pb "github.com/MarcGrol/go-training/examples/grpc/notification/notificationapi"
"github.com/google/uuid"
pb "github.com/xebia/go-training/examples/grpc/notification/notificationapi"
"google.golang.org/grpc"
"google.golang.org/grpc/codes"
"google.golang.org/grpc/status"
Expand Down
2 changes: 1 addition & 1 deletion examples/grpc/notification/notificationserverproxy/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package main
import (
"log"

_ "github.com/MarcGrol/go-training/examples/grpc/notification/notificationapi"
_ "github.com/xebia/go-training/examples/grpc/notification/notificationapi"
)

func main() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ import (
"log"
"net/http"

pb "github.com/MarcGrol/go-training/examples/grpc/notification/notificationapi"
"github.com/grpc-ecosystem/grpc-gateway/runtime"
pb "github.com/xebia/go-training/examples/grpc/notification/notificationapi"
)

type server struct {
Expand Down
2 changes: 1 addition & 1 deletion examples/grpc/streaming/flightinfoclient/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (
"log"
"time"

pb "github.com/MarcGrol/go-training/examples/grpc/streaming/flightinfoapi"
pb "github.com/xebia/go-training/examples/grpc/streaming/flightinfoapi"
)

func main() {
Expand Down
2 changes: 1 addition & 1 deletion examples/grpc/streaming/flightinfoserver/flightsStore.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package main
import (
"sync"

pb "github.com/MarcGrol/go-training/examples/grpc/streaming/flightinfoapi"
pb "github.com/xebia/go-training/examples/grpc/streaming/flightinfoapi"
)

type flightStore struct {
Expand Down
2 changes: 1 addition & 1 deletion examples/grpc/streaming/flightinfoserver/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package main
import (
"log"

pb "github.com/MarcGrol/go-training/examples/grpc/streaming/flightinfoapi"
pb "github.com/xebia/go-training/examples/grpc/streaming/flightinfoapi"
)

func main() {
Expand Down
2 changes: 1 addition & 1 deletion examples/grpc/streaming/flightinfoserver/producer.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ import (
"log"
"time"

pb "github.com/MarcGrol/go-training/examples/grpc/streaming/flightinfoapi"
"github.com/google/uuid"
pb "github.com/xebia/go-training/examples/grpc/streaming/flightinfoapi"
)

func simulateProductionOfFlightsInBackground(flightStore *flightStore, sessionStore *sessionStore) {
Expand Down
2 changes: 1 addition & 1 deletion examples/grpc/streaming/flightinfoserver/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (

"github.com/google/uuid"

pb "github.com/MarcGrol/go-training/examples/grpc/streaming/flightinfoapi"
pb "github.com/xebia/go-training/examples/grpc/streaming/flightinfoapi"
"google.golang.org/grpc"
)

Expand Down
2 changes: 1 addition & 1 deletion examples/grpc/streaming/flightinfoserver/session.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (

"github.com/google/uuid"

pb "github.com/MarcGrol/go-training/examples/grpc/streaming/flightinfoapi"
pb "github.com/xebia/go-training/examples/grpc/streaming/flightinfoapi"
)

const (
Expand Down
5 changes: 3 additions & 2 deletions examples/interfaces/main.go
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
package main

import (
"github.com/MarcGrol/go-training/examples/interfaces/datastore"
"github.com/MarcGrol/go-training/examples/interfaces/patient"
"log"

"github.com/xebia/go-training/examples/interfaces/datastore"
"github.com/xebia/go-training/examples/interfaces/patient"
)

// START OMIT
Expand Down
3 changes: 2 additions & 1 deletion examples/interfaces/patient/patient.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@ package patient

import (
"fmt"
"github.com/MarcGrol/go-training/examples/interfaces/datastore"

"github.com/xebia/go-training/examples/interfaces/datastore"
)

type Patient struct {
Expand Down
3 changes: 2 additions & 1 deletion examples/registrationServiceGrpc/client/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,11 @@ import (
"context"
"flag"
"fmt"
"github.com/MarcGrol/go-training/examples/registrationServiceGrpc/regprotobuf"
"log"
"os"
"time"

"github.com/xebia/go-training/examples/registrationServiceGrpc/regprotobuf"
)

func main() {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
package datastoring

import (
"github.com/MarcGrol/go-training/examples/registrationServiceGrpc/lib/api/datastorer"
"sync"

"github.com/xebia/go-training/examples/registrationServiceGrpc/lib/api/datastorer"
)

type inMemoryPatientStore struct {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ import (
"net/http"
"os"

"github.com/MarcGrol/go-training/examples/registrationServiceGrpc/lib/api/emailsender"
"github.com/sendgrid/sendgrid-go"
"github.com/sendgrid/sendgrid-go/helpers/mail"
"github.com/xebia/go-training/examples/registrationServiceGrpc/lib/api/emailsender"
)

type sendgridEmailSender struct {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"math/rand"
"time"

"github.com/MarcGrol/go-training/examples/registrationServiceGrpc/lib/api/pincoder"
"github.com/xebia/go-training/examples/registrationServiceGrpc/lib/api/pincoder"
)

func init() {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package uuiding

import (
"github.com/MarcGrol/go-training/examples/registrationServiceGrpc/lib/api/uuider"
"github.com/google/uuid"
"github.com/xebia/go-training/examples/registrationServiceGrpc/lib/api/uuider"
)

type basicuuider struct{}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ syntax = "proto3";

package regprotobuf;

option go_package = "github.com/MarcGrol/go-training/examples/registrationServiceGrpc/regprotobuf";
option go_package = "github.com/xebia/go-training/examples/registrationServiceGrpc/regprotobuf";

service RegistrationService {
rpc RegisterPatient (RegisterPatientRequest) returns (RegisterPatientResponse) {}
Expand Down
10 changes: 5 additions & 5 deletions examples/registrationServiceGrpc/service/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@ package main
import (
"log"

"github.com/MarcGrol/go-training/examples/registrationServiceGrpc/lib/impl/datastoring"
"github.com/MarcGrol/go-training/examples/registrationServiceGrpc/lib/impl/emailsending"
"github.com/MarcGrol/go-training/examples/registrationServiceGrpc/lib/impl/pincoding"
"github.com/MarcGrol/go-training/examples/registrationServiceGrpc/lib/impl/uuiding"
"github.com/MarcGrol/go-training/examples/registrationServiceGrpc/regprotobuf"
"github.com/xebia/go-training/examples/registrationServiceGrpc/lib/impl/datastoring"
"github.com/xebia/go-training/examples/registrationServiceGrpc/lib/impl/emailsending"
"github.com/xebia/go-training/examples/registrationServiceGrpc/lib/impl/pincoding"
"github.com/xebia/go-training/examples/registrationServiceGrpc/lib/impl/uuiding"
"github.com/xebia/go-training/examples/registrationServiceGrpc/regprotobuf"
)

func main() {
Expand Down
10 changes: 5 additions & 5 deletions examples/registrationServiceGrpc/service/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@ import (
"google.golang.org/grpc/codes"
"google.golang.org/grpc/status"

"github.com/MarcGrol/go-training/examples/registrationServiceGrpc/lib/api/datastorer"
"github.com/MarcGrol/go-training/examples/registrationServiceGrpc/lib/api/emailsender"
"github.com/MarcGrol/go-training/examples/registrationServiceGrpc/lib/api/pincoder"
"github.com/MarcGrol/go-training/examples/registrationServiceGrpc/lib/api/uuider"
"github.com/MarcGrol/go-training/examples/registrationServiceGrpc/regprotobuf"
"github.com/xebia/go-training/examples/registrationServiceGrpc/lib/api/datastorer"
"github.com/xebia/go-training/examples/registrationServiceGrpc/lib/api/emailsender"
"github.com/xebia/go-training/examples/registrationServiceGrpc/lib/api/pincoder"
"github.com/xebia/go-training/examples/registrationServiceGrpc/lib/api/uuider"
"github.com/xebia/go-training/examples/registrationServiceGrpc/regprotobuf"
)

const (
Expand Down
12 changes: 5 additions & 7 deletions examples/registrationServiceGrpc/service/service_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,13 @@ import (
"github.com/golang/mock/gomock"
"github.com/stretchr/testify/assert"

"github.com/MarcGrol/go-training/examples/registrationServiceGrpc/lib/api/datastorer"
"github.com/MarcGrol/go-training/examples/registrationServiceGrpc/lib/api/emailsender"
"github.com/MarcGrol/go-training/examples/registrationServiceGrpc/lib/api/pincoder"
"github.com/MarcGrol/go-training/examples/registrationServiceGrpc/lib/api/uuider"
"github.com/MarcGrol/go-training/examples/registrationServiceGrpc/regprotobuf"

"github.com/xebia/go-training/examples/registrationServiceGrpc/lib/api/datastorer"
"github.com/xebia/go-training/examples/registrationServiceGrpc/lib/api/emailsender"
"github.com/xebia/go-training/examples/registrationServiceGrpc/lib/api/pincoder"
"github.com/xebia/go-training/examples/registrationServiceGrpc/lib/api/uuider"
"github.com/xebia/go-training/examples/registrationServiceGrpc/regprotobuf"
)


func TestRegistrationWithEmail(t *testing.T) {
ctrl, uuidGenerator, mockStorer, mockPincoder, emailsender := setupDependencies(t)
defer ctrl.Finish()
Expand Down
14 changes: 7 additions & 7 deletions go-training.slide
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,7 @@ No output means something's missing!
$ cd ${HOME} # on unix/mac
$ cd /d %USERPROFILE% # on windows

$ git clone https://github.com/MarcGrol/go-training.git
$ git clone https://github.com/xebia/go-training.git

Everything will end up in go-training:

Expand Down Expand Up @@ -1675,7 +1675,7 @@ Tasks:
- A module is a tree of go packages, versioned as a whole
- "go.mod"-file in its root stores module-name and dependencies

module github.com/MarcGrol/my-example
module github.com/xebia/my-example

go 1.18

Expand All @@ -1687,7 +1687,7 @@ Tasks:

Real-life example:

github.com/MarcGrol/go-training/go.mod
github.com/xebia/go-training/go.mod

#----------------------------------------------
* Major version upgrade
Expand Down Expand Up @@ -1775,7 +1775,7 @@ Tasks:

- Create a go module

# go mod init github.com/MarcGrol/myuuid
# go mod init github.com/xebia/myuuid
# go mod tidy

#----------------------------------------------
Expand Down Expand Up @@ -2290,11 +2290,11 @@ We'll reconvene in 15 minutes
Implement the plan!

We've prepared a separate repository here:
.link https://github.com/MarcGrol/patientregistration
.link https://github.com/xebia/go-exercise

Checkout the project on your laptop

$ git clone https://github.com/MarcGrol/patientregistration.git
$ git clone https://github.com/xebia/go-exercise.git
$ cd patientregistration
$ go install ./...

Expand Down Expand Up @@ -2438,7 +2438,7 @@ TODO
generates cyclist_slice.go with "SortBy"- and "Where"-methods on CyclistSlice
- Just commit and distribute with your package

.link https://github.com/MarcGrol/go-training/blob/master/examples/generate/cyclist_slice.go cyclist_slice.go
.link https://github.com/xebia/go-training/blob/master/examples/generate/cyclist_slice.go cyclist_slice.go
#----------------------------------------------


Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module github.com/MarcGrol/go-training
module github.com/xebia/go-training

go 1.22

Expand Down
6 changes: 3 additions & 3 deletions goPresent.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@ Use the "present"-tool to "run" the presentation.
$ go get golang.org/x/tools/cmd/present
# present binary should now be in ${HOME}/go/bin

## Step 2 - Fetch the presentation from github
## Step 2 - Fetch the presentation from GitHub

git clone https://github.com/MarcGrol/go-training.git
# presention is located in ${GOPATH}/github.com/MarcGrol/go-training
git clone https://github.com/xebia/go-training.git
# presention is located in ${GOPATH}/github.com/xebia/go-training

## Step 3 - Start presentation within the go-training directory

Expand Down
2 changes: 1 addition & 1 deletion solutions/concurrency/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"fmt"
"time"

"github.com/MarcGrol/go-training/examples/slowapi"
"github.com/xebia/go-training/examples/slowapi"
)

func generator(numTasks int) <-chan int {
Expand Down
Loading

0 comments on commit b4d46c8

Please sign in to comment.