example

package
v1.0.59 Latest Latest
Warning

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

Go to latest
Published: Nov 16, 2024 License: MIT Imports: 21 Imported by: 0

Documentation

Index

Constants

View Source
const (
	BodyUnmarshalFailed requestProcessingResultType = iota + 1
	BodyValidationFailed
	HeaderParseFailed
	HeaderValidationFailed
	QueryParseFailed
	QueryValidationFailed
	PathParseFailed
	PathValidationFailed
	SecurityParseFailed
	SecurityCheckFailed
	ParseSucceed
)

Variables

This section is empty.

Functions

func CallbacksHandler added in v1.0.28

func CallbacksHandler(impl CallbacksService, r chi.Router, hooks *Hooks, securitySchemas SecuritySchemas) http.Handler

func DeleteTransactionsUUIDResponseBuilder

func DeleteTransactionsUUIDResponseBuilder() *deleteTransactionsUUIDStatusCodeResponseBuilder

func PostCallbacksCallbackTypeResponseBuilder added in v1.0.28

func PostCallbacksCallbackTypeResponseBuilder() *postCallbacksCallbackTypeStatusCodeResponseBuilder

func PostTransactionResponseBuilder

func PostTransactionResponseBuilder() *postTransactionStatusCodeResponseBuilder

func PutTransactionResponseBuilder added in v1.0.53

func PutTransactionResponseBuilder() *putTransactionStatusCodeResponseBuilder

func Spec

func Spec(w http.ResponseWriter, _ *http.Request)

func TransactionsHandler

func TransactionsHandler(impl TransactionsService, r chi.Router, hooks *Hooks, securitySchemas SecuritySchemas) http.Handler

Types

type Boolean added in v1.0.39

type Boolean = bool

type CallbacksService added in v1.0.28

type CallbacksService interface {
	PostCallbacksCallbackType(context.Context, PostCallbacksCallbackTypeRequest) PostCallbacksCallbackTypeResponse
}

type CreateTransactionRequest

type CreateTransactionRequest struct {
	Amount        float64              `json:"amount"`
	AmountCents   int                  `json:"amountCents"`
	CallbackURL   url.URL              `json:"callbackURL"`
	Country       countries.Alpha2Code `json:"country"`
	Currency      currency.Code        `json:"currency"`
	Description   string               `json:"description"`
	Details       *string              `json:"details,omitempty"`
	Email         email.Email          `json:"email"`
	RegexParam    string               `json:"regexParam"`
	Title         string               `json:"title"`
	TransactionID uuid.UUID            `json:"transactionID"`
}

func (*CreateTransactionRequest) UnmarshalJSON

func (body *CreateTransactionRequest) UnmarshalJSON(data []byte) error

func (CreateTransactionRequest) Validate added in v1.0.27

func (body CreateTransactionRequest) Validate() error

type DeleteTransactionsUUID200ApplicationJsonResponseBuilder

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

func (*DeleteTransactionsUUID200ApplicationJsonResponseBuilder) Build

type DeleteTransactionsUUID400ApplicationJsonResponseBuilder

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

func (*DeleteTransactionsUUID400ApplicationJsonResponseBuilder) Build

type DeleteTransactionsUUIDRequest

type DeleteTransactionsUUIDRequest struct {
	Header               DeleteTransactionsUUIDRequestHeader
	Path                 DeleteTransactionsUUIDRequestPath
	Query                DeleteTransactionsUUIDRequestQuery
	ProcessingResult     RequestProcessingResult
	SecurityCheckResults map[SecurityScheme]string
}

type DeleteTransactionsUUIDRequestHeader added in v1.0.27

type DeleteTransactionsUUIDRequestHeader struct {
	XFingerprint string `json:"x-fingerprint"`
	XSignature   string `json:"x-signature"`
}

func (DeleteTransactionsUUIDRequestHeader) GetXFingerprint added in v1.0.48

func (header DeleteTransactionsUUIDRequestHeader) GetXFingerprint() string

func (DeleteTransactionsUUIDRequestHeader) GetXSignature added in v1.0.27

func (header DeleteTransactionsUUIDRequestHeader) GetXSignature() string

func (DeleteTransactionsUUIDRequestHeader) Validate added in v1.0.27

func (header DeleteTransactionsUUIDRequestHeader) Validate() error

type DeleteTransactionsUUIDRequestPath

type DeleteTransactionsUUIDRequestPath struct {
	RegexParam string
	UUID       string
}

func (DeleteTransactionsUUIDRequestPath) GetRegexParam added in v1.0.26

func (path DeleteTransactionsUUIDRequestPath) GetRegexParam() string

func (DeleteTransactionsUUIDRequestPath) GetUUID

func (DeleteTransactionsUUIDRequestPath) Validate added in v1.0.27

func (path DeleteTransactionsUUIDRequestPath) Validate() error

type DeleteTransactionsUUIDRequestQuery added in v1.0.39

type DeleteTransactionsUUIDRequestQuery struct {
	TimeParam time.Time
}

