harbor

package
v0.9.9 Latest Latest
Warning

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

Go to latest
Published: Apr 2, 2024 License: MIT Imports: 17 Imported by: 0

README

POSH harbor provider

Usage

Plugin
package main

type Plugin struct {
  l        log.Logger
  harbor   *harbor.Harbor
  commands command.Commands
}

func New(l log.Logger) (plugin.Plugin, error) {
  var err error
  inst := &Plugin{
    l:        l,
    commands: command.Commands{},
  }

  // ...

  inst.harbor, err = harbor.New(l)
  if err != nil {
    return nil, errors.Wrap(err, "failed to create harbor")
  }

  // ...

  inst.commands.Add(harbor.New(l, inst.harbor))

  // ...

  return inst, nil
}
Config
## Harbor
harbor:
  url: https://harbor.foomo.org
  authUrl: https://harbor.foomo.org/c/oidc/login
  project: "foomo"

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AuthChecker added in v0.3.1

func AuthChecker(h *Harbor) check.Checker

Types

type Command

type Command struct {
	// contains filtered or unexported fields
}

func NewCommand

func NewCommand(l log.Logger, harbor *Harbor, opts ...CommandOption) *Command

func (*Command) Complete

func (c *Command) Complete(ctx context.Context, r *readline.Readline) []goprompt.Suggest

func (*Command) Description

func (c *Command) Description() string

func (*Command) Execute

func (c *Command) Execute(ctx context.Context, r *readline.Readline) error

func (*Command) Help

func (c *Command) Help(ctx context.Context, r *readline.Readline) string

func (*Command) Name

func (c *Command) Name() string

type CommandOption

type CommandOption func(*Command)

func CommandWithName

func CommandWithName(v string) CommandOption

type Config

type Config struct {
	URL     string `json:"url" yaml:"url"`
	AuthURL string `json:"authUrl" yaml:"authUrl"`
	Project string `json:"project" yaml:"project"`
}

func (Config) DockerRegistry added in v0.3.1

func (c Config) DockerRegistry() string

type Harbor added in v0.3.1

type Harbor struct {
	// contains filtered or unexported fields
}

Harbor command

func New added in v0.3.1

func New(l log.Logger, opts ...Option) (*Harbor, error)

New command

func (*Harbor) Config added in v0.3.1

func (t *Harbor) Config() Config

func (*Harbor) IsAuthenticated added in v0.3.1

func (t *Harbor) IsAuthenticated(ctx context.Context) bool

type Option added in v0.3.1

type Option func(*Harbor) error

Harbor command

func CommandWithConfigKey added in v0.3.1

func CommandWithConfigKey(v string) Option

Jump to

Keyboard shortcuts

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