示例#1
0
文件: keys.go 项目: laurrentt/deis
// KeysList lists a user's keys.
func KeysList() error {
	c, err := client.New()

	if err != nil {
		return err
	}

	keys, err := keys.List(c)

	if err != nil {
		return err
	}

	fmt.Printf("=== %s Keys\n", c.Username)

	for _, key := range keys {
		fmt.Printf("%s %s...%s\n", key.ID, key.Public[:16], key.Public[len(key.Public)-10:])
	}
	return nil
}
示例#2
0
文件: keys.go 项目: rsackler/deis
// KeysList lists a user's keys.
func KeysList(results int) error {
	c, err := client.New()

	if err != nil {
		return err
	}

	if results == defaultLimit {
		results = c.ResponseLimit
	}

	keys, count, err := keys.List(c, results)

	if err != nil {
		return err
	}

	fmt.Printf("=== %s Keys%s", c.Username, limitCount(len(keys), count))

	for _, key := range keys {
		fmt.Printf("%s %s...%s\n", key.ID, key.Public[:16], key.Public[len(key.Public)-10:])
	}
	return nil
}