service

package
v0.0.0-...-7404c28 Latest Latest
Warning

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

Go to latest
Published: Dec 13, 2024 License: MIT Imports: 65 Imported by: 0

Documentation

Overview

Package service NOTES

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FeatureFlagsHandler

func FeatureFlagsHandler(w http.ResponseWriter, r *http.Request)

FeatureFlagsHandler 特性开关接口

func UserInfoHandler

func UserInfoHandler(w http.ResponseWriter, r *http.Request)

UserInfoHandler 鉴权后的用户信息接口

Types

type BizsOfTmplSpace

type BizsOfTmplSpace struct {
	sync.Mutex
	Bizs map[uint32]struct{}
}

BizsOfTmplSpace are bizs which already have default template spaces with a lock which can be used concurrently

func (*BizsOfTmplSpace) Has

func (b *BizsOfTmplSpace) Has(key uint32) bool

Has judge if a key in the bizs map

func (*BizsOfTmplSpace) Set

func (b *BizsOfTmplSpace) Set(key uint32)

Set save a key in the bizs map

type Exporter

type Exporter interface {
	Export() ([]byte, error)
}

Exporter The Exporter interface defines methods for exporting files.

type FeatureFlags

type FeatureFlags struct {
	// BizView 是否开启业务体验
	BizView bool `json:"BIZ_VIEW"`
	// ResourceLimit 业务资源限制
	ResourceLimit cc.ResourceLimit `json:"RESOURCE_LIMIT"`
}

FeatureFlags feature flags

type JSONExporter

type JSONExporter struct {
	OutData map[string]interface{}
}

JSONExporter implements the Exporter interface for exporting JSON files.

func (*JSONExporter) Export

func (je *JSONExporter) Export() ([]byte, error)

Export method implements the Exporter interface, exporting data as a byte slice in JSON format.

type JSONVariableExporter

type JSONVariableExporter struct {
	OutData map[string]interface{}
}

JSONVariableExporter implements the Exporter interface for exporting JSON files.

func (*JSONVariableExporter) VariableExport

func (js *JSONVariableExporter) VariableExport() ([]byte, error)

VariableExport method implements the Exporter interface, exporting data as a byte slice in JSON format.

type RkvOutData

type RkvOutData struct {
	Key    string `json:"key" yaml:"key" xml:"key"`
	KvType string `json:"kv_type" yaml:"kv_type" xml:"kv_type"`
	Value  string `json:"value" yaml:"value" xml:"value"`
	Memo   string `json:"memo" yaml:"memo" xml:"memo"`
}

RkvOutData struct defines the format of exported data

type Service

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

Service do all the api server's work

func NewService

func NewService(dis serviced.Discover) (*Service, error)

NewService create a service instance.

func (*Service) Handler

func (s *Service) Handler() (http.Handler, error)

Handler return service's handler.

type VariableExporter

type VariableExporter interface {
	VariableExport() ([]byte, error)
}

VariableExporter The Exporter interface defines methods for exporting files.

type XLSXExporter

type XLSXExporter struct {
	OutData []RkvOutData
}

XLSXExporter implements the Exporter interface for exporting XLSX files.

func (*XLSXExporter) Export

func (xe *XLSXExporter) Export() ([]byte, error)

Export method implements the Exporter interface, exporting data as a byte slice in XLSX format.

type XMLExporter

type XMLExporter struct {
	OutData []RkvOutData
}

XMLExporter implements the Exporter interface for exporting XML files.

func (*XMLExporter) Export

func (xe *XMLExporter) Export() ([]byte, error)

Export method implements the Exporter interface, exporting data as a byte slice in XML format.

type YAMLExporter

type YAMLExporter struct {
	OutData map[string]interface{}
}

YAMLExporter implements the Exporter interface for exporting YAML files.

func (*YAMLExporter) Export

func (ye *YAMLExporter) Export() ([]byte, error)

Export method implements the Exporter interface, exporting data as a byte slice in YAML format.

type YAMLVariableExporter

type YAMLVariableExporter struct {
	OutData map[string]interface{}
}

YAMLVariableExporter implements the Exporter interface for exporting YAML files.

func (*YAMLVariableExporter) VariableExport

func (ym *YAMLVariableExporter) VariableExport() ([]byte, error)

VariableExport method implements the Exporter interface, exporting data as a byte slice in YAML format.

Jump to

Keyboard shortcuts

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