Documentation
¶
Index ¶
- Variables
- func AppId(length int) string
- func ArgumentsSliceToString(args []string, separator string) string
- func Checkmark() string
- func ClientCredentialLogin(tokenEndpoint string, clientId string, clientSecret string) error
- func ClientCredentialsLogin(ctx *AppContext, clientId string, clientSecret string) error
- func DeviceLogin(ctx *AppContext) error
- func Indeterminate() string
- func KebabCase(str string) string
- func LookupKind(data []byte) string
- func NewSpinner() *spinner.Spinner
- func NewTemplate() *template.Template
- func PrintError(output string) string
- func PrintSuccess(output string) string
- func PrintWarning(output string) string
- func RefreshToken(ctx *AppContext) error
- func SaveConfig(data *TokenResponse) error
- func SplitYAML(resources []byte) ([][]byte, error)
- func StartCase(str string) string
- func Times() string
- type ApiErrorResponse
- type ApiResponse
- type AppContext
- type AuthDetails
- type DeviceData
- type FS
- type NewApi
- func NewApiDelete[T any](ctx *AppContext, url string) (*NewApi[T], error)
- func NewApiGet[T any](ctx *AppContext, url string) (*NewApi[T], error)
- func NewApiPost[T any](ctx *AppContext, url string, body io.Reader) (*NewApi[T], error)
- func NewApiPut[T any](ctx *AppContext, url string, body io.Reader) (*NewApi[T], error)
- type OpenApi
- type T
- type TokenRequestError
- type TokenResponse
- type WellKnownConfig
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrorStyle = lipgloss.NewStyle().Foreground(lipgloss.Color("#d8292f"))
View Source
var SuccessStyle = lipgloss.NewStyle().Foreground(lipgloss.Color("#2d9f44"))
View Source
var WarningStyle = lipgloss.NewStyle().Foreground(lipgloss.Color("#fcba19"))
Functions ¶
func ArgumentsSliceToString ¶
func ClientCredentialLogin ¶
func ClientCredentialsLogin ¶
func ClientCredentialsLogin(ctx *AppContext, clientId string, clientSecret string) error
func DeviceLogin ¶
func DeviceLogin(ctx *AppContext) error
func Indeterminate ¶
func Indeterminate() string
func LookupKind ¶
func NewSpinner ¶
func NewTemplate ¶
func PrintError ¶
func PrintSuccess ¶
func PrintWarning ¶
func RefreshToken ¶
func RefreshToken(ctx *AppContext) error
func SaveConfig ¶
func SaveConfig(data *TokenResponse) error
Types ¶
type ApiErrorResponse ¶
type ApiErrorResponse struct {
Error string `json:"error"`
ErrorMessage string `json:"error_description"`
Message string `json:"message"`
Details struct {
Item struct {
Message string `json:"message"`
} `json:"d0"`
} `json:"details"`
}
API error parsing
func (*ApiErrorResponse) GetError ¶
func (e *ApiErrorResponse) GetError() error
type ApiResponse ¶
type AppContext ¶
type AuthDetails ¶
type AuthDetails struct {
Token string
}
type DeviceData ¶
type NewApi ¶
func NewApiDelete ¶
func NewApiDelete[T any](ctx *AppContext, url string) (*NewApi[T], error)
func NewApiGet ¶
func NewApiGet[T any](ctx *AppContext, url string) (*NewApi[T], error)
Convience methods
func NewApiPost ¶
func (*NewApi[T]) Do ¶
func (m *NewApi[T]) Do() (ApiResponse[T], error)
type OpenApi ¶
type OpenApi struct {
Components struct {
SecuritySchemes struct {
OpenId struct {
OpenIdConnectUrl string `yaml:"openIdConnectUrl"`
} `yaml:"openid"`
Oauth2 struct {
Flows struct {
ClientCredentials struct {
TokenUrl string `yaml:"tokenUrl"`
} `yaml:"clientCredentials"`
} `yaml:"flows"`
} `yaml:"oauth2"`
} `yaml:"securitySchemes"`
} `yaml:"components"`
}
type TokenRequestError ¶
type TokenResponse ¶
type TokenResponse struct {
AccessToken string `json:"access_token"`
ExpiresIn int16 `json:"expires_in"`
RefreshExpiresIn int32 `json:"refresh_expires_in"`
RefreshToken string `json:"refresh_token"`
TokenType string `json:"token_type"`
SessionState string `json:"session_state"`
Scope string `json:"scope"`
}
type WellKnownConfig ¶
Click to show internal directories.
Click to hide internal directories.