service

package
v0.21.2 Latest Latest
Warning

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

Go to latest
Published: Aug 25, 2021 License: GPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// headers
	HeaderXAPI          = "X-Api"
	HeaderXAPIToken     = "X-Api-Token"
	HeaderXClientIP     = "X-Client-IP"
	HeaderXRequestID    = "X-Request-ID"
	HeaderReferer       = "Referer"
	HeaderContentLength = "Content-Length"
	HeaderContentType   = "Content-Type"
	HeaderCookie        = "Cookie"
	HeaderLocation      = "Location"
	HeaderXForwardedFor = "X-Forwarded-For"
	HeaderXRealIP       = "X-Real-IP"
	HeaderAuthorization = "Authorization"
	HeaderOrigin        = "Origin"

	// cors
	HeaderAccessControlRequestMethod    = "Access-Control-Request-Method"
	HeaderAccessControlRequestHeaders   = "Access-Control-Request-Headers"
	HeaderAccessControlAllowOrigin      = "Access-Control-Allow-Origin"
	HeaderAccessControlAllowMethods     = "Access-Control-Allow-Methods"
	HeaderAccessControlAllowHeaders     = "Access-Control-Allow-Headers"
	HeaderAccessControlAllowCredentials = "Access-Control-Allow-Credentials"
	HeaderAccessControlExposeHeaders    = "Access-Control-Expose-Headers"
	HeaderAccessControlMaxAge           = "Access-Control-Max-Age"

	// csrf
	HeaderStrictTransportSecurity         = "Strict-Transport-Security"
	HeaderXContentTypeOptions             = "X-Content-Type-Options"
	HeaderXXSSProtection                  = "X-XSS-Protection"
	HeaderXFrameOptions                   = "X-Frame-Options"
	HeaderContentSecurityPolicy           = "Content-Security-Policy"
	HeaderContentSecurityPolicyReportOnly = "Content-Security-Policy-Report-Only"
	HeaderXCSRFToken                      = "X-CSRF-Token"
	HeaderReferrerPolicy                  = "Referrer-Policy"
)

header keys

View Source
const (
	MIMEApplicationJSON                  = "application/json"
	MIMEApplicationJSONCharsetUTF8       = MIMEApplicationJSON + "; " + charsetUTF8
	MIMEApplicationJavaScript            = "application/javascript"
	MIMEApplicationJavaScriptCharsetUTF8 = MIMEApplicationJavaScript + "; " + charsetUTF8
	MIMEApplicationXML                   = "application/xml"
	MIMEApplicationXMLCharsetUTF8        = MIMEApplicationXML + "; " + charsetUTF8
	MIMETextXML                          = "text/xml"
	MIMETextXMLCharsetUTF8               = MIMETextXML + "; " + charsetUTF8
	MIMEApplicationForm                  = "application/x-www-form-urlencoded"
	MIMEApplicationProtobuf              = "application/protobuf"
	MIMEApplicationMsgpack               = "application/msgpack"
	MIMETextHTML                         = "text/html"
	MIMETextHTMLCharsetUTF8              = MIMETextHTML + "; " + charsetUTF8
	MIMETextPlain                        = "text/plain"
	MIMETextPlainCharsetUTF8             = MIMETextPlain + "; " + charsetUTF8
	MIMEMultipartForm                    = "multipart/form-data"
	MIMEOctetStream                      = "application/octet-stream"
)

mime keys

Variables

View Source
var EventType_name = map[int32]string{
	0: "create",
	1: "delete",
	2: "update",
}
View Source
var EventType_value = map[string]int32{
	"create": 0,
	"delete": 1,
	"update": 2,
}
View Source
var Protocol_name = map[int32]string{
	0: "LOCAL",
	1: "GRPC",
	2: "HTTP",
	3: "QUIC",
	4: "UDP",
	5: "TCP",
}
View Source
var Protocol_value = map[string]int32{
	"LOCAL": 0,
	"GRPC":  1,
	"HTTP":  2,
	"QUIC":  3,
	"UDP":   4,
	"TCP":   5,
}
View Source
var RegisterType_name = map[int32]string{
	0: "memory",
	1: "etcd",
}
View Source
var RegisterType_value = map[string]int32{
	"memory": 0,
	"etcd":   1,
}

Functions

func ReplaceURL

func ReplaceURL(str string) string

ReplaceURL replace url

Types

type EventType

type EventType int32
const (
	EventType_create EventType = 0
	EventType_delete EventType = 1
	EventType_update EventType = 2
)

func (EventType) EnumDescriptor

func (EventType) EnumDescriptor() ([]byte, []int)

func (EventType) String

func (x EventType) String() string

type LifeCycle

type LifeCycle interface {
	Start() error
	Stop() error
}

LifeCycle service's lifecycle

type Protocol

type Protocol int32
const (
	Protocol_LOCAL Protocol = 0
	Protocol_GRPC  Protocol = 1
	Protocol_HTTP  Protocol = 2
	Protocol_QUIC  Protocol = 3
	Protocol_UDP   Protocol = 4
	Protocol_TCP   Protocol = 5
)

func (Protocol) EnumDescriptor

func (Protocol) EnumDescriptor() ([]byte, []int)

func (Protocol) String

func (x Protocol) String() string

type RegisterType

type RegisterType int32
const (
	RegisterType_memory RegisterType = 0
	RegisterType_etcd   RegisterType = 1
)

func (RegisterType) EnumDescriptor

func (RegisterType) EnumDescriptor() ([]byte, []int)

func (RegisterType) String

func (x RegisterType) String() string

type Service

type Service struct {
	Domain               string   `protobuf:"bytes,1,opt,name=domain,proto3" json:"domain,omitempty"`
	Name                 string   `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"`
	Version              string   `protobuf:"bytes,3,opt,name=version,proto3" json:"version,omitempty"`
	Topic                string   `protobuf:"bytes,4,opt,name=topic,proto3" json:"topic,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func ParseService

func ParseService(s string) (*Service, error)

ParseService parse a string to base service

func (*Service) Descriptor

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

func (*Service) FullRegistryPath

func (p *Service) FullRegistryPath(ps ...string) string

FullRegistryPath Service full registry path

func (*Service) GetDomain

func (m *Service) GetDomain() string

func (*Service) GetName

func (m *Service) GetName() string

func (*Service) GetTopic

func (m *Service) GetTopic() string

func (*Service) GetVersion

func (m *Service) GetVersion() string

func (*Service) ID

func (p *Service) ID(ps ...string) string

ID gen service id

func (*Service) ProtoMessage

func (*Service) ProtoMessage()

func (*Service) Reset

func (m *Service) Reset()

func (*Service) String

func (m *Service) String() string

func (*Service) TrellisName

func (p *Service) TrellisName() string

TrellisName service name

func (*Service) TrellisPath

func (p *Service) TrellisPath(ps ...string) string

TrellisPath Service full path

func (*Service) XXX_DiscardUnknown

func (m *Service) XXX_DiscardUnknown()

func (*Service) XXX_Marshal

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

func (*Service) XXX_Merge

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

func (*Service) XXX_Size

func (m *Service) XXX_Size() int

func (*Service) XXX_Unmarshal

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

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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