Documentation ¶
Index ¶
- Constants
- type Todos
- func (t *Todos) Create(ctx context.Context, req *proto.NewTodo) (*proto.Todo, error)
- func (t *Todos) Delete(ctx context.Context, req *proto.TodoID) (*proto.Todo, error)
- func (t *Todos) Get(ctx context.Context, req *proto.TodoID) (*proto.Todo, error)
- func (t *Todos) List(ctx context.Context, req *empty.Empty) (*proto.TodoList, error)
- func (t *Todos) Reorder(ctx context.Context, req *proto.TodoReorder) (*proto.Todo, error)
- func (t *Todos) SubscribeToChanges(req *empty.Empty, srv proto.Todos_SubscribeToChangesServer) error
- func (t *Todos) Update(ctx context.Context, req *proto.Todo) (*proto.Todo, error)
Constants ¶
View Source
const ( TodosCreatedChannelPrefix = "todos:created" // NATS prefix for created todos TodosUpdatedChannelPrefix = "todos:updated" // NATS prefix for updated todos TodosDeletedChannelPrefix = "todos:deleted" // NATS prefix for deleted todos )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Todos ¶
type Todos struct { proto.UnimplementedTodosServer DB *sql.DB NATS *nats.Conn }
Todos manages todos
func (*Todos) SubscribeToChanges ¶
func (t *Todos) SubscribeToChanges(req *empty.Empty, srv proto.Todos_SubscribeToChangesServer) error
SubscribeToChanges subscribes to all changes
Click to show internal directories.
Click to hide internal directories.