rkgrpccors

package
v1.2.18 Latest Latest
Warning

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

Go to latest
Published: Dec 31, 2021 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Overview

Copyright (c) 2021 rookie-ninja

Use of this source code is governed by an Apache-style license that can be found in the LICENSE file.

Package rkgrpccors is a CORS interceptor for grpc framework

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Interceptor

func Interceptor(h http.Handler, opts ...Option) http.Handler

Types

type Option

type Option func(*optionSet)

Option if for middleware options while creating middleware

func WithAllowCredentials

func WithAllowCredentials(allow bool) Option

WithAllowCredentials allow credentials or not

func WithAllowHeaders

func WithAllowHeaders(headers ...string) Option

WithAllowHeaders provide allowed headers

func WithAllowMethods

func WithAllowMethods(methods ...string) Option

WithAllowMethods provide allowed http methods

func WithAllowOrigins

func WithAllowOrigins(origins ...string) Option

WithAllowOrigins provide allowed origins.

func WithEntryNameAndType

func WithEntryNameAndType(entryName, entryType string) Option

WithEntryNameAndType provide entry name and entry type.

func WithExposeHeaders

func WithExposeHeaders(headers ...string) Option

WithExposeHeaders provide expose headers

func WithMaxAge

func WithMaxAge(age int) Option

WithMaxAge provide max age

func WithSkipper

func WithSkipper(skip Skipper) Option

WithSkipper provide skipper.

type Skipper

type Skipper func(*http.Request) bool

Skipper default skipper will always return false

Jump to

Keyboard shortcuts

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