Documentation ¶
Index ¶
- func ConvertProto(p *gen.Project) *protoProject[*gen.Node, *gen.Edge]
- func MessageFromTypes(name string, types []protoreflect.MessageDescriptor) (*desc.MessageDescriptor, error)
- type DependencyProvider
- type Edge
- type IO
- type IOFunc
- type Info
- type Listener
- type Node
- type ProtoEdge
- type ProtoGraph
- type ProtoNode
- type ProtoProject
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ConvertProto ¶
TODO breadchris figure out how to make this generic
func MessageFromTypes ¶
func MessageFromTypes(name string, types []protoreflect.MessageDescriptor) (*desc.MessageDescriptor, error)
TODO breadchris if there is only one field, set name of message to just the name of the one field. this is canonical in grpc
Types ¶
type DependencyProvider ¶
type Info ¶
type Info struct {
Method *grpc.MethodDescriptor
}
func NewInfoFromType ¶
func NewInfoFromType(name string, msg protoreflect.ProtoMessage) (*Info, error)
func (*Info) BuildProto ¶
type Node ¶
type Node interface { ID() string Name() string NormalizedName() string // TODO breadchris type should probably just return a message descriptor Type() (*Info, error) Provide() ([]*gen.Node, error) // Provider returns the node that this node depends on. (eg. a grpc method node will return the service node) Provider() (Node, error) SetProvider(n Node) error // Dependents returns the nodes that depend on this node. Dependents() []Node AddDependent(n Node) // Wire up the node to an input stream of data and return an output stream of data Wire(ctx context.Context, input IO) (IO, error) // Subscribers returns the nodes that subscribe to this node. Subscribers() []Listener AddSubscriber(n Listener) // Publishers returns the nodes that this node subscribes to. Publishers() []Listener AddPublishers(n Listener) }
type ProtoEdge ¶
type ProtoEdge interface { protoreflect.ProtoMessage GetId() string GetFrom() string GetTo() string }
type ProtoGraph ¶
type ProtoNode ¶
type ProtoNode interface { protoreflect.ProtoMessage GetId() string }
type ProtoProject ¶
type ProtoProject[T ProtoNode, U ProtoEdge] interface { GetId() string GetGraph() ProtoGraph[T, U] }
Click to show internal directories.
Click to hide internal directories.