manifest

package
v0.12.10 Latest Latest
Warning

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

Go to latest
Published: Dec 10, 2024 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

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

Functions

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 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"`
	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)

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)

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 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)

Jump to

Keyboard shortcuts

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