tyk_vcs

package
v1.4.3 Latest Latest
Warning

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

Go to latest
Published: Mar 28, 2024 License: MPL-2.0 Imports: 15 Imported by: 1

Documentation

Index

Constants

View Source
const (
	CREATE PublishAction = "create"
	UPDATE PublishAction = "update"
	ERROR  PublishAction = "error"

	TYPE_APIDEF SpecType = "apidef"
	TYPE_OAI    SpecType = "oas"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type APIInfo

type APIInfo struct {
	File  string `json:"file,omitempty"`
	APIID string `json:"api_id,omitempty"`
	DBID  string `json:"db_id,omitempty"`
	ORGID string `json:"org_id,omitempty"`
	OAS   struct {
		OverrideTarget     string `json:"override_target,omitempty"`
		OverrideListenPath string `json:"override_listen_path,omitempty"`
		VersionName        string `json:"version_name,omitempty"`
		StripListenPath    bool   `json:"strip_listen_path,omitempty"`
	} `json:"oas,omitempty"`
}

type BaseGetter

type BaseGetter struct {
	Getter
	// contains filtered or unexported fields
}

type FSGetter

type FSGetter struct {
	*BaseGetter
	Getter
	// contains filtered or unexported fields
}

func NewFSGetter

func NewFSGetter(filePath string, subdirectoryPath string) (*FSGetter, error)

func (*FSGetter) FetchAPIDef

func (gg *FSGetter) FetchAPIDef(spec *TykSourceSpec) ([]objects.DBApiDefinition, error)

func (*FSGetter) FetchPolicies

func (gg *FSGetter) FetchPolicies(spec *TykSourceSpec) ([]objects.Policy, error)

func (*FSGetter) FetchRepo

func (gg *FSGetter) FetchRepo() error

func (*FSGetter) FetchTykSpec

func (gg *FSGetter) FetchTykSpec() (*TykSourceSpec, error)

type Getter

type Getter interface {
	FetchRepo() error
	FetchAPIDef(spec *TykSourceSpec) ([]objects.DBApiDefinition, error)
	FetchPolicies(spec *TykSourceSpec) ([]objects.Policy, error)
	FetchTykSpec() (*TykSourceSpec, error)
}

type GitGetter

type GitGetter struct {
	*BaseGetter
	Getter
	// contains filtered or unexported fields
}

func NewGGetter

func NewGGetter(repo, branch string, key []byte, subdirectoryPath string) (*GitGetter, error)

func (*GitGetter) FetchAPIDef

func (gg *GitGetter) FetchAPIDef(spec *TykSourceSpec) ([]objects.DBApiDefinition, error)

func (*GitGetter) FetchPolicies

func (gg *GitGetter) FetchPolicies(spec *TykSourceSpec) ([]objects.Policy, error)

func (*GitGetter) FetchRepo

func (gg *GitGetter) FetchRepo() error

func (*GitGetter) FetchTykSpec

func (gg *GitGetter) FetchTykSpec() (*TykSourceSpec, error)

type PolicyInfo

type PolicyInfo struct {
	File string `json:"file,omitempty"`
	ID   string `json:"id,omitempty"`
}

type PublishAction

type PublishAction string

type Publisher

type Publisher interface {
	Name() string
	CreateAPIs(apiDefs *[]objects.DBApiDefinition) error
	UpdateAPIs(apiDefs *[]objects.DBApiDefinition) error
	SyncAPIs(apiDefs []objects.DBApiDefinition) error
	CreatePolicies(pols *[]objects.Policy) error
	UpdatePolicies(pols *[]objects.Policy) error
	SyncPolicies(pols []objects.Policy) error
	Reload() error
}

type SpecType

type SpecType string

type TykSourceSpec

type TykSourceSpec struct {
	Type     SpecType     `json:"type,omitempty"`
	Files    []APIInfo    `json:"files,omitempty"`
	Policies []PolicyInfo `json:"policies,omitempty"`
}

Jump to

Keyboard shortcuts

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