common

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: May 22, 2021 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConvertToTool added in v0.1.2

func ConvertToTool(data map[string]string) (*opslevel.ToolCreateInput, error)

func GetString

func GetString(parser JQParser, data []byte) string

func NewClient added in v0.2.0

func NewClient() *opslevel.Client

Types

type JQParser

type JQParser struct {
	JQ jq.JQ
}

func NewJQParser

func NewJQParser(filter string) JQParser

func (*JQParser) Parse

func (parser *JQParser) Parse(data []byte) *JQResponse

type JQResponse

type JQResponse struct {
	Bytes          []byte
	Type           JQResponseType
	StringObj      string
	StringArray    []string
	StringMap      map[string]string
	StringMapArray []map[string]string
}

func (*JQResponse) Unmarshal

func (resp *JQResponse) Unmarshal()

type JQResponseType

type JQResponseType int
const (
	Empty JQResponseType = iota
	String
	StringArray
	StringStringMap
	StringStringMapArray
	Unknown
)

type ServiceRegistration

type ServiceRegistration struct {
	Name        string
	Description string                     `json:",omitempty"`
	Owner       string                     `json:",omitempty"`
	Lifecycle   string                     `json:",omitempty"`
	Tier        string                     `json:",omitempty"`
	Product     string                     `json:",omitempty"`
	Language    string                     `json:",omitempty"`
	Framework   string                     `json:",omitempty"`
	Aliases     []string                   `json:",omitempty"`
	Tags        map[string]string          `json:",omitempty"`
	Tools       []opslevel.ToolCreateInput `json:",omitempty"` // This is a concrete class so fields are validated during `service preview`
}

func QueryForServices

func QueryForServices(c *config.Config) ([]ServiceRegistration, error)

type ServiceRegistrationParser

type ServiceRegistrationParser struct {
	Name        JQParser
	Description JQParser
	Owner       JQParser
	Lifecycle   JQParser
	Tier        JQParser
	Product     JQParser
	Language    JQParser
	Framework   JQParser
	Aliases     []JQParser
	Tags        []JQParser
	Tools       []JQParser
}

func (*ServiceRegistrationParser) Parse

func (parser *ServiceRegistrationParser) Parse(data []byte) *ServiceRegistration

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
JackTT - Gopher 🇻🇳