Пример #1
0
func NewRegistry(id, name, addr string) (*Registry, error) {
	rClient, err := registry.NewRegistryClient(addr, nil)
	if err != nil {
		return nil, err
	}

	return &Registry{
		ID:             id,
		Name:           name,
		Addr:           addr,
		registryClient: rClient,
	}, nil
}
Пример #2
0
func NewRegistry(id, name, addr, username, password string) (*Registry, error) {
	rClient, err := registry.NewRegistryClient(addr, &tls.Config{InsecureSkipVerify: true}, username, password)
	if err != nil {
		return nil, err
	}

	return &Registry{
		ID:             id,
		Name:           name,
		Addr:           addr,
		Username:       username,
		Password:       password,
		registryClient: rClient,
	}, nil
}
Пример #3
0
func getClient(c *cli.Context) (*registry.RegistryClient, error) {
	return registry.NewRegistryClient(c.GlobalString("url"), nil)
}