characters

package
v0.0.0-...-a6fc1d5 Latest Latest
Warning

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

Go to latest
Published: Jul 28, 2018 License: MIT Imports: 7 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RouterCharacters

func RouterCharacters(charRepo Repository, router *httprouter.Router)

RouterCharacters |

Types

type CharacterController

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

CharacterController |

func NewCharacterController

func NewCharacterController(service *CharacterService) *CharacterController

NewCharacterController |

func (*CharacterController) Create

Create |

func (*CharacterController) Delete

Delete |

func (*CharacterController) Find

Find |

func (*CharacterController) List

List |

func (*CharacterController) Update

Update |

type CharacterService

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

CharacterService |

func NewService

func NewService(r Repository) *CharacterService

NewService |

func (*CharacterService) AddChar

func (s *CharacterService) AddChar(char models.Character) error

AddChar |

func (*CharacterService) CharExists

func (s *CharacterService) CharExists(name string) bool

CharExists |

func (*CharacterService) DeleteCharByName

func (s *CharacterService) DeleteCharByName(name string) error

DeleteCharByName |

func (*CharacterService) GetAllChars

func (s *CharacterService) GetAllChars() ([]models.Character, error)

GetAllChars |

func (*CharacterService) GetCharByName

func (s *CharacterService) GetCharByName(name string) (models.Character, error)

GetCharByName |

func (*CharacterService) IsValid

func (s *CharacterService) IsValid(char models.Character) (bool, string)

IsValid |

func (*CharacterService) UpdateChar

func (s *CharacterService) UpdateChar(char models.Character) error

UpdateChar |

type MongoRepository

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

MongoRepository |

func NewMongoRepository

func NewMongoRepository(session *mgo.Session) *MongoRepository

NewMongoRepository |

func (*MongoRepository) AddChar

func (r *MongoRepository) AddChar(char models.Character) error

AddChar |

func (*MongoRepository) DeleteCharByName

func (r *MongoRepository) DeleteCharByName(name string) error

DeleteCharByName |

func (*MongoRepository) GetAllChars

func (r *MongoRepository) GetAllChars() ([]models.Character, error)

GetAllChars |

func (*MongoRepository) GetCharByName

func (r *MongoRepository) GetCharByName(name string) (models.Character, error)

GetCharByName |

func (*MongoRepository) UpdateChar

func (r *MongoRepository) UpdateChar(char models.Character) error

UpdateChar |

type Read

type Read interface {
	GetAllChars() ([]models.Character, error)
	GetCharByName(name string) (models.Character, error)
}

Read |

type Repository

type Repository interface {
	Read
	Write
}

Repository |

type Service

type Service interface {
	IsValid(char models.Character) bool
	Read
	Write
}

Service |

type Write

type Write interface {
	AddChar(char models.Character) error
	UpdateChar(char models.Character) error
	DeleteCharByName(name string) error
}

Write |

Jump to

Keyboard shortcuts

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