Skip to content

Improve config.Service validation, introduce config.BaseURL#18

Merged
VojtechVitek merged 4 commits intomasterfrom
introduce-config-url-that-works-with-tom
Nov 25, 2025
Merged

Improve config.Service validation, introduce config.BaseURL#18
VojtechVitek merged 4 commits intomasterfrom
introduce-config-url-that-works-with-tom

Conversation

@VojtechVitek
Copy link
Contributor

@VojtechVitek VojtechVitek commented Nov 25, 2025

config.BaseURL

[metadata]
  url = "http://localhost:4242"
package config

import "github.com/0xsequence/go-libs/config"

type MetadataConfig {
    URL config.BaseURL `toml:"url"`
}

// url := config.Metadata.BaseURL.URL()

config.Services

[services.metadata]
    url = "http://localhost:4242"
    jwt_secret = "secret"
    debug_requests = false

[services.indexer]
    url = "https://indexer.sequence.app"
    jwt_secret = "secret"
    access_key = "key"  ## This will error out, as jwt_secret and access_key are mutually exclusive
    debug_requests = true

[services.another]
    disabled = true
    url = ""            ## Empty URL is OK, since the service is disabled
    debug_requests = true

@VojtechVitek VojtechVitek changed the title Introduce config.URL that works with TOML configs Improve service validation, introduce config.BaseURL for TOML configs Nov 25, 2025
@VojtechVitek VojtechVitek changed the title Improve service validation, introduce config.BaseURL for TOML configs Improve config.Service validation, introduce config.BaseURL Nov 25, 2025
klaidliadon
klaidliadon previously approved these changes Nov 25, 2025
Copy link
Contributor

@david-littlefarmer david-littlefarmer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@VojtechVitek VojtechVitek merged commit 64d9463 into master Nov 25, 2025
2 checks passed
@VojtechVitek VojtechVitek deleted the introduce-config-url-that-works-with-tom branch November 25, 2025 13:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants