service

package
v0.0.0-...-b4bb62b Latest Latest
Warning

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

Go to latest
Published: Apr 8, 2024 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Address

type Address struct {
	Addr string
	Port int
}

Address describes the service listening address and port

func AddressFromString

func AddressFromString(addressPort string) (Address, error)

AddressFromString returns a service address from a string, could be IPv4 or IPv6

func (Address) String

func (sa Address) String() string

type State

type State int64

State describes the state of a service.

const (
	// StoppedState service stopped
	StoppedState State = iota + 1
	// StartingState service starting
	StartingState
	// RunningState service running
	RunningState
	// StoppingState service stopping
	StoppingState
)

func (*State) CompareAndSwap

func (s *State) CompareAndSwap(old, new State) bool

CompareAndSwap executes the compare-and-swap operation for a state

func (*State) Load

func (s *State) Load() State

Load atomatically loads and returns the state

func (*State) MarshalJSON

func (s *State) MarshalJSON() ([]byte, error)

MarshalJSON marshal the connection state to JSON

func (*State) Store

func (s *State) Store(state State)

Store atomatically stores the state

type Type

type Type string

Type describes the service type

func (Type) String

func (t Type) String() string

Jump to

Keyboard shortcuts

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