me

package
v1.0.46 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 13, 2026 License: MIT Imports: 12 Imported by: 0

Documentation

Overview

Package me implements the `gro me` command — a token-dense one-liner describing the currently authenticated Google user, modeled on `jtk me`.

Index

Constants

This section is empty.

Variables

View Source
var ClientFactory = func(ctx context.Context) (PeopleClient, error) {
	return people.NewClient(ctx)
}

ClientFactory is the function used to create People clients. Override in tests to inject mocks.

Functions

func NewCommand

func NewCommand() *cobra.Command

NewCommand returns the `me` cobra command.

func RenderExtended

func RenderExtended(w io.Writer, p *people.Profile, e Extras)

RenderExtended writes the one-liner plus extended rows to w.

func RenderID

func RenderID(w io.Writer, p *people.Profile)

RenderID writes just the primary email followed by a newline.

func RenderJSON

func RenderJSON(w io.Writer, p *people.Profile, e Extras, idOnly, extended bool) error

RenderJSON emits one of three JSON shapes depending on (idOnly, extended).

func RenderOneLiner

func RenderOneLiner(w io.Writer, p *people.Profile)

RenderOneLiner writes the canonical `resourceName | displayName | primaryEmail` pipe one-liner to w. Empty fields render as "-"; embedded pipes are escaped to `\|`; embedded newlines collapse to spaces. Exported so the init wizard can render the same line as part of its success message.

Types

type Extras

type Extras struct {
	GrantedScopes  []string
	TokenExpiry    string
	StorageBackend string
}

Extras is the data shown by --extended that doesn't come from People.

type PeopleClient

type PeopleClient interface {
	GetMe(ctx context.Context) (*people.Profile, error)
}

PeopleClient defines the interface for People client operations used by the me command.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL