methods

package
v0.0.25 Latest Latest
Warning

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

Go to latest
Published: Apr 19, 2025 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BasicAuth

func BasicAuth(next http.HandlerFunc) http.HandlerFunc

basicAuth - adding basic authentication to route

func CreateLinks(r *http.Request, count models.Count) models.Links

CreateLinks - Creating links for return object

func CreateLogger added in v0.0.10

func CreateLogger(level string) *zap.Logger

Create tailored logger

func RespondWithError

func RespondWithError(w http.ResponseWriter, code int, err error)

RespondWithError - creating JSON response with error

func RespondWithJSON

func RespondWithJSON(w http.ResponseWriter, code int, payload interface{})

RespondWithJSON - creating JSON response

func RespondWithMessage added in v0.0.25

func RespondWithMessage(w http.ResponseWriter, code int, status models.StatusObject)

RespondWithMessage - creating JSON response message, use status object

func ToBSON_D

func ToBSON_D(fields string, values string) bson.D

func ToBSON_M

func ToBSON_M(fields string, values string) bson.M

func VersionNotFound added in v0.0.22

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

VersionNotFound - Return version not found

Types

type Keycloak added in v0.0.12

type Keycloak struct {
	Logger       *zap.SugaredLogger
	Gocloak      *gocloak.GoCloak
	ClientId     string
	ClientSecret string
	Realm        string

	Permissions *[]gocloak.RequestingPartyPermission
	// contains filtered or unexported fields
}

Keycloak settings

func (*Keycloak) VerifyToken added in v0.0.12

func (auth *Keycloak) VerifyToken(next http.HandlerFunc) http.HandlerFunc

Validate access token. No detailed permissions

func (*Keycloak) VerifyTokenPermissions added in v0.0.12

func (auth *Keycloak) VerifyTokenPermissions(permissions string, next http.HandlerFunc) http.HandlerFunc

Validate access token. With detail permissions

type MongoPaginate

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

func NewMongoPaginate

func NewMongoPaginate(page int, limit int) *MongoPaginate

func (*MongoPaginate) GetPaginatedOpts

func (mp *MongoPaginate) GetPaginatedOpts() *options.FindOptions

Jump to

Keyboard shortcuts

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