config

package
v0.1.7 Latest Latest
Warning

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

Go to latest
Published: Mar 18, 2022 License: MIT Imports: 10 Imported by: 7

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Get

func Get(key string) (string, error)

根据key获取配置信息

func GetString

func GetString(key string) string

func RegisterAppconfigServer

func RegisterAppconfigServer(s *grpc.Server, srv AppconfigServer)

Types

type AppconfigClient

type AppconfigClient interface {
	// 定义接口 (结构体可以复用)
	// 方法 (请求消息结构体) returns (返回消息结构体) {}
	GetAppConfig(ctx context.Context, in *Params, opts ...grpc.CallOption) (*Result, error)
}

AppconfigClient is the client API for Appconfig service.

For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.

func NewAppconfigClient

func NewAppconfigClient(cc *grpc.ClientConn) AppconfigClient

type AppconfigServer

type AppconfigServer interface {
	// 定义接口 (结构体可以复用)
	// 方法 (请求消息结构体) returns (返回消息结构体) {}
	GetAppConfig(context.Context, *Params) (*Result, error)
}

AppconfigServer is the server API for Appconfig service.

type Params

type Params struct {
	Keys                 string   `protobuf:"bytes,1,opt,name=keys,proto3" json:"keys,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

定义 Res 消息结构

func (*Params) Descriptor

func (*Params) Descriptor() ([]byte, []int)

func (*Params) GetKeys

func (m *Params) GetKeys() string

func (*Params) ProtoMessage

func (*Params) ProtoMessage()

func (*Params) Reset

func (m *Params) Reset()

func (*Params) String

func (m *Params) String() string

func (*Params) XXX_DiscardUnknown

func (m *Params) XXX_DiscardUnknown()

func (*Params) XXX_Marshal

func (m *Params) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*Params) XXX_Merge

func (m *Params) XXX_Merge(src proto.Message)

func (*Params) XXX_Size

func (m *Params) XXX_Size() int

func (*Params) XXX_Unmarshal

func (m *Params) XXX_Unmarshal(b []byte) error

type Result

type Result struct {
	Code                 int32    `protobuf:"varint,2,opt,name=Code,proto3" json:"Code,omitempty"`
	Data                 string   `protobuf:"bytes,1,opt,name=Data,proto3" json:"Data,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (*Result) Descriptor

func (*Result) Descriptor() ([]byte, []int)

func (*Result) GetCode

func (m *Result) GetCode() int32

func (*Result) GetData

func (m *Result) GetData() string

func (*Result) ProtoMessage

func (*Result) ProtoMessage()

func (*Result) Reset

func (m *Result) Reset()

func (*Result) String

func (m *Result) String() string

func (*Result) XXX_DiscardUnknown

func (m *Result) XXX_DiscardUnknown()

func (*Result) XXX_Marshal

func (m *Result) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*Result) XXX_Merge

func (m *Result) XXX_Merge(src proto.Message)

func (*Result) XXX_Size

func (m *Result) XXX_Size() int

func (*Result) XXX_Unmarshal

func (m *Result) XXX_Unmarshal(b []byte) error

type UnimplementedAppconfigServer

type UnimplementedAppconfigServer struct {
}

UnimplementedAppconfigServer can be embedded to have forward compatible implementations.

func (*UnimplementedAppconfigServer) GetAppConfig

func (*UnimplementedAppconfigServer) GetAppConfig(ctx context.Context, req *Params) (*Result, error)

Jump to

Keyboard shortcuts

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