Skip to content
foomo golang integration
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
go/src/github.com/foomo/gofoomo/services/rpc
lib/Foomo/Go
tests/Foomo/Go
.gitignore
README.md

README.md

foomo - golang integration module

This foomo php module is designed to work with the gofoomo Go package .

Generate Go structs for php value objects

This is a snippet for a foomo module class:


// typically the make method of a foomo module class is a good place to generate code
public static function make($target, \Foomo\Modules\MakeResult $result)
{
    switch($target) {
        case 'all':
            // typically point to you go path 
            $goPath = self::getBaseDir('go');
            if(file_exists($goPath) && is_dir($goPath) && is_writable($goPath)) {
                // this call will generate gopath/src/github.com/foomo/gofoomo/services/rpc/value_objects.go
                \Foomo\Go\Utils::writeStructsForValueObjects(
                    [
                        'Foomo\\Services\\RPC\\Protocol\\Call\\MethodCall',
                        'Foomo\\Services\\RPC\\Protocol\\Reply\\MethodReply'
                    ],
                    $package = 'github.com/foomo/gofoomo/services/rpc',
                    $goPath
                );
                $result->addEntry('wrote go value object sources');
            } else {
                $result->addEntry('can not write go value object sources');
            }
            break;
        default:
            parent::make($target, $result);
    }
}
You can’t perform that action at this time.