// Show is an event fired when a contextmenu event was fired on/bubbled to an
// element that has a contextmenu attribute
//
// https://developer.mozilla.org/docs/Web/Events/show
186245
func Show(listener func(*vecty.Event)) *vecty.EventListener {
	return &vecty.EventListener{Name: "show", Listener: listener}
}
753577
func (m *MetaClient) ShowCluster(ctx context.Context) (*Cluster, error) {
	res, err := m.Do(ctx, "/show-cluster", "GET", m.authorizer, nil, nil)
	if err != nil {
		return nil, err
	}

	defer res.Body.Close()
	dec := json.NewDecoder(res.Body)
	out := &Cluster{}
	err = dec.Decode(out)
	if err != nil {
		return nil, err
	}
	return out, nil
}
354987
func show(c context.Context, client *prpc.Client, name string) error {
	desc, err := loadDescription(c, client)
	if err != nil {
		return fmt.Errorf("could not load server description: %s", err)
	}

	if name == "" {
		for _, s := range desc.Services {
			fmt.Println(s)
		}
		return nil
	}

	file, obj, path := descutil.Resolve(desc.Description, name)
	if obj == nil {
		return fmt.Errorf("name %q could not resolved", name)
	}

	print := newPrinter(os.Stdout)
	if err := print.SetFile(file); err != nil {
		return err
	}

	switch obj := obj.(type) {

	case *descriptor.ServiceDescriptorProto:
		print.Service(obj, -1)

	case *descriptor.MethodDescriptorProto:
		serviceIndex, methodIndex := path[1], path[3]
		print.Service(file.Service[serviceIndex], methodIndex)

		printMsg := func(name string) error {
			name = strings.TrimPrefix(name, ".")
			file, msg, _ := descutil.Resolve(desc.Description, name)
			if msg == nil {
				print.Printf("// Message %q is not found\n", name)
				return nil
			}
			if err := print.SetFile(file); err != nil {
				return err
			}
			print.Message(msg.(*descriptor.DescriptorProto))
			return nil
		}

		print.Printf("\n")
		if err := printMsg(obj.GetInputType()); err != nil {
			return err
		}
		print.Printf("\n")
		if err := printMsg(obj.GetOutputType()); err != nil {
			return err
		}

	case *descriptor.DescriptorProto:
		print.Message(obj)

	case *descriptor.FieldDescriptorProto:
		print.Field(obj)

	case *descriptor.EnumDescriptorProto:
		print.Enum(obj)

	case *descriptor.EnumValueDescriptorProto:
		print.EnumValue(obj)

	default:
		return fmt.Errorf("object of type %T is not supported", obj)
	}

	return print.Err
}
1053958
func (c *WorkitemController) Show(ctx *app.ShowWorkitemContext) error {
	var wi *workitem.WorkItem
	var wit *workitem.WorkItemType
	err := application.Transactional(c.db, func(appl application.Application) error {
		var err error
		wi, err = appl.WorkItems().LoadByID(ctx, ctx.WiID)
		if err != nil {
			return errs.Wrap(err, fmt.Sprintf("Fail to load work item with id %v", ctx.WiID))
		}
		wit, err = appl.WorkItemTypes().Load(ctx.Context, wi.Type)
		if err != nil {
			return errs.Wrapf(err, "failed to load work item type: %s", wi.Type)
		}
		return nil
	})
	if err != nil {
		return jsonapi.JSONErrorResponse(ctx, err)
	}
	return ctx.ConditionalRequest(*wi, c.config.GetCacheControlWorkItem, func() error {
		comments := workItemIncludeCommentsAndTotal(ctx, c.db, ctx.WiID)
		hasChildren := workItemIncludeHasChildren(ctx, c.db)
		wi2, err := ConvertWorkItem(ctx.Request, *wit, *wi, comments, hasChildren)
		if err != nil {
			return jsonapi.JSONErrorResponse(ctx, err)
		}
		resp := &app.WorkItemSingle{
			Data: wi2,
		}
		return ctx.OK(resp)
	})
}
1302186
func (s *DirectMessageService) Show(id int64) (*DirectMessage, *http.Response, error) {
	params := &directMessageShowParams{ID: id}
	dm := new(DirectMessage)
	apiError := new(APIError)
	resp, err := s.sling.New().Get("show.json").QueryStruct(params).Receive(dm, apiError)
	return dm, resp, relevantError(err, *apiError)
}
1087211
func (d *Dock) Show() (err error) {
	if err = d.isActionable(); err != nil {
		return
	}
	_, err = synchronousEvent(d.c, d, d.w, Event{Name: eventNameDockCmdShow, TargetID: d.id}, eventNameDockEventShown)
	return
}
562710
func ShowCommandHelp(c *Context, command string) {
	for _, c := range c.App.Commands {
		if c.HasName(command) {
			HelpPrinter(CommandHelpTemplate, c)
			return
		}
	}

	if c.App.CommandNotFound != nil {
		c.App.CommandNotFound(c, command)
	} else {
		fmt.Printf("No help topic for '%v'\n", command)
	}
}
293607
func (s *DirectMessageService) EventsShow(id string, params *DirectMessageEventsShowParams) (*DirectMessageEvent, *http.Response, error) {
	if params == nil {
		params = &DirectMessageEventsShowParams{}
	}
	params.ID = id
	// Twitter API wraps the event response
	wrap := &struct {
		Event *DirectMessageEvent `json:"event"`
	}{}
	apiError := new(APIError)
	resp, err := s.sling.New().Get("events/show.json").QueryStruct(params).Receive(wrap, apiError)
	return wrap.Event, resp, relevantError(err, *apiError)
}
216577
func (c *WorkItemTypeGroupController) Show(ctx *app.ShowWorkItemTypeGroupContext) error {
	var typeGroup *workitem.WorkItemTypeGroup
	var err error
	err = application.Transactional(c.db, func(appl application.Application) error {
		typeGroup, err = appl.WorkItemTypeGroups().Load(ctx, ctx.GroupID)
		if err != nil {
			return errs.WithStack(err)
		}
		return nil
	})
	if err != nil {
		return jsonapi.JSONErrorResponse(ctx, err)
	}
	return ctx.OK(&app.WorkItemTypeGroupSingle{
		Data: ConvertTypeGroup(ctx.Request, *typeGroup),
	})
}
629793
func ShowCommandHelp(ctx *Context, command string) error {
	// show the subcommand help for a command with subcommands
	if command == "" {
		HelpPrinter(ctx.App.Writer, SubcommandHelpTemplate, ctx.App)
		return nil
	}

	for _, c := range ctx.App.Commands {
		if c.HasName(command) {
			if c.CustomHelpTemplate != "" {
				HelpPrinterCustom(ctx.App.Writer, c.CustomHelpTemplate, c, nil)
			} else {
				HelpPrinter(ctx.App.Writer, CommandHelpTemplate, c)
			}
			return nil
		}
	}

	if ctx.App.CommandNotFound == nil {
		return NewExitError(fmt.Sprintf("No help topic for '%v'", command), 3)
	}

	ctx.App.CommandNotFound(ctx, command)
	return nil
}
1265694
func (s *Action) show(ctx context.Context, c *cli.Context, name, key string, recurse bool) error {
	if name == "" {
		return ExitError(ctx, ExitUsage, nil, "Usage: %s show [name]", s.Name)
	}

	if s.Store.IsDir(ctx, name) && !s.Store.Exists(ctx, name) {
		return s.List(ctx, c)
	}
	if s.Store.IsDir(ctx, name) && ctxutil.IsTerminal(ctx) {
		out.Cyan(ctx, "Warning: %s is a secret and a folder. Use 'gopass show %s' to display the secret and 'gopass list %s' to show the content of the folder", name, name, name)
	}

	// auto-fallback to binary files with b64 suffix, if unique
	if !s.Store.Exists(ctx, name) && s.Store.Exists(ctx, name+BinarySuffix) {
		name += BinarySuffix
	}

	if HasRevision(ctx) {
		return s.showHandleRevision(ctx, c, name, key, GetRevision(ctx))
	}

	sec, ctx, err := s.Store.GetContext(ctx, name)
	if err != nil {
		return s.showHandleError(ctx, c, name, recurse, err)
	}

	return s.showHandleOutput(ctx, name, key, sec)
}
286971
func (el *eventLogger) Event(ctx context.Context, event string, metadata ...Loggable) {

	// short circuit if theres nothing to write to
	if !writer.WriterGroup.Active() {
		return
	}

	// Collect loggables for later logging
	var loggables []Loggable

	// get any existing metadata from the context
	existing, err := MetadataFromContext(ctx)
	if err != nil {
		existing = Metadata{}
	}
	loggables = append(loggables, existing)

	for _, datum := range metadata {
		loggables = append(loggables, datum)
	}

	e := entry{
		loggables: loggables,
		system:    el.system,
		event:     event,
	}

	accum := Metadata{}
	for _, loggable := range e.loggables {
		accum = DeepMerge(accum, loggable.Loggable())
	}

	// apply final attributes to reserved keys
	// TODO accum["level"] = level
	accum["event"] = e.event
	accum["system"] = e.system
	accum["time"] = FormatRFC3339(time.Now())

	var buf bytes.Buffer
	encoder := json.NewEncoder(&buf)
	encoder.SetEscapeHTML(false)
	err = encoder.Encode(accum)
	if err != nil {
		el.Errorf("ERROR FORMATTING EVENT ENTRY: %s", err)
		return
	}

	writer.WriterGroup.Write(buf.Bytes())
}
913202
func (c *Callbacks) OnCUserMessageShowMenu(fn func(*dota.CUserMessageShowMenu) error) {
	c.onCUserMessageShowMenu = append(c.onCUserMessageShowMenu, fn)
}
1029582
func (v *version) Events() EventInformer {
	return &eventInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions}
}
331537
func (rc *ResourceController) ShowHandler(c *gin.Context) {
	c.Set("Action", "read")
	_, err := rc.LoadResource(c)
	if err != nil && err != ErrNotFound {
		c.AbortWithError(http.StatusInternalServerError, err)
		return
	}

	if err == ErrNotFound {
		c.Status(http.StatusNotFound)
		return
	}
	resource, _ := c.Get(rc.Name)
	c.JSON(http.StatusOK, resource)
}
58762
func (c *UserController) Show(ctx *app.ShowUserContext) error {
	// retrieve the user's identity ID from the token
	identityID, err := c.tokenManager.Locate(ctx)
	if err != nil {
		log.Error(ctx, map[string]interface{}{
			"err": err,
		}, "Bad Token")
		return jsonapi.JSONErrorResponse(ctx, errors.NewUnauthorizedError("bad or missing token"))
	}
	user, identity, err := c.app.UserService().UserInfo(ctx, identityID)
	if err != nil {
		return jsonapi.JSONErrorResponse(ctx, err)
	}
	if user.Banned {
		ctx.ResponseData.Header().Add("Access-Control-Expose-Headers", "WWW-Authenticate")
		ctx.ResponseData.Header().Set("WWW-Authenticate", "DEPROVISIONED description=\"Account has been banned\"")
		return jsonapi.JSONErrorResponse(ctx, errors.NewUnauthorizedError("Account has been banned"))
	}

	return ctx.ConditionalRequest(*user, c.config.GetCacheControlUser, func() error {
		// Init tenant (if access to tenant service is configured/enabled)
		if c.tenantService != nil {
			go func(ctx context.Context) {
				c.tenantService.Init(ctx)
			}(ctx)
		}
		return ctx.OK(ConvertToAppUser(ctx.RequestData, user, identity, true))
	})
}
919356
func (c *UserServiceController) Show(ctx *app.ShowUserServiceContext) error {
	t, err := c.ShowTenant(ctx)
	if err != nil {
		return jsonapi.JSONErrorResponse(ctx, err)
	}

	return ctx.OK(convert(t))
}