Пример #1
0
// GetGlobalStatusVar implements GlobalVarAccessor GetGlobalStatusVar interface.
func (c *Context) GetGlobalStatusVar(ctx context.Context, name string) (string, error) {
	v := variable.GetStatusVar(name)
	if v == nil {
		return "", terror.UnknownStatusVar.Gen("unknown status variable: %s", name)
	}
	return v.Value, nil
}
Пример #2
0
// SetGlobalStatusVar implements GlobalVarAccessor SetGlobalStatusVar interface.
func (c *Context) SetGlobalStatusVar(ctx context.Context, name string, value string) error {
	v := variable.GetStatusVar(name)
	if v == nil {
		return terror.UnknownStatusVar.Gen("unknown status variable: %s", name)
	}
	v.Value = value
	return nil
}
Пример #3
0
// GetGlobalStatusVar implements GlobalVarAccessor.GetGlobalStatusVar interface.
func (s *session) GetGlobalStatusVar(ctx context.Context, name string) (string, error) {
	// TODO: get global status variables from store.
	v := variable.GetStatusVar(name)
	if v == nil {
		return "", terror.UnknownStatusVar.Gen("unknown status variable:%s", name)
	}

	return v.Value, nil
}
Пример #4
0
// SetGlobalStatusVar implements GlobalVarAccessor.SetGlobalStatusVar interface.
func (s *session) SetGlobalStatusVar(ctx context.Context, name string, value string) error {
	// TODO: set global status variables from store.
	v := variable.GetStatusVar(name)
	if v == nil {
		return terror.UnknownStatusVar.Gen("unknown status variable:%s", name)
	}
	v.Value = value

	return nil
}