umbrella

package
v0.0.0-...-54ce176 Latest Latest
Warning

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

Go to latest
Published: Oct 19, 2023 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateJSONPayload

func CreateJSONPayload(data interface{}) (*bytes.Buffer, error)

func RemoveAtIndex

func RemoveAtIndex(s []string, index int) []string

Types

type Destination

type Destination struct {
	ID          string `json:"id"`
	Destination string `json:"destination"`
	Type        string `json:"type"`
	Comment     string `json:"comment"`
	CreatedAt   string `json:"createdAt"`
}

type DestinationList

type DestinationList struct {
	ID                   int                 `json:"id"`
	OrganizationID       int                 `json:"organizatioNId"`
	Access               string              `json:"access"`
	IsGlobal             bool                `json:"isGlobal"`
	Name                 string              `json:"name"`
	ThirdpartyCategoryId string              `json:"thirdpartyCategoryId"`
	CreatedAt            int                 `json:"createdAt"`
	ModifiedAt           int                 `json:"modifiedAt"`
	IsMspDefault         bool                `json:"isMspDefault"`
	MarkedForDeletion    bool                `json:"markedForDeletion"`
	BundleTypeId         int                 `json:"bundleTypeId"`
	Meta                 DestinationListMeta `json:"meta"`
}

type DestinationListMeta

type DestinationListMeta struct {
	DestinationCount int `json:"destinationCount"`
	DomainCount      int `json:"domainCount"`
	URLCount         int `json:"urlCount"`
	IPv4Count        int `json:"ipv4Count"`
	ApplicationCount int `json:"applicationCount"`
}

type Meta

type Meta struct {
	Page  int `json:"page"`
	Limit int `json:"limit"`
	Total int `json:"total"`
}

type NewDestination

type NewDestination struct {
	Destination string `json:"destination"`
}

type Status

type Status struct {
	Code int    `json:"code"`
	Text string `json:"text"`
}

type UmbrellaClient

type UmbrellaClient struct {
	// contains filtered or unexported fields
}

func CreateUmbrellaClient

func CreateUmbrellaClient(configurationManager configurationManager.ConfigurationManager, logger logging.Logger) *UmbrellaClient

func (*UmbrellaClient) Delete

func (u *UmbrellaClient) Delete(scope string, endpoint string, headers map[string]string, params map[string]string, data io.Reader) (UmbrellaResponse, error)

func (*UmbrellaClient) Get

func (u *UmbrellaClient) Get(scope string, endpoint string, headers map[string]string, params map[string]string) (UmbrellaResponse, error)

func (*UmbrellaClient) Patch

func (u *UmbrellaClient) Patch(scope string, endpoint string, headers map[string]string, params map[string]string, data io.Reader) (UmbrellaResponse, error)

func (*UmbrellaClient) Post

func (u *UmbrellaClient) Post(scope string, endpoint string, headers map[string]string, params map[string]string, data io.Reader) (UmbrellaResponse, error)

func (*UmbrellaClient) Request

func (u *UmbrellaClient) Request(method string, url string, headers map[string]string, params map[string]string, data io.Reader) (UmbrellaResponse, error)

type UmbrellaConnector

type UmbrellaConnector struct {
	// contains filtered or unexported fields
}

func New

func New(client *UmbrellaClient, configurationManager configurationManager.ConfigurationManager, logger logging.Logger) (*UmbrellaConnector, error)

func (*UmbrellaConnector) AddDestinations

func (u *UmbrellaConnector) AddDestinations(destinationList DestinationList, destinationsToAdd []string, chunkSize int) (DestinationList, error)

Add destinations to a destination list

func (*UmbrellaConnector) CreateDestinationList

func (u *UmbrellaConnector) CreateDestinationList(access string, isGlobal bool, name string) (DestinationList, error)

Creates a new destination list

func (*UmbrellaConnector) DeleteDestinationList

func (u *UmbrellaConnector) DeleteDestinationList(id int) error

func (*UmbrellaConnector) DeleteDestinations

func (u *UmbrellaConnector) DeleteDestinations(destinationList DestinationList, destinationsToRemove []string, existingDestinations []Destination, chunkSize int) (DestinationList, error)

Removes destinations from a destination list

func (*UmbrellaConnector) GetDestinationList

func (u *UmbrellaConnector) GetDestinationList(id int) (DestinationList, error)

Gets a single destination list

func (*UmbrellaConnector) GetDestinationLists

func (u *UmbrellaConnector) GetDestinationLists(limit int) ([]DestinationList, error)

Gets all destination lists using pagination

func (*UmbrellaConnector) GetDestinations

func (u *UmbrellaConnector) GetDestinations(id int, limit int) ([]Destination, error)

Gets all destinations from a destination list

func (*UmbrellaConnector) UpdateDestinationList

func (u *UmbrellaConnector) UpdateDestinationList(id int, name string) (DestinationList, error)

Updates a destination lists name

func (*UmbrellaConnector) ValidateDestinationValues

func (u *UmbrellaConnector) ValidateDestinationValues(destinations []string) ([]string, error)

type UmbrellaResponse

type UmbrellaResponse struct {
	Status Status           `json:"status"`
	Meta   Meta             `json:"meta"`
	Data   *json.RawMessage `json:"data"`
}

type UmbrellaResponseError

type UmbrellaResponseError struct {
	Error    string      `json:"error"`
	Message  interface{} `json:"message"`
	Code     int         `json:"code"`
	CodeText string      `json:"code_text"`
}

Jump to

Keyboard shortcuts

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