sync

package
v0.6.1 Latest Latest
Warning

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

Go to latest
Published: Jun 9, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func PullKey

func PullKey(providerName, keyFile, secretName, projectID, path, environment string) error

PullKey 执行密钥拉取的通用入口

func SyncKey

func SyncKey(providerName, keyFile, secretName, projectID, path, environment string) error

SyncKey 执行密钥同步的通用入口

Types

type InfisicalProvider

type InfisicalProvider struct{}

InfisicalProvider 实现 Infisical 的同步逻辑

func (*InfisicalProvider) Check

func (p *InfisicalProvider) Check(projectID string) error

Check 检查 Infisical 是否可用

func (*InfisicalProvider) Name

func (p *InfisicalProvider) Name() string

func (*InfisicalProvider) Pull

func (p *InfisicalProvider) Pull(keyFile, secretName, projectID, path, environment string) error

Pull 从 Infisical 拉取密钥

func (*InfisicalProvider) Sync

func (p *InfisicalProvider) Sync(keyFile, secretName, projectID, path, environment string) error

Sync 将密钥同步到 Infisical

type Provider

type Provider interface {
	// Name 返回提供者名称
	Name() string
	// Check 检查提供者是否可用(CLI 安装、配置文件等)
	Check(projectID string) error
	// Sync 执行同步操作
	Sync(keyFile, secretName, projectID, path, environment string) error
	// Pull 从提供者拉取密钥
	Pull(keyFile, secretName, projectID, path, environment string) error
}

Provider 定义密钥同步提供者的接口

func GetProvider

func GetProvider(name string) (Provider, error)

GetProvider 根据名称获取对应的 Provider

Jump to

Keyboard shortcuts

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