Thanks to visit codestin.com
Credit goes to Github.com

Skip to content

Conversation

@qawatake
Copy link
Owner

@qawatake qawatake commented May 15, 2023

This is a copy of internal/example/graph/README.md.

wire graph

wire graph -injector initializeX -trim_prefixes github.com/qawatake/wire/_example/graph.

Generated graph.

flowchart BT;
	 0(["context.Context"]) -- "context.Context" --> 1["NewA"];
	 2[["E"]] -- "E" --> 3{{"F"}};
	 2[["E"]] -- "E" --> 4["NewH"];
	 3{{"F"}} -- "F" --> 5["NewX"];
	 6("H.G") -- "G" --> 5["NewX"];
	 7[["I2"]] -- "I2" --> 8["NewD"];
	 1["NewA"] -- "I1" --> 9["NewB"];
	 1["NewA"] -- "A" --> 4["NewH"];
	 9["NewB"] -- "B" --> 3{{"F"}};
	 9["NewB"] -- "B" --> 5["NewX"];
	 8["NewD"] -- "D" --> 3{{"F"}};
	 8["NewD"] -- "D" --> 5["NewX"];
	 4["NewH"] -- "H" --> 6("H.G");
Loading

Raw output.

flowchart BT;
	 0(["context.Context"]) -- "context.Context" --> 1["NewA"];
	 2[["E"]] -- "E" --> 3{{"F"}};
	 2[["E"]] -- "E" --> 4["NewH"];
	 3{{"F"}} -- "F" --> 5["NewX"];
	 6("H.G") -- "G" --> 5["NewX"];
	 7[["I2"]] -- "I2" --> 8["NewD"];
	 1["NewA"] -- "I1" --> 9["NewB"];
	 1["NewA"] -- "A" --> 4["NewH"];
	 9["NewB"] -- "B" --> 3{{"F"}};
	 9["NewB"] -- "B" --> 5["NewX"];
	 8["NewD"] -- "D" --> 3{{"F"}};
	 8["NewD"] -- "D" --> 5["NewX"];
	 4["NewH"] -- "H" --> 6("H.G");

Node shapes

Function Provider

NewX
flowchart
	0["NewX"];
Loading

Struct Provider

wire.Struct(new(F), "*")
flowchart
	0{{"NewF"}};
Loading

Value Provider

wire.Value(E{})
wire.InterfaceValue(new(I2), C{})
flowchart
	0[["E"]]
	1[["I2"]]
Loading

Field Provider

wire.FieldsOf(new(H), "G")
flowchart
	0("H.G")
Loading

Injector Argument

func initializeX(context.Context) X {
	panic(wire.Build(Set))
}
flowchart
	0(["context.Context"])
Loading

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants