model

package
v0.0.0-...-46b5f2f Latest Latest
Warning

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

Go to latest
Published: Feb 23, 2022 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Field

type Field struct {
	Type     string
	Name     string
	Repeated bool
}

func NewField

func NewField(kind, name string, repeated bool) Field

type Handler

type Handler struct {
	// Name (full path) for the generated file
	Name string

	// Namespace to use in file
	Namespace string

	// Routes
	RPCs []*proto.RPC
}

func NewHandler

func NewHandler(name, namespace string, rpcs []*proto.RPC) *Handler

func (*Handler) Bytes

func (f *Handler) Bytes() []byte

func (*Handler) Filename

func (f *Handler) Filename() string

type Message

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

func NewMessage

func NewMessage(name, namespace string) *Message

func (*Message) AddField

func (f *Message) AddField(n Field)

func (*Message) Bytes

func (f *Message) Bytes() []byte

func (*Message) Filename

func (f *Message) Filename() string

type Route

type Route struct {
	RPC    *proto.RPC
	Method string
	URL    string
}

func NewRoute

func NewRoute(rpc *proto.RPC, method, url string) *Route

type Router

type Router struct {
	// Name (full path) for the generated file
	Name string

	// Namespace to use in file
	Namespace string

	// Routes
	Routes []*Route

	// RPCs
	RPCs []*proto.RPC

	// Twirp specific options
	Prefix, PackageName, ServiceName string
}

func NewRouter

func NewRouter(name, namespace string) *Router

func (*Router) Bytes

func (f *Router) Bytes() []byte

func (*Router) Filename

func (f *Router) Filename() string

type Service

type Service struct {
	RPCs []*proto.RPC

	// Name (full path) for the generated file
	Name string

	// Namespace to use in file
	Namespace string

	// Comment from proto file
	Comment string
	// contains filtered or unexported fields
}

func NewService

func NewService(name, namespace string) *Service

func (*Service) AddFunction

func (f *Service) AddFunction(def []string)

func (*Service) AddRPC

func (f *Service) AddRPC(rpc *proto.RPC)

func (*Service) Bytes

func (f *Service) Bytes() []byte

func (*Service) Filename

func (f *Service) Filename() string

Jump to

Keyboard shortcuts

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