Example #1
0
func (c *tchanMetaClient) Health(ctx Context) (*meta.HealthStatus, error) {
	var resp meta.HealthResult
	args := meta.HealthArgs{}
	success, err := c.client.Call(ctx, "Meta", "health", &args, &resp)
	if err == nil && !success {
	}

	return resp.GetSuccess(), err
}
Example #2
0
func (s *tchanMetaServer) handleHealth(ctx Context, protocol athrift.TProtocol) (bool, athrift.TStruct, error) {
	var req meta.HealthArgs
	var res meta.HealthResult

	if err := req.Read(protocol); err != nil {
		return false, nil, err
	}

	r, err :=
		s.handler.Health(ctx)

	if err != nil {
		return false, nil, err
	}

	res.Success = r

	return err == nil, &res, nil
}