github.com/gitbundle/modules@v0.0.0-20231025071548-85b91c5c3b01/setting/nsq.go (about)

     1  // Copyright 2023 The GitBundle Inc. All rights reserved.
     2  // Copyright 2017 The Gitea Authors. All rights reserved.
     3  // Use of this source code is governed by a MIT-style
     4  // license that can be found in the LICENSE file.
     5  
     6  package setting
     7  
     8  import "github.com/gitbundle/modules/log"
     9  
    10  var (
    11  	Nsq = struct {
    12  		ClusterTcpAddr string
    13  		AuthSecret     string
    14  		Debug          bool
    15  		Disable        bool
    16  	}{}
    17  )
    18  
    19  func newNsqService() {
    20  	if err := Cfg.Section("nsq").MapTo(&Nsq); err != nil {
    21  		log.Fatal("Failed to map nsq settings: %v", err)
    22  	}
    23  
    24  	if Nsq.ClusterTcpAddr == "" {
    25  		log.Fatal("Empty ClusterTcpAddr for nsq setting")
    26  	}
    27  }