manifest

package
v0.13.0 Latest Latest
Warning

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

Go to latest
Published: Jan 3, 2025 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ManifestConfigFile = ".hx"
	ManifestSecretFile = ".hxkey"
)

Functions

func AddAppToLocalProject added in v0.13.0

func AddAppToLocalProject(appDir string) error

func ExistsInFolder added in v0.13.0

func ExistsInFolder(folder string) bool

func ExistsLocal

func ExistsLocal() bool

func GetGlobalDirectory

func GetGlobalDirectory() string

func GlobalInitializeConfig

func GlobalInitializeConfig(mc Config) error

func InitializeConfig

func InitializeConfig(mc Config, configFile string) error

func UpsertGlobalConfig

func UpsertGlobalConfig(mc Config) error

func UpsertGlobalOrganizationID

func UpsertGlobalOrganizationID(organizationID string) error

func UpsertGlobalProjectID

func UpsertGlobalProjectID(projectID string) error

func UpsertLocalSecret

func UpsertLocalSecret(secret Secret) error

func UpsertLocalWorkspace added in v0.13.0

func UpsertLocalWorkspace(workspace Project) error

func UpsertOrganizationID

func UpsertOrganizationID(organizationID string) error

func UpsertProjectID

func UpsertProjectID(projectID string) error

Types

type Config

type Config struct {
	ProjectName        *string     `json:"project_name,omitempty"`
	ProjectId          *string     `json:"project_id,omitempty"`
	ProjectAlternateId *string     `json:"project_alternate_id,omitempty"`
	AppName            *string     `json:"app_name,omitempty"`
	AppId              *string     `json:"app_id,omitempty"`
	AppAlternateId     *string     `json:"app_alternate_id,omitempty"`
	OrganizationId     string      `json:"organization_id,omitempty"`
	HyphenAccessToken  *string     `json:"hyphen_access_token,omitempty"`
	HyphenRefreshToken *string     `json:"hyphen_refresh_token,omitempty"`
	HypenIDToken       *string     `json:"hyphen_id_token,omitempty"`
	ExpiryTime         *int64      `json:"expiry_time,omitempty"`
	HyphenAPIKey       *string     `json:"hyphen_api_key,omitempty"`
	IsMonorepo         *bool       `json:"is_monorepo,omitempty"`
	Project            *Project    `json:"project,omitempty"`
	Database           interface{} `json:"database,omitempty"`
}

func RestoreConfig

func RestoreConfig() (Config, error)

func RestoreConfigFromFile

func RestoreConfigFromFile(manifestConfigFile string) (Config, error)

func RestoreGlobalConfig added in v0.12.6

func RestoreGlobalConfig() (Config, error)

func RestoreLocalConfig added in v0.12.6

func RestoreLocalConfig() (Config, error)

func (*Config) IsMonorepoProject added in v0.13.0

func (c *Config) IsMonorepoProject() bool

type Manifest

type Manifest struct {
	Config
	Secret
}

func Initialize

func Initialize(mc Config, secretFile, configFile string) (Manifest, error)

func LocalInitialize

func LocalInitialize(mc Config) (Manifest, error)

It will detect if its an app of a monorepo, and will not create the .hxkey

func Restore

func Restore() (Manifest, error)

func RestoreFromFile

func RestoreFromFile(manifestConfigFile, manifestSecretFile string) (Manifest, error)

func (*Manifest) GetSecretKey

func (m *Manifest) GetSecretKey() *secretkey.SecretKey

type Project added in v0.13.0

type Project struct {
	Apps []string `json:"app"`
}

func (*Project) AddApp added in v0.13.0

func (w *Project) AddApp(appDir string)

type Secret

type Secret struct {
	SecretKeyId int64  `json:"secret_key_id"`
	SecretKey   string `json:"secret_key"`
}

func InitializeSecret

func InitializeSecret(secretFile string) (Secret, error)

func NewSecret

func NewSecret(sk *secretkey.SecretKey) Secret

func RestoreSecretFromFile

func RestoreSecretFromFile(manifestSecretFile string) (Secret, error)

func RestoreSecretFromMonorepo added in v0.13.0

func RestoreSecretFromMonorepo() (Secret, error)

Jump to

Keyboard shortcuts

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