• Stars
    star
    1,150
  • Rank 39,608 (Top 0.8 %)
  • Language
    Go
  • License
    MIT License
  • Created almost 7 years ago
  • Updated over 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

πŸ§™ High-performance PHP-to-Golang IPC/RPC bridge

High-performance PHP-to-Golang IPC bridge

GoDoc Linux macOS Windows Linters Go Report Card Codecov

PHPClasses Innovation Award

Goridge is high performance PHP-to-Golang codec library which works over native PHP sockets and Golang net/rpc package. The library allows you to call Go service methods from PHP with a minimal footprint, structures and []byte support.
PHP source code can be found in this repository: goridge-php


See https://github.com/roadrunner-server/roadrunner - High-performance PHP application server, load-balancer and process manager written in Golang

Features

  • no external dependencies or services, drop-in (64bit PHP version required)
  • low message footprint (12 bytes over any binary payload), binary error detection
  • CRC32 header verification
  • sockets over TCP or Unix (ext-sockets is required), standard pipes
  • very fast (300k calls per second on Ryzen 1700X over 20 threads)
  • native net/rpc integration, ability to connect to existed application(s)
  • standalone protocol usage
  • structured data transfer using json
  • []byte transfer, including big payloads
  • service, message and transport level error handling
  • hackable
  • works on Windows
  • unix sockets powered (also on Windows)

Installation

GO111MODULE=on go get github.com/roadrunner-server/goridge/v3

Sample of usage

package main

import (
	"fmt"
	"net"
	"net/rpc"

	goridgeRpc "github.com/roadrunner-server/goridge/v3/pkg/rpc"
)

type App struct{}

func (s *App) Hi(name string, r *string) error {
	*r = fmt.Sprintf("Hello, %s!", name)
	return nil
}

func main() {
	ln, err := net.Listen("tcp", ":6001")
	if err != nil {
		panic(err)
	}

	_ = rpc.Register(new(App))

	for {
		conn, err := ln.Accept()
		if err != nil {
			continue
		}
		_ = conn
		go rpc.ServeCodec(goridgeRpc.NewCodec(conn))
	}
}

License

The MIT License (MIT). Please see LICENSE for more information.

More Repositories

1

roadrunner

🀯 High-performance PHP application server, process manager written in Go and powered with plugins
Go
7,073
star
2

endure

⚑ Fault-tolerant service container for Golang applications
Go
38
star
3

roadrunner-plugins

πŸ“¦ Home for the roadrunner plugins
Go
25
star
4

roadrunner-docs

RoadRunner application server documentation (automatic sync to the website).
24
star
5

birddog

Birddog is a free tool for monitoring workers, services and jobs of a RoadRunner instance.
PHP
18
star
6

velox

🧱 Automated build system for the RR with custom plugins.
Go
13
star
7

kafka

RoadRunner Kafka driver for the Jobs plugin
Go
7
star
8

api

πŸ”Œ RoadRunner API, powered with protobuf. Contains plugins interfaces and proto api.
Go
7
star
9

rr-e2e-tests

Roadrunner end-to-end tests dashboard
4
star
10

http

HTTP(1, 2)/TLS/fCGI plugin
Go
3
star
11

errors

Golang SpiralScout errors package, fully compatible with the standard errors. Include stacktrace and operations.
Go
3
star
12

metrics

RR metrics plugin
Go
3
star
13

grpc

RRv2 gRPC plugin
Go
3
star
14

jobs

RRv2 jobs plugin
Go
3
star
15

kv

RRv2 KV (key-value) plugin
Go
3
star
16

logger

RR logger plugin
Go
3
star
17

proxy_ip_parser

X-Forwarded-*, Forwarded, True-Client-IP, X-Real-Ip parser http middleware
Go
3
star
18

roadrunner-rs

[WIP] RoadRunnen in RUST
Rust
3
star
19

samples

RR2 plugins samples
Go
3
star
20

rpc

RRv2 RPC plugin
Go
3
star
21

sdk

πŸ€– RoadRunner Go SDK. Contains worker, pool, queues and other utilities and core RR features.
Go
3
star
22

prometheus

RRv2 prometheus metrics HTTP middleware
Go
3
star
23

goridge-rs

Goridge protocol written in Rust
Rust
2
star
24

beanstalk

Beanstalk plugin for the RRv2
Go
2
star
25

boltdb

RRv2 BoltDB plugin
Go
2
star
26

amqp

AMQP-0-9-1 protocol drivers (RabbitMQ)
Go
2
star
27

new_relic

RRv2 NewRelic HTTP middleware
Go
2
star
28

websockets

RRv2 websockets HTTP middleware
Go
2
star
29

memcached

RRv2 memcached plugin
Go
2
star
30

plugin_template

RR plugin template.
Go
2
star
31

tcp

RRv2 TCP plugin
Go
2
star
32

redis

RRv2 Redis plugin
Go
2
star
33

service

RRv2 service plugin
Go
2
star
34

tcplisten

🌍 Package tcplisten provides a customizable TCP net.Listener with various performance-related options
Go
2
star
35

send

RRv2 HTTP X-Sendfile middleware
Go
2
star
36

headers

RRv2 Headers HTTP middleware
Go
2
star
37

reload

RRv2 reload plugin
Go
2
star
38

config

RRv2 configuration parser
Go
2
star
39

memory

RRv2 memory plugin
Go
2
star
40

nats

RRv2 NATS plugin
Go
2
star
41

otel

OpenTelemetry HTTP middleware
Go
2
star
42

gzip

RRv2 gzip HTTP middleware
Go
2
star
43

server

RRv2 worker's server plugin
Go
2
star
44

google-pub-sub

Google PubSub Jobs driver
Go
1
star
45

broadcast

RRv2 Broadcast plugin
Go
1
star
46

plugin_sample

RR plugin sample
Dockerfile
1
star
47

informer

RRv2 informer plugin
Go
1
star
48

cache

RRv2 RFC 7234 HTTP Cache middleware
Go
1
star
49

resetter

RRv2 resetter plugin
Go
1
star
50

sqs

RRv2 SQS plugin
Go
1
star
51

fileserver

RRv2 fileserver plugin
Go
1
star
52

status

RRv2 status plugin
Go
1
star
53

middleware_sample

RR http middleware sample
Go
1
star
54

static

RRv2 HTTP static files middleware
Go
1
star
55

fastcgi

FastCGI protocol implementation
Rust
1
star