initializers

package
v0.0.0-...-4cbe2fd Latest Latest
Warning

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

Go to latest
Published: Jun 18, 2023 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func InitLog

func InitLog(logfile string) *os.File

Types

type Env

type Env struct {
	Port         string `env:"PORT" envDefault:"8080"`
	LogFile      string `env:"LOG_FILE" envDefault:"gin.log"`
	KeycloakUrl  string `env:"KEYCLOAK_URL" envDefault:"http://localhost:8080/auth/"`
	Realm        string `env:"REALM" envDefault:"bingemate-local"`
	ClientId     string `env:"CLIENT_ID" envDefault:"keycloak-service"`
	ClientSecret string `env:"CLIENT_SECRET" envDefault:"eolmrfghiouerhiueyrhtgzeriughz"`
}

func LoadEnv

func LoadEnv() (Env, error)

type KeycloakClient

type KeycloakClient struct {
	Realm   string
	Gocloak gocloak.GoCloak
	Token   *gocloak.JWT
	// contains filtered or unexported fields
}

func ConnectToKeycloak

func ConnectToKeycloak(env Env) (*KeycloakClient, error)

func (*KeycloakClient) EnsureToken

func (kc *KeycloakClient) EnsureToken(ctx context.Context) error

Jump to

Keyboard shortcuts

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