func (DeleteTransactionsUUIDRequestQuery) GetTimeParam added in v1.0.39

func (query DeleteTransactionsUUIDRequestQuery) GetTimeParam() time.Time

func (DeleteTransactionsUUIDRequestQuery) Validate added in v1.0.39

func (query DeleteTransactionsUUIDRequestQuery) Validate() error

type DeleteTransactionsUUIDResponse

type DeleteTransactionsUUIDResponse interface {
	// contains filtered or unexported methods
}

type Email

type Email = email.Email

type GenericResponse

type GenericResponse struct {
	Result GenericResponseResultEnum `json:"result"`
}

func (*GenericResponse) UnmarshalJSON

func (body *GenericResponse) UnmarshalJSON(data []byte) error

func (GenericResponse) Validate added in v1.0.27

func (body GenericResponse) Validate() error

type GenericResponseResultEnum

type GenericResponseResultEnum string
var GenericResponseResultEnumFailed GenericResponseResultEnum = "failed"
var GenericResponseResultEnumSuccess GenericResponseResultEnum = "success"

func (GenericResponseResultEnum) Check

func (enum GenericResponseResultEnum) Check() error

func (*GenericResponseResultEnum) UnmarshalJSON

func (enum *GenericResponseResultEnum) UnmarshalJSON(data []byte) error

type Hooks

type Hooks struct {
	RequestSecurityParseFailed    func(*http.Request, string, RequestProcessingResult)
	RequestSecurityParseCompleted func(*http.Request, string)
	RequestSecurityCheckFailed    func(*http.Request, string, string, RequestProcessingResult)
	RequestSecurityCheckCompleted func(*http.Request, string, string)
	RequestBodyUnmarshalFailed    func(*http.Request, string, RequestProcessingResult)
	RequestHeaderParseFailed      func(*http.Request, string, string, RequestProcessingResult)
	RequestPathParseFailed        func(*http.Request, string, string, RequestProcessingResult)
	RequestQueryParseFailed       func(*http.Request, string, string, RequestProcessingResult)
	RequestBodyValidationFailed   func(*http.Request, string, RequestProcessingResult)
	RequestHeaderValidationFailed func(*http.Request, string, RequestProcessingResult)
	RequestPathValidationFailed   func(*http.Request, string, RequestProcessingResult)
	RequestQueryValidationFailed  func(*http.Request, string, RequestProcessingResult)
	RequestBodyUnmarshalCompleted func(*http.Request, string)
	RequestHeaderParseCompleted   func(*http.Request, string)
	RequestPathParseCompleted     func(*http.Request, string)
	RequestQueryParseCompleted    func(*http.Request, string)
	RequestParseCompleted         func(*http.Request, string)
	RequestProcessingCompleted    func(*http.Request, string)
	RequestRedirectStarted        func(*http.Request, string, string)
	ResponseBodyMarshalCompleted  func(*http.Request, string)
	ResponseBodyWriteCompleted    func(*http.Request, string, int)
	ResponseBodyMarshalFailed     func(http.ResponseWriter, *http.Request, string, error)
	ResponseBodyWriteFailed       func(*http.Request, string, int, error)
	ServiceCompleted              func(*http.Request, string)
}

type PostCallbacksCallbackType200ApplicationOctetStreamResponseBuilder added in v1.0.28

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

func (*PostCallbacksCallbackType200ApplicationOctetStreamResponseBuilder) Build added in v1.0.28

type PostCallbacksCallbackType200Headers added in v1.0.36

type PostCallbacksCallbackType200Headers struct {
	XJwsSignature string
}

type PostCallbacksCallbackType307Headers added in v1.0.57

type PostCallbacksCallbackType307Headers struct {
	ReferrerPolicy string
}

type PostCallbacksCallbackType307ResponseBuilder added in v1.0.57

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

func (*PostCallbacksCallbackType307ResponseBuilder) Build added in v1.0.57

type PostCallbacksCallbackTypeRequest added in v1.0.28

type PostCallbacksCallbackTypeRequest struct {
	Body                 RawPayload
	Path                 PostCallbacksCallbackTypeRequestPath
	Query                PostCallbacksCallbackTypeRequestQuery
	ProcessingResult     RequestProcessingResult
	SecurityCheckResults map[SecurityScheme]string
}

type PostCallbacksCallbackTypeRequestPath added in v1.0.28

type PostCallbacksCallbackTypeRequestPath struct {
	CallbackType string
}

func (PostCallbacksCallbackTypeRequestPath) GetCallbackType added in v1.0.28

func (path PostCallbacksCallbackTypeRequestPath) GetCallbackType() string

func (PostCallbacksCallbackTypeRequestPath) Validate added in v1.0.28

type PostCallbacksCallbackTypeRequestQuery added in v1.0.39

type PostCallbacksCallbackTypeRequestQuery struct {
	HasSmth bool
}

func (PostCallbacksCallbackTypeRequestQuery) GetHasSmth added in v1.0.39

func (query PostCallbacksCallbackTypeRequestQuery) GetHasSmth() bool

