protocolgen

package
v0.0.0-...-4f71f7c Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 30, 2022 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// HTTP is default protocol
	ProtocolHttp = "http"
	// TODO: implement these protocol
	ProtocolGrpc = "grpc"
	ProtocolAmqp = "amqp"
	ProtocolCli  = "cli"
	ProcolEmpty  = "without"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type ProtocolDto

type ProtocolDto struct {
	ProtocolType ProtocolType
	Name         string
	Path         string
	ProjectPath  string
	GomodName    string
	DomainName   string
}

type ProtocolGen

type ProtocolGen interface {
	CreateProtocolInternalType(dto ProtocolDto) error
	CreateProtocolSrcBaseFile(dto ProtocolDto) error
	CreateProtocolSrcHandler(dto ProtocolDto) error
	InjectDomainServiceIntoHandler(dto ProtocolDto) error
	// contains filtered or unexported methods
}

type ProtocolGenImpl

type ProtocolGenImpl struct {
	// contains filtered or unexported fields
}

func NewProtocolGen

func NewProtocolGen(
	fs database.FileSystem,
	protocolType protocoltype.ProtocolType,
) *ProtocolGenImpl

default protocol is http

func (*ProtocolGenImpl) CreateProtocolInternalType

func (s *ProtocolGenImpl) CreateProtocolInternalType(dto ProtocolDto) error

func (*ProtocolGenImpl) CreateProtocolSrcBaseFile

func (s *ProtocolGenImpl) CreateProtocolSrcBaseFile(dto ProtocolDto) error

create protocol directory. under src or under internal

func (*ProtocolGenImpl) CreateProtocolSrcHandler

func (s *ProtocolGenImpl) CreateProtocolSrcHandler(dto ProtocolDto) error

func (*ProtocolGenImpl) InjectDomainServiceIntoHandler

func (s *ProtocolGenImpl) InjectDomainServiceIntoHandler(dto ProtocolDto) error

type ProtocolType

type ProtocolType int
const (
	Http ProtocolType = iota + 1
	Grpc
	Amqp
	Cli
	Empty
)

func NewProtocolType

func NewProtocolType(protocol string) ProtocolType

func (ProtocolType) NotEmpty

func (r ProtocolType) NotEmpty() bool

func (ProtocolType) ToString

func (r ProtocolType) ToString() string

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL