Documentation ¶
Index ¶
- Constants
- type Repository
- type Server
- func (s Server) Query(ctx context.Context, req *contactspb.QueryRequest) (*contactspb.QueryReply, error)
- func (s Server) RemoveContact(ctx context.Context, req *contactspb.RemoveContactRequest) (*contactspb.RemoveContactReply, error)
- func (s Server) SetAddress(ctx context.Context, req *contactspb.SetAddressRequest) (*contactspb.SetAddressReply, error)
- func (s Server) SetPhone(ctx context.Context, req *contactspb.SetPhoneRequest) (*contactspb.SetPhoneReply, error)
- func (s Server) Start(addr string) error
- func (s Server) Stop()
Constants ¶
View Source
const (
DatabaseName = "contact"
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Repository ¶
type Repository interface { SetAddress(*contactspb.SetAddressRequest) (*contactspb.Contact, error) SetPhone(*contactspb.SetPhoneRequest) (*contactspb.Contact, error) Query(*contactspb.QueryRequest) ([]*contactspb.Contact, error) RemoveContact(*contactspb.RemoveContactRequest) (bool, error) Migrate() error }
func NewRepository ¶
func NewRepository(url string) (Repository, error)
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
func (Server) Query ¶
func (s Server) Query(ctx context.Context, req *contactspb.QueryRequest) (*contactspb.QueryReply, error)
func (Server) RemoveContact ¶
func (s Server) RemoveContact(ctx context.Context, req *contactspb.RemoveContactRequest) (*contactspb.RemoveContactReply, error)
func (Server) SetAddress ¶
func (s Server) SetAddress(ctx context.Context, req *contactspb.SetAddressRequest) (*contactspb.SetAddressReply, error)
func (Server) SetPhone ¶
func (s Server) SetPhone(ctx context.Context, req *contactspb.SetPhoneRequest) (*contactspb.SetPhoneReply, error)
Click to show internal directories.
Click to hide internal directories.