strike

package module
v0.0.0-...-eb9df38 Latest Latest
Warning

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

Go to latest
Published: May 7, 2023 License: MIT Imports: 7 Imported by: 0

README

Strike

Overview

is a framework upon the microservices implemented by Golang

Getting Started

todo

Prerequisites

todo

Installation

todo

Documentation

Index

Constants

View Source
const Release = "v0.0.1"

Release is the current kratos version.

Variables

This section is empty.

Functions

func NewContext

func NewContext(ctx context.Context, s AppContext) context.Context

NewContext returns a new Context that carries value.

Types

type App

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

func New

func New(opts ...Option) *App

New create an application runner

func (*App) Endpoint

func (app *App) Endpoint() []string

func (*App) ID

func (app *App) ID() string

func (*App) Metadata

func (app *App) Metadata() map[string]string

func (*App) Name

func (app *App) Name() string

func (*App) Run

func (app *App) Run() error

Run todo

func (*App) Stop

func (app *App) Stop() error

func (*App) Version

func (app *App) Version() string

type AppContext

type AppContext interface {
	ID() string
	Name() string
	Version() string
	Metadata() map[string]string
	Endpoint() []string
}

AppContext is a application context value

func FromContext

func FromContext(ctx context.Context) (s AppContext, ok bool)

FromContext returns the Transport value stored in ctx, if any.

type Option

type Option func(o *options)

func AfterStart

func AfterStart(fn func(context.Context) error) Option

AfterStart run funcs after app starts

func AfterStop

func AfterStop(fn func(context.Context) error) Option

AfterStop run funcs after app stops

func BeforeStart

func BeforeStart(fn func(context.Context) error) Option

Before and Afters BeforeStart run funcs before app starts

func BeforeStop

func BeforeStop(fn func(context.Context) error) Option

BeforeStop run funcs before app stops

func Context

func Context(ctx context.Context) Option

Context with service context.

func Endpoint

func Endpoint(endpoints ...*url.URL) Option

Endpoint with service endpoint.

func ID

func ID(id string) Option

ID with service id.

func Logger

func Logger(logger *logrus.Logger) Option

Logger with service logger.

func Metadata

func Metadata(md map[string]string) Option

Metadata with service metadata.

func Name

func Name(name string) Option

Name with service name.

func Signal

func Signal(sigs ...os.Signal) Option

Signal with exit signals.

func Version

func Version(version string) Option

Version with service version.

type ServiceInstance

type ServiceInstance struct {
	Endpoint []string
}

Directories

Path Synopsis
cmd
strike Module

Jump to

Keyboard shortcuts

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