model

package
v0.0.0-...-5972462 Latest Latest
Warning

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

Go to latest
Published: Apr 6, 2023 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type APIKey

type APIKey struct {
	Header []string `toml:"header"`
}

APIKey type

type Basic

type Basic struct {
	Username string   `toml:"username"`
	Password string   `toml:"password"`
	Header   []string `toml:"header"`
}

Basic type

type Bearer

type Bearer struct {
	Header []string `toml:"header"`
}

Bearer type

type Configs

type Configs struct {
	General  General  `toml:"General"`
	Gist     Gist     `toml:"Gist"`
	Services Services `toml:"Services"`
}

Configs type

func NewConfigs

func NewConfigs() *Configs

NewConfigs creates an instance of Configs

func (*Configs) Decode

func (g *Configs) Decode(path string) error

Decode decodes from file to struct

func (*Configs) Encode

func (g *Configs) Encode(path string) error

Encode encodes struct and store on file

type Endpoint

type Endpoint struct {
	ID          string     `toml:"id"`
	Name        string     `toml:"name"`
	Description string     `toml:"description"`
	Method      string     `toml:"method"`
	Headers     [][]string `toml:"headers"`
	Parameters  [][]string `toml:"parameters"`
	URI         string     `toml:"uri"`
	Body        string     `toml:"body"`
	Public      bool       `toml:"public"`
}

Endpoint type

type General

type General struct {
	Editor    string `toml:"editor"`
	Column    int    `toml:"column"`
	Selectcmd string `toml:"selectcmd"`
	Backend   string `toml:"backend"`
	Sortby    string `toml:"sortby"`
}

General type

type Gist

type Gist struct {
	AccessToken string `toml:"access_token"`
	GistID      string `toml:"gist_id"`
	Username    string `toml:"username"`
	Public      bool   `toml:"public"`
	AutoSync    bool   `toml:"auto_sync"`
}

Gist type

type Main

type Main struct {
	ID          string     `toml:"id"`
	Name        string     `toml:"name"`
	Description string     `toml:"description"`
	Timeout     string     `toml:"timeout"`
	ServiceURL  string     `toml:"service_url"`
	Headers     [][]string `toml:"headers"`
}

Main type

type Security

type Security struct {
	Scheme string `toml:"scheme"`
	Basic  Basic  `toml:"Basic"`
	APIKey APIKey `toml:"ApiKey"`
	Bearer Bearer `toml:"Bearer"`
}

Security type

type Service

type Service struct {
	Main     Main       `toml:"Main"`
	Security Security   `toml:"Security"`
	Endpoint []Endpoint `toml:"Endpoint"`
}

Service type

func NewEmptyService

func NewEmptyService(id string) *Service

NewEmptyService creates an empty instance of Service

func NewService

func NewService(id string) *Service

NewService creates an instance of Service

func (*Service) Decode

func (s *Service) Decode(path string) error

Decode decodes from file to struct

func (*Service) Encode

func (s *Service) Encode(path string) error

Encode encodes struct and store on file

type Services

type Services struct {
	Directory string `toml:"directory"`
}

Services type

Jump to

Keyboard shortcuts

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