common

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jan 10, 2020 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

View Source
const (
	UsersEndpoint        = "/_opendistro/_security/api/internalusers/"
	RolesEndpoint        = "/_opendistro/_security/api/roles/"
	RolesMappingEndpoint = "/_opendistro/_security/api/rolesmapping/"
	ActiongroupEndpoint  = "/_opendistro/_security/api/actiongroups/"
	TenantEndpoint       = "/_opendistro/_security/api/tenants/"
	HealthEndpoint       = "/_opendistro/_security/health"
)

Variables

View Source
var Status = &statusList{
	Error:      "error",
	Forbidden:  "FORBIDDEN",
	Created:    "CREATED",
	Ok:         "OK",
	NotFound:   "NOT_FOUND",
	BadRequest: "BAD_REQUEST",
}

Functions

This section is empty.

Types

type ClientInterface

type ClientInterface interface {
	Do(ctx context.Context, reqBytes interface{}, endpoint string, method string) ([]byte, error)
	Get(ctx context.Context, path string, T interface{}) error
	GetBaseURL() string
	Modify(ctx context.Context, path string, method string, reqBytes interface{}) error
}

type Modifyable

type Modifyable interface {
	Delete(ctx context.Context, name string) error
	Update(ctx context.Context, name string, patches *[]Patch) error
	UpdateBatch(ctx context.Context, patches *[]Patch) error
}

type Patch

type Patch struct {
	Op    string      `json:"op"`
	Path  string      `json:"path"`
	Value interface{} `json:"value"`
}

type Service

type Service struct {
	Client ClientInterface
}

type StatusError

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

func NewStatusError

func NewStatusError(reason string, invalidKeys map[string]string) *StatusError

func (StatusError) Error

func (e StatusError) Error() string

type StatusResponse

type StatusResponse struct {
	Status      *string            `json:"status"`
	Message     *string            `json:"message"`
	Reason      *string            `json:"reason"`
	InvalidKeys *map[string]string `json:"invalid_keys"`
}

Jump to

Keyboard shortcuts

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