func (PostCallbacksCallbackTypeRequestQuery) Validate added in v1.0.39

type PostCallbacksCallbackTypeResponse added in v1.0.28

type PostCallbacksCallbackTypeResponse interface {
	// contains filtered or unexported methods
}

type PostTransaction201ApplicationJsonResponseBuilder

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

func (*PostTransaction201ApplicationJsonResponseBuilder) Build

type PostTransaction400ApplicationJsonResponseBuilder

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

func (*PostTransaction400ApplicationJsonResponseBuilder) Build

type PostTransaction500ApplicationJsonResponseBuilder added in v1.0.27

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

func (*PostTransaction500ApplicationJsonResponseBuilder) Build added in v1.0.27

type PostTransactionRequest

type PostTransactionRequest struct {
	Body             CreateTransactionRequest
	Header           PostTransactionRequestHeader
	ProcessingResult RequestProcessingResult
}

type PostTransactionRequestHeader added in v1.0.27

type PostTransactionRequestHeader struct {
	XFingerprint string `json:"x-fingerprint"`
	XSignature   string `json:"x-signature"`
}

func (PostTransactionRequestHeader) GetXFingerprint added in v1.0.48

func (header PostTransactionRequestHeader) GetXFingerprint() string

func (PostTransactionRequestHeader) GetXSignature added in v1.0.27

func (header PostTransactionRequestHeader) GetXSignature() string

func (PostTransactionRequestHeader) Validate added in v1.0.27

func (header PostTransactionRequestHeader) Validate() error

type PostTransactionResponse

type PostTransactionResponse interface {
	// contains filtered or unexported methods
}

type PutTransaction200ApplicationJsonResponseBuilder added in v1.0.53

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

func (*PutTransaction200ApplicationJsonResponseBuilder) Build added in v1.0.53

type PutTransaction400ApplicationJsonResponseBuilder added in v1.0.53

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

func (*PutTransaction400ApplicationJsonResponseBuilder) Build added in v1.0.53

type PutTransaction500ApplicationJsonResponseBuilder added in v1.0.53

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

func (*PutTransaction500ApplicationJsonResponseBuilder) Build added in v1.0.53

type PutTransactionRequest added in v1.0.53

type PutTransactionRequest struct {
	Body             UpdateTransactionRequest
	Header           PutTransactionRequestHeader
	ProcessingResult RequestProcessingResult
}

type PutTransactionRequestHeader added in v1.0.53

type PutTransactionRequestHeader struct {
	XFingerprint string `json:"x-fingerprint"`
	XSignature   string `json:"x-signature"`
}

func (PutTransactionRequestHeader) GetXFingerprint added in v1.0.53

func (header PutTransactionRequestHeader) GetXFingerprint() string

func (PutTransactionRequestHeader) GetXSignature added in v1.0.53

func (header PutTransactionRequestHeader) GetXSignature() string

func (PutTransactionRequestHeader) Validate added in v1.0.53

func (header PutTransactionRequestHeader) Validate() error

type PutTransactionResponse added in v1.0.53

type PutTransactionResponse interface {
	// contains filtered or unexported methods
}

type RawPayload added in v1.0.28

type RawPayload = []byte

type RequestProcessingResult

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

func NewRequestProcessingResult

func NewRequestProcessingResult(t requestProcessingResultType, err error) RequestProcessingResult

func (RequestProcessingResult) Err

func (RequestProcessingResult) Type

func (r RequestProcessingResult) Type() requestProcessingResultType

type SecurityCheckResult

type SecurityCheckResult struct {
	Scheme SecurityScheme
	Value  string
}

type SecuritySchemas

type SecuritySchemas interface {
	SecuritySchemeBasic(r *http.Request, scheme SecurityScheme, name string, value string) error
	SecuritySchemeBearer(r *http.Request, scheme SecurityScheme, name string, value string) error
	SecuritySchemeCookie(r *http.Request, scheme SecurityScheme, name string, value string) error
}

type SecurityScheme

type SecurityScheme string
const (
	SecuritySchemeBasic  SecurityScheme = "Basic"
	SecuritySchemeBearer SecurityScheme = "Bearer"
	SecuritySchemeCookie SecurityScheme = "Cookie"
)

type Time added in v1.0.39

type Time = time.Time

type URL

type URL = url.URL

type UpdateTransactionRequest added in v1.0.53

type UpdateTransactionRequest struct {
	Description string  `json:"description"`
	Details     *string `json:"details,omitempty"`
	Title       string  `json:"title"`
}

func (*UpdateTransactionRequest) UnmarshalJSON added in v1.0.53

func (body *UpdateTransactionRequest) UnmarshalJSON(data []byte) error

type WithEnum added in v1.0.28

type WithEnum string
var WithEnumOne WithEnum = "one"
var WithEnumTwo WithEnum = "two"

func (WithEnum) Check added in v1.0.28

func (enum WithEnum) Check() error

func (*WithEnum) UnmarshalJSON added in v1.0.28

func (enum *WithEnum) UnmarshalJSON(data []byte) error

Jump to

Keyboard shortcuts

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