native

package
v0.27.1 Latest Latest
Warning

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

Go to latest
Published: Aug 29, 2025 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Overview

Package native provides the ability for Vela to integrate with the Database as a secret backend.

Usage:

import "github.com/go-vela/server/secret/native"

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client added in v0.27.0

type Client struct {
	// client to interact with database for secret operations
	Database database.Interface
	// https://pkg.go.dev/github.com/sirupsen/logrus#Entry
	Logger *logrus.Entry
}

Client represents a struct to hold native secret setup.

func New

func New(opts ...ClientOpt) (*Client, error)

New returns a Secret implementation that integrates with a Native secrets engine.

func (*Client) Count added in v0.27.0

func (c *Client) Count(ctx context.Context, sType, org, name string, teams []string) (int64, error)

Count counts a list of secrets.

func (*Client) Create added in v0.27.0

func (c *Client) Create(ctx context.Context, sType, org, name string, s *api.Secret) (*api.Secret, error)

Create creates a new secret.

func (*Client) Delete added in v0.27.0

func (c *Client) Delete(ctx context.Context, sType, org, name, path string) error

Delete deletes a secret.

func (*Client) Driver added in v0.27.0

func (c *Client) Driver() string

Driver outputs the configured secret driver.

func (*Client) Get added in v0.27.0

func (c *Client) Get(ctx context.Context, sType, org, name, path string) (*api.Secret, error)

Get captures a secret.

func (*Client) List added in v0.27.0

func (c *Client) List(ctx context.Context, sType, org, name string, page, perPage int, teams []string) ([]*api.Secret, error)

List captures a list of secrets.

func (*Client) Update added in v0.27.0

func (c *Client) Update(ctx context.Context, sType, org, name string, s *api.Secret) (*api.Secret, error)

Update updates an existing secret.

type ClientOpt added in v0.8.0

type ClientOpt func(*Client) error

ClientOpt represents a configuration option to initialize the secret client for Native.

func WithDatabase added in v0.8.0

func WithDatabase(d database.Interface) ClientOpt

WithDatabase sets the Vela database service in the secret client for Native.

Jump to

Keyboard shortcuts

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