Documentation ¶
Overview ¶
swapi package implements some object types that are manipulated by our hypothetical API used for this experiment and exposes a Port (interface) for a repository of those objects, as well as a simple in-memory Adapter (implementation) of that repository.
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var TestCharacters = []Character{ { Name: "Luke Skywalker", Height: 172, Mass: 77, HairColor: "blond", Gender: "male", ForceSensitive: true, Ghost: true, Tags: []string{"human", "jedi", "rebel", "starfighter-pilot", "shuttle-pilot", "green-lightsaber"}, }, { Name: "C-3PO", Height: 167, Mass: 75, HairColor: "n/a", Gender: "n/a", ForceSensitive: false, Ghost: false, Tags: []string{"droid"}, }, { Name: "R2-D2", Height: 96, Mass: 32, HairColor: "n/a", Gender: "n/a", ForceSensitive: false, Ghost: false, Tags: []string{"droid"}, }, { Name: "Darth Vader", Height: 202, Mass: 136, HairColor: "none", Gender: "male", ForceSensitive: true, Ghost: true, Tags: []string{"human", "sith", "empire", "tie-pilot", "crimson-lightsaber"}, }, { Name: "Leia Organa", Height: 150, Mass: 49, HairColor: "brown", Gender: "female", ForceSensitive: true, Ghost: false, Tags: []string{"human", "general", "rebel"}, }, { Name: "Obi-Wan Kenobi", Height: 182, Mass: 77, HairColor: "white", Gender: "male", ForceSensitive: true, Ghost: true, Tags: []string{"human", "jedi", "starfighter-pilot", "medium-blue-lightsaber"}, }, { Name: "Chewbacca", Height: 228, Mass: 112, HairColor: "brown", Gender: "male", ForceSensitive: false, Ghost: false, Tags: []string{"wookie", "smuggler", "freighter-pilot"}, }, { Name: "Han Solo", Height: 180, Mass: 80, HairColor: "brown", Gender: "male", ForceSensitive: false, Ghost: true, Tags: []string{"human", "smuggler", "freighter-pilot"}, }, { Name: "Yoda", Height: 66, Mass: 17, HairColor: "white", Gender: "male", ForceSensitive: true, Ghost: true, Tags: []string{"jedi", "green-lightsaber"}, }, }
TestCharacters is a list of sample Character objects, taken mostly from https://swapi.dev/ and https://starwars.fandom.com/
Functions ¶
func NewInMemoryRepository ¶
func NewInMemoryRepository() *inMemoryRepository
NewInMemoryRepository factory for in-memory repository
Types ¶
Click to show internal directories.
Click to hide internal directories.