request_utils

package
v1.2.0-alpha Latest Latest
Warning

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

Go to latest
Published: Feb 13, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DoRequest

func DoRequest(url string, opts ...RequestModifier) error

Types

type Data

type Data struct {
	Param           string        `json:"param" example:"param1"`
	Params          []string      `json:"params" example:"param1,param2"`
	ActionsRequired []string      `json:"actions_required" example:"iam:AttachUserPolicy,iam:DetachUserPolicy"`
	Reason          string        `json:"reason" example:"policy_id"`
	IssueFound      []interface{} `json:"issue_found"`
}

type Error

type Error struct {
	Message         string   `json:"message"`
	ActionsRequired []string `json:"actions_required"`
	Reason          string   `json:"reason"`
	Data            Data     `json:"data"`
	Params          []string `json:"params"`
	Param           string   `json:"param"`
}

type RequestBody

type RequestBody = map[string]interface{}

type RequestModifier

type RequestModifier = func(*RequestOptions, *http.Response) error

func WithAccessToken

func WithAccessToken(accessToken string) RequestModifier

func WithApiKey

func WithApiKey(apiKey string) RequestModifier

func WithAttachement

func WithAttachement() RequestModifier

func WithExpectedStatusCode

func WithExpectedStatusCode(status int) RequestModifier

func WithRefreshToken

func WithRefreshToken(refreshToken string) RequestModifier

func WithRequestBody

func WithRequestBody(body RequestBody) RequestModifier

func WithRequestBodyByte

func WithRequestBodyByte(body []byte) RequestModifier

func WithRequestBodyObject

func WithRequestBodyObject(body any) RequestModifier

func WithRequestMethod

func WithRequestMethod(method string) RequestModifier

type RequestOptions

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

Jump to

Keyboard shortcuts

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