func (g *Generator) Generate(context *common.Context, schema *schema.Schema) ([]common.Output, error) {
	moduleName := strings.ToLower(schema.Title)
	var outputs []common.Output
	for _, def := range schema.Definitions {
		if def.Type != nil {
			if t, ok := def.Type.(string); ok {
				if t != "object" {
					continue
				}
			}
		}
		f, err := generateMainFile(context, schema)
		if err != nil {
			return nil, err
		}
		path := fmt.Sprintf(
			"%s%s/main.go",
			context.Config.Target,
			moduleName,
		)
		outputs = append(outputs, common.Output{
			Content: f,
			Path:    path,
		})
	}
	return outputs, nil
}
Generate handles the main file generation for persistent connection rpc
server
package mainfile
import (
	"fmt"
	"strings"
	"text/template"
	"bytes"
	"go/format"
	"github.com/cihangir/gene/generators/common"
	"github.com/cihangir/schema"
)
type Generator struct{}