cmd

package
v0.1.0-alpha Latest Latest
Warning

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

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

Documentation

Overview

Copyright © 2025 Timothy Tavarez <timothy.tavarez@decombine.com>

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Index

Constants

This section is empty.

Variables

View Source
var (
	NetworkKey = "network"
	ConfigPath = "/.config/contract/"
)
View Source
var DecombineClient = NetworkClient{
	Address: "http://api.decombine.local:8025",
	Timeout: 10 * time.Second,
}
View Source
var DecombineNetwork = slc.Network{
	Name:              "decombine",
	API:               "https://api.decombine.com",
	URL:               "https://decombine.com",
	ClientID:          "304073732412997862",
	Issuer:            "https://authentication.decombine.com",
	DiscoveryEndpoint: "https://authentication.decombine.com/.well-known/openid-configuration",
}
View Source
var (
	ErrSourceNotSupported = errors.New("source type not supported")
)
View Source
var ErrStyle = lipgloss.NewStyle().Foreground(lipgloss.Color("9"))
View Source
var Lang string

Functions

func Execute

func Execute()

Execute adds all child commands to the root command and sets flags appropriately. This is called by main.main(). It only needs to happen once to the rootCmd.

func GetIDToken

func GetIDToken(name string) (string, error)

func Networks

func Networks() []slc.Network

func UpdateConfig

func UpdateConfig(path string, config *ContractCLIConfig) error

Types

type ContractCLIConfig

type ContractCLIConfig struct {
	Language                string        `yaml:"language" toml:"language" json:"language"`
	DefaultContractFileType string        `yaml:"defaultContractFileType" toml:"defaultContractFileType" json:"defaultContractFileType"`
	DefaultNetwork          string        `yaml:"defaultNetwork" toml:"defaultNetwork" json:"defaultNetwork"`
	Networks                []slc.Network `yaml:"networks" toml:"networks" json:"networks"`
}

func Config

func Config() (ContractCLIConfig, error)

type NetworkClient

type NetworkClient struct {
	Address string
	Timeout time.Duration
}

Jump to

Keyboard shortcuts

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